WordPress.org

Support

Support » Plugins and Hacks » Single Latest Posts Lite » [Resolved] How to delete more

[Resolved] How to delete more

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jose Luis SAYAGO

    @iluminatus

    Hello denis12,

    Please download this modified version: Single Latest Posts: No Excerpt Link and replace your currently installed plugin by this one.

    Bare in mind this is a version I’ve adapted for you, when updates are released changes will be deleted, so in case, you or anyone else want to keep this modification just replace the slp_custom_excerpt function by this one (lines 766 to 818 in single-latest-posts.php:

    /**
     * Limit excerpt length
     * @count: excerpt length
     * @content: excerpt content
     * @permalink: link to the post
     * return customized @excerpt
     */
    function slp_custom_excerpt($count, $content, $permalink, $excerpt_trail){
        if($count == 0 || $count == 'null') { $count = 55; }
        /* Strip shortcodes
         * Due to an incompatibility issue between Visual Composer
         * and WordPress strip_shortcodes hook, I'm stripping
         * shortcodes using regex. (27-09-2012)
         *
         * $content = strip_tags(strip_shortcodes($content));
         *
         * replaced by
         *
         * $content = preg_replace("/\[(.*?)\]/i", '', $content);
         * $content = strip_tags($content);
         */
        $content = preg_replace("/\[(.*?)\]/i", '', $content);
        $content = strip_tags($content);
        // Get the words
        $words = explode(' ', $content, $count + 1);
        // Pop everything
        array_pop($words);
        // Add trailing dots
        // array_push($words, '...');
        // Add white spaces
        $content = implode(' ', $words);
        // Add the trail
        switch( $excerpt_trail ) {
            // Text
            case 'text':
                $content = $content;
                break;
            // Image
            case 'image':
                if( !is_rtl() ) {
                    $content = $content.'<a href="'.$permalink.'"><img src="'.plugins_url('core/img/excerpt_trail.png', __FILE__) .'" alt="'.__('more','trans-slp').'" title="'.__('more','trans-slp').'" /></a>';
                } else {
                    $content = $content.'<a href="'.$permalink.'"><img src="'.plugins_url('core/img/excerpt_trail-rtl.png', __FILE__) .'" alt="'.__('more','trans-slp').'" title="'.__('more','trans-slp').'" /></a>';
                }
                break;
            // Text by default
            default:
                $content = $content.'<a href="'.$permalink.'">'.__('more','trans-slp').'</a>';
                break;
        }
        // Return the excerpt
        return $content;
    }

    Hope this helps.

    Best regards.

    It is working! Thanks bro! You’re the best! One thing
    How do that posts will show in 2,3 categories. I put in shortcode “category=obrazovanie-v-ssha, yazyk-v-ssha” but it showns only posts from category “obrazovanie-v-ssha”

    Plugin Author Jose Luis SAYAGO

    @iluminatus

    Hi denis12,

    I’m glad it works as expected, as for your question, multiple categories and other advantages are available on the professional version of Single Latest Posts.

    However if you know how to code and want to do it yourself, you just have to adapt the plugin to your needs, to transform single to multiple categories just change the way the category parameter is treated, right now is accepting single values, however you could change that to work as an array so you can pass multiple values.

    Cheers.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] How to delete more’ is closed to new replies.
Skip to toolbar