Custom Page Template with Loop and Content

Community Forums Forums Design Tips and Tricks Custom Page Template with Loop and Content

This topic is: not resolved

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  cehwitham 1 year, 1 month ago.

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

    sarova
    Participant

    Hello All-

    I am trying to create a custom page template that will include a custom loop but I would also like to include the content. But the key is, I need my content below the loop. I have tried different hooks and filters, but I am not quite there. When I put the ‘genesis_do_post_content’ , i am putting it outside the content area, so I do not have a div so I can style the page. So I would like to add a div to the add_action. Below is copy of my template for the page, I might be doing it all wrong. Thanks in advance for your help.

     

    I would like to add new styling for this, add_action(‘genesis_after_content’,’genesis_do_post_content’); – I am not sure how to accomplish.

    <?php
    /*
    * Template Name: Engineering Home Page
    */

    /**
    * This removes the loop.
    * If you want to include the static page title and content,
    * remove or comment out this code.
    */

    add_filter ( ‘genesis_before_content’, ‘dms_custom_header’ );

    function dms_custom_header () {
    echo ‘<div id=”page_featured”>’;
    echo the_post_thumbnail( ‘slider’ );
    echo ‘</div>’;

    }

    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );

    add_action ( ‘genesis_after_content’, ‘childtheme_about_loop’ );
    function childtheme_about_loop() {

    if(is_active_sidebar(‘engineering’)){

    dynamic_sidebar(‘engineering’);
    }
    }

    add_action(‘genesis_after_content’,’genesis_do_post_content’);

    genesis();


    Debbie Saro

    http://premierac.com/premier-automation-engineering/
    #43712

    cehwitham
    Participant
    Post count: 396

    Hi Debbie,

    What happens if you use the_content rather than genesis_do_post_content?

    Also have you considered using the blog page template then just adding the content in? Something like:

    `
    function news_title(){
    the_title();
    the_content();
    }
    add_action(‘genesis_after_loop’,’news_title’);`


    Twitter: cehwitham Web: cehwitham.com

    • This reply was modified 1 year, 1 month ago by  cehwitham.
    • This reply was modified 1 year, 1 month ago by  cehwitham.
    • This reply was modified 1 year, 1 month ago by  cehwitham.
    • This reply was modified 1 year, 1 month ago by  cehwitham.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.