Community Forums › Forums › Archived Forums › Design Tips and Tricks › Full Page Template problem
Tagged: full page template
- This topic has 8 replies, 3 voices, and was last updated 10 years, 5 months ago by crayon.
-
AuthorPosts
-
November 16, 2013 at 3:09 am #73368crayonMember
I'm trying to create a full page template but I seem to be missing something. Regardless of the CSS I use the text keeps appearing above the actual header. What am I missing?
Thanks
<?php /* Template Name: Template Home */ add_filter ( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); remove_action( 'genesis_loop', 'genesis_do_loop' ); add_filter( 'body_class', 'add_body_class' ); function add_body_class( $classes ) { $classes[] = 'Genesis Sample'; return $classes; } ?> <div id="main_container"> <div class="site-inner"> My page content goes here </div> </div> <?php genesis(); ?>
November 16, 2013 at 9:33 am #73405Sridhar KatakamParticipantNovember 16, 2013 at 10:52 pm #73511crayonMemberHi
I'm using the basic child theme that you can download from this site.
November 16, 2013 at 11:45 pm #73520nutsandboltsMemberThis is the template I use for full-width - I don't put any content in the template; I just add this to my child's theme folder as page_full_width.php, then I'm able to select it from the template dropdown in the page editor. Hopefully that makes sense, but please let me know if I'm missing the point of what you're trying to do (which is very possible).
<?php /* * Template Name: Full Width Page */ /** Force full width layout */ add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); genesis();
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 16, 2013 at 11:57 pm #73523crayonMemberHi Andrea
Thanks for the reply. I can do that but it's not what I'm trying to do. I'm creating a custom layout for the homepage and want to add the code directly to the template itself, rather than going through the editor interface. The reason is I want complete control and not risk it being messed up by someone typing something into the text editor.
November 17, 2013 at 12:00 am #73525nutsandboltsMemberOkay, I had a feeling I wasn't reading your post in the way you meant it. Let me try this on a test site tomorrow so I can try to replicate it and I'll post back.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 17, 2013 at 12:16 am #73527Sridhar KatakamParticipantPlace the following in a file named front-page.php in your child theme:
<?php //* Force full width content layout add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); remove_action( 'genesis_loop', 'genesis_do_loop' ); add_action( 'genesis_loop', 'custom_do_loop' ); function custom_do_loop() { ?> <p>My page content goes here</p> <?php } //* Run the Genesis loop genesis();
November 17, 2013 at 12:17 am #73528Sridhar KatakamParticipantI have deliberately not included the code to add custom body classes as I feel it is redundant. Homepage's body element will have a unique 'home' class out of the box.
November 17, 2013 at 1:14 am #73535crayonMemberGreat, that worked. Thanks Sridhar!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.