Unanswered Questions
4,443 questions with no upvoted or accepted answers
7
votes
1
answer
2k
views
Registering menu with 'Automatically add new top-level pages to this menu' selected
Is it possible to register a menu inside of a theme functions file and have 'Automatically add new top-level pages to this menu' pre-selected? I can't find any info about this in the ...
6
votes
0
answers
636
views
How to load paginated post pages via ajax
Here's the case I got: I've setup post pagination for my website and everything works well. Except one thing - on every new page request all the resources are loaded again. This makes the website ...
6
votes
2
answers
661
views
Link to Author archive from Navigation Menus in dashboard?
I'd like to display a grid of authors on my site showing the name of the author and their avatar. The tricky part is, I'd like to be able to control this from the Menus page in the dashboard so I have ...
6
votes
1
answer
395
views
How can I safely increase the character limit for post passwords?
When I want to protect a post on one of my blogs, I like to use a passphrase instead of a password (albeit purely for the sake of creativity, not security — they're stored plainly anyway). However, ...
6
votes
2
answers
689
views
Let readers suggest edits from the frontend
I'd like to make my articles editable at the front-end for any reader who visits the site. (More like a wiki). I don't really want to trouble them through the registration process. I have no idea how ...
5
votes
1
answer
1k
views
Order wp_query by calculated field
Hi I'm working on a store locator.
I have a custom post "clinics" where I save clinic details (address,.., lat, lng). Each time I publish a new clinic I save post_id, lat and lng also in a custom ...
5
votes
1
answer
12k
views
wp_query->max_num_pages always returns 0 on custom post type
Hi there I am developing a theme where I have to load some posts with ajax, in my index page everything works properly, the problem is when I need to use it on custom post type, I pass the values for ...
5
votes
2
answers
790
views
Extending WP_Query — Optimise SQL query
I'm storing posts, a user follows in a custom table that has the columns id, post_id and user_id. To fetch posts that a user follows I have extended the WP_Query as follows:
class ...
4
votes
0
answers
651
views
What to use: wp_is_post_autosave( $post_id ) or DOING_AUTOSAVE?
I was doing some action on save_post hook, and noticed that there exists
wp_is_post_autosave( $post_id )
function.
How does it differ from DOING_AUTOSAVE constant?
If I want my action not to run ...
4
votes
1
answer
3k
views
WP_Query min and max values
I'm building a houses class and I want to filter these houses with a query. But don't get any results:
Example house:
Min price: 10
Max price (field not required): empty
I've a price filter ...
4
votes
2
answers
2k
views
How do I order pages and categories by ID or name in the same query?
I would like to query most of my pages and categories on the homepage. So far I am able to get the pages and category (posts), but I cannot order the list the way I want to. I want to be able to get a ...
4
votes
0
answers
2k
views
get_permalink returns default link
I hope you can help me.
So I'm using /%postname%/ as permalink structure, and my htaccess looks like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /develop/...
4
votes
1
answer
644
views
Get page content by category or tag
I'm trying to sort of emulate the Views behaviour in Drupal with WordPress, but doing it in theme templates.
Now, I have pages that are assembled by using wp_query in the template to get posts ...
4
votes
1
answer
353
views
How to sort posts by last name (2nd word) on ONE category only?
I have an "author" category that is used as a list to browse multiple posts containing author biographies. I have Smart Category Ordering installed and right now it is sorted by title ascending. ...
3
votes
2
answers
1k
views
WP rest api returns 404 only when author param is used
I have a multisite wordpress installation on aws linux, working perfectly fine. The WP Rest api is also working exactly as it should. Except for one single case.
/wp-json/wp/v2/posts?author=<some ...