Get post meta retrieving wrong value

Please take some time to read the Codex. the_ID echos content. That means that the ID is never being passed to get_post_meta. It is just echoed in place. From the same Codex Page: Note: This function displays the ID of the post, to return the ID use get_the_ID(). So, use get_the_ID instead. Second problem… quote … Read more

How do I show posts from another wordpress installation?

Non-Multisite setup: You need to create another instance of the WPDB Class. $newWPDB = new wpdb(‘Username’,’password’,’database’,’localhost’); $rows = $newWPDB->get_results(“you-query-here”); On WordPress Multisite: Does having WordPress MultiSite make things a lot easier or should we stick with single installations? There is the switch_to_blog() function available. You will need to restore_current_blog() after getting your results. Note that … Read more

Number of displayed posts

The WordPress function get_posts() supports: ‘posts_per_page’ => 10, ‘numberposts’ => 10, so you should use: $projects = get_posts(array(‘post_type’ => ‘projects’, ‘numberposts’ => 10)); instead of $projects = get_posts(array(‘post_type’ => ‘projects’, ‘number posts’ => 10)); If you want to show all posts, you can use ‘posts_per_page’ => -1 You can read more about this in the … Read more

Display Posts with template on a Page

query_posts() is a horrible function and shouldn’t be used. Also it doesn’t has much to do with loading template, since it was originally designed to be used in template. Should not be used. If you are looking for logic of how WP picks template files from theme to load see Template Hierarchy. If you just … Read more

Query posts by Author and/or by Tag

Your first query is very strange. You seem to be mixing meta_query parameters with other WP_Query arguments. You can’t do that. author is not a valid component of a meta_query, neither is tag. The correct meta_query, if I am interpreting this right, wouldn’t even be a meta query. You are dealing with a taxonomy, a … Read more

static landing page leading to author specific pages w/ “live” content

As i see your code in header.php and index.php looking messy (because of many if conditions). If i’m understanding your problem then i do it like this create separate author.php for both authors their name like author-cait.php and author-shannons.php Give link like http://www.yousite.com/author/cait/ to button on static landing page.When user click on this,it takes him … Read more

Is there a query string for edit.php to show all posts that have no custom taxonomy terms?

Use a tax_query with a NOT IN operator. $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘sms_premium_posts’, ‘field’ => ‘slug’, ‘terms’ => ‘Premium’, ‘operator’ => ‘NOT IN’ ) ) ); $query = new WP_Query( $args ); Now, to make that work on the post edit page via a $_GET string something … Read more

Add Post As a menu Item

You can go to the admin end and to the Appearence->Menus and then add the post under the category menu. If you dont see the posts be3ing displayed on the left side of the page, click on screen options on top and then select posts and the list of posts will be displayed inb the … Read more