Custom Post type excerpts

Community Forums Forums General Discussion Custom Post type excerpts

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Ozzy 1 year, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #37972

    jkoop814
    Participant
    Post count: 1

    Hey, I have got a custom post types excerpts to work on the home page with this in home.php

    remove_action(‘genesis_loop’, ‘genesis_do_loop’);
    add_action(‘genesis_loop’, ‘custom_loop’);

    function custom_loop() {
    $arg = array(
    ‘post_type’ => ‘Publications’, // this can be an array : array(‘guide’,’guide1′,…)
    ‘posts_per_page’ => 6,
    ‘order’ => ‘DESC’,
    // ‘category_name’ => 6
    ‘post_status’ => ‘publish’
    );
    $query = new WP_Query($arg);
    if ( $query->have_posts() ) :
    while ( $query->have_posts() ) : $query->the_post();
    ?>
    <article>
    <h2 class=”entry-title”><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></h2>
    <div class=”post-info”><?php the_excerpt(); ?></div>
    <div class=”entry-content”><?php the_excerpt(); ?></div>
    </article>
    <?php
    endwhile;
    endif;
    wp_reset_query();
    }
    genesis();

    Problem is that its not effecting the “Publications” page. Is there a different way of implementing excerpts as the main post format when it has to do with my custom post type “Publications”?

    http://eppc.polymath.io/
    #38004

    Ozzy
    Participant
    Post count: 213

    you’d need to create a page called archive-publications.php and change the loop there.


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.