Tagged: slider
- This topic has 4 replies, 3 voices, and was last updated 6 years, 11 months ago by opino.
-
AuthorPosts
-
November 28, 2012 at 6:25 am #2080rumyanMember
I’m trying to remove the link in the slider, which moves to the post. I tried to override the simplecatch_sliders function in functions directory.
Removing
$ simplecatch_sliders. = ‘<a Href=”‘. Get_permalink().'” Title=”Permalink is’.the_title(”,”,false).'”>’,
unfortunately does not help.
November 30, 2012 at 8:07 pm #2148SakinKeymaster@rumyan: if you want to make changes to the theme then I recommend you to build child theme and then add in the changes there in child theme. If you make changes directly in the theme core files then it will be reverted back after you make the updates.
You need to replace the below code
[php]
/**
* 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).’" rel="nofollow">’;
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
[/php]with
[php]
/**
* 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() ) {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’ ) );
}
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
[/php]Then you need to clear the cache by making changes on any theme setting in your slider.
But if you want to use simple image slider with your own link, title and description. Everything is optional then you can upgrade to Simple Catch Pro theme.
December 1, 2012 at 2:48 am #2174rumyanMemberI did exactly what you wrote.
Yes, I use a child theme.
In child them I created a folder ‘functions’ and put simplecatch_functions.php file there . Inside I pasted simplecatch_sliders function without a link. I cleaned the cache. Unfortunately, it did not help.
I made the same change in simple-catch theme. I cleaned the cache. Also nothing.Looks strange, isn’t? Any idea?
UPDATE:
When I enter a change in simple-catch it works. Theoretically child time should be an overriding theme, right?
January 9, 2018 at 1:10 am #129417opinoParticipantJust add this custom CSS:
.slider-image {pointer-events: none;}
.entry-container {pointer-events: none;}January 9, 2018 at 4:49 am #129427opinoParticipantI am sorry, that was wrong CSS.
The correct one is:
.featured-slider {pointer-events: none;} -
AuthorPosts
- The topic ‘How to disable link in the slider?’ is closed to new replies.