skip to Main Content

Re-Inserting the Slider Back into AgentPress 1.0

Older versions of the AgentPresss child theme are experiencing issues with the slider speeding up in certain browser environments. Here’s how you can fix that, or manually update to v1.0.1.

It’s possible that your widgets might shift around during this process – if this happens, you should be able to find them in the Inactive Widgets section on the Widgets screen in your dashboard and place them back where they belong.

Step #1
Open your child theme’s functions.php file, remove the following code:

PHP Code:


// Load script for jFlow slider
add_action('get_header''agentpress_load_scripts');
function 
agentpress_load_scripts() {
    
wp_enqueue_script('jflow'CHILD_URL.'/lib/js/jquery.flow.1.1.js', array('jquery'), '1.1'TRUE);
}

// Load parameters for jFlow slider
add_action('wp_footer''agentpress_jflow_params');
function 
agentpress_jflow_params() {
    
$timer intval(genesis_get_option('slider_timer'));
    
$duration intval(genesis_get_option('slider_duration'));
     
$output '
        jQuery(document).ready(function($) { 
            $("div#controller").jFlow({
                slides: "#slides", 
                width: "920px", 
                height: "300px", 
                timer: '
.$timer.', 
                duration: '
.$duration.
            });
        });
    '
;
    
$output str_replace(array("n","t","r"), ''$output);
    echo 
'<script type='text/javascript'>'.$output.'</script>';




And also this:

PHP Code:


// Add new box to the Genesis -> Theme Settings page
add_action('admin_menu', 'agentpress_add_settings_boxes', 11);
function agentpress_add_settings_boxes() {
    global $_genesis_theme_settings_pagehook;
    add_meta_box('genesis-theme-settings-slider', __('Slider Settings', 'agentpress'), 'agentpress_theme_settings_slider_box', $_genesis_theme_settings_pagehook, 'column2');
}
function agentpress_theme_settings_slider_box() { ?>
    <p><input type="checkbox" name="<?php echo GENESIS_SETTINGS_FIELD?>[slider_enable]" id="<?php echo GENESIS_SETTINGS_FIELD?>[slider_enable]" value="1" <?php checked(1genesis_get_option('slider_enable')); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD?>[slider_enable]"><?php _e('Enable the Slider?''agentpress'); ?></label></p>
    <p><label><?php _e('Category''agentpress'); ?><?php wp_dropdown_categories(array('name' => GENESIS_SETTINGS_FIELD.'[slider_cat]''selected' => genesis_get_option('slider_cat'), 'orderby' => 'Name' 'hierarchical' => 1'show_option_all' => __("All Categories"'agentpress'), 'hide_empty' => '0')); ?></label></p>
    <p><label><?php _e('Number of Posts''agentpress'); ?>: <input type="text" name="<?php echo GENESIS_SETTINGS_FIELD?>[slider_num]" value="<?php genesis_option('slider_num'); ?>" size="5" /></label></p>
    <p><label><?php _e('Time Between Slides (in milliseconds)''agentpress'); ?>: <input type="text" name="<?php echo GENESIS_SETTINGS_FIELD?>[slider_timer]" value="<?php genesis_option('slider_timer'); ?>" size="5" /></label></p>
    <p><label><?php _e('Slide Transition Speed (in milliseconds)''agentpress'); ?>: <input type="text" name="<?php echo GENESIS_SETTINGS_FIELD?>[slider_duration]" value="<?php genesis_option('slider_duration'); ?>" size="5" /></label></p>
<?php
}

// Add new default values for the slider
add_filter('genesis_theme_settings_defaults''agentpress_slider_defaults');
function 
agentpress_slider_defaults($defaults) {
    
$defaults['slider_enable'] = 1;
    
$defaults['slider_num'] = 1;
    
$defaults['slider_timer'] = 6000;
    
$defaults['slider_duration'] = 400;
    return 
$defaults;
}



Step #2
Open your child theme’s functions.php file, find this code:

PHP Code:



// Add the slider on the homepage above the content area
add_action('genesis_after_header''agentpress_include_slider'); 
function 
agentpress_include_slider() {
    if(
is_front_page() && genesis_get_option('slider_enable'))
    require(
CHILD_DIR '/slider.php');




And replace it with this:

PHP Code:


/** Add the slider on the homepage above the content area */
add_action('genesis_after_header''agentpress_include_slider'); 
function 
agentpress_include_slider() {
    if(
is_front_page())
    
dynamic_sidebar'slider' );




Step #3
Open your child theme’s functions file, find this code:

PHP Code:



genesis_register_sidebar(array(
    
'name'=>'Multi-Agent Page',
    
'description' => 'This is the main content area of the mult-agent page template.',
    
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
)); 




Immediately after that, place this code:

PHP Code:


genesis_register_sidebar(array(
    
'name'=>'Slider',
    
'id' => 'slider',
    
'description' => 'This is the slider section on the homepage',
)); 




Step #4
Download and activate the Genesis Slider plugin. You’ll need to configure the Genesis Slider Settings page with the following:

Time Between Slides (in milliseconds): 6000

Slide Transition Speed (in milliseconds): 400
Slider Width (in pixels): 900
Slider Height (in pixels): 300

Step #5
Delete the slider.php file from your child theme folder, as well as the js folder.

Step #6
Open up your child theme’s style.css file and remove the following code:

PHP Code:



/***** Slider ********************/

#gen-slider-wrap {
    background#FFFFFF;
    
width920px;
    
height300px;
    
margin0 auto 0;
    
padding10px;
    
border10px solid #516B86;
    
}
    
#gen-slider-wrap p {
    
margin0;
    
padding0 0 5px 0;
    }
    
