WordPress.org

Ready to get started?Download WordPress

Forums

TPG Get Posts
Latest Update showing Related posts (21 posts)

  1. ccolotti
    Member
    Posted 1 year ago #

    This was working very well, but the latest update seems to now include the 'Latest Posts" sections from Yet Another Realted POsts plugin and Microkid's related posts on the home page:

    http://www.v-fit.us

    Is there anyway to prevent these from showing? They were not previous to the latest update.

    I am using:
    [tpg_get_posts show_meta="false" show_byline="false" shorten_content="w700" numberposts=5]

    http://wordpress.org/extend/plugins/tpg-get-posts/

  2. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    These are difficult issues as there are 3 (?) plugins working on the home page display.

    Let me summarize my understanding of what is happening. The get_posts pulls the most current 5 posts. It displays them, suppressing the metadata. Then the Related Post plugin pulls in links to related posts (I am not familiar with this plugin) and a third plugin pulls in links to read more about...

    In looking at the individual post, it seems that there are imbedded shortcodes in the post which pull in the Read More About and Related Posts links.

    If these guesses are correct, then the shortcodes are being processed even though they reside beyond the shortened content.

    Please confirm that I understand the situation correctly.

  3. ccolotti
    Member
    Posted 1 year ago #

    Yes I think you have the situation perfectly. Now to just figure out how to get those two other shortcode suppressed. I swear they were a couple days ago before an update.

  4. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    I have have tagged the 2.0.1 release (typo, should be 2.0.2) in WP and you can update to the previous version to get your site back to previous behavior.

    I will look at this, but it will take a couple of days to try a debug as I need to set up a test environment.

    Do you remember if you upgraded from 1.3.8 or 2.0.2 ? I released ver 2 in early November and it is a considerable restructuring of the code base and then added a feature to the premium version with the release last week.

  5. ccolotti
    Member
    Posted 1 year ago #

    I just started using your plugin last week, so whatever was available then is what I originally installed.

  6. ccolotti
    Member
    Posted 1 year ago #

    Hmmm....looks like I have 2.0.1 installed so I must have loaded it when it was 1.3.8. Was that still up last week when I first used it? I bet I was using 1.3.8. Can you give me a link to grab that one instead?

    I do have a BETA server if you need help working through debugging it but the two plugins showing are:

    Microkids Related Posts
    Yet Another Related Posts Plugin

    I love the ability to mix posts and other items on my home page so I love your plugin.

  7. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    Here is the link to access the archives:

    http://wordpress.org/extend/plugins/tpg-get-posts/developers/

    Thanks for the offer of the test site, I will try to set something on my site, but if I get stuck I might want to contact directly. Would you send an email: webmaster tpginc.net so I have a way to email you instead of cluttering up this forum.

    Thanks for the info, it really helps focus the debugging.

  8. richokun
    Member
    Posted 1 year ago #

    Hi -
    I too love the simplicity and functionality of your plug in - thank you - I am having a similar issue - I only uploaded your program this morning and it says Version 2.01.00 - When I use the default shortcode (tpg_get_posts) on a page I get a call (2 calls) to another plug in's shortcode which is not on the page - I use Navayan Subscribe and the page gets 2 calls to that code even though it is not in the page
    http://www.maya-the-puppuppy-poet.com/the-latest-posts-3/
    I would love to clean this up.
    Thank you again for your wonderful plugin.
    Rich

  9. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    I have looked at the above mentioned plugins and in the case of the related posts plugins, they are hooking into the WP the_content filter and anytime it is called the related post is called. The plugin can be hacked to remove the filters before getting the post content, but then the code must be maintained. I am evaluating a way to allow custom functions to be called, but that feature is not available at this time.

    In the case of the Navayan Subscribe, that plugin is being invoked before the tpg_get_post plugin is called. This must be a setup issue with the plugin.

  10. richokun
    Member
    Posted 1 year ago #

    Hi and thankyou for your reply - In the case of the Navayan Subscribe - what I described is not happening on any other page and only happens after I put in the shortcode to invoke the tpg get posts - so it is a puzzle why that is called even though not active on the page. On other pages and posts I do use a shortcode to embed the subscribe in the post, but not on the latest post page I am referring to. I even deactivated the navayan plugin and it still pulled the subscribe message - so I am not sure what might do that. Any ideas would be appreciated as it would clean up the page for me.
    'Thank you for your help
    Rich

  11. msubretort
    Member
    Posted 1 year ago #

    I have a similar problem with my site, and came up with a workaround.

    My workaround will only work if you never intend to use tpg get posts and YARPP on the same page.
    On my site, I use tpg on my pages and only my pages, and yarpp only on the end of posts, so it works out just fine.

    Edit /tpg-get-posts/inc/class-tpg-gp-process.php Line 302
    Change
    $content = '<div id="tpg-get-posts" >';

    to
    $content = ' <STYLE type="text/css">.yarpp-related {display:none}</STYLE><div id="tpg-get-posts" >';

    That's it. Now when you call tpg get posts, it will inject the css to hide any yarpp addons.

  12. ccolotti
    Member
    Posted 1 year ago #

    Cool!! Can you figure out a way to do this all in CSS without editing the files as I am sure your changes will be lost on an update.

  13. msubretort
    Member
    Posted 1 year ago #

    I tried putting it in the .css file, but the css file gets called on every page, so it was hiding the yarpp addons on posts where tpg wasn't called.
    Maybe the author of the plugin can figure out a more elegant solution.

  14. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    I have been working on the plugin and may have uncovered the issue with the yarpp post. I hope to finish my testing and have some beta code available for testing. Is anyone available to apply the code change and test on their site?

    I am looking at when the content filter is applied. By moving this to immediately after the content section, the problem is not occurring on my test site. However, I really need a more robust test environment for this issue, so would appreciate an willing test case.

    You can post back here to let every one know that status, but send me an email directly.

    Timing: Hope to have the code ready to test by end of today.

  15. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    I released 2.2 today and on my test system the problem with related posts does not appear. I am marking this closed unless someone reports a problem after they upgrade.

  16. ccolotti
    Member
    Posted 1 year ago #

    I am still seeing the YARRP entries showing when TPG is in use. Also The posts also have quickadsense entries in them which is now showing as well :/

    http://www.v-fit.us

    It works really well, I would just think it shoudl drop the other content that plugins put in below the post like YARRP and QuickAdsense.

    I can setup another test server for you if you want a place to mess with it. :)

  17. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    It seems that the solution provided by msubretort which uses css to hide the YARRP is the quickest way forward at this point. This technique could also be applied to QuickAdsense and any other post plugin.

    Use custom css (see doc for placement location) and then provide the specific tag to hide, starting with the tpg division. Use a browser debugger to find the exact sequence of tags to hide so only those YARRP classes in the tpg-get-post div are hidden.

    By putting the css in the custom css file in your template, the changes will not be lost with upgrades to the plugin. And if you are using a child template, upgrades to the template will not affect the custom css which is in the child theme folder.

    What the plugin should do is accurately display the post on a static page. Then allow you to customize display options.

    The other option is with the premium version you can call a custom function and turn off/on the hooks for the post. While the plugin supports that capability, it is up to the developer to write the code. I am unable to support custome php solutions, but here is what my testing code looked like (with echo's for testing included)

    function tpg_gp_pst_post_filter($content,$cfp=null) {
    	/*
    	 * the following code is a sample to add the MPR & Yet Another Related post plugins
    	 * uncomment to activate sample
    	*/
    	echo "in pst_post filter<br>";
        add_filter('the_content','MRP_auto_related_posts');
        global $yarpp;
        add_filter('the_content', array($yarpp,'the_content'), 1200);
    	return $content;
    }
    
    /**
     *	tpg_gp_pre_plugin_filter
     *
     * allow custom function to be invoke before content
     *
     * @param	string	content
     * @param	string	custom function parm
     * @return	string  content
     *
     */
    function tpg_gp_pre_plugin_filter($content,$cfp=null) {
    	/*
    	 * the following code is a sampe to turn off MPR & Yet Another Related post plugins
    	 * uncomment to activate sample
    	*/
    	echo "in pre_plugin filter<br>";
        remove_filter('the_content','MRP_auto_related_posts');
        global $yarpp;
        remove_filter('the_content', array($yarpp,'the_content'), 1200);
    	return $content;
    }
  18. ccolotti
    Member
    Posted 1 year ago #

    I will try the CSS change for now. I assume on an update of the plugin that will get lost?

  19. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    From my comment above:

    By putting the css in the custom css file in your template,
    the changes will not be lost with upgrades to the plugin.
    And if you are using a child template, upgrades to the
    template will not affect the custom css which is in
    the child theme folder.

    If you follow the guidelines in the doc for custom styling, the only time you need to be concerned with loosing the css changes is when you upgrade the theme. Or if you use a child theme, only when you upgrade the child theme. An additional reason for using child themes.

    If you change the plugin css directly, then the changes will be lost, so don't do that. Set up a custom css file.

  20. ccolotti
    Member
    Posted 1 year ago #

    According to the post above it could not be done in the theme CSS as it removed it from all pages:

    "I tried putting it in the .css file, but the css file gets called on every page, so it was hiding the yarpp addons on posts where tpg wasn't called.
    Maybe the author of the plugin can figure out a more elegant solution."

    So I used this change from above which worked but it's not really CSS based:

    Edit /tpg-get-posts/inc/class-tpg-gp-process.php Line 302
    Change
    $content = '<div id="tpg-get-posts" >';

    to
    $content = ' <STYLE type="text/css">.yarpp-related {display:none}</STYLE><div id="tpg-get-posts" >';

  21. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    It depends on how specific you write the css. if you write the css for the class within the tpg-get-posts div only, then it only suppresses the display for the posts being rendered by the plugin.

    You will have to do some work to determine the specificity of the needed css.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.