Thanks in advance
Matan.
This list it will display the author avatar, the autor name, the post title and the date of the post title.
The HTML structure is below:
<ul>
<li>
<img src="AVATAR"/>
<h6>[author name] at [post date]</h6>
<a href="#" title="rrrr">[post title]</a>
</li>
</ul>
Help-me guys!
]]>How to show all category name that have today post?
Thank you..
]]>These reference custom post types should be displayed on a archive on the URL references/. I’ve created a custom template (template-reference.php) and a page called reference using this template. I don’t know if this is the best way for creating a archive – please advice me, if I could do it different.
On the archive, the reference custom post types should be ordered first by the taxonomy and next the menu order. First showing all web references and next all print references.
In the template-reference.php file, my query looks like this:
$my_query = new WP_Query('post_type=reference&orderby=menu_order&order=ASC');
This will only sort the references by the menu_order – but I would like to group them in the different taxonomy, as explained before. How can I do that?
I’m wondering, if I first, in some way, could get a list of all the created taxonomies and then do the query for each taxonomies. But I don’t know how to do that.
I hope someone could help me. Please tell me, if you don’t understand the situation.
]]>I created a custom category page template. On this template, I want to list the 3 sub categories. Then, under each sub category, I want to list the posts that are filed under them. So, it would look like:
Parent
-Sub Category 1
–Post 1
–Post 2
-Sub Category 2
–Post 1
–Post 2
-Sub Category 3
–Post 1
–Post 2
How can I do this?
Thanks
]]><?php
/**
* Template Name: Page for the tutorials
*
* Selectable from a dropdown menu on the edit page screen.
*/
?>
<?php get_header(); ?>
<div id="container">
<div id="content">
<?php
$type = 'tutorial';
$args=array(
'post_type' => $type,
'post_status' => 'publish',
'paged' => $paged,
'posts_per_page' => 10,
'caller_get_posts'=> 1
);
$temp = $wp_query; // assign orginal query to temp variable for later use
$wp_query = null;
$wp_query = new WP_Query($args);
?>
<?php
get_template_part( 'loop', 'index' );?>
</div><!-- #content -->
</div><!-- #container -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
However, I do not know on how to display the taxonomies there, for my custom post type. I got it to work before by using this type of code, and that worked awesome as well, except for the fact that the metadata (posted in, by author etc.) wasn’t displayed.
<?php
/*
Template Name: Tutorials
*/
?>
<?php get_header(); ?>
<div id="container">
<div id="content">
<?php
$tutorial = new WP_Query( array( 'post_type' => 'tutorial', 'posts_per_page' => 10, 'orderby' => 'rand' ) );
while ( $tutorial->have_posts() ) : $tutorial->the_post();
the_title( '<h2><a href="' . get_permalink() . '" >', '</a></h2>' );
?>
<div class="entry-content">
<?php the_content(); ?>
<?php echo get_the_term_list( $post->ID, 'language', '<p>Language: ', ', ', '</p>' ); ?>
</div>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #container -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Also I’d like to know how to get the CPT’s displayed within the loop. Justin Tadlock’s recipe for that isn’t working anymore…
add_filter('pre_get_posts','my_get_posts');
function my_get_posts($query ){
if ( is_home())
$query->set('post_type', array('post', 'page', 'album', 'movie', 'quote', 'attachment'));
return $query;
Thanks a lot!
[sig moderated]
]]>This is the code I use:
function related_mess() {
$relation = get_the_term_list( $post->ID, 'relations',' ', ', ', '' );
if(!empty($relation)) { ?>
<div stuff>
<?php $rmquery = new WP_query(array('relations' => $relation, 'showposts' =>10, 'post__not_in' => array($exclude)));
while ( $rmquery->have_posts()) : $rmquery->the_post(); ?>
[do stuff]
I know where it goes wrong, it’s simply ‘relations’ => wants a string and doesn’t really get it. How do I fix this?
]]>So say you set up a new Taxonomie and you then query all posts with that particular tag?
Can it be done?
Cheers
]]>is there any way that i can show random category list in my post bottom side
What do I do?
thanks
]]>