get_pages gives wrong ID for blogpage

No, the blog page is just a regular page, it has no special ID number and it can be anything. The only special thing about a blog page is that it was assigned to use as a “blog” page and you can check for its ID value in one of the options.

Custom post page has attributes of latest post [closed]

I believe you are talking about the blog page, the page you set as posts page when you select a static front page. Many functionality like breadcrumbs relies on the $post global. By default, if nothing breaks the $post global, before the loop, the $post global should always hold the first post in the main … Read more

WordPress loop: Display if posts exist

You can use the has_tag function in a conditional statement to achieve what you want. Take a look at the codex page here: Function Reference/has tag. This isn’t 100% tailored to your specific question, but you should see how it’s working and adjust for your specific task: <?php if( has_tag() ) { ?> <?php query_posts( … Read more

Query specific posts from parent by slug rather ID

there are two WordPress functions you could try: http://codex.wordpress.org/Function_Reference/get_page_by_title (as suggested by @t31os in the comments to your quoted link) http://codex.wordpress.org/Function_Reference/get_page_by_path if you have already tried them, please describe how these failed to do what you want.

Get custom field from page, in a post?

I would suggest a different approach. The option for manually adding post excerpt should go in a theme option as opposed to a custom field. Also you should use this hook for modifying the excerpt’s more text http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_more If the user is supposed to enter custom excerpt on a per-post basis, they can do it … Read more

get USER ID in functions.php using user_register action

You are giving $wpdb->get_results a string for its second parameter. It should be a constant– ARRAY_N— meaning you need to remove the quotes $getunion = $wpdb->get_results( “SELECT value from wp_bp_xprofile_data where user_id = $getid AND field_id = 4”, ARRAY_N ); Since you claim it works in the second instance, I am assuming $wpdb compensates, but … Read more

Display 1 category only with get_the_category (by ID or slug)

I think you could do something like this: $categories = get_the_category(); $displayed_category_id = 1; // set this to the category ID you want to show $output=””; if($categories){ foreach($categories as $category) { if ( $displayed_category_id == $category->term_id) { $output .= ‘<a href=”‘.get_category_link($category->term_id ).'” title=”‘ . esc_attr( sprintf( __( “View all posts in %s” ), $category->name ) … Read more

unused post IDs

You can stop WP creating revisions by adding the following to your wp-config.php: define(‘WP_POST_REVISIONS’, false ); You can replace false with an integer if you just want to restrict the number a maximum number of revisions. If you check the plugin directory you’ll find several that will clean up old revisions, such as this one. … Read more