Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Removing links on featured slider

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #6413

    Could you help me with removing the links on the featured slider?
    This is my website It’s my first website and I’m not a coder but have been learning a bit as I go along (so far that’s very little).
    I have a child theme and created a header-extensions.php file.
    I then removed this line;

    $cleanretina_featured_post_slider .= '<figure><a href="' . get_permalink() . '" title="'.the_title('','',false).'">';

    Nothing happened. Have I done the right thing and, if so, why isn’t it working
    Thanks, Sue


    Ok I’ve worked out that as the above command is not in a template I can’t just change it in a child theme so it overrides the parent theme. I think I know what needs to be done – I need to put a command to remove the action into a functions.php file in the child theme – but am not sure how to do it

    Can anybody tell me if I’m right and what command I need to put in the functions.php file?

    Sanjip Shah

    @scarroll Just copy this function cleanretina_featured_post_slider in the functions.php file of you child theme and make your changes there. This is the best approach.


    Thanks for replying.

    make your changes there.

    This is the bit I don’t know – what changes do I make to cleanretina_featured_post_slider? I understand I need to copy the function cleanretina_featured_post_slider into my child theme functions.php file but then I don’t know what to do with it.

    I would really appreciate any help with this – it is the only thing left to do on the website and then it is ready

    Sanjip Shah

    @scarroll Remove this line <a href="' . get_permalink() . '" title="'.the_title('','',false).'"> and also the closing tag below </a> some lines below. After that, go to Appearance->Theme Options and click in any of the ‘Save Changes’ button (no changes may reflect due to the previous cache, this is done just to delete the previous caching)


    I have made a functions.php file and pasted exactly this in it.

    if ( ! function_exists( 'cleanretina_featured_post_slider' ) ) :
     * display featured post slider
     * @uses set_transient and delete_transient
    function cleanretina_featured_post_slider() {	
    	global $post;
    	global $cleanretina_theme_options_settings;
       $options = $cleanretina_theme_options_settings;
    	$cleanretina_featured_post_slider = '';
    	if( ( !$cleanretina_featured_post_slider = get_transient( 'cleanretina_featured_post_slider' ) ) && !empty( $options[ 'featured_post_slider' ] ) ) {
    		$cleanretina_featured_post_slider .= '
    		<section class="featured-slider"><div class="slider-wrap"><div class="slider-cycle">';
    			$get_featured_posts = new WP_Query( array(
    				'posts_per_page' 			=> $options[ 'slider_quantity' ],
    				'post_type'					=> array( 'post', 'page' ),
    				'post__in'		 			=> $options[ 'featured_post_slider' ],
    				'orderby' 		 			=> 'post__in',
    				'ignore_sticky_posts' 	=> 1 						// ignore sticky posts
    			$i=0; while ( $get_featured_posts->have_posts()) : $get_featured_posts->the_post(); $i++;
    				$title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) );
    				$excerpt = get_the_excerpt();
    				if ( 1 == $i ) { $classes = "slides displayblock"; } else { $classes = "slides displaynone"; }
    				$cleanretina_featured_post_slider .= '
    				<div class="'.$classes.'">';
    						if( has_post_thumbnail() ) {
    							$cleanretina_featured_post_slider .= '<figure><a href="' . get_permalink() . '" title="'.the_title('','',false).'">';
    							$cleanretina_featured_post_slider .= get_the_post_thumbnail( $post->ID, 'slider', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ), 'class'	=> 'pngfix' ) ).'</a></figure>';
    						if( $title_attribute != '' || $excerpt !='' ) {
    						$cleanretina_featured_post_slider .= '
    							<article class="featured-text">';
    							if( $title_attribute !='' ) {
    									$cleanretina_featured_post_slider .= the_title( '<span>','</span>', false );
    							if( $excerpt !='' ) {								
    								$cleanretina_featured_post_slider .= $excerpt.'<a href="' . get_permalink() . '" title="'.the_title('','',false).'">'.' '.__( 'Continue Reading', 'cleanretina' ).'</a>';
    						$cleanretina_featured_post_slider .= '
    							</article><!-- .featured-text -->';
    				$cleanretina_featured_post_slider .= '
    				</div><!-- .slides -->';
    			endwhile; wp_reset_query();
    		$cleanretina_featured_post_slider .= '</div></div>				
    		<nav id="controllers" class="clearfix">
    		</nav><!-- #controllers --></section><!-- .featured-slider -->';
    	set_transient( 'cleanretina_featured_post_slider', $cleanretina_featured_post_slider, 86940 );
    	echo $cleanretina_featured_post_slider;	

    However the code is appearing at the top of the website (I was going to make the changes as suggested above in the child theme editor)

    Am I copying the function correctly?


    OK, ignore my post above, I forgot to put <?php /> around the above code. The links have gone, brilliant!
    Thanks very much for your help and for this wonderful theme


    that should read <?php ?>

    Sanjip Shah

    @scarroll Okay. Great.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.