• escalatoraccidnt

    (@escalatoraccidnt)


    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://ww.wp.xz.cn/extend/plugins/list-category-posts/

Viewing 3 replies - 1 through 3 (of 3 total)
  • bowoolley

    (@bowoolley)

    Try this as custom CSS:

    .titleclass{
    pointer-events: none;
    cursor: default;
    }
    Thread Starter escalatoraccidnt

    (@escalatoraccidnt)

    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.

    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.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Remove Link From Post Title’ is closed to new replies.