Articles of recursive

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 theme’s main stylesheet style.css, @imports another stylesheet from a subdirectory: css/default.css. Meanwhile, default.css @imports the main stylesheet at the top […]

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 wondering how to push the stored procedure to the databases of all the sites.(Since this is a multisite configuration, each […]

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 ) { $args = array( ‘monthnum’ => $month, ‘year’ => $year ); $query = new WP_Query( $args ); var_dump( $month ); // int 11, int […]

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 sub page of stores. Not only that, but is recursive so if […]

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’ => ‘store’, ‘orderby’ => ‘post_id’, ‘meta_key’ => ‘flagged’, ‘limit’ => 10 ) ); if($flagged_stores->have_posts()): ?> <div class=”table”> <table class=”form-table”> <tr> <th>Store</th> <th>Flag Reason</th> <th>Delete Flag</th> </tr> […]