Tag Info

New answers tagged

0

I assume this has been resolved. Below is what I see in Chrome. <div class="span7"> <p><img class="alignleft" src="http://dev.connectshow.com/wp-content/uploads/2015/05/ad1.jpg" /><br /> <img class="alignright" src="http://dev.connectshow.com/wp-content/uploads/2015/05/ad2.jpg" /></p>


0

there is a way but for post but i guess it will work also for images. //Set Post Views function observePostViews($postID) { $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ $count = 0; delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); }else{ $count++; update_post_meta($postID, ...


0

There is no default way to show view count for Wordpress post/page/attachment. You have to implement that yourself. One possible way is to store the view count in post meta and increment that value each time a post/page/attachment is viewed by users.


0

As said before in the comment, besides as @CristineCooper said the image quality and as @shanebp said the stretching issue, using ImageMagick - has to be available at your server - instead of GD gives generally better image quality results.


0

For all my answers I'm assuming you both have the legal rights to use those images and are aware of any implications of duplicate content (SEO etc). That being said there are definitely ways. At what point would you like to scrape images? Regularly? If so look into WP_Cron and automate it. If you just want to scrape the image once you generate a new post, ...


0

I've found some examples of using regular expressions to add some classes to the HTML. This works for me: add_filter('image_send_to_editor', 'add_class_to_image', 10, 8); with the following function: function add_class_to_image($html, $id, $caption, $title, $align, $url, $size, $alt='') { $classes_to_add = 'media-img'; if (preg_match('/<a.? ...


2

I found a solution based on the code of this page: https://core.trac.wordpress.org/ticket/22180 All attachment files have a post status of 'inherit'. So first you need to add "inherit" as one of the possible post status to search for. You can use the wp_link_query_args filter to do that. function my_wp_link_query_args( $query ) { if (is_admin()){ ...


1

It depends on your image and stylesheet location. But this is the syntax: .theme-image { background-image: url('../images/header-img.jpg'); } The above code is for the structure wp-content - themes - your-theme - images - header-img.jpg - css - style.css You are making the browser come one directory before and search for images ...


0

If you are talking about a featured image on each post, the wordpress hook is the_post_thumbnail(); You may be able to find that on the template you are working with and remove it? Images embedded in posts or pages would be different. https://codex.wordpress.org/Function_Reference/the_post_thumbnail


0

to prevent WordPress from making the additional sizes for certain images only, you would have to have a way to indicate that an image you are ABOUT TO upload will be used only for a particular purpose. this must happen BEFORE you uploaded it. since there is no such interface (out-of-the-box) to indicate such options during an upload action, then you cannot ...


0

It means that you want to load that image on post right... place the below code where you want images <?php $post_id = 75; $thumbnail_id = 112; if(!empty(get_the_title($thumbnail_id))){ echo '<img src="img.jpg" title="'.get_the_title($thumbnail_id).'" />'; } else{ echo '<img src="img.jpg" title="'.get_the_title($post_id).'" />'; } ...


1

Some of your images are png: http://www.shoplikeits1999.com/wp-content/uploads/2015/02/Harvest_Moon_64_Coverart.png And that image not 460px by 300px and is being stretched to fit the grid. I would guess that you need to be more careful in which images you upload and how you process the images prior to uploading.


0

This could be a number of things, but very likely, you have a function either in your functions.php or plugin folder that sets the compression percentage of JPEG files (affects all of your image sizes beside full) For testing, in your functions.php file, set the JPEG compression to full (100%): function jpeg_quality_callback($arg) { return (int)100; } ...


2

