Static Content Above Blog Homepage – Lifestyle Theme

Community Forums Forums Design Tips and Tricks Static Content Above Blog Homepage – Lifestyle Theme

This topic is: not resolved

This topic contains 8 replies, has 2 voices, and was last updated by  livelife7 7 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #95810

    livelife7
    Participant
    Post count: 20

    Hello,

    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!!!

    • This topic was modified 7 months, 1 week ago by  livelife7.
    • This topic was modified 7 months, 1 week ago by  livelife7.
    http://santaynezweddingguide.com
    #95835

    braddalton
    Participant
    Post count: 10243

    In 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.


    #96000

    livelife7
    Participant
    Post count: 20

    Hi 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!!!

    #96020

    braddalton
    Participant
    Post count: 10243

    You can change the hook in the code to genesis_before_loop or genesis_after_header


    #96067

    livelife7
    Participant
    Post count: 20

    Hi 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!!

    #96071

    braddalton
    Participant
    Post count: 10243

    Hello @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?


    #96166

    livelife7
    Participant
    Post count: 20

    Hi 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!!!

    #96201

    braddalton
    Participant
    Post count: 10243

    And what content did you put into the new widget area?


    #96414

    livelife7
    Participant
    Post count: 20

    Hi Brad,

    Yay, I now have static content above my blog! Thank you so much for all of your time and efforts!

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.