Original Blog Post content get stripped of HTMl and Shortcodes

Home Forums Product Support Forums Related Posts Pro for WordPress Support Original Blog Post content get stripped of HTMl and Shortcodes

This topic contains 19 replies, has 2 voices, and was last updated by Shivaji Mitra Shivaji Mitra 9 years, 7 months ago.

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #2337
    Shivaji Mitra
    Shivaji Mitra
    Participant

    Yesterday I purchased this plugin but despite my lot of effort, I am unable to figure out few issues.

    1. I am using “Slick layout” within the Post. The related Post throws lot of errors. It seems under “Formatting options”, There is an order of operations for these options which is creating this problem. If I enable all three, my original Blog Post is stripped of all HTML and Shortcodes within it and the entire blog look like a one single big paragraph ?? If I switch OFF three option, the related Posts throws lot of errors….

    2. How to show only Related Post which consist of Images? There re are few post which doesnt have any Featured images and which I didnt want to show.

    Please help.

    #2338
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    1. You should try to disable the “Run the content filter” and “Run the title filter” options on the same panel: https://i.imgur.com/pKLsAct.png
    Could you please also send me a log of the errors throwed by the plugin?

    2. Currently there is no option for that, but with a simple modification it’s possible. Open up the plugins/related-posts-pro/includes/related_content.class.php file and go to line 843, this should be an empty line, and put this code there:

    if ( $this->posts[$key]->image == null || $this->posts[$key]->image == '') {
      unset($this->posts[$key]);
      continue;  
    }
    

    Save the settings once again to refresh the cache, and you shouldn’t see posts without images in the result list anymore.

    Best,
    Ernest Marcinko

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


    #2342
    Shivaji Mitra
    Shivaji Mitra
    Participant

    Hello:

    Thank you very much for a very quick reply. Based on your suggestion, I again install the plugin and activated the configuration which was there before. As the problem didnt solved after applying point 1 answer of yours, I again Deactivated the Plugin. As its a LIVE site and lot of visitirs come during this time, so I can not keep the post with error.

    1. Based on the screenshot, i disable both this options “Run the content filter” and “Run the title filter”. It doesn’t solve the problem. Doing this the Blog Content Formatting seems okay (no stripping of html) BUT the Related Posts area consist of error and as a result entire blog post look broken. I was experimenting with this Blog Post http://www.anblik.com/top-30-list-of-online-shopping-cart-builder-store-builder-reviews/ You can try once asI given you all the login details to check.

    2. Thanks for the suggestions. I have added the code just above the comment // ——- Content query ——–, uploaded the php page and saved the option in admin and open the blog post http://www.anblik.com/top-30-list-of-online-shopping-cart-builder-store-builder-reviews/ and as a result it shows error:

    Fatal error: Cannot break/continue 1 level in /home1/anblik/public_html/anblik.com/wp-content/plugins/related-posts-pro/includes/related_content.class.php on line 421

    Looking forward to your reply specially for Point 1.

    Thanks,’
    Shivaji

    #2343
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    1. As I looked at the source code of the page, the problem is that something else is “stripping” parts out of the plugin output. Fragments of the HTML code are missing, which indicates that perhaps some other plugin is conflicting with the content filter. I think it would be safer to put the related posts shortcode straight to the template instead of using the “Show the plugin under content” option, because it looks like that some other function is hooked after the related posts pro functions – and it would be extremely hard to trace which one and where exactly.

    Rather you should try to insert the shortcode straight to the theme. The themes single.php file is usually responsible for outputting the single post or page content. I’m not sure how familiar you are with wordpress, or coding, but you should try to put the shortcode somewhere between the content and the comment section of the code.
    The php format of the shorcode is the following:

    
    

    You can find this shortcode for every related posts pro intance on the top of the settings page.

    Don’t forget to turn off the “Show plugin under the content” option, to avoid duplication of the code: https://i.imgur.com/1RmZHeR.png

    2. I think you put the code somewhere else, because the error indicates line 421, which is far from line 843. You should check that again please. The code should be put to line 843.

    Best,
    Ernest Marcinko

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


    #2344
    Shivaji Mitra
    Shivaji Mitra
    Participant

    I am familiar with worpress and I am applying your suggestions now. get back to you soon with the results.

    #2345
    Shivaji Mitra
    Shivaji Mitra
    Participant

    For Point 2 I attached the PHP file for you to check the correct position of the snippet. Please confirm if it is okay.

    #2346
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I think you might need to zip the php file first, due to security risks.

    Best,
    Ernest Marcinko

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


    #2347
    Shivaji Mitra
    Shivaji Mitra
    Participant

    1. Point 1 solved after applying the template tag in single.php file. http://www.anblik.com/top-30-list-of-online-shopping-cart-builder-store-builder-reviews/ (clear browser cache before opening)

    #2348
    Shivaji Mitra
    Shivaji Mitra
    Participant

    For Point 2, I attached the PHP in a zip file for you to check the correct position of the snippet. Please confirm if it is okay.

    Attachments:
    You must be logged in to view attached files.
    #2350
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Oh, the problem with 2. is that the the server added blank lines after saving after each line, so the line 843 became 421. I’m attaching you the correct file, it should work after overwriting it.

    Attachments:
    You must be logged in to view attached files.
    Best,
    Ernest Marcinko

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


    #2352
    Shivaji Mitra
    Shivaji Mitra
    Participant

    All fine except there are still two issues remains.

    3. Home Page Slideshow stopped Working. Under Layout Options, ‘Show on the home page’ is OFF. So I guess there is no script running of related posts.

    4. The related post being displayed in a Posts or Pages are not relevant to the post content. The post should be displayed which is related to the subject. I have activated both Page and Post and under “Content Options”, “return posts” and “return pages” are ON.

    Page Example: http://www.anblik.com/services/
    Post Example: http://www.anblik.com/top-30-list-of-online-shopping-cart-builder-store-builder-reviews/

    #2353
    Shivaji Mitra
    Shivaji Mitra
    Participant

    For Point 3 above, I have even added “Exclude posts by ID” with ID: 8, 53, 55, 58, 60, 62, 65, 501, but slideshow is not working.

    #2354
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    3. I switched the compatibility mode of the javascript to minified from minified scoped on the compatibility options panel. It fixed it instantly.

    4. I need more information on that. The algorithm analyzes the post content, defines the most used keywords and chooses content based on those keywords. Based on the link you provided, I can’t see any irrelevance. Just by looking at the article I can see 40 appearances of the words “website”, “ecommerce”, “builder”, “shopping”. If I look at the relevant content, I can see posts with these titles exactly.

    Best,
    Ernest Marcinko

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


    #2355
    Shivaji Mitra
    Shivaji Mitra
    Participant

    3. I switched the compatibility mode of the javascript to minified from minified scoped on the compatibility options panel. It fixed it instantly.

    REPLY: Wow, I didn’t even noticed this option in Admin Panel. Thank you very much.

    #2356
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    No problem at all.

    In addition to point 4. Please scroll through this part of the documentation: http://wp-relatedpostspro.demo.wp-dreams.com/docs/#relevance_options

    There are some basic information about relevance selection, keywords and such. You have a lots of long content, so for better relevance you might need to experiment a bit with the relevance options. Right now the number of keywords (Minimum occurences) is set to 10, but based on your content you should try lowering it to 5 or 3. It basically then selects a lower amount of keywords and might result in more relevant results. You can also try to experiment with the relevance values as well. Lowering the title relevance might give you different results. There is also an option called “Keep each field exclusive?” – you can find more about this on the link I upper mentioned. It might also give you more precise results.

    It is also possible to choose which posts you want exactly for each post. Under the post editor, there is a metabox, where you can override the content with selected posts. Here you can read more about this: http://wp-relatedpostspro.demo.wp-dreams.com/docs/#genearal_behaviour_override_for_certain_post_local

    You should also try to experiment with the restricted keywords. As you can see the related-posts-pro/restricted.txt file holds some common words that are not considered as keywords. If you feel, that some of the words on your site are too common, you can add them to that file. Every word is separated by a space.

    Best,
    Ernest Marcinko

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


Viewing 15 posts - 1 through 15 (of 20 total)

The forum ‘Related Posts Pro for WordPress Support’ is closed to new topics and replies.