Tag Info

Hot answers tagged

4

if you set image size in function.php as a "gallery" add_image_size( 'gallery', 200, 120, true ); you can remove width and height of specific image size such as "gallery": add_filter('wp_get_attachment_link', 'remove_img_width_height', 10, 4); function remove_img_width_height( $html, $post_id, $post_image_id,$post_thumbnail) { if ...


3

There is no plugin to remove anchor tags with that url ( atleast I don't know any ), but you can replace the url with this plugin http://wordpress.org/plugins/search-and-replace/


3

You can use the Search Regex plugin. This will allow you to create a regular expression to intelligently search and replace across all of your posts. After you activate the plugin, go to Tools, Search Regex. If you want to remove all links to http://example.com, here is one regular expression you could try: /<a ...


3

Maybe this works function remove_post() { if(isset($_POST['post_id']) && is_numeric($_POST['post_id'])) { $post = get_post($_POST['post_id']); if(get_current_user_id() == $post->post_author) { $args = array( 'post_parent' => $_POST['post_id'] ...


3

There's no filter that covers the entire output produced during wp_head(). You would have to use a fairly complicated process of output buffering starting before wp_head, then filtering out what you don't want afterwards, before releasing the buffer. Lets assume that you're dealing with plugins that have registered their scripts properly> Try adding this to ...


3

You could redirect anything that's not a page or admin to home via the parse_query action: function wpa_parse_query( $query ){ if( ! is_admin() && ! $query->is_page() ) { wp_redirect( home_url() ); exit; } } add_action( 'parse_query', 'wpa_parse_query' ); If it's not an admin screen or a query for a page, it'll redirect. ...


3

There is the plugin Unwanted Plugins Remover now. It will remove the plugins Akismet and Hello Dolly on every upgrade. You can filter the plugin list to match only one of those plugins or to add more. From the code: $this->unwanted_plugins = apply_filters( 'unwanted_plugins_list', array( 'akismet/akismet.php', 'hello.php' ) );


2

Goto Settings->Media->Auto-embeds->Uncheck the box( When possible, embed the media content from a URL directly onto the page).Hit save and problem solved.This is the Permanent way.:)


2

I tested this and it works for removing the categories dropdown on the All Posts page: add_action( 'load-edit.php', 'no_category_dropdown' ); function no_category_dropdown() { add_filter( 'wp_dropdown_cats', '__return_false' ); } -- below: old answer when I misunderstood the question -- The code you posted works just fine for me. But here's an ...


2

Joost de Valk's WordPress SEO plugin is capable of disabling most, if not all, archives you mention:


1

I think the select elements are passed through the wp_dropdown_cats filter. So you should be able to add a filter to that which returns a blank string.


1

How about a plugin that effectively "clicks" the none button for you automatically? Check out "Remove Link URL" which removes the link by default but still allows it to be added back


1

Just use the built-in exporter/importer. Export from the existing site, and import into the new site. You won't ever even need to touch the database.


1

You're missing part of your post <div> Look through your loop and you'll see something that's not closed or something. It will more than likely look like this <?php the_ID(); ?>" <?php post_class(); ?>> When it needs to be something like <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> Hope that helps.


1

You just need to write a delete avatar function that gets the location of the file and deletes it using the php unlink function. The following code can be used as an example of how it's done. I use this to delete the old user avatars when a user uploads a new one. It is also used to replace default avatars that were once stored in a custom directory from ...


1

Here's a tutorial on how to export / import your WordPress database and run the queries you'll need so the new site works: http://web-kreation.com/tutorials/migrating-a-wordpress-site-ftp-phpmyadmin-and-sql-queries/ If you just want a local environment so you can play around with themes, this is a good tutorial for setting that up on your Mac: ...


1

You can use wp_deregister_style() and wp_deregister_script() to clean up overly aggressive Plugin script/style injections. For example, here's how I "optimize" Contact Form 7's style/script injections: // Optimize Contact Form 7 function deregister_cf7_js() { if ( ! is_page( 'contact' ) ) { wp_deregister_script( 'contact-form-7' ); } } ...


1

Mike had covered killing Dolly in one of his answers, but that was written for initial install script. I've tried to follow code that upgrades core to find a fitting hook, but that is quite a maze with some upgrader classes I am not acquainted with yet.



Only top voted, non community-wiki answers of a minimum length are eligible