how to keep same archive.php template for post from archive?
-
Hi everybody,
I have create a new template for my archive ( using archive.php);
however, when I click to the post from my archive list, it keep the same layout of the single_post,
I’d like the post open from the archive to keep the same layout of this archive.php
Do you know what has to be the process to realize this ?
?php global $wp_query; $args = array_merge( $wp_query->query_vars, array( 'meta_key' => 'super_post_views', 'orderby' => 'meta_value_num', 'posts_per_page' => 4 ) ); /*, 'tag' => featured*/ query_posts( $args ); $i=0; while(have_posts()): the_post(); ?>
this code is one part of the new layout from the archive.php
I suppose it must be link from this line:
while(have_posts()): the_post();
and call a new single_post template, I don’t really know, what do you suggest ?
I’ve also created a new archive_template by the function:
add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'archive_post', array( 'labels' => array( 'name' => __( 'archive_post' ), 'singular_name' => __( 'archive_post' ) ), 'public' => true, 'has_archive' => true, ) ); }
but it doenst link it :s
Thank you for your time ??
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘how to keep same archive.php template for post from archive?’ is closed to new replies.