• Resolved TataVostru

    (@tatavostru)


    Hy how can i retrive the category from post type…

    Ex: Post type – stiri
    Categories – Lansari
    – Noutati

    I have something like this in my theme, but it display only the post_type…

    <?php
    $recentPosts = new WP_Query();
    $recentPosts->query(array('showposts' => 1, 'post_type' =>array('stiri')));
    ?>
    <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
    <div class="sidebar-titlu"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></div>
    <div class="sidebar-stiri">
    <img src="/scripts/timthumb.php?src=<?php the_field('imagine_stire'); ?>&h=60&w=90&zc=1" alt="" title="<?php the_title(); ?>" />
    <?php $excerpt = get_the_excerpt();echo string_limit_words($excerpt,30);?><a class="detalii" href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">...detalii</a>
    </div>
    </div>
    <?php endwhile; ?>
    <ul>

    For example now it display:

    site.com/stiri/will-smith/

    I want to display:

    site.com/stiri/(the category of post_type)/will-smith/

    Thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How can i retrive the content by categoy – post_type’ is closed to new replies.