I am in need of some assistance as I am getting into a bit of a tangle with my custom Wordpress theme. what I am trying to achieve is having a standard blog running where I can use the normal features add an image, description tags and also drop it into a category.
I am also wanting to add in a portfolio section also which runs pretty much the same. Now, the way we have approached this is y separating the content using categories, so created one for blog and one for portfolio so that if by chance I want to create some content that would fall under both blog and portfolio it can show in both sections.
I am struggling to understand how to get to that point, I am not looking for any code as such but some suggestion on the best approach.
the way I have currently got this set up is as mentioned above so using categories to separate the content. I am not looking to use plugins either because I want it to all be a true Wordpress custom theme. I had considered using a custom post type which looks like this:
add_action('init', 'register_mypost_type');
function register_mypost_type() {
register_post_type('people',
array( 'label' => 'Portfolio',
'public' => true,'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => array('slug' => ''),
'query_var' => true,
'has_archive' => true,
'supports' => array('title','editor','thumbnail',),
'taxonomies' => array('category',),
'menu_position' => 5,
) );
}
Within my functions.php file, however, when trying to show the results because of how the code pulls the posts from the post type its almost like again the categories are seperate from eachother. How would I cross feed them?
<?php
$args = array(
'post_type' => 'Post',
'cat' => -4,
'posts_per_page' => 3,
'post_status' => 'publish', //or 'draft', 'trash', 'pending', ...
);
$the_query = new WP_Query( $args );
?>
The above shows a snippet from my portfolio page, yet by changing only the post_type is not enough because yes it will show posts from that custom post type but the categories are not behaving correctly.
I am really stuck as to wha the best approach is here, so any ideas or thoughts would be much appreciated.