Use front.php with custom posts
I have front.php setup and a home tab on my users profiles .I have a custom posts setup and I want to add a custom post the home tab to each member profile and assign the post by author. I can pull in the custom post content into the home tab by add this code to front.php
<?php //My custom post type name in the arguments $args = array('post_type' => 'bios'); //Define the loop based on arguments $loop = new WP_Query( $args ); //Display the contents while ( $loop->have_posts() ) : $loop->the_post(); ?> <h1 class="entry-title"><?php the_title(); ?></h1> <div class="entry-content"> <?php the_content(); ?> </div> <?php endwhile;?>
What I need help with is adding the post author to the loop so only the custom post created by that author shows on the home tab for that user . I think you could add something like $profileUserID = bp_displayed_user_id(); but im not sure about the php syntax to do this
Any help is greatly appreciated
- You must be logged in to reply to this topic.