Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

wp-query

How to properly rewrite pagination rules for a CPT to avoid 404 error on /page/2

August 5, 2022August 4, 2022 by Magenaut

I have custom post type called News and a static page that uses a custom template (page-news.php) and indexes all the news posts under homepage.com/news url.

Categories Q&A, Wordpress Tags custom-post-types, paginate-links, wp-query Leave a comment

Function is printing twice – any suggestions?

August 5, 2022August 4, 2022 by Magenaut

My function is returning the results correctly, but for whatever reason it is returning them twice. Any suggestions? It’s for a shortcode that queries and lists custom post types matching custom taxonomies.

Categories Q&A, Wordpress Tags functions, posts, shortcode, wp-query Leave a comment

How sort products by calculate value? ( custom post meta, price, option)

August 5, 2022August 4, 2022 by Magenaut

I have options: wz_currency_dollar, wz_currency_euro. And post meta _wz_currency. In the admin panel price of product defined in dollar or euro and select corresponding post meta. In the front-end price recalculate for html by next formula:

Categories Q&A, Wordpress Tags sort, woocommerce-offtopic, wp-query Leave a comment

Carousel slider with WP_Query to show 3 posts on each slide

August 5, 2022August 4, 2022 by Magenaut

I am trying to create a bootstrap carousel to show 3 posts on each slide. But my code is showing only a single item on each slide.

Categories Q&A, Wordpress Tags twitter-bootstrap, wp-query Leave a comment

Weird query with get_posts and WP_Query

August 5, 2022August 4, 2022 by Magenaut

Attempting to make a search in a custom post type “comunicados” inside a shortcode in a custom plugin I send this to get_posts()

Categories Q&A, Wordpress Tags get-posts, wp-query Leave a comment

Can I alter the main loop to ‘orderby’ a custom callback?

August 5, 2022August 4, 2022 by Magenaut

I have a custom post type where the title is a name, and I want to sort the loop by the last word in title, the surname.

Categories Q&A, Wordpress Tags loop, pre-get-posts, wp-query Leave a comment

WP_QUERY post_in problem

August 5, 2022August 4, 2022 by Magenaut

why when i using this code :

Categories Q&A, Wordpress Tags php, wp-query Leave a comment

Query with meta_query and tax_query together not working properly

August 5, 2022August 4, 2022 by Magenaut

I got some post in some categories { kids, man, woman } , and some ACF meta fields per country { Japan, South Korea ... }.

Categories Q&A, Wordpress Tags meta-query, tax-query, wp-query Leave a comment

pagination with numbers for WP_User_Query

August 5, 2022August 4, 2022 by Magenaut

I have pagination with next/previous links but I also would like to show numbers so the user can click on 2, 3, 4 etc. Pagination seems more tricky with WP_User_Query as there isn’t any default WordPress pagination for this as far as I know. The below works correctly as far as I can tell for the next and previous links.

Categories Q&A, Wordpress Tags pagination, wp-query, wp-user-query Leave a comment

has_excerpt() not working inside wp_query

August 5, 2022August 4, 2022 by Magenaut

I am trying to check for an excerpt and if it doesn’t exist then show the content but trimmed. Currently nothing is showing.

Categories Q&A, Wordpress Tags excerpt, loop, the-content, wp-query Leave a comment
Older posts
Newer posts
← Previous Page1 … Page7 Page8 Page9 … Page25 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress