WordPress.org

Ready to get started?Download WordPress

Forums

Single Latest Posts Lite
[resolved] How to delete more (5 posts)

  1. denis12
    Member
    Posted 1 year ago #

    Hi! How to delete the link "more" in slposts-thumbleft?

    http://wordpress.org/extend/plugins/single-latest-posts-lite/

  2. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. denis12
    Member
    Posted 1 year ago #

    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"

  4. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. denis12
    Member
    Posted 1 year ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic