Trouble getting wpdb to work – first time
Trouble getting wpdb to work – first time
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
You need to add your code in functions.php inside wp-content/themes/your_theme_directory/ You can add wordpress hooks into this file, upload your CRM SDK files into this directory, and your integration will live there. Also, you could look for any existing (possibly commercial) wordpress plugins, that allows integration with your CRM.
Query Monitor is a good way to track what part of WP is chewing up resources. What search functionality are you trying to implement, exactly? It’s very hard to give advice based on a vague question that leaves out relevant details.