Categories
CMS Mastering Development Wordpress

change permalink number

these days I wonder how I can change the final permalink number of my posts by +1, i found this code on the net, but it needs to be changed someone help me? // Get all posts $query = new WP_Query(array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1, )); $posts = $query->get_posts(); foreach ($posts as $post) […]

Categories
CMS Mastering Development Wordpress

Display images that are not in the content

The function below returns all the images attached to the post, however, if I delete the image inserted into the content, it still returns in the function, because the media is still as attached to the post. So, how do I really bring only the images inserted in the content of the post? <?php $args […]

Categories
CMS Mastering Development Wordpress

Order is breaking wp_query

Have never encountered anything like this. Running a simple query of custom post types, show only those that the current user is the author, and sort them by a custom meta field. global $current_user; $user = wp_get_current_user(); $args = array( ‘post_type’ => ‘order’, ‘post_status’ => ‘publish’, ‘author’ => $current_user->ID, ‘posts_per_page’ => ‘-1’, ‘meta_query’ => array( […]

Categories
CMS Mastering Development Wordpress

Form ajax in frontend loses search values

I am using an ajax form in the frontend, and at the user experience level it is fabulous, the user can have fun finding what he wants by playing with the filters, no problem. The problem instead arises when once the user decides to choose a result, he obviously enters the result page, but if […]

Categories
CMS Mastering Development Wordpress

Custom query give me 404 when paginate

in my site I have "CPT Clients" and each client has "CPT Success Stories", also I have a list of client’s taxonomies, and when access to one of thees, I need to display the stories which client belongs to that taxonomy. My code looks like this: $query_obj = get_queried_object(); $args = array( ‘post_type’ => ‘sky-client’, […]

Categories
CMS Mastering Development Wordpress

Avoid to select/show a randomly queried post for a certain period of time (post of the day)

I would like to present a randomly selected post on my homepage every day. I have already created a working query for this (I have set 60 seconds as time for testing purposes). Now I’m looking for a solution that for a certain period of time (e.g. a month) the same posts are not shown […]

Categories
CMS Mastering Development Wordpress

Looping Through Categories of a CPT

I am trying to create tabs using the Foundations framework, outputting posts from a custom post type called testimonial and filtering them through their assigned custom category called filed-under. What am I doing wrong in my loop? What I Have Working Category tabs appear when new categories are created What is Not Working The posts […]

Categories
CMS Mastering Development Wordpress

Display two items from a custom post type that have 2 different taxonomy terms but output different HTML in the loop for one of those terms

sorry if my question title does not make much sense, I couldn’t think of a good way of wording it. Essentially, I currently have some custom loop code on single.php that does the following: If a post_tag from the main article (post_type: post) contains a matching post_tag of a single item (game) in the custom […]

Categories
CMS Mastering Development Wordpress

WordPress primitive query returns = array

i am trying to primitive query form this wp_query: $query_v = array( ‘post_type’ => array(‘pro’), ‘posts_per_page’ => -1, ‘orderby’ => $count_visit, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘servizi_pro’, ‘field’ => ‘slug’, ‘terms’ => $art_p, ‘parent’ => 0 ) ) ); the problem with this wp_query is that it does not sort me […]