You can try the following test plugin, that uses the domDocument class, to see how it works on your HTML. It assumes PHP 5.4+ with LibXML 2.7.8+. <?php /** * Plugin Name: Add Missing Image Title Attributes * Description: For posts in the main loop (Assumes PHP 5.4+ with LibXML 2.7.8+) * Plugin URI: http://wordpress.stackexchange.com/a/188560/26350 ...


0

It is possible as referenced here but you are talking about a great deal of customization in the Gravity forms plugin and like you said you are not a programmer yourself, so you better open a support ticket in their forums and they might be able to help. Also look at this code that can help you if you decide to do it yourself $upload_dir = ...


0

first of all add theme support for post-thumbnails with the following "function.php" add_theme_support( 'post-thumbnails' ); then add image size with the following code "function.php" add_image_size( 'portfolio', 600, 600, true ); use both of these inside a function which you have to hook into add_action( 'after_setup_theme', 'prefix_theme_setup' ); ...


0

It's informative to check out Really Simple Syndication Best Practices Profile . About the <item> tag: An item MAY contain the following child elements: author, category, comments, description, enclosure, guid, link, pubDate, source and title. All of these elements are OPTIONAL but an item MUST contain either a title or description. About ...


1

Good news for WordPress versions 4.2+ Since version 4.2 the handy get_avatar_url() function, introduced as a feature request in ticket #21195 few years ago, now ships with the core: /** * Retrieve the avatar URL. * * @since 4.2.0 * * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash, * ...


0

Does the image title attribute actually have to be in the database? If it's only the matter of displaying text, for example in the photo gallery, would't using a jQuery function serve your purpose? Something like: $(document).ready(function() { $('img').each(function() { if ($(this).attr('title') === undefined) { var title = $('h1').text(); ...


1

I'm afraid it's not possible to do it without any plugin. Author's image (gravatar) is not published in RSS, and it's computed based on author's e-mail address, which also is not published in RSS... But if you have control over both of these sites, then you could use JSON API/XML RPC to get the newest blog posts - then you could get all info from these ...


1

If we can assume that this is done properly for images that are in templates, and you're only concerned about page/post body content, you could use a filter when saving any post or page ( https://codex.wordpress.org/Plugin_API/Action_Reference/save_post ) to scan the content Since this action is triggered right after the post has been saved, you can ...


0

There is no default way to do this, but this popular plugin solves the issue for most people. I have no connection to the creators of this free plugin, but I've used it on several sites. https://wordpress.org/plugins/enable-media-replace/


1

Multiple solutions for defining the images -> Post Thumbnails While creating a new post, you can set the Featured Image which will automatically set the post image. Since your image is full width, you need to set the size of the thumbnail using: https://codex.wordpress.org/Function_Reference/the_post_thumbnail Media Upload Go to Media -> Add New. ...


0

I think it is possible with custom fields. Add a custom fields, for example, named link. Put the link into the value field. Then you will be able to access it something like that: <a href="<?php echo get_post_meta( get_the_ID(), 'link', true ); ?>"> <?php the_post_thumbnail(); ?> </a>


3

No need for post IDs what has no thumbnail. Use meta query to get only those what has thumbnail. Add meta query function get_only_posts_with_images( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'meta_query', array( array( 'key' => '_thumbnail_id' ) ) ); } } add_action( 'pre_get_posts', ...


0

Hi – i had a similar problem. Woocommerce uses catalogue images for catalogue and related product images. That is not ideal, for you loose either image quality or speed. So i tried to add a fourth image category for my related products. Howdy McGee has solved the problem. Please take a look at Howdy McGees answer: Modify Related Product Image Sizes: read ...


0

Solved (edit: May 7, 2015) A while ago I deleted header('Content-Type: image/png'); and it magically works. I used to use comments (//header('Content-Type: image/png');) to disable it, but that didn't seem to do the trick.


0

I figured out the problem: the SEO plugin by Yoast is breaking the images as described, doing (probably) a URL rewrite at the time the media is upload. I resolved temporarily bye disabling the plugin. I will then find a better solution analyzing why the plugin is behaving in such a way and update my answer.


0

My advice is to make the whole site https. Either add https to the settings -> wordpress address & settings -> site address or remove https if it appears in either of those inputs. For securing admin login panel only: easy method but doesn't show secure icon. right result but more steps to consider method.


0

Found out that the answer was these two functions: https://codex.wordpress.org/Function_Reference/wp_generate_attachment_metadata https://codex.wordpress.org/Function_Reference/wp_update_attachment_metadata


1

There is a simple solution for this. Let the gallery use the 5 column grid system and using the @media-queries we can alter it for tablet and mobile. I just tested it on your given URL and it works perfect. But try to remove any custom codes you have used before since I had to remove it in order to use the following code. /* For displaying 3 columns on ...


0

So there are several ways images can be "related" to post: When you upload image in post context that post is set as its parent (that is parent field of image attachments post has post's ID). When you set image as a featured on a post (or use similar functionality from custom fields frameworks) the post records image attachment's ID in it its meta. When ...


0

I'm not sure why this old question is suddenly showing up on the homepage, but, video embeds are now innately supported by Wordpress core. I haven't done much with frontend submission, but do any of the frontend submission plugins now work with this inately as well?



Top 50 recent answers are included