Custom Posts and Posts – next_post_link and previous_post_link not working together

You will need a filter on get_{$adjacent}_post_where to add your CPT. function alter_adj_where_wpse_106694($where) { $where = str_replace(“p.post_type=”post””,”p.post_type IN (‘post’,’yourcpt’)”,$where); return $where; } add_filter(‘get_next_post_where’, ‘alter_adj_where_wpse_106694’ ); add_filter(‘get_previous_post_where’, ‘alter_adj_where_wpse_106694’ ); There is no flexibility to that callback. It is a simple string replace. If this is your site you should be OK, but if this is a … Read more

Get Users Post ID

I am surprised that you didn’t find references to the two components that you need. These are both extremely common. $current_user = wp_get_current_user(); $query = new WP_Query( array ( ‘author’ => $current_user->ID, ‘posts_per_page’ => 1, ‘post_status’ => array(‘any’), ) ); var_dump($query); // debug Reference: http://codex.wordpress.org/Function_Reference/wp_get_current_user http://codex.wordpress.org/Class_Reference/WP_Query

If post does not exist, do something

If in your template you create a 404.php all not-found requests will be handled by this template file, and there you can put whatever you want. Just as example, in the 404.php file is possible to use something like (it’s just a draft): <?php get_header(); ?> <h3> <?php $slug = get_query_var(‘name’); if ( $slug ) … Read more

WordPress “Add new tag” button is not working

I’ve had similar problem, maybe it’s not js issue, but XML instead. Check if there are white spaces at end of the files involved ( after the PHP closing tag “?>”) Hope it helps! UPDATE maybe ajax cross domain issue ( 307 Temporary Redirect ) last chance: Set this entries on your .htaccess file SetEnvIf … Read more

Posts and order

What you are looking for is page-attributes support in the post type. However… ‘page-attributes’ (template and menu order) (hierarchical must be true) (the page template selector is only available for the page post type) … and posts are not hierarchical. I am not sure you can force them to be, never mind the potential issues … Read more

links to posts not working on homepage

If you want that the featured image is clickable replace: <?php the_post_thumbnail(); ?> with <a href=”https://wordpress.stackexchange.com/questions/108215/<?php the_permalink(); ?>” rel=”bookmark”><?php <?php the_post_thumbnail(); ?></a> For the title and date replace this: <h1 class=”entry-title”><?php the_title(); ?><br><small class=”time”><?php the_date(‘F j, Y’); ?></small></h1> whit this: <a href=”https://wordpress.stackexchange.com/questions/108215/<?php the_permalink(); ?>” rel=”bookmark”><h1 class=”entry-title”><?php the_title(); ?><br><small class=”time”><?php the_date(‘F j, Y’); ?></small></h1></a> Remove that … Read more