WordPress.org

Ready to get started?Download WordPress

Forums

Display Posts Shortcode
[resolved] [...] Appears like plain text [no link] (5 posts)

  1. ElginC
    Member
    Posted 1 year ago #

    Hello. First of all Thank you for your plugin I have been searching for something like this in like a month. This plugin actualy works perfectly but at the end of the excerpt there appears the [...] which should be a link. I tried to add the php code you provided to my functions.php but then I got server error (the site wont load at all with that code inserted). I would realy appreciate the help. Thank you.

  2. ElginC
    Member
    Posted 1 year ago #

    Please someone help me, this is the last feture for my website to start... Thanx.

  3. ElginC
    Member
    Posted 1 year ago #

    I found a solution of my problem. For everyone having this problem, here is what I did:
    I added the following code inside the display-posts-shortcode.php

    function be_excerpt_link( $more ) {
    	return '<a href="' . get_permalink() . '">' . $more . '</a>';
    }
    add_filter( 'excerpt_more', 'be_excerpt_link', 20 );

    Here it is where I added this code:

    // Create the shortcode
    add_shortcode( 'display-posts', 'be_display_posts_shortcode' );
    function be_display_posts_shortcode( $atts ) {
    
    function be_excerpt_link( $more ) {
    	return '<a href="' . get_permalink() . '">' . $more . '</a>';
    }
    add_filter( 'excerpt_more', 'be_excerpt_link', 20 );
  4. Bill Erickson
    Member
    Plugin Author

    Posted 1 year ago #

    You can place that code in your theme's functions.php file. Do not place it in the plugin files as it will be overwritten when you update the plugin

  5. ElginC
    Member
    Posted 1 year ago #

    Hello, I tried to do that but that messes up the website (the website wont load at all when I add the code to theme-functions.php) Maybe adding the code manualy after the plugin update would do it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic