WordPress.org

Forums

Advanced Post List
[resolved] Items appear twice on the page (9 posts)

  1. scifo
    Member
    Posted 3 years ago #

    Hi

    I'm having an issue after upgrading to the latest version today.

    When using shortcodes on my page, the items appear as they should, however they're also added in the bottom of the page again, but without the applied formatting (On the page itself, not the footer)

    Any idea why this is happening, and what to do about it?

    Thanks in advance!

    /Scifo

    http://wordpress.org/extend/plugins/advanced-post-list/

  2. EkoJr
    Member
    Plugin Author

    Posted 3 years ago #

    Hmm, this is a very odd issue, considering that the post/page attribute shortcodes are only applied when it goes through the call-stack APLCore::APL_display to (private)APLCore::APL_run to APLInternalShortcodeReplace function. So any other post attribute shortcodes shouldn't be applied before or after the post_list shortcode.

    However, if you have a post_list that also displays other posts/pages with post_list shortcode(s), then the (child) post will remain unformatted by the plugin. That is one common issue I see happen to me, and I haven't yet gotten around to adding support for post list shortcodes within post list shortcodes. So, that's one issue you may want to check on.

    If that isn't the issue, I got a few questions that currently come to mind.

    • Did you have this problem at all in version 0.3.b3? (although you did hint that you did not)
    • Have you tried checking if a different plugin is conflicting with the APL plugin? (deactivate them until you find the plugin causing the issue)
    • Can you link the URL that is having this issue? (I may be able to inspect it and get a couple of clues as to what the issue is)
  3. scifo
    Member
    Posted 3 years ago #

    Hi EkoJr

    Thank you for a quick response.

    As I am only using the short codes for the plugin on the frontage, the first issue you mention should not apply.

    - I did not have this issue before I upgraded.
    - no, but I will try that this evening and see if it helps.
    - the site is located at http://www.slagelsetennis.dk (problem is on the first page)

  4. EkoJr
    Member
    Plugin Author

    Posted 3 years ago #

    I don't think its related to my plugin, but I do think it is related to a theme that you have active.

    The two entries at the bottom both have the same CSS classes from
    http://www.slagelsetennis.dk/wp-content/themes/propulsion/propulsion/css/layout.css
    AND
    http://www.slagelsetennis.dk/wp-content/themes/propulsion/propulsion/css/base.css

    Which leads me to believe that it is a theme issue.

    Instead of deactivating the other plugins, try deactivating Advanced Post List, but make sure you have the APL admin option settings set to NOT delete the database upon deactivation. Then check the issue to see if it continues, and when you re-activate the APL plugin, your settings should all still be there with 0.3.b4 (others beta versions are bugged).

  5. scifo
    Member
    Posted 3 years ago #

    I've tried deactivating the APL plugin, and then the problem disappears.

    Screenshot of how it looks with the plugin deactivated:
    http://screencast.com/t/TJGQ2yrL

  6. EkoJr
    Member
    Plugin Author

    Posted 3 years ago #

    Very odd. I still think something is conflicting with theme. I was looking around to see if I can get the theme so I can duplicate the issue, but it looks like you bought yourself a premium theme. Which makes it pretty hard to figure out on my end. Plus I don't even know if you can give someone a theme like that to debug on a localhost.

    I went through the plugin's revisions to see what changes I made, and the only related things I see is changes in 'exclude current', page and term dynamics, and adding wp_reset_postdata() and wp_reset_query() functions to APLQuery class.

    Are you using any 'include terms' in your taxonomies, and/or using 'Current Page' from your page hierarchy. Then are you using the exclude current function at all?

    Lastly, leaves the reset function in the APLQuery.php file. Which I thought would improve the sorting, but could be what's causing the problem. Plus, after WP's update, some fixes to WP_Query class cleaned up the issues that I was having during development, which is why I ended up added the reset functions to the current version.

    If the first two aren't the issue, then I would try replacing APLQuery.php by extracting this new file in /wp-content/plugins/advanced-post-list/includes/class/APLQuery.php

    the new file is linked on this page under APLQuery File Replace:
    APL Version 0.3.b4 Page

  7. scifo
    Member
    Posted 3 years ago #

    Sorry for the late reply.

    I had the time to take a look at it this evening, and since i do not use "include terms" or "current page" i went ahead and switched the current APLQuery file out with the new one you supplied and now the issue is solved. So it looks like the reset function is not compatible with the theme?

    Is that something you can look into in time (Perhaps with some testing/input from me), or should I refraign from upgrading the plugin in the future?

    Anyway, thank you so much for taking the time and effort to supporting :)

  8. EkoJr
    Member
    Plugin Author

    Posted 3 years ago #

    It's no problem, thanks for the reply back. I was beginning to worry, but I'm just glad we were able to find a fix for this, and have an available fix for others. I've been doing some work on the plugin, and I was waiting on to see what your results would be so I can make some more adjustments as well as further investigation into it. I have a couple of ideas why this is error is happening.

    So for the most part, I would recommending continuing staying up-to-date with the plugin. There's many more features and settings along the way, and I'm also planing on staying up-to-date with WordPress, and I probably won't be supporting older version in the process. If I do, it would probably be because of multiple requests. The best thing that helps is when others report issues. Kind of a blessing and a curse.

    Getting back to the point though. I think this could be happening in 0.3.b4 because themes typically use the WP_Query class as well as global $post, and in the process. Even though I've been trying to keep the data seperate, I may unintentionally integrated it with global $post when using wp_reset_postdata(). After some looking into, I may want to add wp_reset_query() back since it is made for using multiple queries. I was just trying to hit 2 birds with one stone in this case.

    I don't have any solid information as to why this is happening, but I will keep you posted.

  9. EkoJr
    Member
    Plugin Author

    Posted 3 years ago #

    While debugging, I wasn't able to reproduce the results, but after researching I've found that it really isn't necessary to use the WP reset functions in the manner the plugin uses it. Plus, there have been issues reported when wp_reset_query() is placed on a home page or front end page. The function itself is made to reset any modifications made to global $wp_query (custom variables are separate from globals), and for some reason the query variables were being integrated with the main query. So I'm stripping that out. As for wp_reset_postdata(), I plan on just taking that out as well. The 2 functions do effect the globals, the plugin doesn't use anyways.

    It was something I added during development, and just left in. I probably should of just left it out before the release. When I start modifying the shortcode section though, I'll more than likely add wp_reset_postdata() back into some code, but I'm pretty sure it was wp_reset_query() that was causing the issue.

    If you would like to test theory beforehand and check for the issue, then I have a link under Other Files on a development page. It would help me out as well knowing what might happen for future development. Anyways, thanks in advance.

    APL 0.3.b5 Development Page (subject to change after release)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Post List
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.