Can Categories be used to hack a Multisite-like setup w/ a single MySql db?
I think you misunderstood, WordPress multisite works with only one database for all sites!
I think you misunderstood, WordPress multisite works with only one database for all sites!
there is no single function you can use but you can create your own something like: function get_all_post_fields($post_id){ $p[‘standard’] = get_post($post_id, ARRAY_A); $p[‘meta’] = get_post_custom($post_id); return $p; } then once you have this in your functions.php file you can use it: $fields_all = get_all_post_fields($ID); Update: If you have just the title then i have a … Read more
Looks like you are not familiar with WordPress Bulk Edit. Change the Screen Options to show all the products you have (if there are too many this can be slow, and is better to do it following some 100/200 product per page). Select all the products, select Edit in the Bulk Edit dropdown and Apply. … Read more
There was an issue with the code originally posted by kaiser in that it queried for year, month and day distinctly resulting in values representing “the largest month for any date” or the “smallest day for any date” rather than values representing the MAX and MIN dates globally. I altered that original code to query … Read more
Why don’t you use WordPress get_posts? You can add the parameter orderby => ‘title’ as you want. $args = array( ‘posts_per_page’ => -1, ‘order’ => ‘ASC’, ‘orderby’ => ‘title’ ); $posts = get_posts( $args ); print_r($posts); If you want the sql you can just add ORDER BY post_title: SELECT * FROM $wpdb->posts WHERE post_type=”post” AND … Read more
Questions like this usually yield a lot of discussions, but let me give it a shot: If you’re talking about SQL queries: If you’re only adding content, managing plugins, themes and WordPress updates, there’s a 99.9% chance that you will never need to write a single line of it. I don’t want to put 100% … Read more
First, let me point out a few issues. Your SQL statement has 2 different conditions that cannot both be true: meta key = “state” AND meta_key LIKE “habitat_types_%_habitat_type”. To do this properly, post meta must be inner joined onto itself (see more about this below). You are not inner joining the posts table, meaning you … Read more
I love to use this tool, Search and Replace for WordPress Databases. It is basically a PHP script that is written for WordPress usage (but of course can be used with any database). When placed in the WordPress project, it automatically detects and loads the Database using data from wp-config.php file. It enables you to … Read more
I would highly suggest that you use CSS to do this, as mentioned per other answer. Still, if you need to update the database due to some technical business, here’s the way to go. First, we will try and fetch all the tags using the get_terms() function, then we will update everyone of them using … Read more
When you include wp-load.php, WordPress will load wp-config.php, where constants with the same identifiers you have chosen here are already defined. This should be throwing warnings regarding the duplicate definition. Because you cannot re-define constants, the values you are attempting to set in this file are ignored. Choose different names for them if they are … Read more