Numberposts 1 not cooperating in 3.5

What do you mean by “isn’t liking what I’m doing for some reason.”? What happens? Does it break or just not return the amount you expected? Is the second query working? As for the trick of stripping shortcodes it’s just as easy as: <?php echo strip_shortcodes( get_the_content() ); ?>

wp_get_attachment_link() add rel attribute if the link points to direct image

add_filter( ‘wp_get_attachment_link’, ‘sant_prettyadd’, 10, 6); function sant_prettyadd ($content, $id, $size, $permalink, $icon, $text) { if ($permalink) { return $content; } $content = preg_replace(“/<a/”,”<a rel=\”prettyPhoto[slides]\””,$content,1); return $content; } Update: function sant_prettyadd checks permalink argument. if the permalink = true then it returns the content as it is. if the permalink = false then it skips to … Read more

How to show the image caption on custom post type …?

You should be able to use the caption from post_excerpt of the WP_Post object. $the_imgs = get_custom_field(‘gallery_img:to_array’); foreach( $the_imgs as $img ) { list( $url, $width, $height ) = wp_get_attachment_image_src( $img, ‘thumbnail’ ); $img_post = get_post( $img ); echo ‘<img src=”‘ . $url . ‘” width=”‘ . $width . ‘” height=”‘ . $height . ‘”> … Read more

Slider do not add alt attribute. Cant get alt attribute from a media library!

When I test get_the_post_thumbnail (also the_post_thumbnail) on WordPress 3.5.1, the alt attribute is added as it should be. If you look at the source, you will see that get_the_post_thumbnail uses wp_get_attachment_image which does add that alt attribute. By default, that attribute is the image file name but it can be edited from wp-admin->Media to be … Read more

Changing layout of defaul gallery output to masonry

try it like this: $.each($(‘.gallery img’), function () { var rndmnum = Math.floor((Math.random()*11)+1); rndmnum = rndmnum *20 + 260; $(this).css({ ‘max-width’ : rndmnum }); }); note: untested sources: https://stackoverflow.com/questions/8904707/javascript-random-number-between-15-and-225-increments-of-30 https://stackoverflow.com/questions/8733838/random-max-width-for-each-image-on-a-page edit: corrected calculation

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)