Forum Replies Created
-
AuthorPosts
-
dsgnrMember
Okay I think I'm getting there, I just need help on something else please.
I have this code in my functions.php:
// Home page widgets genesis_register_sidebar( array( 'id' => 'home-featured-full', 'name' => __( 'Home Featured Full', 'CHILD_THEME_NAME' ), 'description' => __( 'This is the featured area if you want full width.', 'CHILD_THEME_NAME' ), ) );
and this is my custom-homepage.php file:
<?php /** * Custom Front Page * Template Name: Homepage * */ if ( is_active_sidebar( 'home-featured-full' )) { remove_action( 'genesis_loop', 'genesis_do_loop' ); add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); add_action( 'genesis_before_content', 'sc_home_do_featured' ); add_action( 'genesis_loop', 'genesis_do_loop' ); } // Home feature widget section function sc_home_do_featured() { if ( is_active_sidebar( 'home-featured-full' )) { genesis_widget_area( 'home-featured-full', array( 'before' => '<main class="home-featured-full">', 'after' => '</main>', ) ); } } genesis(); ?>
This works the way I'd like it to however, the "home-featured-full" widget appears inside the site-inner div. I have looked to see whether I can remove_action the site-inner div and then include the home-featured code, then re-add the site-inner div in another action.
I can't seem to find anywhere in the snippets area to explain how to do this.
I have tried:
// Home feature widget section add_action ('genesis_after_header'); { function home_do_featured() { if ( is_active_sidebar( 'home-featured-full' )) { genesis_widget_area( 'home-featured-full', array( 'before' => '<main class="home-featured-full">', 'after' => '</main>', ) ); } } }
I feel like I'm close, I just need to get the home-featured div outside the site-inner width constraints.
dsgnrMemberHi David, thank you for your code above unfortunately it didn't actually make a difference to the site.
I have decided to start again with this with the genesis child theme sample instead of one I found on another blog which has given me a few ideas to try something else. I suspect it's something that I have done as I absolute positioned the optim box which then made everything else float behind, instead of underneath as you want so I think it was somewhere there that was causing me problems.
I will post my findings and maybe even put it up on github for other people for fork if it's worthwhile!
Thanks again
dsgnrMemberDavid, thank you for responding. That's basically what I have done. I edited some of the css so that I just have to add
<div class="wrap">
in order to create a box effect. However, I can only get this to work on pages I have manually entered text into and not archive pages for a custom post type for example if this makes sense.I have tried to create custom templates (like you would in a typical framework. I have previously used WP-Forge) so that the homepage is 100% the width of the browser size and I would select this template in the WP page template attribute. Then I would have a boxed template for other pages as default if this makes sense.
Having tried to create a custom template, either it doesn't show up in the attributes panel or it doesn't make a difference to the page.
In regards to the Optim widget area, I would like this only to show up on the homepage and no where else on the site. I have tried something like
if ( !is_front_page() ) { remove_action( 'genesis_optim_widget' ); }
I understand that isn't the right class for the action but that's the sorta thing I need.
-
AuthorPosts