Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [recursive]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

How do I split a large query with a semi-expensive function included into multiple smaller queries

I have a count stored in post-meta called version-count. I just wrote a little plugin to delete the data stored in this post-meta using delete_post_meta_by_key. I want my plugin to then go through ...
DJZEEGLER's user avatar
  • 119
0 votes
1 answer

html sitemap via recursive function

I'm trying to render my page structure as an ordered list (<ol>) showing the hierarchy using nested ordered lists. So it should look something like <ol> <li> About <ol&...
Daveh0's user avatar
  • 191
0 votes
1 answer

wp_insert_post wrong post type [closed]

Much like this question, I'm having trouble with wp_insert_post causing recursive post adding. I do, however, have implemented a page type check - the problem is the inserted post always gets added as ...
codesquid's user avatar
0 votes
0 answers

How to get post count including nested categories

I am traversing through categories using function like this function hierarchical_term_tree($category = 0) { $r = ''; $args = array( 'parent' => $category, ); $next = ...
CROSP's user avatar
  • 437
1 vote
1 answer

Get the last month with posts using a recursive function…

There is probably another way but I would like to understand why this code returns null... I only have posts in october and here's the recursive function: function last_post( $month,$year ) { $...
benoît's user avatar
  • 145
0 votes
1 answer

Is there any good reason for two CSS files to @import each other?

I'm working on some critical style revisions for a client's WordPress site that was designed by another team. The CSS seems to be a tangled mess. One of the idiosyncrasies I've found is that the ...
John Stephens's user avatar
1 vote
1 answer

Pushing stored procedure to a multisite database in WordPress

I am given a WordPress multisite and need to extract information from the site. I have written a stored procedure that recursively builds a tree relationship for posts of a certain kind. Now I am ...
Praveen's user avatar
  • 113
2 votes
4 answers

Why am I getting an infinite loop with have_posts?

I have the following code, which causes an infinite loop for some reason. Can anybody explain what's going on please? Thanks! <?php $flagged_stores = new WP_Query( array ( 'post_type' => '...
yuval's user avatar
  • 121
0 votes
2 answers

How to show only parents subpages of current page item in vertical menu?

I just can't find a way to make it possible to show only current parent items down to current page item in a vertical menu the "wordpress way". What I want to achieve is the following dynamic ...
Peter Westerlund's user avatar
1 vote
3 answers

A function like is_page() but returns true if on any sub page of given page

In my header I use this code: if(is_page("stores")) { // Do something } I run some code if on the page stores but what I want to do is run that code if the page is stores or any page that is a ...
Scott's user avatar
  • 12.2k