Custom archive, search page loops stripping hook features

Community Forums Forums Design Tips and Tricks Custom archive, search page loops stripping hook features

This topic is: not resolved

This topic contains 1 reply, has 1 voice, and was last updated by  btstudio 1 year, 3 months ago.

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

    btstudio
    Participant
    Post count: 5

    I made custom loops to display posts on search results and archive pages by adding search.php and archive.php with the custom loop in my child theme. After doing this, the custom loop works, but the Genesis functions which dynamically display the page content do not show up. Is there something I can add to my search.php and archive.php to allow these to work?

    Thanks.

    #54750

    btstudio
    Participant
    Post count: 5

    Here’s what I have for my archive.php file.


    <?php /*
    Template Name: Custom archive page
    */ ?>

    <?php
    remove_action('genesis_loop', 'genesis_do_loop');
    add_action('genesis_loop', 'custom_archive_loop');
    function custom_archive_loop() { ?>
    <div id="posts"><?php
    while ( have_posts() ) : the_post();
    get_template_part( 'content', get_post_format() );
    endwhile; ?>
    </div><?php
    }

    genesis();

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

You must be logged in to reply to this topic.