Agency Welcome Widget – How to Make Another

Community Forums Forums Design Tips and Tricks Agency Welcome Widget – How to Make Another

This topic is: not resolved

This topic contains 6 replies, has 2 voices, and was last updated by  eluviis 1 year, 6 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #23341

    eluviis
    Participant
    Post count: 115

    I really like the wide Agency welcome widget. It’s sad that all remaining 6 widgets on the theme (minus the slider) are all 3 column squares.

    How can I add another wide widget similar to the Welcome widget just below the slider?

    I’m OK replacing all 3 home widgets for a wide one, or adding an extra one, either way.

    #23344

    braddalton
    Participant
    Post count: 9446

    Use this tutorial with the is_home() conditional tag and change the hook http://designsbynickthegeek.com/tutorials/add-widgeted-sidebar


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #23379

    eluviis
    Participant
    Post count: 115

    Thanks, I got it to work with that tutorial…

    1. I registered the widget – Check!

    2. Then I tried using simple hooks to display it, but that didn’t work of couse, because I only want it in the middle of the homepage.

    3. So… I went to home.php and found the code for the home-welcome widget I’m trying to duplicate.

    4. I duplicated this code for function agency_home_welcome_helper () {

    if ( is_active_sidebar( ‘home-welcome’ ) ) {
    echo ‘<div id=”home-welcome”>’;
    dynamic_sidebar( ‘home-welcome’ );
    echo ‘</div><!– end #home-welcome –>’;
    }

    And I changed the home-welcome to “home-wide” the name of my new widget. Like this:

    if ( is_active_sidebar( ‘home-wide’ ) ) {
    echo ‘<div id=”home-wide”>’;
    dynamic_sidebar( ‘home-wide’ );
    echo ‘</div><!– end #home-wide –>’;
    }

     

    It works!

    I do have one doubt. Do I also have to add “home-wide” (my new widget’s ID) to this string of PHP code that’s in the home.php (there’s mention of all the widgets on the homepage, so I would guess I need to add my new “home-wide” as well, right?

    ————————————–

    function agency_home_genesis_meta() {

    if ( is_active_sidebar( ‘home-welcome’ ) || is_active_sidebar( ‘home-slider’ ) || is_active_sidebar( ‘home-left’ ) || is_active_sidebar( ‘home-middle’ ) || is_active_sidebar( ‘home-right’ ) ) {

    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
    add_action( ‘genesis_after_header’, ‘agency_home_welcome_helper’ );
    add_action( ‘genesis_loop’, ‘agency_home_loop_helper’ );
    add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_full_width_content’ );
    add_filter( ‘body_class’, ‘add_body_class’ );

    function add_body_class( $classes ) {
    $classes[] = ‘agency’;
    return $classes;
    }

    }
    }

    ————————————–

    #23382

    braddalton
    Participant
    Post count: 9446

    You’ll also need to duplicate the CSS and change the selectors.

    And yes, the new widget needs a unique i.d.

    If it works then you won’t need to do this:

    I would have created a new widget using the code from Nicks site rather than duplicate the widget in the home.php. Why didn’t this work for you?

    Do you want the new widget sitewide or just home?

    I think its better if you use this code from Brian and change the class and hook if needed http://www.briangardner.com/welcome-text-widget/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #23388

    eluviis
    Participant
    Post count: 115

    I did create the widget using Nick’s tutorial. That makes it work in the WordPress UI as it registers properly. My problem came when displaying the widget as I only want it in the middle of the homepage. I couldn’t find anything on Nick’s article that could help me for that part.

    That’s when I had the idea to look in the home.php.

    That’s when I duplicated the code for the home-welcome and just changed the ID and name to home-wide (so I would have both).

    I then copied the CSS from #home-welcome and duplicated it for #home-wide – and changed a couple of parameters.

    I’m still unsure about that bit of PHP code at the top of home.php that states all the homepage widgets except my new one. Not sure if I have to add it there for some reason… so if @nickthegeek sees this, maybe he can point me in the right direction

    However, the widget displays and works brilliantly.

    Look here for the content-wide text with header right under the slider: http://ravx.com/xrd/ (temporary link).

    This is the text display you are looking for:

    XRD Offers Solutions for Dedicated Cyclists

    Long hours in the saddle are challenging. XRD provides solutions that put excitement and pleasure back into competitive cycling. Some cycle to win and some cycle for fun, but we are all serious about our sheer love of riding.

    Continue scrolling below to see more of what XRD has to offer…

    THANKS!!!!!!!!!!!!!!!!

    #23398

    braddalton
    Participant
    Post count: 9446

    hahaha.

    Site looks good. Be better if you could make the background of the sliders content excerpt transparent with white text.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #23412

    eluviis
    Participant
    Post count: 115

    ^^^ I’ll take a look into that tomorrow. I’m not actually seeing exactly that. My slider is all white with black text over the regular white excerpt box. (which only shows when it covers a section of product photo). Maybe making it translucent would be good. But I have to test this in various browsers now.

    I have to publish this thing by tomorrow afternoon, so I’m rushing to make changes, but the site is almost complete. Made a tons of progress today.

    Thanks for all your help man.

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

You must be logged in to reply to this topic.