Slider Text & Action Button
Support Area › Forums › Bottega › Slider Text & Action Button
- This topic has 3 replies, 2 voices, and was last updated 8 years, 11 months ago by Bill Robbins.
-
AuthorPosts
-
April 26, 2015 at 13:06 #29187Nicholas MinnichParticipant
Hi Bill,
I think I got spoiled by your newer templates with the sliders with text overlay and action button!
Is it feasible to replicate Elite’s slideshow without tons of development time?
I would even be happy with a custom field to add html on top of each slide…
Thanks!!!
April 27, 2015 at 08:52 #29193Bill RobbinsModeratorGood Morning Nicholas,
I can appreciate that. Just about anything can be done if you’d like to make the changes. The slides are created in the page-home.php file in this section:
<li id="slide-<?php the_ID(); ?>"> <?php if(get_post_meta($post->ID, "slide_video", $single = true) != ""){ ?> <div class="fit-video"> <?php echo get_post_meta($post->ID, "slide_video", TRUE); ?> </div> <?php } else { ?> <a href="<?php echo get_post_meta($post->ID, "slideurl", TRUE); ?>"><?php the_post_thumbnail('header-image'); ?></a> <?php } ?> </li>
Right above this:
<a href="<?php echo get_post_meta($post->ID, "slideurl", TRUE); ?>"><?php the_post_thumbnail('header-image'); ?></a>
you could add in custom fields. A new field might look like this:
<?php if ( get_post_meta($post->ID, "slide_title", $single = true ) != "" ) { ?> <h2 class="slide-title"><?php echo get_post_meta($post->ID, "slide_title", TRUE); ?></h2> <?php } ?>
That would add in a new field with the key of slide_title to the front end of the site. For the backend you’d need to edit the bottega-meta-boxes.php file (it’s in the includes/custom-meta-boxes folder). This section is where the meta boxes are added to the slides:
$meta_boxes[] = array( 'id' => 'slide_metabox', 'title' => 'Slide Options', 'pages' => array( 'slide', ), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => true, // Show field names on the left 'fields' => array( array( 'name' => __( 'Optional Link', 'organizedthemes' ), 'desc' => __( 'Works with an image slide, not a video slide.', 'organizedthemes' ), 'id' => 'slideurl', 'type' => 'text', ), array( 'name' => __( 'Video Code', 'organizedthemes' ), 'desc' => __( 'To make this slide a video, paste your embed code here. Video slides do not support links or captions. For best results with videos, set the slideshow to NOT Automatically play', 'organizedthemes' ), 'id' => 'slide_video', 'type' => 'textarea_code', ), ), );
You could duplicate:
array( 'name' => __( 'Optional Link', 'organizedthemes' ), 'desc' => __( 'Works with an image slide, not a video slide.', 'organizedthemes' ), 'id' => 'slideurl', 'type' => 'text', ),
and change the id to slide_title from slideurl and change the name and description to describe what you’re adding.
That should let you add in a slide title. You can repeat that for as many other fields as you need to add in there.
If you run into any questions or trouble, let me know.
Have a great week,
BillApril 27, 2015 at 19:33 #29221Nicholas MinnichParticipantIt worked! Thanks for the outstanding service!
April 27, 2015 at 20:02 #29225Bill RobbinsModeratorFantastic…happy to help out 🙂
-
AuthorPosts
- The topic ‘Slider Text & Action Button’ is closed to new replies.