Hi there,
The site I am developing needs two general user profiles: corporate and family. Each has a username and password which will be used by members of their respective groups. They do not want individual registration/login.
I have set up a blog on the site with role-based access/display so the family see the family category archive and the corporates see the corporate category archive.
I want the visitors to be able to post to the relevant "blog" so I created two forms and used conditional code in the archive.php to display the correct post entry form according to the category being displayed. All good. Form works well.
Problem is I want to publish the poster's name on the blog and since they are logged in under a general group profile and not as an individual I can't use the_author and so on.
I created a name field in the form and am trying to follow the after post submission function docs to pick up the data in that name field and assign it to $uniquename which I then echo in archive.php in the meta section. I can't get it to work. Here's my code:
in functions.php:
<?php
add_action("gform_after_submission_3", "after_submission", 10, 2);
function after_submission($entry, $form){
$uniquename = $entry["5"];
}
?>
in archive.php:
<h2 class="title"><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<div class="meta"> <?php echo $uniquename; ?></div>
Any help much appreciated. Thanks.
-AW