How to change url of posts?

You can customize your permalink structure to include “blogs” for posts. Here are the steps to do that: Go to your WordPress dashboard and click on “Settings” > “Permalinks”. Select the “Custom Structure” radio button. In the text field, enter “/blogs/%postname%/” (without the quotes). Click the “Save Changes” button. This will set the permalink structure … Read more

Assign a tag to custom post type using a query

Put code below to your functions.php add_filter(‘pre_get_posts’, ‘query_post_type’); function query_post_type($query) { if(is_category() || is_tag()) { $post_type = get_query_var(‘post_type’); if($post_type) $post_type = $post_type; else $post_type = array(‘post’,’cpt’); // replace cpt to your custom post type $query->set(‘post_type’,$post_type); return $query; } }

Dynamic archive of posts by date

Please note that I have now resolved this issue. For whomever is interested, please find my code below (I’ve included everything to a shortcode to facilitate adding it anywhere I want): function archiveday() { $x=1; do { $result = date(‘l jS F Y’,strtotime(“-$x days”)); $year= date(‘Y’,strtotime(“-$x days”)); $month= date(‘n’,strtotime(“-$x days”)); $day= date(‘j’,strtotime(“-$x days”)); $my_query2 = … Read more

WP Query – Show custom posts only if user contain some user meta

You could approach in two steps. First get all the users that match your criteria $user_ids = get_users([ ‘meta_key’ => ‘activeacc’, ‘meta_value’ => true, // or whatever value you are storing ‘fields’ => ‘ID’, ]); and then run your WP_Query for only those users $properties = new WP_Query([ ‘post_type’ => ‘property’, ‘author__in’ => $user_ids, ]); … Read more

Display ACF object field data using Elementor Custom Query

The issue can be solved with this code : function my_cpt_query( $query ) { $myPostObjetField= get_field(‘cpt1_field_for_cpt2’,$post_id,false); foreach( $myPostObjetField as $post_field_item_value ) { $ids[] = (int) $post_field_item_value; } $query->set( ‘post_type’, ‘CPT2’); $query->set( ‘post__in’, $ids); } add_action( ‘elementor/query/13600’, ‘my_cpt_query’ );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)