Forums

List category posts
Some code to add to the plugin (2 posts)

  1. thewpguy
    Member
    Posted 1 year ago #

    Hi Fernando,

    Love this plugin and am really enjoying the template system.

    I am wanting to create excerpts that have a read more link below the excerpt.
    I achieved it but had to modify one of the actual plugin files which is not permanent unless added you can add the code.

    Wondering if you would consider adding the following code to the file below:
    Includes/CatListDisplayer.php

    Code added at line: 168

    private function get_post_link($single, $tag = null, $css_class = null){
            $info = '<a href="' . get_permalink($single->ID).'" >' . 'read more' . '</a>';
            return $this->assign_style($info, $tag, $css_class);
        }

    If anyone else wants to add a read more link below the excerpt this is what I also did.

    - created a copy of the default.php file and saved it in a folder called list-category-posts in the current theme directory
    - changed line 89 , changed the 'div' to 'p' to separate the excerpt from the post title.
    - added the code below at line: 91

    //adds a read more link below the excerpt
    $lcp_display_output .= $this->get_post_link($single);

    http://wordpress.org/extend/plugins/list-category-posts/

  2. geologist
    Member
    Posted 8 months ago #

    Thanks for the code Thewpguy. I'm using it with my excerpt. There's just one refinement I'm hoping to get help with. Using the code as you've shown it, the "read more" displays below the actual excerpt. I would like to get it to display on the last line of the excerpt instead of below it. Does anyone have any suggestions?

    Here is my page with excerpts:http://www.palmyracob.org/honest/about-us/meet-our-staff/


    http://wordpress.org/extend/plugins/list-category-posts/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic