WordPress.org

Forums

Promotion Slider
remove Continue reading... (7 posts)

  1. DAZDOREY
    Member
    Posted 1 year ago #

    My site is http://www.irenemariedorey.com

    I have searched & tried to follow what was suggested but nothing has worked.
    Please help!!!

    Thanks!

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

  2. Micah Wood
    Member
    Plugin Author

    Posted 1 year ago #

    @dazdorey,

    When displaying excerpts in the slider, the Promotion Slider plugin just displays the default WordPress excerpt. Any ellipses on the end, or 'Continue reading...' links, etc are added by the theme or possibly another plugin. WordPress provides a filter so that themes and plugins can manipulate this output.

    Adding something like this to your active theme's functions.php file should do the trick:

    add_filter( 'excerpt_more', 'custom_promo_slider_excerpt_more' );
    function custom_promo_slider_excerpt_more( $more ) {
    	if( 'ps_promotion' == get_post_type() ) {
    		$more = '';
    	}
    	return $more;
    }
  3. Adam Blythe
    Member
    Posted 1 year ago #

    Hi Micah,

    I couldn't remove the 'continue reading' link using your code above in my functions.php file.

    My promotions go to internal pages on my website not to posts so the 'continue reading' text is not needed.

    I am using a child theme of twenty ten.

    Also, I would prefer to insert html for each slide using the post content box rather than the excerpt box in the admin for each slider.

    Please help.

    So far I am really impressed with this plugin! Great work!

  4. Micah Wood
    Member
    Plugin Author

    Posted 1 year ago #

    @adsleeblythe,

    The 'excerpt_more' filter is a built-in WordPress hook: http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_more

    TwentyTen uses this filter to add the 'continue reading' link. Just add this to your functions.php file to disable it:

    remove_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );

    You could use the post content instead of the excerpt in the slide, however it would take some manipulating as that isn't the way the plugin was intended to work.

  5. Adam Blythe
    Member
    Posted 1 year ago #

    Thanks Micah,

    I done some reading and got it working using:

    <?php
    function really_remove_the_2010_excerpt_filter () {
    remove_filter( 'excerpt_length', 'twentyten_excerpt_length' );
    remove_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );
    remove_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );
    }
    add_action('after_setup_theme','really_remove_the_2010_excerpt_filter');
    ?>

    I obtained this from a previous WP thread from a person with a similar problem.

    However, am I correct in saying that the code above must remove the 'Continue reading' link from all excerpts on my site?

    How would I remove this filter from ONLY promotion slider posts?

    I don't want this to affect other post types on my website.

    Thanks again!

  6. Adam Blythe
    Member
    Posted 1 year ago #

    How would I implement the code above into the code you provided at the start of this thread?

    Thanks

  7. Micah Wood
    Member
    Plugin Author

    Posted 1 year ago #

    Try this:

    <?php
    function really_remove_the_2010_excerpt_filter () {
       $post = get_post();
        if( $post && 'ps_promotion' == $post->post_type ) {
           remove_filter( 'excerpt_length', 'twentyten_excerpt_length' );
           remove_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );
           remove_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );
        }
    }
    add_action('after_setup_theme','really_remove_the_2010_excerpt_filter');
    ?>

    That will check to make sure we are on the promotion post type before removing any links.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Promotion Slider
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic