Viewing 15 replies - 1 through 15 (of 18 total)
  • Thread Starter icing

    (@icing)

    Till i find the solution to this, I will use Easing Slider Plugin.

    Theme Author Catch Themes

    (@catchthemes)

    You need to customize the simplecatch_sliders() function or you can upgrade to Simple Catch Pro and use Featured Image Slider where you can add images without links as well. No need to be posts…

    i would also like to know how to remove links from the slider. any tips on what exactly i would be customizing with the simplecatch_sliders() function? here it is below (i found the following code in the simplecatch_functions.php file)

    /**
     * This function to display featured posts on homepage header
     *
     * @get the data value from theme options
     * @displays on the homepage header
     *
     * @useage Featured Image, Title and Content of Post
     *
     * @uses set_transient and delete_transient
     */
    function simplecatch_sliders() {
    	global $post;
    	//delete_transient( 'simplecatch_sliders' );
    
    	global $simplecatch_options_settings;
        $options = $simplecatch_options_settings;
    
    	$postperpage = $options[ 'slider_qty' ];
    
    	if( ( !$simplecatch_sliders = get_transient( 'simplecatch_sliders' ) ) && !empty( $options[ 'featured_slider' ] ) ) {
    		echo '<!-- refreshing cache -->';
    
    		$simplecatch_sliders = '
    		<div class="featured-slider">';
    			$get_featured_posts = new WP_Query( array(
    				'posts_per_page' => $postperpage,
    				'post__in'		 => $options[ 'featured_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 ( $i == 1 ) { $classes = "slides displayblock"; } else { $classes = "slides displaynone"; }
    				$simplecatch_sliders .= '
    				<div class="'.$classes.'">
    					<div class="featured">
    						<div class="slide-image">';
    							if( has_post_thumbnail() ) {
    
    								$simplecatch_sliders .= '<a href="' . get_permalink() . '" title="Permalink to '.the_title('','',false).'">';
    
    								if( $options[ 'remove_noise_effect' ] == "0" ) {
    									$simplecatch_sliders .= '<span class="img-effect pngfix"></span>';
    								}
    
    								$simplecatch_sliders .= get_the_post_thumbnail( $post->ID, 'slider', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ), 'class'	=> 'pngfix' ) ).'</a>';
    							}
    							else {
    								$simplecatch_sliders .= '<span class="img-effect pngfix"></span>';
    							}
    							$simplecatch_sliders .= '
    						</div> <!-- .slide-image -->
    					</div> <!-- .featured -->
    					<div class="featured-text">';
    						if( $excerpt !='') {
    							$simplecatch_sliders .= the_title( '<span>','</span>', false ).': '.$excerpt;
    						}
    						$simplecatch_sliders .= '
    					</div><!-- .featured-text -->
    				</div> <!-- .slides -->';
    			endwhile; wp_reset_query();
    		$simplecatch_sliders .= '
    		</div> <!-- .featured-slider -->
    			<div id="controllers">
    			</div><!-- #controllers -->';
    
    	set_transient( 'simplecatch_sliders', $simplecatch_sliders, 86940 );
    	}
    	echo $simplecatch_sliders;
    } // simplecatch_sliders
    Thread Starter icing

    (@icing)

    something to do with this?
    $simplecatch_sliders .= '<a href="' . get_permalink() . '" title="Permalink to '.the_title('','',false).'">';

    Didn’t see a solution in the thread. Could you explain?

    i don’t believe a solution has been found for this yet

    Theme Author Catch Themes

    (@catchthemes)

    @silico26 : you can just replace ‘ . get_permalink() . ‘ with # . see it below:

    $simplecatch_sliders .= '<a href="#" title="Permalink to '.the_title('','',false).'">';

    After you make the change, you need to clear the cache set by set_transient( 'simplecatch_sliders', $simplecatch_sliders, 86940 );

    So, to clear the cache you can change any value in Slider option from your WordPress Dashboard.

    thanks for your reply sakin. i removed the link, but am unable to change it to a custom link. did i follow your directions correctly? i am mostly confused about the cache part you mentioned. here is what i did:

    i took the simplecatch_functions.php file (located here:
    wp-content/themes/simple-catch/functions/simplecatch_functions.php)

    and pasted it into a child theme directory (wp-content/themes/simple-catch-child)

    and i removed this part of it:

    ( get_permalink() ) . '">' . sprintf( __( '%s', 'simplecatch' ), esc_attr( $more_tag_text ) ) . '</a>';

    and replaced it it with this:

    ( $simplecatch_sliders .= '<a href="https://www.google.com" title="Permalink to '.the_title('','',false).'">'; ) . '">' . sprintf( __( '%s', 'simplecatch' ), esc_attr( $more_tag_text ) ) . '</a>';

    when i reuploaded the file to the child theme directory, it effectively removed the link, but did not add the example google link. maybe this is because i did not follow or understand this part you mentioned below?


    After you make the change, you need to clear the cache set by set_transient( ‘simplecatch_sliders’, $simplecatch_sliders, 86940 );

    So, to clear the cache you can change any value in Slider option from your WordPress Dashboard.

    Thanks, Sakin.

    Now if I could just remove the post excerpt below the featured images it would be great.

    @luichy were you able to add a custom link via sakin’s instructions above?

    Sorry, silico26. I just needed to remove the permalink and it worked. Although partially, because there’s still a link to the homepage.

    Theme Author Catch Themes

    (@catchthemes)

    @silico26: I mean you need to clear the cache by delete_transient which you don’t need to code it but can change any setting fields in Slider option from your WordPress Dashboard otherwise you have to wait for 24 hours to clear the cache.

    interesting luichy, mine removed the link altogether, no link to the home page.

    Theme Author Catch Themes

    (@catchthemes)

    @luichy: # means it will link to # of homepage but the slider is in homepage so it just like removing the link. If you want to totally remove the link then you have to delete whole line

    $simplecatch_sliders .= '<a href="' . get_permalink() . '" title="Permalink to '.the_title('','',false).'">';

    and in the following line just delete .”

    $simplecatch_sliders .= get_the_post_thumbnail( $post->ID, 'slider', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ), 'class'	=> 'pngfix' ) ).'</a>';

    @silico26: I mean you need to clear the cache by delete_transient which you don’t need to code it but can change any setting fields in Slider option from your WordPress Dashboard otherwise you have to wait for 24 hours to clear the cache.

    i guess i am too much of a noob to understand what you’re saying, but i appreciate you trying. the fact that the link was removed after i uploaded my tweaked php file makes me think that it’s not a matter of the cache needing to be cleared but an error in the code somewhere

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Theme: Simple Catch] How to remove permalink from featured slider’ is closed to new replies.