WordPress.org

Ready to get started?Download WordPress

Forums

OptionTree
[resolved] Adding slides as default (3 posts)

  1. nathanegraham
    Member
    Posted 1 year ago #

    I want to set two sliders as default for users when they install a theme (e.g., when a user installs the theme and goes to Theme Options-->Front Page Slider, they will already see two slider images with the option to add more or modify the default slides. This is for a course I'm teaching and I need to really guide my students with a lot of default values.

    I want users to see this in theme options when they go to front-page slider by default:

    http://www.flickr.com/photos/digitalborn/8183198356/in/photostream/lightbox/

    How do I add default sliders with list-item?

    Here's part of what I have so far and it's not even close to working. Thanks in advance!

    array(
    'id' => 'homepage_slider',
    'label' => 'Slider: Slide Manager',
    'desc' => 'Upload images that you'd like used as slides on the default homepage layout, as well as a simple destination URL for when visitors click each slide.

    Note: The theme will automatically resize any oversized images to fit the space',
    'std' => '',
    'type' => 'list-item',
    'section' => 'skeleton_slider',
    'class' => '',
    'choices' => array(),
    'settings' => array(
    array(
    'id' => 'slider_image',
    'label' => 'image',
    'desc' => '',
    'std' => 'http://stat-ass3.ses.com/12230313/banner-blog-spreadingIdeas.jpg',
    'type' => 'upload',
    'class' => '',
    'choices' => array()
    ),
    array(
    'id' => 'slider_link',
    'label' => 'Link to Post',
    'desc' => 'Enter the posts url.',
    'std' => 'http://digitalborn.org',
    'type' => 'text',
    'class' => '',
    'choices' => array()
    ),

    http://wordpress.org/extend/plugins/option-tree/

  2. Derek Herman
    Member
    Plugin Author

    Posted 1 year ago #

    This would be the entire Theme Options file if you only had that one option.

    https://gist.github.com/4a2f47727f1e034114a9

  3. nathanegraham
    Member
    Posted 1 year ago #

    Thanks for your help! This almost worked. It definitely gives me default sliders in theme options, which looks like this

    http://www.flickr.com/photos/digitalborn/8187968763/in/photostream/lightbox/

    but the sliders don't actually display correctly on the front page of the theme. Perhaps this just isn't possible.

    Here's what results when I add the code you've linked:

    http://www.flickr.com/photos/digitalborn/8189049870/in/photostream/lightbox/

    Here's what it should look like:

    http://www.flickr.com/photos/digitalborn/8187968705/in/photostream/lightbox/

    Thanks again for looking into this. Ideally when the theme is activated a slider image will appear in the theme by default. Since I've changed background images, added static images, text, etc., to appear as default through theme-options.php, it seems like I should be able to add the list-item slider for the front page by default. This would give users a default example of what to enter while also keeping a consistent look to the front page from semester to semester.

    Thanks!
    NG

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic