dynamic page not displaying correctly when Varnish hosting ignores query string parameters

Caching content with query string parameters Varnish hashes the URL and uses this value as its cache key. When a single value in the URL changes, the cache key changes. This would result in a cache miss. Query string parameters are exceptionally prone to this: omitting a parameter, adding a parameter, or changing the order … Read more

Bash script to check available updates

WP-CLI and AWK One way is to do the counting of the available string in the third column via AWK: wp plugin list | \ awk ‘BEGIN{N=0;} \ ($3==”available”){N++; print $0;} \ END{print(N>0)?”Plugin updates available: “N:”No plugin updates available”;}’ where N is the number of available updates, in case you need the number, $0 is … Read more

Populate acf-field, depending on block name

You are calling get_post() using null. Try to retrieve the post individually. Use get_post(get_the_ID()) to get the post content. $post = get_post(get_the_ID()); if ( has_blocks( $post->post_content ) ) { $blocks = parse_blocks( $post->post_content ); if ( $blocks[0][‘blockName’] === ‘acf/full-width-talker’ ) { } }

How get horizontal div instead vertical CSS

<style> .makeitseo{ width: 100%; margin: 10px auto; text-align: center; display: flex; justify-content: center; } img { width: 100%; } .cell { margin: 10px 10px 10px 10px; height: 400px; width: 400px; padding: 2px; display: flex; align-items: center; overflow: auto; flex-direction: column; } </style> use this styles for your html and change the parent container with so … Read more

How can I pass WP_Query results to a plugin?

I think for shortcodes, which are generally used in the WYSIWYG editor by non-technical users, it’s best to keep the parameters simple: [custom-shortcode color=”red” size=”medium”] In other words, shortcodes are designed to provide functionality that an end-user can place somewhere in their content, with the option of supplying a few different customizations. For obtaining something … Read more