Custom Posts on Profile
-
Hi- like the Posts on Profile plugin, but for wordpress 3.0 it is not picking up posts classified using either a custom post type or filed in a particular taxonomy. I think this section of code in the plugin is the one that needs altering:
`function bp_postsonprofile_setup_nav() {
global $bp, $wpdb;
$user_id = bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id();
$where = $wpdb->prepare(‘WHERE post_author = %d AND post_type = %s AND post_status=%s’, $user_id, ‘post’, ‘publish’);
$post_count = $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->posts $where” );
$post_count = $post_count ? $post_count : 0;
$postsonprofile_link = $bp->loggedin_user->domain . $bp->postsonprofile->slug . ‘/’;
`
What I’d like to do is be able to use this plugin to call a member’s custom posts. For example – let’s say I created a new post type called ‘movies’. This post type contains taxonomies such as ‘genres’, ‘actors’ etc. These taxonomies contain terms such as ‘horror’. I want to have a tab on the BP Profile page which say ‘Movies’ (not ‘posts’) and it shows an archive of all posts submitted by this user using the movies post type. I think this should be easy for an experienced BP programmer Something in the above code which uses post_type=’movies’. Something like this perhaps:
`
<?php global $wp_query;
query_posts( array(
‘post_type’ => ‘movies’ ,
“genre” => “horror”, “comedy” etc
‘showposts’ => 10 )
);
?>Any suggestions would be greatly appreciated. Thanks!
- The topic ‘Custom Posts on Profile’ is closed to new replies.