StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   Diff Meteor Slide on Each Page + Genesis (http://www.studiopress.com/support/showthread.php?t=123006)

mrsmarshah 11-01-2012 10:59 PM

Diff Meteor Slide on Each Page + Genesis
 
I have created multiple slideshows with the Meteor Slides plugin. I would like to have Meteor Slide #1 on the "About Us" page and Meteor Slide #2 on "Home" (for example). Could someone help me with the code I would need to add to functions.php?

I came across this thread from WordPress.org, but I'm not sure how to make the code work with Genesis Framework.


...Thanks!

NicktheGeek 11-02-2012 08:43 AM

you should be able to add the short code to your page editor.

mrsmarshah 11-02-2012 10:35 AM

Sorry Nick, I should have specified. I am using the Education theme and have the Meteor Slide in the Slide widget area.

NicktheGeek 11-02-2012 10:43 AM

The slide widget area is only in the homepage. You would need to remove the add_action/function for it from the home.php file and move that to the functions.php file. Then you could use the Widget Logic plugin to insert multiple widgets for different pages.

mrsmarshah 11-02-2012 12:44 PM

Thank you for the help Nick!

Site: http://designedbymarsha.com/wordpress2/

I moved the following from home.php to functions.php

Code:

/** Slide Sidebar */
function education_home_genesis_meta() {
       
        global $paged;
       
        if( $paged < 1 ) {
                if ( is_active_sidebar( 'slider' ) || is_active_sidebar( 'intro' ) || is_active_sidebar( 'featured' ) || is_active_sidebar( 'call-to-action' ) ) {
               
                        add_action( 'genesis_before_content', 'education_home_loop_helper', 1 );
       
                }
        }
       
}

I installed the Widget Logic plugin and tried out is_single() and left Metadata blank. The slideshow only works on my homepage and I am guessing that is because in the code above, it has a conditional statement already. I tried removing bits of this code but I can't seem to get it right.

NicktheGeek 11-02-2012 02:02 PM

you have to get just the part for the slider. you will need to make your own action for it or you can add that to the Genesis Simple Hooks plugin. The code you copied just called the education_home_loop_helper function. That function has the code for the slider in it.

mrsmarshah 11-07-2012 04:20 PM

Thank you Nick!

I removed is_active_sidebar( 'slider' ) || from home.php

I used simple hooks and put <?php if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); } ?> into genesis_before_content.

[S]It worked =).[/S] Edit: It's showing the same slideshow on every page. I have two Meteor slide widgets in my slider section.

http://designedbymarsha.com/wordpres...07/widgets.gif

I would prefer to have it hardwired into my functions.php file, but I can't seem to get the code right. Here's what I added

Code:

/** Meteor Slides */
add_action('genesis_before_content', 'meteor_slides');
function meteor_slides() {
        echo '<?php if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); } ?>';
   
}}

Where did I go wrong?

NicktheGeek 11-08-2012 08:06 AM

you should call a sidebar with dynamic_sidebar() or genesis_widget_area like ti does in home.php file.

mrsmarshah 11-08-2012 11:33 PM

Nick, thank you for being patient with me. It is my desire to go through your Genesis explained series very soon. I am excited to learn, thank you for making that available =). I finally figured out how to do this. Nick, if you notice any errors, would you let me know? My functions.php file didn't crash so that is how I assume everything is correct .. =P.

For anyone looking for the same thing, here is how to get a different Meteor Slide on every page using the Genesis Framework.

1. Install Meteor Slides Plugin
2. Install Widget Logic plugin
3. Drag Meteor Slides Widget into Slider section, set conditional tags in the widget logic box.
4. Open up home.php, remove is_active_sidebar( 'slider' ) ||

OPTION ONE:
Install Genesis Simple Hooks plugin

add

Code:

<?php dynamic_sidebar( ‘slider’ ); ?>
to the genesis_before_content Hook and check off Execute PHP on this hook?. Save settings.

OPTION TWO:
add this code to functions.php file
Code:

add_action( 'genesis_before_content', 'my_slider_function' );
function my_slider_function() {
    if ( is_active_sidebar( 'slider' ) ) {
        echo '<div id="slider-image">';
        dynamic_sidebar( 'slider' );
        echo '</div>';
    }
}

Thank you http://genesissnippets.com/ for the snippet and thank you Nick for your help as well! =)

NicktheGeek 11-09-2012 08:50 AM

You're welcome.

Since this is resolved I'm going to close this thread.


All times are GMT -5. The time now is 02:25 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.