• Please help!

    On the site wich I develop, on the page (and some other)
    https://www.legeartis.rs/category/pravno-ekonomske-oblasti/kompanijsko-pravo/
    problem can be seen.

    I modified post excerpt that instead standard “[…]” at the end, now there is “…vi?e >>” (more) with link to the full post page.

    But, as a add that – post list was broke up, as you saw on first link.

    I put this code

    function new_excerpt_more($more) {
           global $post;
    	return '<a href="'. get_permalink($post->ID) . '"> ...више ? </a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');

    in file functions.php

    NOTE: If I put instead

    '. get_permalink($post->ID) . '

    some simple web adress, there is no problem. For example:
    href=”https://www.legeartis.rs&#8221;
    Every post get nice link to that web page “…vi?e >>” and everything cool.

    Well, it’s look that creating a links make problem. Also, some posts now dont have that link at all ( but evrey post have […] at the end, without this change). On post where making link was unsuccessful next post look like “child” of that bad one before.

    Can someone tell me how to solve this problem.

    Sorry for my english.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    There is code elsewhere, perhaps a plugin or custom child theme, that is corrupting what get_permalink() returns in some cases, probably by returning invalid data in a hooked filter. You can narrow down where the corrupt code is by deactivating each plugin in turn until you get proper permalinks. If all plugins deactivated still does not solve the problem, the problem is your theme or child theme. Switch to a default theme like twentyfourteen to confirm this.

    Once you’ve identified the guilty package, finding the problem code can be difficult. It’s easiest to do without the package if possible. Reporting the problem to the package author could lead to a fix.

    Try this to see if it works:

    function new_excerpt_more($more) {
           global $post;
           return ' <a class="readmore" href="'. esc_url( get_permalink() ) . '">' . __( '...више ?', 'legeartis' ) . '</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    Thread Starter rethinkable

    (@rethinkable)

    Thank you very much.

    @bcworkz. I try everything that you suggest but problem still exist. Definitely I must write to template maker.

    @harrison O. Thanks for code, it works but in a same maner as my first solution. Problem is still there.

    If I find solution, I will write it here.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem with "excerpt_more" link’ is closed to new replies.