Community Forums › Forums › Archived Forums › Design Tips and Tricks › Shortcode widget plugin that is compatible with genesis for 2nd landing page?
- This topic has 7 replies, 2 voices, and was last updated 10 years, 5 months ago by
Ben @ Inbound Creative.
-
AuthorPosts
-
September 23, 2014 at 11:39 pm #125510
phoenixjade
MemberHi can anyone recommend a plugin that I might be able to use to add widgets to a single page content. I tried using the amr shortcode plugin and it just doenst seem to want to work. It worked at first for default widgets but not anymore. From what I can gather from googling a solution there seems to be a conflict with genesis. Ive also tried “widget shortcode” but got a fatal error
What I am trying to do is create a second landing page for just one category in my blog but I want it to be set up like you would see on the home page with featured posts widgets.
Ultimately I would like 1 featured post widget per tag belonging to a category. That might be too specific to achieve with a widgets alone but really Id be happy with just knowing how to add a widget to the content area of page.
fyi I am currently using news pro
thanks in advance for any help and reading:)
September 24, 2014 at 2:29 am #125524Ben @ Inbound Creative
MemberIt's pretty simple to do using the Genesis hooks, though it does require some knowledge of PHP.
Can I just double check what you want though before I write the code? (It'll take me a couple of minutes once I know what you want).
Do you mean you want the featured box to appear at the top of the category's archive page?
September 24, 2014 at 5:16 am #125527phoenixjade
MemberHi Ben
Thanks for the reply. What Im trying to achieve is to create a fresh new page or post that mimics the front page. So not the category's archive page at all, but a blank new page that I can write some content, add some images then use a shortcode if possible to insert some widgets
Basically exactly what the AMR shortcode any widget does - but for some reason doesn't play nicely with genesis.
September 24, 2014 at 5:22 am #125528Ben @ Inbound Creative
MemberI can recreate the whole home page template for you if that's easier? You would then just create a page and select the custom template.
September 24, 2014 at 5:26 am #125529phoenixjade
MemberThat sounds like a great solution. I appreciate the help
September 24, 2014 at 5:40 am #125530Ben @ Inbound Creative
MemberSimply copy and paste the below code into a new file and call it landingpage.php
<?php /** * This file adds a customisable page to your theme. * * @author Advice Media * @subpackage Customizations * * Template Name: Landing Page */ add_action( 'genesis_meta', 'am_home_genesis_meta' ); /** * Add widget support for homepage. If no widgets active, display the default loop. * */ function am_home_genesis_meta() { if ( is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-bottom' ) ) { // Force content-sidebar layout setting add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar' ); // Add am-home body class add_filter( 'body_class', 'am_body_class' ); // Remove the default Genesis loop remove_action( 'genesis_loop', 'genesis_do_loop' ); // Add homepage widgets add_action( 'genesis_loop', 'am_landing_page_widgets' ); } } function am_body_class( $classes ) { $classes[] = 'landing'; return $classes; } function am_landing_page_widgets() { genesis_widget_area( 'landing-top', array( 'before' => '<div class="home-top widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'landing-middle', array( 'before' => '<div class="home-middle widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'landing-bottom', array( 'before' => '<div class="home-bottom widget-area">', 'after' => '</div>', ) ); } genesis();
You'll also need to add the following sidebars underneath the others in your functions.php file:
genesis_register_sidebar( array( 'id' => 'landing-top', 'name' => __( 'Landing Page | Top', 'am'), 'description' => __( 'Section for the landing-top', 'am' ), ) ); genesis_register_sidebar( array( 'id' => 'landing-middle', 'name' => __( 'Landing Page | Middle', 'am'), 'description' => __( 'Section for the landing-middle', 'am' ), ) ); genesis_register_sidebar( array( 'id' => 'landing-bottom', 'name' => __( 'Landing Page | Bottom', 'am'), 'description' => __( 'Section for the landing-bottom', 'am' ), ) );
I've left the landing page widget areas' css the same as the home page so that you won't need to dive in an add a ton of css.
Once you're done, create a new page and then in the template menu on the right hand side, select Landing Page as the template.
Hey presto, you're done.
September 24, 2014 at 5:41 am #125531phoenixjade
MemberThank-you so much. I really appreciate this
September 24, 2014 at 5:42 am #125532Ben @ Inbound Creative
MemberI missed out a little bit of info, so just have a re-read over the stuff before you do anything. 🙂
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.