Community Forums › Forums › Archived Forums › Design Tips and Tricks › Static Content Above Blog Homepage – Lifestyle Theme
Tagged: above blog content, lifestyle, static content
- This topic has 8 replies, 2 voices, and was last updated 10 years, 11 months ago by
livelife7.
-
AuthorPosts
-
March 20, 2014 at 9:13 am #95810
livelife7
MemberHello,
I read this article, http://wpsites.net/web-design/adding-new-widget-areas-in-studiopress-themes/, and have tried to input static content above my blog on my homepage by creating a widget. I must be doing something wrong as it does not work. Please let me know if you have any ideas?
Thank you!!!
http://santaynezweddingguide.comMarch 20, 2014 at 10:55 am #95835Brad Dalton
ParticipantIn which hook position http://genesistutorials.com/visual-hook-guide/
What the code does is create a new widget area under Appearance > Widgets where you can add any widget or text/html content.
Your front page and your home page are different. Your home page is always your posts page which can be your blog page or front page according to your Reading Settings.
Your front page is always the front page of your site unlike the home page.
March 21, 2014 at 4:58 pm #96000livelife7
MemberHi Brad,
Thank you for the response. I have tried switching to the front page blog page and just to my latest posts under reading settings and I still am not able to have any static content (a few sentences) show above my blog. Any suggestions? What am I missing?
Thank you!!!
March 21, 2014 at 8:37 pm #96020Brad Dalton
ParticipantYou can change the hook in the code to genesis_before_loop or genesis_after_header
March 22, 2014 at 8:23 am #96067livelife7
MemberHi Brad,
Thank you for your thoughts. Below is the code I have added to my functions.php file. I tried changing the two hooks as well as my reading settings between latest posts and static pages (which are set to the blog template) and I still cannot seem to add any content above the blog. However, I am able to create the new widget area, but the content I add never shows up. Do you have any other suggestions?
) );
genesis_register_sidebar( array(
'id' => 'text before blog',
'name' => __( 'Text Before Blog', 'domain' ),
'description' => __( 'Add Content Here', 'domain' ),
) );add_action( 'genesis_before_loop', 'your_widget' );
function your_widget() {
if ( is_front_page() && is_active_sidebar('new-widget') ) {
genesis_widget_area( 'new-widget', array(
'before' => '<div class="new-widget widget-area">',
'after' => '</div>',
) );
}
}
Thank you so much for your time!!
March 22, 2014 at 9:38 am #96071Brad Dalton
ParticipantHello @livelife7
The reason it doesn't work is because you have modified it incorrectly.
Please use the original code which i have linked to as it is tested and works.
Are you using Lifestyle or Lifestyle Pro?
March 23, 2014 at 8:12 am #96166livelife7
MemberHi Brad,
Thank you for the suggestion. Okay, I copied the exact code from the above posting and it still is not working?
genesis_register_sidebar( array(
'id' => 'new-widget',
'name' => __( 'New Widget', 'domain' ),
'description' => __( 'Add Content Here', 'domain' ),
) );add_action( 'genesis_after_header', 'your_widget' );
function your_widget() {
if ( is_front_page() && is_active_sidebar('new-widget') ) {
genesis_widget_area( 'new-widget', array(
'before' => '<div class="new-widget widget-area">',
'after' => '</div>',
) );
I am using Lifestyle Pro. Let me know if you have any other ideas?
Thank you!!!
March 23, 2014 at 11:44 am #96201Brad Dalton
ParticipantMarch 24, 2014 at 8:52 am #96414livelife7
MemberHi Brad,
Yay, I now have static content above my blog! Thank you so much for all of your time and efforts!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.