WordPress.org

Ready to get started?Download WordPress

Forums

Adding Title to slider (4 posts)

  1. purrfect10
    Member
    Posted 3 years ago #

    On my slider, I have the text of the article. But, I want to add the title to that article. I would also like it to be linkable. Does anyone know how I can do so?

    http://www.skinnyfrommckinney.com

  2. hedronist
    Member
    Posted 3 years ago #

    This needs to be changed in your theme -- either in the theme-specific section of the Dashboard or in the PHP files that came with the theme.

    It appears that the slider is only on your front page, so look at the index.php file in your theme folder (.../wp-content/themes/multichrome/index.php most likely) and look for text that says <div id="slidearea">. The slider might also be coming from a file that is included() by index.php. Inside that div will be a loop that appears to be grabbing 5 posts and then outputting the image and the_excerpt() (or possibly the_content()). When you find it you can insert this code to get the title: <?php the_title(); ?> (reference page), surrounded by whatever formating you care to do.

    Here is a list of other Post Tags available in the loop.

  3. purrfect10
    Member
    Posted 3 years ago #

    Ok, it appears that <div id="slidearea"> is in the slide.php. Where do I add <?php the_title(); ?> ? See below.

    <script type="text/javascript">
    jQuery(function() {
    jQuery(".mygallery").jCarouselLite({
    btnNext: ".nextb",
    btnPrev: ".prevb",
    visible: 1,
    speed: 5000,
    auto: 2000,
    easing: "backout"
    });
    });
    </script>
    
    <div id="slidearea">
    
    <div id="gallerycover">
    <div class="mygallery">
    
    	<ul>
    			<?php
    			$gldcat = get_option('mult_gldcat');
    			$gldct = get_option('mult_gldct');
    			$my_query = new WP_Query('category_name='.$gldcat.'&showposts='.$gldct.'');
    			while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID;
    			?>
     <li>
    <div class="mytext">
    
    <?php
    if ( has_post_thumbnail() ) {
    			 the_post_thumbnail( 'slider-thumbnail', array('class' => 'slidim') );
    } else {
    	// the current post lacks a thumbnail
    }
    ?>
    <?php the_excerpt(); ?> 
    
    </div>
     </li>
    			<?php endwhile; ?>
         </ul>
    
        <div class="clear"></div>  
    
    </div>
    
    </div>
    
       <a href="#" class="prevb"></a>
       <a href="#" class="nextb"></a>  
    
    </div>
  4. hedronist
    Member
    Posted 3 years ago #

    It looks like you already did it. :-)

    You might want to consider making the title left justified. The way you have it right now makes it a little hard to read. Also, I find the bouncing left-right-left-stop thing to be a) distracting, and b) slightly nauseating if you focus on it for more than a few seconds. You might want to consider commenting out the easing arg to jCarouselLite.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags