Community Forums › Forums › Archived Forums › Design Tips and Tricks › Initial landing page linking to two custom widgetized page templates
Tagged: Add Widget, custom page template, landing page, new widget
- This topic has 3 replies, 2 voices, and was last updated 5 years, 3 months ago by
Amber.
-
AuthorPosts
-
December 15, 2017 at 5:14 pm #214587
Amber
MemberHi Genesis geniuses! I've been working with Genesis for quite some time now but actually have something I've never done with it before on my plate.
I'm familiar with hooks, creating new page templates, updating the functions.php file and all that jazz (although I'm no developer!).
The first thing is:
I'm looking to have almost like a landing page come up first where a visitor can click on one logo that would link to custom-page-template-1.php or the other logo that would link to custom-page-template-2.php. These custom page templates will be widgetized.The only way I know how to do this is add a index.html page but then way too many other issues arise doing it that way. Is there a quick way in Genesis to have your home page a landing page with said logos to then link where I want? I looked for some landing page plugins but I think those are for when the site in coming soon or under maintenance.
The second thing is:
I've tried to create my own custom page template. By either following tutorial to make sure I haven't missed anything or copying and pasting from the front-page.php file I have (using the altitude-pro theme) and renaming the widgets and calls to something unique. However nothing works. My landing-page.php doesn't even work so many there is soemthign I'm missing in my functions.php? What are some reasons a custom page template wouldn't work?This is my most recent attempt at a custom page template with one widget
<?php /* Template Name: Special Template */ ?> <?php add_action( 'genesis_meta', 'theme_name_template_name_genesis_meta' ); /** * Add widget support for this template. If no widgets are active, display the default Genesis loop. * */ function theme_name_template_name_genesis_meta() { if ( is_active_sidebar( 'template-name-widget-name' ) ) { remove_action( 'genesis_loop', 'genesis_do_loop' ); add_action( 'genesis_loop', 'theme_name_template_name_widget_name' ); add_filter( 'body_class', 'add_body_class' ); function add_body_class( $classes ) { $classes[] = 'theme-name-template-name'; return $classes; } } } function theme_name_template_name_widget_name() { if ( is_active_sidebar( 'template-name-widget-name' ) ) { genesis_widget_area( 'template-name-widget-name', array( 'before' => '<div class="template-name-widget-name widget-area">', ) ); } } genesis();
I've made sure that I've added my widget in my functions.php and chosen the Special Template on my new page, but all that shows is the header and footer of the site and nothing else.
This is the page but I don't think it will help much. Nothing is there.
**On the link that was provided for the site, if you click on the left logo it will link to the rest of the site.**
I appreciate any and all feedback. Thanks so much!
http://ambergoodwin.com/draft/patioburger/December 16, 2017 at 3:59 am #214591Brad Dalton
ParticipantThere's 2 parts to creating widgets. You also need to register each new widget.
December 16, 2017 at 11:16 am #214603Amber
MemberHi braddalto, thanks for the suggestion. I have registered each new widget. That's what I said under the code snippet (just I didn't say those exact words), I said "I've made sure that I've added my widget in my functions.php". So I'm confused as to why it wouldn't be working? I know it's not the theme as I have no troubles adding any other widgetized area in the site.
December 16, 2017 at 2:39 pm #214611Amber
MemberSo I've figured out how to do the home page. Just make it a static page and remove what you don't want. I'm still stumped on why the page-templates aren't working though.
I've even tried another theme and it still doesn't work.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.