• Resolved giorjoe

    (@giorjoe)


    How can show category ID list in page?
    I add custom-page2.php template with this code:
    <?php
    /*
    Template Name: Custom Page Example2
    */
    ?>

    <?php do_action( ‘__before_main_wrapper’ ); ##hook of the header with get_header ?>
    <?php tc__f(‘rec’ , __FILE__ , __FUNCTION__ ); ?>
    <div id=”main-wrapper” class=”container”>

    <?php do_action( ‘__before_main_container’ ); ##hook of the featured page (priority 10) and breadcrumb (priority 20)…and whatever you need! ?>

    <div class=”container” role=”main”>
    <div class=”row”>

    <?php do_action( ‘__before_article_container’); ##hook of left sidebar?>

    <?php query_posts(‘post_type=post&post_status=publish&posts_per_page=10&paged=’. get_query_var(‘paged’)); ?>

    <div class=”<?php echo tc__f( ‘__screen_layout’ , tc__f ( ‘__ID’ ) , ‘class’ ) ?> article-container”>

    <?php do_action (‘__before_loop’);##hooks the header of the list of post : archive, search… ?>

    <?php if ( tc__f(‘__is_no_results’) || is_404() ) : ##no search results or 404 cases ?>
    <article <?php tc__f(‘__article_selectors’) ?>>
    <?php do_action( ‘__loop’ ); ?>
    </article>
    <?php endif; ?>

    <?php if ( have_posts() && !is_404() ) : ?>
    <?php while ( have_posts() ) : ##all other cases for single and lists: post, custom post type, page, archives, search, 404 ?>
    <?php the_post(); ?>
    <article <?php tc__f(‘__article_selectors’) ?>>
    <?php
    do_action( ‘__loop’ );
    ?>
    </article>
    <?php endwhile; ?>

    <?php endif; ##end if have posts ?>

    <?php do_action (‘__after_loop’);##hook of the comments and the posts navigation with priorities 10 and 20 ?>

    </div><!–.article-container –>

    <?php wp_reset_query(); ?>

    <?php do_action( ‘__after_article_container’); ##hook of left sidebar?>

    </div><!–.row –>
    </div><!– .container role: main –>

    <?php do_action( ‘__after_main_container’ ); ?>

    </div><!–#main-wrapper”–>

    <?php do_action( ‘__after_main_wrapper’ );##hook of the footer with get_get_footer ?>

    Is possibile filter for category?

Viewing 3 replies - 1 through 3 (of 3 total)
  • giorjoe
    when you have to paste code use backticks or patesbin.com.
    Said so, replace this:

    <?php query_posts('post_type=post&post_status=publish&posts_per_page=10&paged='. get_query_var('paged')); ?>

    with

    <?php query_posts('cat=ID_OF_YOUR_CAT&posts_per_page=10&paged='. get_query_var('paged')); ?>

    hope this helps.

    p.s.
    Can I suggest you to upgrade your customizr to the latest version before copying/using any template?

    Thread Starter giorjoe

    (@giorjoe)

    Thanks a lot code work!!! About your PS i can’t update theme, this is other problem for me:)

    Ah 🙁
    Hope you can find a solution.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show category ID (post excertp list) in page’ is closed to new replies.