Make division in post_query?

MySQL can do math but can’t pass it through query_posts like that, or any WordPress’ post query functions, which depend upon WP_Query. They will literally look for a table/column named, in your case, “meta_value_num / date”. To do it in SQL I believe– aka., this is untested– you’d have to do something like this: SELECT … Read more

Change places custom fields with title field in post wp-admin

function wpse81499_move_postcustom_to_top() { if( ‘post’ != get_current_screen()->id ) return; ?> <script> jQuery(document).ready(function(){ jQuery(‘#postcustom’).prependTo(‘#titlediv’); }); </script> <?php } add_action( ‘admin_footer’, ‘wpse81499_move_postcustom_to_top’ );

How to filter categories of a post

have you tried something like, $post_categories = wp_get_post_categories( $post -> ID ); foreach($post_categories as $c){ $cat = get_category( $c ); if ( $cat->slug != “cat” ) { echo “$cat->name”; }; }

Commenting on a post from the admin panel?

This creates a custom meta box and the contents of the textarea field it contains are being saved as a comment to the post. Please note: Built with code sample adapted from the Codex. Relevant functions: add_meta_box and wp_insert_comment. I removed comment_author_IP and comment_agent from the insert comment arguments. Not sure of the consequences. Bug: … Read more

Custom Post Title as search term

If you register the post type with public set to true, the titles will be included automatically. You shouldn’t have to do anything to make this happen. Something as simple as this from the Codex: function codex_custom_init() { $args = array( ‘public’ => true, ‘label’ => ‘Books’ ); register_post_type( ‘book’, $args ); } add_action( ‘init’, … Read more

1 post, 2 templates

Your best bet would probably be the Rewrite Endpoints API. The API allows you to create post URLs with endpoints like lorem.com/post/133/json/ or lorem.com/post/133/print/. You’ll find useful code examples in the link provided.

Insert link to my thumbnail images

You may want to change your code to something like this: <a href=”https://wordpress.stackexchange.com/questions/83700/<?php the_permalink() ?>” class=”alignnone” title=”<?php the_title(); ?>”> <a href=”<?php the_permalink(); ?>” title=”<?php the_title();?>”> <?php if (has_post_thumbnail()) : ?> <?php the_post_thumbnail(); ?></a> <?php else : ?> <img src=”<?php bloginfo(‘template_url’); ?>/images/noimage.jpg” width=”213″ height=”187″ alt=””/> <?php endif; ?> </a> and I assume you’ve specified a Featured … Read more

include other content type post ID not working

try adding page like this on post type ‘post_type’ => array( ‘portfolio’, ‘page’ ) post_type can accept array… more of it here… http://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters

Remove read more

It sounds like your theme is using the_excerpt() instead of the_content() when displaying the post. If you want to display the full post you’ll need to edit your index.php file to use the_content() instead.

Show last post of employee in his profile page

You can use the following code to get the most recent post by a given Author, just un-comment one of the two lines as appropriate. See the Codex for more info on WP_Query. The Codex entry is pretty long, so scroll down to the Parameters section for more info on the various options you can … Read more

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