How do I get all attachments that are used in the current post, not just the children?
How do I get all attachments that are used in the current post, not just the children?
How do I get all attachments that are used in the current post, not just the children?
I see a couple of things. First your missing the closing bracket for your js function. Also, in WP you need to use jQuery() rather than $() for jQuery calls. Finally, make sure your script is inside a jQuery(document).ready(function() { });block.
works_secondary-image_thumbnail_html is not a WordPress core hook, so your code never executes. As long as images are displayed on your site by calling wp_get_attachment_image in your theme, you can add to the attributes by hooking into wp_get_attachment_image_attributes: add_filter( ‘wp_get_attachment_image_attributes’, ‘wpse_235266_image_attributes’, 10, 3 ); function wpse_235266_image_attributes( $attr, $attachment, $size ) { $attr[‘itemprop’] = ‘image’; return $attr; … Read more
You have to uncheck Prevent caching of objects after settings change in the Browser caching settings of the W3 Total Cache plugin. This will remove the query string from media (image, video, etc.) URLs. But in this case, media files will remain cached by the visitor’s browser until the browser cache will be emptied or … Read more
Based on your question, it’s hard to exactly determine when you say: …I add an image I can’t see it above the post title… Also, considering that you said this is your first wordPress site, I am going to assume you added the in within your Post and not set it as a Featured Image … Read more
We lack context, but remember that CSS files are read from top to bottom, the lower definitions having priority over the top ones. The same logic applies within the file. That is why the !important attribute is used for. That being said, in your case you could have A caching plugin that loads a cached … Read more
There are no built in functions to size-up an image. You might be able to accomplish what you are looking for by using wp_get_attachment_metadata and an Image processor like GD or Imagegick if your host supports it. Normally at least one of them is supported. So wp_get_attachment_metadata returns an array on success or bool false … Read more
If I read your question well, you already use WordPress Custom Logo, but you want a different logo on your front page. This means you will need to upload a separate image. Assuming you already know how to use the customizer in general you will need to build an upload field like this: $wp_customize->add_control( new … Read more
So when you regenerated the thumbnails, did you use a plugin like: WordPress Regenerate Thumbnails plugin. Or did you make them in some other fashion? I’ve used this plugin before and it seemed to work for me. Another possible way to do this is with making a style modification in your style.css file. You can … Read more
Get size of smaller image version