Tag Info

New answers tagged

0

You don't need to pass an array to the function if you want Post Thumbnails everywhere. Just pass the function without arguments: add_theme_support( 'post-thumbnails' ); Maybe you just need to change the post options. On the top right corner of the "edit post/edit page" page you have a button called "Options". There you can choose different areas to show ...


0

The Syntax is defined as <?php echo get_the_post_thumbnail( $post_id, $size, $attr ); ?> You can get default wordpress thumbnail size (150X150) by following code <?php get_the_post_thumbnail( $post_id, 'thumbnail' ); ?> If you want a custom size thumbnail, then use bellow code : <?php get_the_post_thumbnail( $post_id, array( 200, 200) ...


0

Hey First add this line into your function.php file add_image_size( 'custom-size', 120, 140 ); Then call custom-size like this <?php $thumb_id = get_post_thumbnail_id( $id ); if ( '' != $thumb_id ) { $thumb_url = wp_get_attachment_image_src( $thumb_id, 'custom-size', true ); $image = ...


0

You can try using the wp_get_attachment_src() $thumb_id = get_post_thumbnail_id($post[$i]['id']); $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true); $post[$i]['thumbnail'] = $thumb_url_array[0]; In the above code, wp_get_attachment_image_src() returns an array with image src, height and width, $thumb_url_array[0] is your ...


0

A little late to this party but it seems the OP wants to (1) prevent these WP Selfies from recurring and (2) remove existing WP Selfies. Here is a great filter to prevent it from happening in the future: http://andrewnorcross.com/tutorials/stop-hyperlinking-images/. And I just posted a snippet that removes existing self linking images here: ...


0

I think you'd need to get the actual page object and find the ID from there. Then, you can pass that ID to the_post_thumbnail(), otherwise I think the ID of a post in the loop will be used, not the actual home page. Try this $page_object = get_queried_object(); to get info about your home page.


-2

You are probably missing ImageMagick (PHP extension). Install it and the JPG artifacts will be gone.


0

This should do the trick. The filter will check for images and removes the a (link) tag. Just add it to your theme's functions.php: add_filter( 'the_content', 'attachment_image_link_remove_filter' ); function attachment_image_link_remove_filter( $content ) { $content = preg_replace( array('{<a(.*?)(wp-att|wp-content/uploads)[^>]*><img}', ...


0

When inserting the image via the »Media Library« Modal, after clicking »Add Media«, select »None« for »Link To« under »Attachment Display Settings« section. To remove it for already linked images, click on the image and then press the »Remove link« button.


0

The bloginfo() function outputs immediately. since you're storing to a $variable you'll want to use get_bloginfo() instead. also, you're missing a concatenation. $large_image_url = get_bloginfo('template_directory') . '/library/images/default-header-image.jpg';


0

While looking at some code for another issue I had a lightbulb went off in my head and brought me back to this problem. So after several tries at it I came up with this... function add_image_to_feed( $thumbz){ if( is_feed() ){ $def_thmb = get_post_meta( get_the_ID(),'def_thmb',true); $subPath = tube_sub_dir_path(get_the_ID()); $upload_dir ...


0

After trying to ask help from others, I got my solution and here I am sharing that below. First there is no use of 'in_same_cat' => false, in upper code and second get_next_post(true);, get_previous_post(true); is used to show next/prev post from current post categories but if you want to show all posts in next/prev then you have to use only ...


0

Lazy Load really does not require no coding, you can use the Lazy Load plugin (just activate it). I also suggest providing different thumbnail sizes on the basis of the required dimension for the position (and you could even deliver them differently on the basis of the screen size, if you wish, to allow rensponsive themes work well). Other ideas can be ...



Top 50 recent answers are included