How to compare Event period with Week period using get_posts(), meta_query, relation and compare

To be able to do this your post meta values need to be strings in a valid date format, e.g. 2022/01/31 for January 31st 2022. Note I used ISO standard timestamp format with the biggest value first, then everything descending, and avoided using a regional value such as 31/1/2022 from the UK, or 1/31/2023 from … Read more

How customizable is a self-hosted WordPress blog compared to a Blogger blog?

The front-end customization options in self-hosted WordPress are absolute. You can edit whatever you want in PHP/HTML templates and CSS style sheets. While WordPress comes with single theme (“Twenty Ten” at moment) the availability of third party free and paid themes for it is huge. See: Where can I download WordPress themes from? for good … Read more

Filter posts/pages by user_role array

You’ve used LIKE comparison method, that means every similar expression will be matched, including exact string and similar string. If you want to match exact string, you should use = operator. Example: global $current_user; $user_roles = $current_user->roles; $user_role_query = array(); for ($i=0; $i < sizeof($user_roles); $i++) { $user_role_query[] = array( ‘key’=>’attribution_roles’, ‘value’ => $user_roles[$i], ‘compare’=>’=’ … Read more

Comparison operator

string(5) “>=” concerns me. It should be string(2) should it not? This feels like you’re actually getting &gt;= instead of >=. If you are doing a var_dump into the basic HTML body, it will encode what you see. View Source or wrap your var_dump in a <pre> tag, and you should see what’s up. Try … Read more

tech