Okay right here we go. I’ve 2 totally different {custom} publish sorts. The primary is named ‘portfolio’, the second ‘video games’.
All the sport opinions I write are ‘video games’ posts. To have a greater overview I created {custom} classes like opinions, ps xbox and so on. Sadly everytime I want to show the posts of 1 categorie (http://www.zock-around-the-clock.com/games_category/testcategory) I simply get an 404 Error Web page.
I dont actually use the ‘portfolio’ posts however with them the arrengement into classes would work simply completely. (http://www.zock-around-the-clock.com/portfolio-view/testcategory).
I want to ask you what’s the distinction between these two sorts and why is it working with the portfolio posts however not with the video games posts.
I additionally tried including regular classes into the video games posts by including 'taxonomies' => array('class'),
however sadly it’s nonetheless not attainable to show the video games posts of a single class.
This is the single-portfolio.php
<?php get_header(); ?>
<?php if ( have_posts() ) whereas ( have_posts() ) : the_post(); ?>
<?php
${custom} = get_post_custom($post->ID);
$lightbox = ${custom}["lightbox-url"][0];
?>
<div id="post-<?php the_ID(); ?>" <?php post_class('publish'); ?>>
<article class="single-post">
<header>
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>
<div class="post-content wrapper">
<?php if(has_post_thumbnail()) {
echo '<div class="featured-thumbnail no-hover"><div class="img-wrap">'; the_post_thumbnail(''); echo '</div></div>';
}
?>
<?php the_content(); ?>
<?php wp_link_pages('earlier than=<div class="pagination">&after=</div>'); ?>
</div><!--.post-content-->
</article>
</div><!-- #post-## -->
<?php comments_template( '', true ); ?>
and the init. for the portfolio posts:
perform my_post_type_portfolio() {
register_post_type( 'portfolio',
array(
'label' => __('Portfolio'),
'singular_label' => __('Porfolio Merchandise', 'theme1575'),
'_builtin' => false,
'public' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'hierarchical' => true,
'capability_type' => 'web page',
'menu_icon' => get_template_directory_uri() . '/consists of/photographs/icon_portfolio.png',
'rewrite' => array(
'slug' => 'portfolio-view',
'with_front' => FALSE,
),
'helps' => array(
'title',
'editor',
'thumbnail',
'excerpt',
'custom-fields',
'feedback')
)
);
register_taxonomy('portfolio_category', 'portfolio', array('hierarchical' => true, 'label' => 'Portfolio Classes', 'singular_name' => 'Class', "rewrite" => true, "query_var" => true));}add_action('init', 'my_post_type_portfolio');
This is the single-games.php
<?php get_header(); ?><div id="content material" class="grid_8 <?php if (of_get_option('blog_sidebar_pos') == "proper" ) {echo "alpha";} else {echo "omega";} ?> <?php echo of_get_option('blog_sidebar_pos') ?>">
<?php if ( have_posts() ) whereas ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('publish'); ?>>
<article class="single-post">
<div class="post-header">
<h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php $post_meta = of_get_option('post_meta'); ?>
<?php if ($post_meta=='true' || $post_meta=='') { ?>
<div class="post-meta">
<?php _e('Geposted am', 'theme1575'); ?> <span class="date up to date"><?php the_time('j. F, Y'); ?></span> <i><?php _e('by', 'theme1575'); ?> <span class="vcard creator"> <span class="fn"><?php the_author_posts_link() ?></span> </span></i>
</div><!--.post-meta-->
<?php } ?>
</div>
<div class="post-content wrapper">
<?php if(has_post_thumbnail()) {
echo '<div class="featured-thumbnail no-hover"><div class="img-wrap">'; the_post_thumbnail(''); echo '</div></div>';
}
?>
<?php the_content(); ?><?php wp_link_pages('earlier than=<div class="pagination">&after=</div>'); ?>
</div><!--.post-content-->
</article>
<?php /* If a consumer fills out their bio data, it is included right here */ ?>
<div id="post-author">
<h3><?php _e('Written by', 'theme1575'); ?> <?php the_author_posts_link() ?></h3>
<p class="gravatar"><?php if(function_exists('get_avatar')) { echo get_avatar( get_the_author_email(), '80' ); /* This avatar is the consumer's gravatar (http://gravatar.com) based mostly on their administrative e-mail handle */ } ?></p>
<div id="author-description">
<?php the_author_meta('description') ?>
<div id="author-link">
<p><?php _e('View all posts by:', 'theme1575'); ?> <?php the_author_posts_link() ?></p>
</div><!--#author-link-->
</div><!--#author-description -->
</div><!--#post-author-->
</div><!-- #post-## -->
<nav class="oldernewer">
<div class="older">
<?php previous_post_link('%hyperlink', __('« Earlier publish', 'theme1575')) ?>
</div><!--.older-->
<div class="newer">
<?php next_post_link('%hyperlink', __('Subsequent Publish »', 'theme1575')) ?>
</div><!--.newer-->
</nav><!--.oldernewer-->
and the init. for the video games posts:
perform my_post_type_games() {
register_post_type( 'video games',
array(
'label' => __('Video games'),
'taxonomies' => array('class'),
'public' => true,
'query_var'=> true,
'publicly_queryable'=> true,
'show_ui' => true,
'show_in_nav_menus' => false,
'menu_position' => 5,
'rewrite' => array(
'slug' => 'games-view',
'with_front' => true,
'hierarchical' => true,
),
'has_archive' => true,
'helps' => array(
'title',
'creator',
'thumbnail',
'revisions',
'feedback',
'editor',
'excerpt')
)
); register_taxonomy('games_category', 'video games', array('hierarchical' => true, 'label' => 'Video games Classes', 'singular_name' => 'Class', "rewrite" => true, "query_var" => true)); } add_action('init', 'my_post_type_games');?>