Adding a filter to wp_edit_posts_query() to prevent hierarchical display of pages

I don’t think it can be done that way, in class-wp-posts-list-table.php I found this line $this->hierarchical_display = ( $post_type_object->hierarchical && ‘menu_order title’ == $wp_query->query[‘orderby’] ); It’s not filtered and it directly depends on the unfilterable attribute “is hierarchical” and the post order set in the admin interface (edit.php). What you can do is to try … Read more

New rewrite rules for custom taxonomy and reuse default

Note that the url-rewriting doesn’t directly determine the template used. A pretty url is interpreted as a query and then that query determines what template is used based on the template hierarchy. So only need one rule: example.com/localdeals/myterm => example.com/?location=myterm WordPress will look for the template taxonomy-location-myterm.php and use that (if it exists) or otherwise … Read more

Blogroll entry generates hundreds of ‘Links to Your Site’ in Google Webmaster Tools for the linked site

I found the answer in a simple plugin called ‘Nofollow Blogroll SEO’: http://wordpress.org/extend/plugins/nofollow-blogroll-seo/ This plugin has no settings. It simply adds ‘rel=nofollow’ to all your blogroll links, unless the blogroll is being shown on the home page. Perfect! Here’s some information from Google about how they handle ‘nofollow’ links: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=96569

retrieve post slug by post_tags taxonomy

i am not sure but try this: query_posts(‘category_name=”. $category[0]->cat_name); if (have_posts()) : while (have_posts()) : the_post(); $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { $all_tags_arr[] = array($tag->name,wp_basename(get_permalink())); } } endwhile; endif; foreach ($all_tags_arr as $cat_by_tag) { $output_promotion .= “<li><a href=”‘ . get_bloginfo(‘url’). “https://wordpress.stackexchange.com/” . $cat_by_tag[1] . “https://wordpress.stackexchange.com/”>’. $cat_by_tag[0] .'</a></li>’; } print_r($output_promotion);

Automatic adding thumbnail to post

This should work: $wp_upload_dir = wp_upload_dir(); $fileurl = “http://damianc.pl/th.jpg”; $filename = $upload_dir[‘path’] . DIRECTORY_SEPARATOR . basename( $fileurl ); if ( file_put_contents( $filename, file_get_contents( $fileurl ) ) ) { require_once(ABSPATH . ‘wp-admin/includes/image.php’); $wp_filetype = wp_check_filetype(basename($filename), null); $attachment = array( ‘post_mime_type’ => $wp_filetype[‘type’], ‘post_title’ => preg_replace(‘/\.[^.]+$/’, ”, basename($filename)), ‘post_content’ => ”, ‘post_status’ => ‘inherit’ ); $attach_id = … Read more

Vote It Up Plugin – Add ascending numbers to MostVotedAllTime Chart Function

Use this: function MostVotedAllTime_Widget() { $a = SortVotes(); //Before ?> <div class=”JibbleChart”> <div class=”title”>Most Recommended Albums</div> <?php $rows = 0; //Now does not include deleted posts $i = 0; while ($rows < get_option(‘voteiu_widgetcount’)) { if ($a[0][$i][0] != ”) { $postdat = get_post($a[0][$i][0]); if (!empty($postdat)) { $rows++; if (round($rows / 2) == ($rows / 2)) { … Read more

How to extend the page editor?

I think the batter way is to use plugin. Check this : http://wordpress.org/extend/plugins/search.php?q=form&sort= I personally suggest you Contact Form 7 Just past form plugin short code in your page/post , that’s it ! Cheers !