clairedelune
Forum Replies Created
-
Thank you Juan. ??
Interesting change noted since my last post: the add to Wishlist is no longer displaying when I am logged into my WP administrator account. It still displays when not logged in.
Another thing that I have noticed: now when I click the “add to cart” button it no longer goes to the affiliate vendor site but displays a message “this product cannot be purchased”, which is a very good thing.
However, the product is still displaying in the Wishlist as “Free!” and that is a problem: prices cannot be added into the product listing on the database because of affiliate agreement stipulations about prices.
With many, many thanks again.
Thank you. ??
I am only using the native Woocommerce external product type, not a plugin.
I have a snippet running to manage the behaviour of when the link for an external/affiliate product is clicked. I found the snippet on https://www.tychesoftwares.com/how-to-make-woocommerce-external-product-links-open-in-a-new-tab/?.
Other than that I have a very lean list of plugins running, mostly for security and optimisation.
Many thanks again.
Forum: Developing with WordPress
In reply to: Custom Shortcode Function error: Listing Posts on a PageI finally had the opportunity today to take another look at this and made the adjustment suggested by @bcworkz and it seems to be working correctly ~ thank you.
Final code now looks like this with a couple of extra spaces and typo errors fixed:
function faq_postsbycategory() { $the_query = new WP_Query( array( 'category_name' => 'faq', 'posts_per_page' => 10, 'order' => 'ASC', 'orderby' => 'link', ) ); if ( $the_query->have_posts() ) { $string .= '<div class="postsbycategory widget_recent_entries">'; while ( $the_query->have_posts() ) { $the_query->the_post(); if ( has_post_thumbnail() ) { $string .= '<p>'; $string .= '<b><a href="' . get_the_permalink() . '"rel="bookmark">' . get_the_post_thumbnail($post_id, array( 200, 100) ) . get_the_title() . '</a></b><br><h7>Posted: ' . get_the_date() . '</h7><br>' . get_the_excerpt() . '</p>'; } else { $string .= '<p><a href="' . get_the_permalink() .'" rel="bookmark">' . get_the_title() . '</a><br><h7>Posted: ' . get_the_date() . '</h7><br>' . get_the_excerpt() . '</p>'; } } } else { } $string .= '</div>'; wp_reset_postdata(); return $string; } add_shortcode('faq-posts', 'faq_postsbycategory');
Forum: Plugins
In reply to: [YITH WooCommerce Wishlist] Heart O icon gone since update this morning.The problem should NOT be resolved this way because as soon as my theme is next updated it will be wiped.
It is the Yith Wishlist Plugin at fault NOT my theme and I am not comfortable messing with the rest of my website to fix Yith’s mess up.
Forum: Plugins
In reply to: [Search Regex] Compatibility with PHP8I have the same problem. Apparently there is a major upgrade in the works with a Bata version available on GitHub if you want to test it out.
A work around I tried a few months ago was rolling PHP back to an earlier version, doing what I needed to do on my site, and then updating to v8 again. Not ideal but it got the job done. I have a whole bunch of changes I need to make again … wish the new version was ready already.
Forum: Developing with WordPress
In reply to: Custom Shortcode Function error: Listing Posts on a PageThat is interesting, thanks for the additional info. The CSS buffs would have us all believe something that is not true lol
I’m working on an old iPad and unsure how to view source HTML … just another challenge for me to solve.
I will test it out, I just haven’t had a chance yet.
Forum: Developing with WordPress
In reply to: Custom Shortcode Function error: Listing Posts on a PageBeing gracious: Thanks for that @bcworkz.
NB: The comments are not
hidden
by the CSS, they are set todisplay:none
which means exclusion from output.However, the result I am after is that they not be affected at all by the script so I will test your suggestion… Although from what you post it may be a case of leaving that line out all together if it is not necessary.
Forum: Developing with WordPress
In reply to: Custom Shortcode Function error: Listing Posts on a PageOk the experiment produced the same results:: comments on the posts displaying in the page where the shortcode is inserted.
Logically this should not be happening so is it possibly a flaw in the theme?
Be that as it may, for posterity …
SOLUTION USING CSS
.page-id-9999 #comments { display:none; }
Replace the number 9999 in the page-id- to your own page. Find the page ID per the instructions here: 8 Proper Ways to Hide Elements on Your Website With CSS (2021)
Happy coding.
Again for posterity, additional CSS to hide the unnecessary / unwanted display of comments.
.page-id-9999 #comments { display:none; }
Replace the number 9999 in the page-id- to your own page. Find the page ID per the instructions here: 8 Proper Ways to Hide Elements on Your Website With CSS (2021)
Happy coding.
Forum: Developing with WordPress
In reply to: Custom Shortcode Function error: Listing Posts on a PageI am going to do another experiment on another page that has comments disabled and nil comments ever submitted.
This only started after the recent round of Plugin updates after the last core WP update.
Forum: Developing with WordPress
In reply to: Custom Shortcode Function error: Listing Posts on a PageSame thing is happening on my site home page.
The home page has NEVER had any comments submitted there yet the comments from the last one of the posts in the short code generated list are being displayed.
Forum: Developing with WordPress
In reply to: Custom Shortcode Function error: Listing Posts on a PageI don’t understand what you mean!? The comments are disabled on that page and there have never been any comments submitted on that page.
The comments that are displaying are from the last post in the list generated by the shortcode. I know this for certain because I tested it by creating the comments on that post, not on the page where the shortcode is placed and yet they are displaying on the page.
I do not understand what you are saying.
- This reply was modified 3 years, 3 months ago by clairedelune.
Don’t you just love coding? The day after I got this working something triggered a fatal error on my site when I cloned the above and modified it for another category.
Working again but now it spits out the comments forms and responses on the last post in the generated list.
How can I exclude the response box and fields and all the submitted comments from being displayed at the bottom of the page the shortcode is used on?
Forum: Plugins
In reply to: [Advanced Editor Tools] Compatibility Update?Why are you spamming this thread steiner?
Go find your own support people.
Disregard: I see that you figured out your own problem.
Forum: Plugins
In reply to: [Advanced Editor Tools] Compatibility Update?Ok, no response and numerous other support threads the same, so taking the lack of answer as no more support for this plugin, best to deactivate and uninstall.