• There was already another post on the subject, I tried to post via this one but not feedback. So posting now as a new thread.
    The more tag not displayed where you want but only after 80 words is quite annoying.

    I tried the solution proposed by Dakota127, but I was unable to have it working.

    Any chance to have this solved soon in an update? I would like to keep the this theme because I really like it but without the standard behaviour of the more tag, I am not too sure.

    Thank you
    Alain

Viewing 5 replies - 1 through 5 (of 5 total)
  • @asiantpo, Maybe Falguni (Thanks to her for this wonderful theme!!) or some one who is more experienced would have a better way. Nevertheless, after few hours of trial and error, I could get this done by pasting the following code into the functions.php of my child theme. (ofcourse, you could replace ‘nisargipchild’ with your own nicky whereever it appears). The code is basically picked from the functions.php of the parent theme. Change the number 10 to whatever number of words you want to display as excerpt.

    remove_filter( 'excerpt_length', 'custom_excerpt_length' );
    function nisargipchild_excerpt_length( $length ) {
    	return 10;
    }
    add_filter( 'excerpt_length', 'nisargipchild_excerpt_length' );
    
    function nisargipchild_new_excerpt_more( $more ) {
        return '...<p class="read-more"><a href="'. esc_url(get_permalink( get_the_ID() )) . '">' . __(' Read More', 'nisarg') . '<span class="screen-reader-text"> '. __(' Read More', 'nisarg').'</span></a></p>';
    }
    add_filter( 'excerpt_more', 'nisargipchild_new_excerpt_more' );
    Thread Starter asaintpo

    (@asaintpo)

    Hi @infinitepoet, Thanks for your reply.
    I tried your suggestion but the only thing I was able to have is the change in the number of words before the excerpt is displayed. I did not succeed to have the ‘more’ tag displayed where I want.
    Well, I will continue to investigate …

    @asaintpo
    Somehow the same code is not working for me now!! (not even the word limit feature!)

    Im at my wit’s end now.

    @asaiintpo

    I finally figured it. Ignore my older code. Just use the below code:

    function child_custom_excerpt_length( $length ) {
    	return 10;
    }
    add_filter( 'excerpt_length', 'child_custom_excerpt_length', 1020 );

    if you look at the parent theme functions.php, 999 is the priority assigned to this particular function. The replacing function in child theme has to be assigned a higher priority so that the child theme function overrides parent theme function. The below link helped me


    http://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623

    Thread Starter asaintpo

    (@asaintpo)

    @infinitepoet

    Thank you for your reply. I tried but I did not succeed to have what I wanted. Finally after more search I found the settings that suit me.
    In the personalisation menu ‘Appearance’ you can set post option to ‘Post Excerpt’ or ‘Full Post’. If I am selecting ‘Full Post’, then I am retrieving the control of the ‘Read More’ function, plus some other features such as the hypertext links, image thumbnail when needed, … all things that are not possible if the excerpt mode is selected.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘More tag not working’ is closed to new replies.