Community Forums › Forums › Archived Forums › General Discussion › Craftiness Theme – Static homepage
- This topic has 7 replies, 2 voices, and was last updated 11 years ago by vanhovland.
-
AuthorPosts
-
April 11, 2013 at 9:33 am #34742vanhovlandMember
Hi all,
I am working with the Craftiness Theme and I want to place a slider on the homepage, using a static page. It works great if I leave it as a non-static page using the Genesis Slider.
Do I need to change the function.php if there is already the following widget?
/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'featured',
'name' => __( 'Featured', 'craftiness' ),
'description' => __( 'This is the featured section.', 'craftiness' ),
) );What do I need to do with the home.php to make it work?
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'craftiness_grid_loop_helper' );
/** Add support for Genesis Grid Loop */
function craftiness_grid_loop_helper() {
if ( function_exists( 'genesis_grid_loop' ) ) {
genesis_grid_loop( array(
'features' => 2,
'feature_image_size' => 'featured',
'feature_image_class' => 'alignleft post-image',
'feature_content_limit' => 500,
'grid_image_size' => 'thumbnails',
'grid_image_class' => 'alignleft post-image',
'grid_content_limit' => 0,
'more' => __( '[Continue reading...]', 'genesis' ),
'posts_per_page' => 10,
'offset' => 0,
) );
} else {
genesis_standard_loop();
}
}/** Add homepage widget area above posts */
add_action( 'genesis_before_loop', 'craftiness_homepage', 9 );
function craftiness_homepage() {
if ( is_home() ) {
dynamic_sidebar('Homepage');
}
}/** Add featured widget area above posts */
add_action( 'genesis_before_loop', 'craftiness_before_post', 9 );
function craftiness_before_post() {
echo '<div class="featured">';
dynamic_sidebar('featured');
echo '</div>';
}genesis();
Thanks!
Heidi
April 11, 2013 at 9:34 am #34743vanhovlandMemberSorry my site url is: http://96.127.180.186/~mvmontes/
Heidi
April 11, 2013 at 10:08 am #34753Brad DaltonParticipantThere's different ways to do this depending on:
1. The location you want the slider displayed on your home page
2. And which slider plugin you want to use.Firstly, choose the hook location using this visual guide and then add that hook to the code using one of two methods.
1. You can then add the code to your child themes functions.php file
2. Or use another code snippet in one of the Genesis Simple Hooks fields.
3. Or you can create a widget area for the slider if you want to use the Genesis Slider.
Please let me know exactly what you want and i'll provide the code.
April 11, 2013 at 10:20 am #34754vanhovlandMemberBrad,
Thanks for responding. There already is a 'featured' widget (so I don't think I need to crate a new one). I have put the Genesis Responsive Slider in there, and it works if I select your latest posts under the Theme's options.
I did try emailing to the site's developer and got this back: "To have the slider work with a static page, you would need to create a "widget" area on the static page, which would mean customizing both your PHP theme file, and your CSS file. Brian Gardner, creator of StudioPress, has a couple of tutorials on his blog about how to accomplish this, if you are interested in doing it, as does "Nick the Geek", another StudioPress employee."
I tried to find the tutorials mentioned by doing a search, but did not find them.
I guess I would like to create the widget area, I think that would give me the most flexibility.
Thank you so much for your help!
Heidi
April 11, 2013 at 10:54 am #34761Brad DaltonParticipantYou'll need to create a widget area for the static home page.
What location?
Before the header
In the header
After the headerChoose from these hooks and i'll give you the code.
You could try this code and change the hook location:
https://gist.github.com/5285591.git
April 11, 2013 at 12:58 pm #34804vanhovlandMemberBrad,
I want it after the header. If I am understanding the hooks correctly, my guess would be: genesis_before_content.
Thanks!
April 11, 2013 at 4:45 pm #34870Brad DaltonParticipantAny of these:
genesis_after_header genesis_before_content_sidebar_wrap genesis_before_content
Add this code to the end of your child themes functions.php file
Change the hook if you want it after the nav menu. Use one of the above 3 hooks if you want it full width.
Code not displaying? Try here https://gist.github.com/braddalton/5285591
April 12, 2013 at 8:44 am #34990vanhovlandMemberThank you!! I now understand and it is working 🙂 :).
Thanks again for all your help!
Heidi
-
AuthorPosts
- The topic ‘Craftiness Theme – Static homepage’ is closed to new replies.