Community Forums › Forums › Archived Forums › Design Tips and Tricks › Page Template With Sections
- This topic has 3 replies, 2 voices, and was last updated 9 years, 4 months ago by Porter.
-
AuthorPosts
-
April 29, 2015 at 7:41 pm #149566PorterParticipant
I'm looking to make a page template much like my home page. I made the home page through widgetized areas in functions.php, and I'm not sure how to create the same structure in a page template. My main issue, is how I add the different areas without a background. I believe the issue is the hook I'm using for all of my code:
add_action( 'genesis_entry_content', 'custom_do_page_content', 9 );
The "custom_do_page_content" function is simply holding all of my code, as seen here:
add_action( 'genesis_entry_content', 'custom_do_page_content', 9 ); function custom_do_page_content() { //Page content goes here (custom fields, maps, etc) }
The main issue, is that no matter what divs I use (2/3rds, 1/3rd, etc, I always have the same common background, rather than unique sections like the home page. I think I simply need to change the hook I use, but I'm not sure (I'll play with this tonight). My other issue is, is that the top piece actually needs to contain the breadcrumbs as if it was a normal page. My theory is that I need the top piece to use the above hook, and the rest would use another hook. Or I could simply use one hook (not the entry content), and re-position the breadcrumbs.
Anyway, I'm mostly thinking out loud at this point, any direction would be appreciated!
site - towerofgreed.com
desired page to change - towerofgreed.com/venues/jps-pub/EDIT
It turns out I was right (starting to fully understand the hooks), I just needed to use something that wasn't in the content. That being said, one new question - can I re-position the breadcrumbs using a hook in that template file directly? Is it bad practice to do it within the template, rather than in functions.php like I did for the "main" re-position?
April 30, 2015 at 6:07 am #149593Brad DaltonParticipantcan I re-position the breadcrumbs using a hook in that template file directly? Is it bad practice to do it within the template, rather than in functions.php like I did for the “main” re-position?
Yes, no problem.
May 1, 2015 at 11:38 pm #149786PorterParticipantThanks, I figured so, but the confirmation is appreciated.
I have only one issue left pertaining to this - I can't seem to get the breadcrumbs to join my first "section". Check out the page below:
Page - towerofgreed.com/venues/jps-pub/
I want the breadcrumbs to be in the same block as the title of the venue (where it says JP's Pub), but it's above it. I replaced it using this hook:
//* Reposition the breadcrumbs remove_action( 'genesis_before_entry_content', 'genesis_do_breadcrumbs' ); add_action( 'genesis_before_entry', 'genesis_do_breadcrumbs', 8);
But "genesis_before_entry" is what everything on this page uses. That gets it in the right area, but not as part of the same internal div. How can I get both that title, and the breadcrumbs in the same area, sharing a common div background?
May 2, 2015 at 11:17 am #149835PorterParticipantI figured it out.
genesis_do_breadcrumbs() is simply a function, meaning it can be called anywhere. Since a hook position wasn't specific enough for me (I need it in a specific div), I simply removed the breadcrumbs with:
remove_action( 'genesis_before_entry_content', 'genesis_do_breadcrumbs' );
(my hook is different because I moved it)And then manually called genesis_do_breadcrumbs() within the template file in the position I needed.
-
AuthorPosts
- The topic ‘Page Template With Sections’ is closed to new replies.