Brad
Forum Replies Created
-
Forum: Plugins
In reply to: [WordPress Popular Posts] Offset and AND termsSo my hack doesn’t bomb and the single tag queries are working again but I think maybe something is wrong with the replacement SQL query being built by your code example because whenever I have two categories specified I get WPPs no data message.
I tested with the two biggest categories which probably have over 100 posts common between them and some of the most popular ones on the site and I still get no data with a shortcode like wpp stats_views=0 limit=6 range=’last30days’ cat=’XX,YY’. And a regular single category shortcode shows at least one of the posts that I confirmed are in both categories but that post doesn’t appear when both the categories it is in are specified, just WPPs no data message.Forum: Plugins
In reply to: [WordPress Popular Posts] Offset and AND termsSo I’m not really much of programmer but what if I added to the if statement in your code:
&& str_contains($options['term_id'], ',')
So if there is a comma then there is more than one term_id so use the replacement code with AND relationship. This should then skip replacing the code when there is only 1 term. Too much of a hack?
Will that work? Fail in way you can see that I’m not anticipating?
- This reply was modified 2 months, 3 weeks ago by Brad.
Forum: Plugins
In reply to: [WordPress Popular Posts] Offset and AND termsSo the plugin builds its own SQL queries and its not as easy as making the plugin use the
category__and
parameter from wp_query?Forum: Plugins
In reply to: [WordPress Popular Posts] Offset and AND termsSee my edit above for an example of what is happening. I only need it for categories not tags if that matters.
Forum: Plugins
In reply to: [WordPress Popular Posts] Offset and AND termsHi Hector @hcabrera ,
Something strange is happening with the code you provided above for the AND relationship.
Background, I have a WPP shortcode in some tag pages and the shortcode uses taxonomy=’post_tag’ term_id=’XX’ (just one id, same as the tag page the shortcode is in). I wasn’t wanting to use the AND here with tags (just with categories) and just noticed the below was off when testing.Just pasting your code into the functions.php is causing the shortcode with post_tag to show show posts from a totally different tag than they were before. The category pages where I want to use the AND seems to be fine for now, haven’t fully tested.
Not sure why it would do that…..
An example would be wpp stats_views=0 limit=4 range=’last30days’ taxonomy=’post_tag’ term_id=’201′ on a tag page is working fine. Then I paste in your code from above to functions.php and the same shortcode is now return only showing things from term_id 197! Very strange. Remove AND relationship code and its back to showing the right posts. So your code seem to affect tags and categories and tags unpredictably?
- This reply was modified 2 months, 3 weeks ago by Brad.
Forum: Plugins
In reply to: [WordPress Popular Posts] Offset and AND termsI did ask about the AND function before. Maybe at the time WP_QUERY didn’t have
category__and
parameter and it does now so it would be easier to implement in the shortcode?Thank you for the code this should work and I will experiment with the offset! I see your point with the changes in what is popular but with larger traffic and a 30 day window they don’t change that frequently for what I have seen.
Forum: Plugins
In reply to: [WordPress Popular Posts] Nopin attributeAmazing. Thank you.
Forum: Plugins
In reply to: [WordPress Popular Posts] Image Caching Turn OffGreat! Thank you, I missed the predefined size option. Is it possible to do the pre-defined size thing in the shortcodes too? Do I just specify an already defined thumbnail size and it will use it?
Forum: Plugins
In reply to: [AddToAny Share Buttons] External load of sm.23.html@micropat
Can we kindly get a responsive to this? If it is your policy that you will not modify the behavior and require external resource loading for your tracking or whatever, please state so.Thank you.
Forum: Plugins
In reply to: [AddToAny Share Buttons] External load of sm.23.htmlYes, this issue is frustrating. It does not appear to exist in the local cache either.
Forum: Plugins
In reply to: [WordPress Popular Posts] Shortcode for Posts Only in Both CategoriesThank you for the reply! Bummer for your hard drive loss. It would be a great addition to the plugin making it a lot more powerful. I like to use the shortcodes on cateogry page descriptions and cornerstone posts/pages and it would be great to be able to show intersections between two categories.
Forum: Plugins
In reply to: [WordPress Popular Posts] Defer JSThank you for the thoughtful reply. Core Web Vitals will become a ranking factor in May 2021 https://www.searchenginejournal.com/google-core-web-vitals-ranking-signals/387142/
For mobile scoring of web vitals, Google artificially throttles the CPU and it becomes a constrained resource so, deferring or delaying even small non-essential JS could make a difference with limited CPU if near the limit.
Wrong plugin, See https://www.ads-software.com/support/plugin/wp-cloudflare-page-cache/
Forum: Plugins
In reply to: [W3 Total Cache] W3TC Filter DocsThank you.
Forum: Plugins
In reply to: [W3 Total Cache] W3TC Filter DocsAs a workaround (but would still prefer a filter if there is one as discussed at the end below) you can add a link header to the .htaccess file in the page cache directory for w3tc.
As a pre-caution, I surrounded it by the files directive because I wanted to be sure it didn’t get added to anything but html pages but probably not necessary since there are no images or scripts etc., in the page cache dir…..
<Files ~ "\.(html|html_gzip|html_br)$"> Header add Link "</wp-includes/js/jquery/jquery.js>; rel=preload; as=script" </Files>
I also tried Header add Link “</wp-includes/js/jquery/jquery.js>; rel=preload; as=script” and saw it pushed in Chrome.
I am not quite marking this as resolved yet because I would like to know from W3TC support if there is a filter to add a http header. If there was a filter then I could use code to push for example a CSS or JS file that changes often like say the ones from the Autoptimize plugin. I cannot push those with a .htaccess header because they change.
So, is there a filter to add a http header with W3TC? If not, it would be nice to add one that other plugins could hook into since the caching bypasses everything and won’t include any headers other plugins try to set or that I set functions.php.
Thank you.
Edit: fixed editor malforming link code I used by using code tag, I think….