Remove hidden formatting when user paste text from MS Word into TinyMCE

I am interpreting the question to mean that you already have Word markup in your post and so you need to clean that up via PHP. If so… You can see the code that cleans up Word content here: http://core.trac.wordpress.org/browser/trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js#L375 That is Javascript. With some work, you could convert that to PHP. PHP Tidy, if … Read more

Replacing all attachment links in post with media file link

I found a nice snippet at this site for your functions.php that does the trick: add_shortcode( ‘gallery’, ‘file_gallery_shortcode’ ); function file_gallery_shortcode( $atts ) { $atts[‘link’] = ‘file’; return gallery_shortcode( $atts ); } I’d actually been looking unsuccessfully for the same thing, so I’m glad you asked.

Sort post by attributes ‘order’

Well, I’m afraid it won’t work this way. Let me explain why… In your wpzen_change_post_order function you check if $query->is_main_query(). To be precise, this checks, if given query is main query for current page – the query generated by WP to display default posts for current page. So if you create your own WP_Query object, … Read more

Getting the Next and Previous Posts Titles in the Sidebar?

The existing WordPress functions are only for displaying one previous or next post. I quickly wrote functions to display any number of posts. Paste the following in your theme functions.php file: function custom_get_adjacent_posts( $in_same_cat = false, $previous = true, $limit = 2 ) { global $post, $wpdb; $op = $previous ? ‘<‘ : ‘>’; if … Read more

blog posts sorting doesnt work while using get_query_var

If something unexpected happens between query_posts() and get_post(), it is probably a plugin that hooks into the query and modifies it. Try disabling all plugins to see whether the problem disappears. Re-enable them one by one until you see the problem, that is the plugin that causes it.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)