Home › Forums › Product Support Forums › Related Posts Pro for WordPress Support › Products from one category only
This topic contains 21 replies, has 2 voices, and was last updated by Wesley McDermott 7 years, 3 months ago.
- AuthorPosts
- November 4, 2015 at 1:02 am #6546
Hi,
I am looking to show related products from a specific category only, and i’m looking to do this sitewide.
I have looked into the exclude sections but I’m not seeing any categories there, and only a small portion of product categories in the exclude terms section.
I’m looking to exclude the categories ‘hotels’ and ‘haunted-places’ and only have the category ‘Ghost Hunts in the Uk’s Most Haunted Locations’ showing on all product listings.
Hope you can help.
Many thanks in advance,
WesNovember 4, 2015 at 8:58 am #6547Hi!
There is a 50 category per taxonomy limit set to display in the plugin code, that’s why you couldn’t see them all. I’ve increased the limit to 600, now you should be able to see and exclude the ones you need 🙂
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 7, 2015 at 9:11 pm #6569Thanks.
I’ve managed to get it showing, however it’s not obeying the relationship with products. I have set relationships for tags only.
As you can see from the page below, it’s showing posts that have different tags:
http://www.hauntedrooms.co.uk/product/the-skirrid-inn-monmouthshire-south-wales
The link above should show products that have the tag ‘south wales’.
Wes
November 9, 2015 at 9:23 am #6572Hi!
I see a related products widget below the post, but it’s not the Related Posts Pro. Can you please check if the correct plugin is activated?
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 9, 2015 at 3:53 pm #6577Hi Ernest,
Sorry about that, please see again.
November 9, 2015 at 4:11 pm #6578Indeed, they are different tags. Can you please also check the log-in details? I can’t seem to be able to log-in to your back-end to check the configuration.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 9, 2015 at 5:00 pm #6580Ah sorry, I’ve just re-added your login. You should be able to login using original details.
November 9, 2015 at 5:12 pm #6581I found the problem!
The override was enabled and configured to show random content always. (General Options -> Override content? option)
I’ve also selected the product_tag taxonomy to match, as the simple tags doesn’t work with products, only posts and pages. Now it displays 1 element on the page with a matching product tag.
The rest is not displayed because they all match one category/term from the excluded categories list. (Advanced Options panel)
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 9, 2015 at 5:26 pm #6582Ah great stuff, thanks! Can’t believe I missed that!
I have noticed another issue not sure what is the matter. I have only one post showing for the tag ‘south wales’ as you can see here: http://www.hauntedrooms.co.uk/product/the-skirrid-inn-monmouthshire-south-wales
and here: http://www.hauntedrooms.co.uk/product/margam-castle-port-talbot-wales
it always seems to be the same event shown too.
There are more related products shown on other tags such as here: http://www.hauntedrooms.co.uk/product/dudley-castle-ghost-hunts-west-midlands
November 9, 2015 at 5:30 pm #6583As I stated in the previous answer:
The rest is not displayed because they all match one category/term from the excluded categories list. (Advanced Options panel)
Each of the rest matches at least one of the excluded terms, so it’s not displayed. If you remove some of the exlusions, they should start displaying.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 10, 2015 at 12:01 am #6589Thanks for your help, I missed a few of the terms I didn’t want excluding out.
One more thing, where do I change the background and text colour of the display, i’ve been and changed the container layout colours but nothing seems to be changing?
November 10, 2015 at 7:56 am #6595It looks like the CDN cache is not updated yet. The preview CSS looks changed, but the site CSS is served from cloudfront and it still contains the older changes.
I’ve enabled the Load inline stylesheets? option on the Compatibility Settings panel, so the CDN minify cache is bypassed, it displays the new styling now. Once the CDN cache is cleared, you can switch it back and it should display the latest changes.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 10, 2015 at 10:34 am #6596Okay thanks very much!
November 12, 2015 at 6:05 pm #6620Hi Ernest,
I’m replying to this ticket as I couldn’t get in to the website to post a new topic.
I have received an email from my host saying the plugin is creating a crazy amount msql requests. You can see the message below:
Also we have checked the log files and found the following error:
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: WordPress database error Got error ‘repetition-operator operand invalid’ from regexp for query
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: \t\tSELECT
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: wp_posts.post_title as title,
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: wp_posts.ID as id,
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: wp_posts.post_date as date,
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: wp_posts.post_content as content,
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: wp_posts.post_excerpt as excerpt,
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: wp_users.user_nicename as author,
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: wp_posts.post_type as post_type,
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: (SELECT DISTINCT CONCAT(‘–‘, GROUP_CONCAT( wp_term_taxonomy.term_id SEPARATOR ‘—-‘ ), ‘–‘) FROM wp_term_taxonomy
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: LEFT JOIN wp_term_relationships ON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: WHERE (wp_term_relationships.object_id = wp_posts.ID) ) as ttid,
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: ((case when
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: (lower(wp_posts.post_title) REGEXP ’18th|march|2016’)
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: then 10 else 0 end) + (case when
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: (lower(wp_posts.post_content) REGEXP ‘>|skirrid|<|investigation|inn|haunted|staircase|*chance|possibly|courtroom’)
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: then 8 else 0 end)) as relevance
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: \t\tFROM wp_posts
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: LEFT JOIN wp_postmeta ON wp_postmeta.post_id = wp_posts.ID
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: LEFT JOIN wp_users ON wp_users.ID = wp_posts.post_author
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr:
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: WHERE
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: (wp_posts.ID <> 12735) AND
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: (wp_posts.post_type REGEXP ‘[[:<:]]dummy_notting[[:>:]]|[[:<:]]post[[:>:]]|[[:<:]]product[[:>:]]’) AND
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: wp_posts.ID NOT IN (-99) AND
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: (wp_posts.post_status = ‘publish’) AND
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: ((lower(wp_posts.post_title) REGEXP ’18th|march|2016′) OR (lower(wp_posts.post_content) REGEXP ’18th|march|2016′) OR (lower(wp_posts.post_content) REGEXP ‘>|skirrid|<|investigation|inn|haunted|staircase|*chance|possibly|courtroom’) OR (lower(wp_posts.post_title) REGEXP ‘>|skirrid|<|investigation|inn|haunted|staircase|*chance|possibly|courtroom’))
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: GROUP BY wp_posts.ID
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: HAVING (ttid NOT REGEXP
‘–344–|–325–|–326–|–327–|–328–|–329–|–330–|–331–|–332–|–333–|–334–|–335–|–336–|–337–|–338–|–339–|–340–|–341–|–342–|–343–|–345–|–346–|–347–|–355–|–356–|–357–|–358–|–359–|–365–|–366–|–360–|–361–|–362–|–363–|–367–|–368–|–369–|–370–|–371–|–372–|–373–|–374–|–375–|–376–|–377–|–378–|–379–|–380–|–381–|–382–|–383–|–384–|–385–|–386–|–388–|–389–|–390–|–393–|–394–|–395–|–396–|–397–|–398–|–399–|–400–|–401–|–402–|–404–|–406–|–408–|–409–|–411–|–412–|–460–|–413–|–414–|–416–|–418–|–419–|–420–|–421–|–422–|–424–|–425–|–448–|–449–|–426–|–427–|–428–|–429–|–430–|–431–|–432–|–433–|–436–|–437–|–439–|–440–|–450–|–441–|–451–|–442–|–443–|–444–|–445–|–446–|–452–|–453–|–454–|–456–|–457–|–458–|–459–|–465–|–461–|–462–|–463–|–464–|–467–|–469–|–470–|–471–|–472–|–473
–|–47
5–|–476–|–477–|–478–|–479–|–480–|–364–|–482–|–483–|–484–|–485–|–486–|–487–|–489–|–490–|–491–|–492–|–494–|–495–|–496–|–497–|–498–|–499–|–500–|–501–|–502–|–503–|–504–|–505–|–507–|–508–|–509–|–513–|–510–|–514–|–511–|–512–‘) AND (ttid REGEXP ‘–297–‘)
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: \t\tORDER BY relevance DESC, wp_posts.post_date DESC
[Thu Nov 12 10:23:22 2015] [warn] [client 188.165.15.196] mod_fcgid: stderr: \t\tLIMIT 3 made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/flatsome/woocommerce/single-product.php’), woocommerce_get_template_part, wc_get_template_part, load_template, require(‘/themes/flatsome/woocommerce/content-single-product-rightcol-fullheight.php’), woocommerce_get_template, wc_get_template, include(‘/themes/flatsome/woocommerce/single-product/tabs/tabs.php’), call_user_func, woocommerce_product_description_tab, wc_get_template, include(‘/themes/flatsome/woocommerce/single-product/tabs/description.php’), the_content, apply_filters(‘the_content’), call_user_func_array, fixShortcode, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, rppShortcodeContainer->wpdreams_rpp_shortcode, wpdreams_related_content->getRelatedPosts, wpdreams_related_content->simpleRelatedNovember 13, 2015 at 8:14 am #6623Hi!
Can you elaborate more on crazy amounts? That should definitely not happen, as repetitive page loads are cached to prevent further query executions. First page loads are of course heavier, as the plugin looks for related posts within the database based on keywords parsed from the configured fields. For more info you can read about a performance test I concluded on related posts plugin: https://wp-dreams.com/articles/2014/11/related-posts-plugins-performace-measured/
I can see an error in that query. There are unexpected “&” and “*” characters, which makes it failing. They look like they are part of html entities, and it’s very hard to escape them.
Since I can’t see FTP access I’ve quickly made a change in my local test environment to the word parser function, to look for more unexpected cases. So far I’m getting positive results on all stress tests.
I’m attaching this version to this post, please re-install it to your server, save the settings again, and check if these errors appear again.If the problem still persists, and you can provide temporary FTP acess as well, I will gladly debug through the code to find the source of the issue. I’m hoping that the attached version will help though.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.