Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2080
    rumyan
    Member

    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.

    #2148
    Sakin
    Keymaster

    @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.

    #2174
    rumyan
    Member

    I 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?

    #129417
    opino
    Participant

    Just add this custom CSS:
    .slider-image {pointer-events: none;}
    .entry-container {pointer-events: none;}

    #129427
    opino
    Participant

    I am sorry, that was wrong CSS.
    The correct one is:
    .featured-slider {pointer-events: none;}

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to disable link in the slider?’ is closed to new replies.