Tags to Post-ID mysql query. Tag Search

These are normal IN mechanics – it matches anything in set, not all of set combined. Type of match you want is called tag_slug__and in WP query arguments. You can see code that generates SQL for it in source of WP_Query->&get_posts() method. Resulting SQL is like this: SELECT p.ID FROM wp_posts p INNER JOIN wp_term_relationships … Read more

How to make the post summary taller?

You can either manually enter content into the_excerpt section or use this code in your functions.php file in your theme function custom_excerpt_length( $length ) { return 200; } add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 ); Change the number 200 to the number of characters you want until it’s the number of lines you’re looking for.

Lose “Blog Archive” from page title

I just realized that you’re talking about the browser “title” at the top; that wasn’t clear from your original post Go into your header.php and at the top look for this line <title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?> – <?php bloginfo(‘description’); ?> … Read more

How do I Show ALL posts for Catagories and Tags?

Try this (add to your theme’s functions.php): function my_unlimited_posts_list( $vars ) { if ( isset($vars[‘category_name’]) || isset($vars[‘tag’]) ) $vars[‘posts_per_page’] = -1; return $vars; } add_filter( ‘request’, ‘my_unlimited_posts_list’ );

post-page: reference to parent page?

You can do that: //add reff to query vars to hold the referring page ID add_filter(‘query_vars’, ‘my_query_vars’); function my_query_vars($vars) { // add movies_view to the valid list of variables $new_vars = array(‘reff’); $vars = $new_vars + $vars; return $vars; } then add ?reff=<?php echo $post->ID; ?> to your “post’s detail” link and on your “post-detail.php” … Read more

Exclude newest post from category X but show rest

A while back i posted a simple function that gets latest post in a certain category: function get_lastest_post_of_category($cat){ $args = array( ‘posts_per_page’ => 1, ‘order’=> ‘DESC’, ‘orderby’ => ‘date’, ‘category__in’ => (array)$cat); $post_is = get_posts( $args ); return $post_is[0]->ID; } So once you have that function you can use use WP_Query or query_posts and using … Read more

Show info to author only

Just compare display names: $currentuser = get_currentuserinfo(); if ( get_the_author() == $currentuser->displayname ) { // current user is the post author; do something } The get_the_author() function returns displayname, which should be able to be compared against the displayname parameter that is a part of the $currentuser object.