WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Excerpt
Select Specific Post Types (2 posts)

  1. computersimple
    Member
    Posted 1 year ago #

    Hi - Just wondering if there is a way or if I can look forward to a way to select specific post types. for example default post types would use the advanced excerpt setting but a custom post type could be excluded from the advanced excerpt settings...

    Thanks, Lavada

    http://wordpress.org/extend/plugins/advanced-excerpt/

  2. gbotica
    Member
    Posted 7 months ago #

    I also needed this functionality. So far, the only way I've managed it is to modify the plugin source code (not ideal, I know)

    Look for the following, in advanced-excerpt.php

    // Create the excerpt
              $text = $this->text_excerpt($text, $length, $use_words, $finish_word, $finish_sentence);
    
    // Add the ellipsis or link
              $text = $this->text_add_more($text, $ellipsis, ($add_link) ? $read_more : false);

    and replace with:

    if (get_post_type() =="post") {
    
     // Create the excerpt
              $text = $this->text_excerpt($text, $length, $use_words, $finish_word, $finish_sentence);
    
    // Add the ellipsis or link
              $text = $this->text_add_more($text, $ellipsis, ($add_link) ? $read_more : false);
    
            }

    Anyone out there know a way do do this in functions.php?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic