Best Way to Inventory the Media Library of a 200+ Multisite Installation?
You may want to check this: How do I query all posts of one type across my multisite installation? Just change post to media and you’ll be fine.
You may want to check this: How do I query all posts of one type across my multisite installation? Just change post to media and you’ll be fine.
Realistically: Not every kind of data fits well into the WordPress meta model. Sometimes, you’d be better off making a custom set of tables for your data. If you have to query against 7 different meta values and a taxonomy, then perhaps a custom post type is not the best way to store your data. … Read more
The problem is that the plugin uses a function available in WordPress 4.4 and you probably have a lower version. Now to get you out of trouble, you could use FTP to reach your site’s files, navigate to wp-content/plugins/ and rename the directory of the troublesome plugin. This would force it to be deactivated. Now … Read more
Your code is creating two divs for every post – a <div class=”container left”> and a <div class=”container right”>. One is empty each time, because you then check the $counter variable (which you’ve set to the post ID), and so only one of the divs ends up containing a post. Tom’s suggestion to use CSS … Read more
http://apis.google.com/js/plusone.js is not a script that a default WordPress install tries to load. It’s likely coming from your theme or a plugin that adds social sharing buttons to your site. Try disabling all plugins to see if the warning still occurs. Then, re-activate each plugin one by one to find the culprit.
Shortcodes need to return their values, but the_content() echoes the post content. So you have two options. First is to capture all output and then return it at the end: ob_start(); // Start capturing output; while( $loop->have_posts() ) { $loop->the_post(); the_content(); }; wp_reset_postdata(); return ob_get_clean(); // Return captured output; That will be the cleanest way … Read more
The else of the $change % 5 == 0 also runs when $change is a 1 and that is why the first post is displayed twice. You could fix it by changing <?php $change++ ?> <?php endif; ?> <?php if ( $change % 5 == 0 ) : ?> to <?php $change++ ?> <?php elseif … Read more
but this code makes the site loading time too big, and I don’t know why! I think that is just because you are getting quite a lot of stuff from the database with your code. Escpecially if your code runs on every single page load. Here’s my suggestions, Extra parameters to WP_Query to potentially make … Read more
OK this is the thing: I used a query $args = array( ‘post__in’ => array($userPostsInternal), Taking the fact the following is a string var_dump($userPostsInternal); -> string(13) “128537,128545” I thought declaring the array here would work array($userPostsInternal) But it’s not, therefore thanks to a comment, suggesting me to explode $userPostsInternal converting the string into an array, … Read more
the_post_thumbnail will echo it, You should Use get_the_post_thumbnail instead to return image.