Home / Forums / DynamiX Support / Wrong version of the-excerpt-reloaded.php in 2.8.7 causes the excerpt to fail?

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts

  • Patrik E
    Participant

    I had a problem with excerpts that did not show as I expected. I wanted to have some formating from my post to pass through on my archive pages.

    After some digging around I found that in the template files i.e. archive.php calls like the_excerpt_reloaded($DYN_arhexcerpt, '<a><br /><p>', 'content', false); was made. Looking inte the-excerpt-reloaded.php the calls did not match the signature of the the_excerpt_reloaded function.

    Further investigation showed that in Dynamix 2.8.7 a completely different plugin was used compared to 2.8.6. In 2.8.6 and earlier the "Plugin Name: the_excerpt Reloaded" by Kaf Oseo was used and in 2.8.7 the "The Excerpt re-reloaded" by Luca Biagini was introduced.

    This causes the parameters in the calls to the_excerpt_reloaded to missmatch (I suspect). 

    Please advice me, should I replace the new file with the old or am totally lost and misstaken? How can I otherwise get some formating to show in the post on the archive page?

    Best regards,

    Patrik

    PS. I'm a total beginner to wordpress and php so be gentle with me if I'm in the wrong here;)

    Andy
    Andy
    Keymaster

    Hi Patrik,

    I had to change the plugin because it was not functioning correctly with some elements. So it calls the same function but the function is different. What isn't showing properly? 


    Patrik E
    Participant

    Ok, but then don't you need to change all invokations of the function call as they dont have the same signature?

    Below is a simple illustration to show you.

    A line from the themes archive.php

        the_excerpt_reloaded($DYN_arhexcerpt, '<a><br /><p>', 'content', false);

    This is called to render the excerpt on the archive page.

    The original (2.8.6) inteded parameter use from your side would have been (I asume)

    the_excerpt_reloaded($excerpt_length=120, $allowedtags='<a>', $filter_type='none', $use_more_link=true, $more_link_text="(more…)", $force_more=true, $fakeit=1, $fix_tags=true, $no_more=false, $more_tag='div', $more_link_title='Continue reading this entry', $showdots=true) 

    With the new (2.8.7) version of the the_excerpt_reloaded function the parameters expected in the function is

    the_excerpt_reloaded($words = 40, $link_text = 'Continue reading this entry &#187;', $allowed_tags = '', $container = 'p', $smileys = 'no' )

    As you can see the call totaly missmatch and the allowed tags become the links text and so on. The reason i detected this was no html tags was used when rendering the posts. According to the code in archive.php you wanted to allow for <a><br /><p>.

    Was this helpful? I rolled back to the original the_excerpt_reloaded and not it works for my but I guess there will be some other problems some place else?

    BTW: Fantstic theme, everybody loves our site using it. Check it out at http://www.topofminds.se

    Best regards,

    Patrik

    Andy
    Andy
    Keymaster

    Hi Patrik,

    The site looks great, congrats and glad your users like it too! With regards to this, I wish I documented why it wouldn't work but I seem to remember it was todo with galleries. 

    I think the way it works at the moment is best unless which strips out any html but I'll need to change the call. Would that be a suitable solution for you or are you in need of HTML tags?


    Patrik E
    Participant

    Andy,

    thanks for the quick feedback. I do need the html tags so I have backed to the old excerpt file. Don't know what errors that will cause but everything looks good now and I'm happy. Just wanted to give you feedback so you can fix it in future versions and also if someone else encouters problems with the excerpt content. 

    As the code is obviously wrong I sugest you fix all calls to the the_excerpt_reloaded function in the next version of the theme. Its only called a few times in maybe ten files. 🙂

    Keep up the good work,

    Patrik

    Andy
    Andy
    Keymaster

    Hi Patrik,

    I haven't got the time to squeeze this into 2.8.8 but I will look into it again – I just remember there being a good reason to change it. 

    Thanks for letting me know. 

    Best regards

    Andy


    Tommaso
    Participant

    Hi, I've lost one day of my life trying to understand why the excerpt is not working properly (it doesn't render the html tag)

    reading this post I understand where is the problem, but I don't unterstand how I can solve it.

    Please, can you help me?

    thanks


    Patrik E
    Participant

    Hi Tommaso,

    the quick and dirty way of solving the problem is to take the the-excerpt-reloaded.php file from theme version 2.8.6 or earlier and copy it into place in your current version which I asume is version 2.8.7 or higher. 

    I have done this and have not seen any errors after that. Andy cant really explain the reason why he changed it so its not to important I hope;)

    Good luck now,

    Patrik

    PS. Please report back if it worked so everyone else can save a day of their life… 🙂

    Andy
    Andy
    Keymaster

    By default excerpt should strip HTML out – however since a few requests have been made to re-implement it I will just with a better excerpt script that doesn't break HTML. 


    Tommaso
    Participant

    Hi Patrick,

    thank you very much for your kind help. It's working perfect now!

    After replacement, just need little changes in archive.php and blog.php to add some permitted HTML tags.

    Hope this helps everyone with the same problem 🙂

    Thank you again, have a nice day

    Andy,

    I know what you're saying, but I was sure that the previous version of Dynamix worked in a different way .. so this is the reason why I was going down! 

    However, no problem with this, Dynamix is still my favorite wordpress theme 🙂

    Best regards,

    Tommaso

    Andy
    Andy
    Keymaster

    Hi Tommaso,

    In DynamiX 2.8.9 I've re-introduced the feature and finally remembered why I took it out. It was because of shortcodes being displayed in posts excerpt. Some of you want this and some of you didn't (I was only hearing from users who didn't want this until I took it out).  

    In 2.8.9 I've found a complete new script which is much better and have introduced the admin option in General Settings to enable or disable shortcodes within the excerpt.


    Tommaso
    Participant

    Hi Andy,

    I'm happy to hear this news, thank you very much!

    Andy
    Andy
    Keymaster

    No problem 😉

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.