#gen-slider-wrap h2 {
    
font-familyGeorgiaTimes New RomanTrebuchet MS;
    
font-size18px;
    
font-weightnormal;
    
margin0;
    
padding0 0 5px 0;
    }
    
#gen-slider-wrap h2 a, #gen-slider-wrap h2 a:visited {
    
color#072C53;
    
text-decorationnone;
    }
    
#gen-slider-wrap h2 a:hover {
    
color#5F788E;
    
text-decorationnone;
    }

#controller {
    
floatleft;
    
displayinline-block;
    
clearboth;
    
margin0;
    
padding0;
    }
    
#controller span {
    
background-repeatno-repeat;
    
displayinline-block;
    
padding0;
    
margin0;
    }
    
#jFlowSlide {
    
floatleft;
    
positionabsolute;
    
margin0;
    
padding0;
    
displayinline-block;
    
clearboth;
    
z-index1;
    }
    
#jFlowSlide img {
    
margin0;
    
padding0;
    
floatleft;
    
positionabsolute;
    
z-index1;
    }
    
#slides {
    
margin0;
    
padding0;
    
width920px;
    
height300px;
    
floatleft;
    
positionabsolute;
    
z-index1;
    
overflowhidden;
    }
    
.
jFlowSlideContainer {
    
margin0;
    
padding0;
    }

.jFlowSlideControl {
    
margin0;
    
padding0;
    }

.slideinfo {
    
floatleft;
    
displayblock;
    
backgroundnone;
    
width400px;
    
max-height460px;
    
margin10px 0 0 490px;
    
padding10px;
    
positionabsolute;
    
z-index8;
    }
    
html body .slideinfoborder {
    
floatleft;
    
displayinline;
    
positionrelative;
    
backgroundnone;
    
width378px;
    
padding10px 10px 5px 10px;
    
margin0;
    
border1px solid #FFFFFF;
    
z-index8;
    }
    
.
slideinfoborder /* IE6 Fix */ {
    
floatleft;
    
displayinline;
    
positionabsolute;
    
backgroundnone;
    
width378px;
    
padding10px 10px 5px 10px;
    
margin0;
    
border1px solid #FFFFFF;
    
z-index8;
    }
    
html body .slideinfobg {
    
floatleft;
    
displayblock;
    
positionabsolute;
    
background#FFFFFF;
    
width420px;
    
height100%;
    
margin: -10px 0 0 -10px;
    
padding0px;
    
filteralpha(opacity=70); /* CSS3 standard */
      
opacity0.7;
    
z-index6;
    }
    
.
slideinfobg /* IE6 Fix */ {
    
floatleft;
    
displayblock;
    
positionabsolute;
    
background#FFFFFF;
    
width420px;
    
height460px;
    
margin: -10px 0 0 -10px;
    
padding0px;
    
filteralpha(opacity=70); /* CSS3 standard */
      
opacity0.7;
    
z-index6;
    }
    
#jFlowSlide .slideimage {
    
margin0;
    
padding0;
    }
    
#previous a img {
    
floatleft;
    
displayblock;
    
backgroundtransparent url(images/slider-previous.pngno-repeat;
    
margin240px 0 0 10px;
    
width48px;
    
height55px;
    
positionabsolute;
    
clearboth;
    
z-index9;
    
overflowhidden;
    }
    
#previous a:hover img {
    
background-position: -48px 0;
    }
    
#next a img {
    
floatright;
    
displayblock;
    
backgroundtransparent url(images/slider-next.pngno-repeat;
    
margin240px 0px 0px 865px;
    
width48px;
    
height55px;
    
positionabsolute;
    
clearboth;
    
z-index9;
    
overflowhidden;
    }
    
#next a:hover img {
    
background-position: -48px 0;
    }
    
.
gen-slider {
    
floatleft;
    
displayblock;
    
clearboth;
    
margin0;
    
padding0;
    
positionrelative;
    
z-index1;
    }
    
.
gen-slider h1 {
    
margin0;
    } 




Step #7
Install and setup the Genesis Slider Plugin. This replaces the slider from the AgentPress 1.0 theme.

Make sure you’ve activated the slider widget in your widgets section (Appearance-Widgets)

Back To Top