Adjustment of RPP placement

This topic contains 6 replies, has 2 voices, and was last updated by

 
Participant
1 year, 11 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #17569

    Participant

    Hi Ernest,

    Following up on the comment stream on codecanyon…

    I am trying to move the RPP instance 0 below a block that appears after content on posts & pages. I had originally wanted to have it appear after the author box too, but have now removed that as a halfway fix. It would be good to turn that back on and still have RPP appear below it. However, I’ll describe the case based on only the block I’d added to the end of every post and page, which is a more important issue…

    I have added the block using adinserter (the block reads “South East Asia Backpacker’s Chosen Resources!”, then some text, then 3 clickable images). The adinsertion is set to “after content”) which I guess must be the same logic that RPP uses. I tried adding the instance shortcode to the same adinserter block as the resources, at the end, but it was sometimes causing RPP to appear twice, and sometimes causing internal error 500 messages, so I took it out. I also tried inserting it with adinserter in a seperate block “before comments”. Again, this worked sometimes, sometimes didn’t appear and sometimes caused internal error 500s.

    I tried changing the code in the hooks .php file, line 253, but when I did that, the shortcode appeared under content and the related posts didn’t display at all.

    I imagine there are many ways to get around this issue. I wanted to find a way to simply run adinserter before RPP, but wasn’t able to figure that out. Otherwise, a sturdy way to inject the instance shortcode after the adinserter block. But I have no clear idea of how to do that.

    I was very surprised that inserting the RPP shortcode with adinserter was causing problems. The resources block is also made up of several sets of shortcode produced by the theme…

    It would be great if you could go in and find a good solution to the issue.

    Thanks in advance for your help!

    #17603

    Hi!

    I have looked at some of the pages on the link, but the plugin appears after the ads section on my end, like so: https://i.imgur.com/GPsZ3Ds.jpg

    Have you managed to solve this, or is this not the correct layout?

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17620

    Participant

    Hi Ernest,

    The block I’m referring to is the one in the attached screenshot (The text with a photo and then three large images).

    On posts it’s appearing after RPP, on pages it’s appearing before.

    (Post example) https://southeastasiabackpacker.com/ghost-town-hanoi/
    (Page example) https://southeastasiabackpacker.com/destinations/singapore/

    All the best,

    Dave

    (P.s. If you can find a way to switch them round, please, could you give us instructions on how to make the change, in case we want to move things around again later?)

    Attachments:
    You must be logged in to view attached files.
    #17664

    Hi Dave,

    I figured it out. Turns out the code suggestion was the key, but for some reason the shortcode was not executed when that was changed. So I have added an additional line to execute the shortcode forcefully either way.

    Changing those numbers suggested will move the plugin. Currently I set it to 999999999999, and now it shows in the same position for both posts and pages.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17665

    Participant

    Hi Ernest,

    Unfortunately, the change caused woocommerce products not to load (either gave an http 500 error, or just left a blank white page). I have been back into the hooks file and changed things back, (it was an emergency). It must be because we have a second instance running on product pages.

    I changed line 253 to
    add_filter(‘the_content’, ‘wpdreams_rpp_add_below_content’, 10, 1);

    and line 63 to
    add_action(‘wp_footer’, ‘wpdreams_rpp_hooks’, 10, 0);

    I’m not sure if I changed line 311 (where I found a similar setup), it currently reads

    add_filter(‘the_content’, ‘wpdreams_rpp_add_above_content’, 10, 1);

    Do you think it would be safe to try changing the numbers again, in spite of using two instances in different places? Does the code look OK at the moment the way I’ve left it? Everything seems to be running OK again…

    An example of a product page, where the second instance is running is this one

    https://southeastasiabackpacker.com/bookings/tefl-course-thailand-koh-samui/

    #17666

    Hi,

    That does not make too much sense to me whatsoever. The filter priority values should support very high numbers, I guess it is too high (?). Changing it should not cause any issues, as it is it’s purpose – to set the priority/order of the filter execution.

    Can you try something lower, like 999999 or 99999, those should definitely work without any problems.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17667

    Participant

    Hi Ernest,

    OK, so it looks like changing line 63 is no problem. I have changed it to
    add_action(‘wp_footer’, ‘wpdreams_rpp_hooks’, 99999, 0);
    without any negative effects.

    For some reason I can’t change line 253 without the product pages breaking, even when I just change it to 11.

    Would I need to change line 311 as well?

    Thanks for your help on this!

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

The topic ‘Adjustment of RPP placement’ is closed to new replies.