How to replace all images in all posts and pages with a different size?
i think the best way to alter images is through css. you add a class to all your pictures that would set its size into your custom size. I think bootstrap has that feature
i think the best way to alter images is through css. you add a class to all your pictures that would set its size into your custom size. I think bootstrap has that feature
Show child theme for users on specific IP
If you want to add a class before each widget you should use the dynamic_sidebar_params filter. Another post explains this well. Here’s the gist of it. function uft_add_nocontent_class($params) { $params[0][‘before_widget’] = ‘<aside id=”%1$s” class=”widget %2$s nocontent”>’; return $params; } add_filter(‘dynamic_sidebar_params’, ‘uft_add_nocontent_class’); Otherwise, go and edit your child theme files. If you don’t have a lot … Read more
Sorry folks – for those curious, I had already solved this later on in my functions.php file and forgot to turn this filter off (silly). Here’s the better solution if anyone cares to comment or improve. Basically, I’m filtering out content based on user role (I have a custom user role as well) so that … Read more
the system was apparently, recently updated from a very old version of WP core. there was a customization around taxonomy suppression and the pre_get_posts hook which didn’t also consider is_admin()
I was able to solve this by using str_replace. function mp_filter_download( $result ) { $search=”<div style=”clear:both;”></div>”; $replacewith=” “; return str_replace( $search, $replacewith, $result ); } add_filter( ‘downloads_shortcode’, ‘mp_filter_download’, 10, 2 );
You would probably get at least equally good performance by simply adding the classes with a filter, and it is certainly neater and closer to the way the WordPress is meant to be modified: function add_classes_wpse_190966($classes) { if (in_array(‘current-menu-parent’,$classes)) { $classes[] = ‘active’; } return $classes; } add_filter(‘nav_menu_css_class’,’add_classes_wpse_190966′); Or, with an array of values: function … Read more
The solutions seems to be (found in /wp-includes/class-wp-editor): add_filter(‘the_editor_content’, ‘YourFunctionName’);
Try this: <div class=”my-metabox”> <!– This is your metabox HTML –> <– Add this button somewhere: –> <button id=”my-submit” class=”button button-primary button-large”>Submit</button> </div> Add this JavaScript snippet however you want only to this screen (either by checking the post type and enqueue this in the admin footer or output it directly along with your metabox … Read more
Have you looked at using add_image_size? Check it out here. It will allow you to crop images various ways. It will also allow you to use the standard the_post_thumbnail and pass it your custom image size when you go to output this on the front-end. I also just noticed that you said inside the content. … Read more