How to fetch posts that are stored in the different table than (default) wp_posts?

Don’t hack the Core. There are filters in WP_Query that should more than suffice to include your table, if your SQL and regex are good enough. posts_distinct – Alters SQL ‘DISTINCTROW’ clause to the query that returns the post array. posts_groupby – Alters SQL ‘GROUP BY’ clause of the query that returns the post array. … Read more

Internal linking to posts permalink fail because of spaces and stripe at postname

Spaces are invalid characters in URLs. Your links are broken, whether the posts exist or not and regardless of whether you want the spaces or not. And uppercase/lowercase can get you in trouble too. Some servers are case sensitive so if you have a permalink to http://somesite.com/hello-world a link like http://somesite.com/Hello-World might work or it … Read more

List latest posts with least comments in WP-Admin

I managed to figure it out. So, get_posts() uses WP_Query() and we can use the example in the documentation to filter the dates. Now for the comments, that is easy, we just add the parameter ‘orderby’=>’comment_count’. Also to note, when filtering get_posts(), we will need to disable suppress_filters. Let’s filter the time first: function filter_where( … Read more

Hide parts of the post content after typing it’s name or searching it by category

If you want to apply the same logic to the category archives and the search results as in that question you reference, the following should do it. // modified code from http://wordpress.stackexchange.com/a/97589/21376 function hide_on_home_page_wpse_97587($atts,$content) { if (!is_home() && !is_category() && !is_search() ) { return $content; } } add_shortcode(‘nohome’,’hide_on_home_page_wpse_97587′);

Display in category ( taxonomy) a number of post that I want

If I understand your question right you seem to have the code that seems close to what you want, but doesn’t function correctly. What I have trouble following is that your description talks about taxonomy archives, but your code seems to be about custom post type archives. I would suggest to use more appropriate query … Read more

How to embed custom HTML code with no plugins?

Sounds like you are using the Visual side of the editor. You need to use the Text side. Get it? Update: Preview won’t show embedded objects. Publish it privately if you absolutely must see it before anyone else, and need to see embedded bits like <object> tags. Update #2: Preview will show many embedded objects … Read more