Support » Plugin: Promotion Slider » [Plugin: Promotion Slider] Remove Link From Excerpts

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Micah Wood

    (@woodent)

    It is common for themes and/or plugins to include default links at the end of the excerpt. These links are set using the excerpt_more filter and can be removed using that same filter.

    You can remove these links across the board by adding something like this to your active theme’s functions.php file:

    remove_all_filters('excerpt_more');

    The problem with this is that it will remove these links in other places in your theme as well and may impact your SEO. I would recommend something more granular, such as removing them just for our slider:

    if( get_post_type() == 'ps_promotion' ){
        remove_all_filters('excerpt_more');
    }

    I had the same issue with the excerpts still showing after being disabled. The CSS-only solution I used is adding “display:none” to the “.promo_slider_excerpt a” selector in slide.css.

    A benefit of using CSS is that particular pages may be targeted for hiding or showing the excerpt links in the slider.

    Hi,

    If i want to remove the link continue reading just from the slider, can i add the code

    if( get_post_type() == ‘ps_promotion’ ){
    remove_all_filters(‘excerpt_more’);
    }

    to anywhere in functions.php for twentyeleven?

    Plugin Author Micah Wood

    (@woodent)

    You will need to at least do it within a hook. Init should work:

    add_action( 'init', 'remove_excerpt_from_slider' );
    function remove_excerpt_from_slider() {
        if( 'ps_promotion' == get_post_type() ) {
            remove_all_filters( 'excerpt_more' );
        }
    }

    Thank you for your assistance:

    And then i place this at the bottom of the functions.php

    Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Promotion Slider] Remove Link From Excerpts’ is closed to new replies.