• Resolved DsNL

    (@dsnl)


    Hi there,

    I′ve downloaded a theme, but i′m used to work with custom post type in wordpress. Normally i can filter quite easily my custom post type on a category, but this time it′s not working and i don′t know why.

    Normally i use tax query in my $args array, but it’s not working right know. Do you guys have any suggestions?

    <?php
    	$args = array(
    	'post_type' => 'portfolio',
    	'taxonomy' => 'home',
    	'numberposts' => 10,
    	'orderby' => 'ASC',
    	);
    	$portfolio_posts = get_posts($args);?>
    <?php if($portfolio_posts) { ?>
    <div id="homepage-portfolio-wrap">
    <?php if($options['home_portfolio_title'] != '') { ?>
    <h2><?php echo stripslashes($options['home_portfolio_title']);  ?></h2>
    <?php } else { ?>
    <h2><?php _e( 'Latest Work' ); ?></h2>
    <?php } ?>
        <ul id="homepage-portfolio">
    		<?php
            foreach($portfolio_posts as $post) : setup_postdata($post); ?>
            <?php $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'portfolio-homepage'); ?>
    
    <li>

    Sorry couldn’t post this in advanced wordpress

Viewing 1 replies (of 1 total)
  • Thread Starter DsNL

    (@dsnl)

    I've fixed it:
    $args = array(
    	'post_type' => 'portfolio',
    	'portfolio-cats' => 'home',
    	'numberposts' => 10,
    	'orderby' => 'ASC',
    	);
Viewing 1 replies (of 1 total)
  • The topic ‘Show category in custom post type’ is closed to new replies.