Attachment image single page

Refer to the Template Hierarchy for attachment post types: `$mimetype.php $attachment.php single-attachment.php single.php index.php So for an image attachment, name your template file image.php. Then, to link to the single post view for an attachment, you would link to it like any other post: get_the_permalink( $postid ).

Authors’ Links on Homepage Not Going to Author Post Pages

The code below is the correct code, in several different PHP files. Currently need to know how to write it using the the_author_posts_link(); <p class=”postAuthor”>By <a href=”https://wordpress.stackexchange.com/questions/74001/<?php the_author_meta(“user_url’); ?>”><?php the_author(); ?></a></p> Just replace this: <a href=”https://wordpress.stackexchange.com/questions/74001/<?php the_author_meta(“user_url’); ?>”><?php the_author(); ?></a> With this: <?php the_author_posts_link(); ?> Alternately, you could use this: <a href=”https://wordpress.stackexchange.com/questions/74001/<?php echo get_author_posts_url(get_the_author_meta(“ID’ )); … Read more

Sidebar limiting to 10 posts?

Your problem is that you’re using query_posts(), when you need to be using WP_Query(). To display all posts (by ignoring pagination, use the posts_per_page parameter: $cat_query_args = array( // Include posts from category with ID $cat_id ‘cat’ => $cat_id, // Include all posts ‘posts_per_page’ => -1 ); $cat_query = new WP_Query( $cat_query_args ); if ( … Read more

Making a form for user to add new custom post with custom taxonomies and custom fields

To list the options for a custom taxonomy you need to query the taxonomy terms. To do that you use get_terms() http://codex.wordpress.org/Function_Reference/get_terms // We are assuming color is the name of the taxonomy $colors = get_terms( ‘color’, array( ‘orderby’ => ‘name’, ‘hide_empty’ => 0 )); // Now loop through the colors and spit out the … Read more