• Resolved danishfareed

    (@danishfareed)


    Hi team,

    Thank you for a wonderful theme.
    I’m new to WordPress development. I’m trying to create a custom page template for single-page.php but how to include a footer & header in it?

    I want to include a footer & header & in the body, I’ll do my stuff.

    I tried looking at the existing single template file, it just calls greenlet();

    Kindly help me out here.

    Thanks in advance

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter danishfareed

    (@danishfareed)

    <?php 
    include get_theme_file_path( '/header.php' );
    echo "body";
    include get_theme_file_path( '/footer.php' );
    ?>
    

    Hey there, I got it. this worked for me.

    Thank you.

    Theme Author Greenlet Team

    (@greenlet)

    Hi @danishfareed
    Happy to see that you achieved what you wanted.

    Just to add, we wrapped the whole page rendering under greenlet() function for consistent rows and columns output. You can take a look at the greenlet() function in library/frontend/main.php to override that function the default way.

    In your case, the same functionality could also be achieved via something like this:

    get_header();
    do_action( 'greenlet_before_main_container' );
    
    echo 'Custom main container';
    
    do_action( 'greenlet_after_main_container' );
    get_footer();

    This could help maintain better future compatibility.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to create custom page(Single, Archive) template?’ is closed to new replies.