New answers tagged

0

To add to what @brasofilo answered 3 years ago, this is what is necessary in the current menu system (WP v4.5.1). add_action( 'admin_head-edit-tags.php', 'modify_menu_highlight_wpse_43839' ); function modify_menu_highlight_wpse_43839() { if( 'post_tag' == $_GET['taxonomy'] ) { ?> <script type="text/javascript"> ...


2

The add_attachment action is fired when the wp_insert_attachment() function is called to add an item to the media library. Images are added to posts after going into the media library first. Even when adding via the post editor, items are added to the library with wp_insert_attachment() then to the post. add_action( 'add_attachment', xyz_my_function() { ...


2

In general I wouldn't recommend modifying the original uploaded image files, just in case we might need to re-generate intermediate sizes. But let's see if it's possible :-) We can in general let WordPress choose the image editor, that depends on modules like GD or Imagick, through: $editor = wp_get_image_editor( $file ); but this can return an WP_Error ...


0

There is a plugin called Resize Image After Upload: <?php /* Plugin Name: Resize Image After Upload Plugin URI: https://wordpress.org/plugins/resize-image-after-upload/ Description: Simple plugin to automatically resize uploaded images to within specified maximum width and height. Also has option to force recompression of JPEGs. Configuration options ...


0

This answer could help you: http://wordpress.stackexchange.com/a/69287/92649 You would need to upload your image at a higher resolution than "large" to have that effect, though


1

is there a way to update all media urls in wordpress I had a similar issue with my media files not having the correct file location after a Wordpress upgrade (somehow all the media links switched to a crazy incorrect directory), so I found Upload URL and Path Enabler which was able to rewrite all media URLs to a different path location where all my ...


0

In your wordpress dashboard go to settings > media and you can manipulate the dimensions for thumbnails and main images there. You can also change individual images to display as thumbnails or full size by going to said post or image, hovering on the image, click properties and set display to either thumbnail, large, fullsize etc.


1

You need to create attachment.php in your child theme. Please check here for more details.


0

// Its working on home page set the "paged" parameter (use 'page' if the query is on a static front page) <?php $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : '1'; $args = array ( 'nopaging' => false, 'paged' => $paged, 'posts_per_page' => '1', 'post_type' ...


0

First you need to include thickbox into your theme to use tb_show popup function include_thickbox_scripts() { // include the javascript wp_enqueue_script('thickbox', null, array('jquery')); // include the thickbox styles wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0'); } ...


0

If you just want to hide it from standard search engines (stop indexing) then one way I know is to use YOAST SEO plugin. Once you install and activate the plugin, go to the Edit Media page which you do not want to appear in search engine results, and update Meta Robots Index to noindex and Meta Robots Follow to nofollow. Please check screenshot below: ...


1

I think I may have the solution below :) Try adding this to your CSS file: @media screen and (max-width: 479px) { .sow-slider-base ul.sow-slider-images li.sow-slider-image.sow-slider-image-cover { background-image: url('http://www.thousandgirlsinitiative.org/wp-content/uploads/2016/04/Wendy-mobile.jpg') !important; } ...


0

The problem is due you having the styles associated to the element style property: <li class="sow-slider-image sow-slider-image-cover cycle-slide cycle-slide-active" style="height: 700px; position: absolute; top: 0px; left: 0px; z-index: 99; opacity: 1; display: block; visibility: visible; background-image: ...


2

You can get what you want via: function get_the_file_urls( ) { $query_media_urls = array( 'post_type' => 'attachment', 'post_status' => 'inherit', 'posts_per_page' => - 1, ); $query_urls = new WP_Query( $query_media_urls ); foreach ( $query_urls->posts as $url ) { ...


0

This is more of a bandaid, but it'll work for my project. I noticed this behavior seems to be related to the duration of my podcast exceeding an hour - and seems to be isolated to just mobile browsers. So, what I did was just hide the overflow (which may not work for everyone): /* MediaElement */ .mejs-container[style] { overflow: hidden !important; } ...



Top 50 recent answers are included