Category: Wordpress

How to Use Animated GIFs as WordPress Featured Images

How to Use Animated GIFs as WordPress Featured Images

When you upload an animated GIF to WordPress, it does all of it’s resizing magic to make the various thumbnail sizes (defaults are thumbnail, medium and large, in addition to the original full). When it does this, the resized versions lose their animation.

How to rename your WordPress wp-content directory

How to rename your WordPress wp-content directory

If you have been working with WordPress, you probably already know that all assets like images, stylesheets, themes, and plugins in WordPress are by default, stored under the /wp-content/ directory. But, do you know that we can actually change this folder name into something else, and yet it will still work?

The shortcode to display quantity of post comments

The shortcode to display quantity of post comments

function get_comments_quantity( $atts, $content = null ) { $atts = shortcode_atts( array( ‘postid’ => ”, ), $atts); $num_comments = get_comments_number( $atts[‘postid’] ); if ( comments_open() ) { if ( $num_comments == 0 ) { $comments = __(‘No Comments’, ‘rehub_framework’); } elseif ( $num_comments > 1 ) { $comments = $num_comments . __(‘ Comments’, ‘rehub_framework’); }…

Read More Read More

How to get a post thumbnailURL of a certain size

How to get a post thumbnailURL of a certain size

Input data: $post_id – ID of the post $size_thumb – e.g. array( 300, 300 ) or a standard / registered name like “middle” etc. function get_thumbnail_post_url( $post_id, $size_thumb ) { $image_id = get_post_thumbnail_id( $post_id ); $image_array = wp_get_attachment_image_src( $image_id, $size_thumb ); $image_url = $image_array[0]; return $image_url; } function thumbnail_post_url( $post_id, $size_thumb ) { echo get_thumbnail_post_url(…

Read More Read More

Inline
Inline