New answers tagged

0

If you are using Wordpress version 4.5 or greater, you can take advantage of the built-in MySQL function RAND(n) along with its seed value. As long as you pass the same n on each query, you will get the same set of random posts. As an example: $randomN = 123456; $posts = get_posts(array( //... arguments here 'orderby' => "rand($randomN)" )); ...


1

You can use output buffering to get the template output and return it in place of the emptied shortcode content: if ($pos !== false) ob_start; get_template_part('content-gallery.php'); $contentgallery = ob_get_contents(); ob_end_clean(); return substr_replace( $content, $contentgallery, $pos, strlen($shortcode[0]) );` } EDIT It might ...


0

Dont mess with all this. Just go to the wordpress dashboard > Media, delete the titles from each picture. Done.


0

I think the best solution for this is the plugin Real Media Library: http://codecanyon.net/item/wp-real-media-library-media-categories-folders/13155134 It can organize the media library with folders. The words of the product description says all: Turn your WordPress media library to the next level with folders / categories. Get organized with thousands ...


0

Turns out the editor was hidden using advanced custom fields plugin.


0

Here's the fix. All the attachment info is now being called inside the php using wp_prepare_attachment_for_js and the info will load for each image in the loop, to display in the photo gallery. It works now. <?php $the_query = new WP_Query(array( 'post_type' => 'attachment', 'post_status' => 'inherit', 'category_name' => 'arch' ...


0

Sprintf is a way to use variables within a string easily. %d designates a digit and %s is any string. So think of it like this sprintf( '<div class="%s">%s</div>', $var1, $var2 ); So for your example, you'd need something like: $output = sprintf( '<div class="gallery gallery-columns-%s" itemprop="image" itemscope ...



Top 50 recent answers are included