Display posts in correct month order using single date custom field
Display posts in correct month order using single date custom field
Display posts in correct month order using single date custom field
*** I’m not familiar with JetEngine, but this is what to do with core WordPress; maybe it will help. *** The post_type_link filter only tells WordPress to change the URL in links, it doesn’t inform WordPress on how the page is requested: Filters the permalink for a post of a custom post type. To have … Read more
Trouble getting wpdb to work – first time
PHP strtotime() takes some weird string values that we can use in combination with the WP_Query date_query ‘before’ keyword. For example, we can get X posts before 1 year before tomorrow: $tomorrow_a_year_ago = wp_date( ‘Y-m-d’, strtotime( ‘-1 year +1 day’ ) ); $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 5, ‘post_status’ => ‘publish’, ‘orderby’ … Read more
I finally found a solution. I had to extend the wpdb class inside wp-contents/db.php. It looks like this: <?php /** * WordPress Database Access Abstraction Object * Custom DB Connection class to provide ssl connection to the database */ class ssldb extends wpdb { /** * Connects to the database server and selects a database. … Read more
After hours of investigation and heavy testing I found the reason. Uninstall the php-extension php8.1-uopz changed everything. It seems uopz will break every wordpress. I hope this information will help others not to install it. Thanks to Bosco, he made me take a closer look at this issue.
When you call register_post_type() to register your custom post type, one of the args is called template which is described as follows: Array of blocks to use as the default initial state for an editor session. Each item should be an array containing block name and optional attributes. So whereever you have the register_post_type(), you … Read more
You can make your life a little easier by moving the details fetching to an earlier point in the WordPress loading sequence and wrapping the data in a class. The object initialized from the class can then be used to provide the data to WordPress and to your template with filters. For example you could … Read more
If the goal is to have a PHP file where you can insert CSS into the header of all pages then what you need is a plugin, one of your own creation, not one you install. Create a .php file in the plugins folder, e.g. templaters-plugin.php and insert this: <?php /* Plugin name: Templaters test … Read more
I’ve ended up with a simple solution. after the query to the DB to get all the desired CPT I’m looping the posts object and inside my loop I get the postmeta I will need to add and append them to each post before return the data to the front-end public function get_contents( WP_REST_Request $request … Read more