WordPress.org

Forums

List category posts
Remove Link From Post Title (4 posts)

  1. escalatoraccidnt
    Member
    Posted 2 years ago #

    Hey,

    Just wondering if anyone knows how to remove the link from the post title?

    The default template looks something like this:

    //Show the title and link to the post:
        $lcp_display_output .= $this->get_post_title($single, 'p');

    It pulls as link as well, anyone have an idea on how to show the title, but no link.

    Thanks

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

  2. bowoolley
    Member
    Posted 2 years ago #

    Try this as custom CSS:

    .titleclass{
    pointer-events: none;
    cursor: default;
    }
  3. escalatoraccidnt
    Member
    Posted 2 years ago #

    Hey thanks bowoolley,

    That works, but it still looks like a link and still has a link in the code. I think that's a pretty big spam flag to have links you can't click on.

    With all the functionality here, I'm sure there is a way to just have the title show as text vs a link. I just can't figure it out.

  4. andre2009
    Member
    Posted 2 years ago #

    Hey guys.
    At
    /wp-content/plugins/list-category-posts/include/CatListDisplayer.php
    line 247

    you can change

    private function get_post_title($single, $tag = null, $css_class = null){
        $info = '<a href="' . get_permalink($single->ID) .
          '" title="'. $single->post_title . '">' .
          apply_filters('the_title', $single->post_title, $single->ID) . '</a>';
        return $this->assign_style($info, $tag, $css_class);
      }

    to

    private function get_post_title($single, $tag = null, $css_class = null){
        $info = apply_filters('the_title', $single->post_title, $single->ID);
        return $this->assign_style($info, $tag, $css_class);
      }

    of course this is a code change and will dissapear if you update the plugin to a newer version.

    As I'm new here I appologise the developer if it is not right to hard change the code, just trying to help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • List category posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags