WordPress.org

Ready to get started?Download WordPress

Forums

Promotion Slider
Remove Link From Excerpts (6 posts)

  1. stormwebent
    Member
    Posted 3 years ago #

    Hi,
    Is there anyway to remove the link from excerpts? I keep getting a link even though disable all links is selected. Is there something I can add to the shortcode to disable this?

    Thanks

    http://wordpress.org/extend/plugins/promotion-slider/

  2. Micah Wood
    Member
    Plugin Author

    Posted 3 years ago #

    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');
    }
  3. ZinZangStudio
    Member
    Posted 3 years ago #

    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.

  4. pilot911
    Member
    Posted 2 years ago #

    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?

  5. Micah Wood
    Member
    Plugin Author

    Posted 2 years ago #

    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' );
        }
    }
  6. pilot911
    Member
    Posted 2 years ago #

    Thank you for your assistance:

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

    Regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic