Note that there are some explanatory texts on larger screens.

plurals
  1. POShow Category in Wordpress Portfolium Theme
    primarykey
    data
    text
    <p>I'm using the <a href="http://wpshower.com/themes/portfolium/" rel="nofollow"><code>portfolium-theme</code></a> for Wordpress and I need your help.</p> <p>I would like to show the portfolio category under the title on the frontpage (loop-portfolio). The Categories are with taxonomy but I can't figure it out.</p> <p><a href="http://florian-koeppen.de/fk/" rel="nofollow">my side</a></p> <p>the loop-portfolio.php</p> <pre><code> &lt;?php if ( have_posts() ) : ?&gt; &lt;?php $i = 0; ?&gt; &lt;?php while ( have_posts() ) : the_post(); $i++; ?&gt; &lt;div class="post_home"&gt; &lt;div class="post_home2"&gt;&lt;/div&gt; &lt;a href="&lt;?php the_permalink() ?&gt;" class="thumb" title="&lt;?php the_title(); ?&gt;"&gt; &lt;?php if (has_post_thumbnail()) : ?&gt; &lt;?php the_post_thumbnail(array(305,145)); ?&gt; &lt;?php else : ?&gt; &lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/i/noimage.jpg" width="305" height="145" alt=""/&gt; &lt;?php endif; ?&gt; &lt;/a&gt; &lt;h2&gt;&lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt; &lt;/div&gt; &lt;?php if ($i % 6 == 0) echo '&lt;div style="clear: both;"&gt;&lt;/div&gt;'?&gt; &lt;?php endwhile; ?&gt; &lt;?php endif; ?&gt; </code></pre> <p>and the taxonomy.php</p> <pre><code> &lt;?php get_header(); ?&gt; &lt;?php $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); query_posts(array('post_type' =&gt; 'portfolio', 'works' =&gt; $term-&gt;slug, 'posts_per_page' =&gt; -1)); ?&gt; &lt;?php get_template_part('loop-portfolio'); // Loop template for portfolio (loop-portfolio.php) ?&gt; &lt;?php get_footer(); ?&gt; </code></pre> <p>the functions.php</p> <pre><code> &lt;?php /*** Top navigation ***/ function register_menu() { register_nav_menu('Header', __('Header')); } add_action( 'init', 'register_menu' ); if ( !is_nav_menu('Header')) { $menu_id = wp_create_nav_menu('Header'); wp_update_nav_menu_item($menu_id, 1); } class extended_walker extends Walker_Nav_Menu{ function display_element( $element, &amp;$children_elements, $max_depth, $depth=0, $args, &amp;$output ) { if ( !$element ) return; $id_field = $this-&gt;db_fields['id']; //display this element if ( is_array( $args[0] ) ) $args[0]['has_children'] = ! empty( $children_elements[$element-&gt;$id_field] ); //Adds the 'parent' class to the current item if it has children if( ! empty( $children_elements[$element-&gt;$id_field] ) ) array_push($element-&gt;classes,'parent'); $cb_args = array_merge( array(&amp;$output, $element, $depth), $args); call_user_func_array(array(&amp;$this, 'start_el'), $cb_args); $id = $element-&gt;$id_field; // descend only when the depth is right and there are childrens for this element if ( ($max_depth == 0 || $max_depth &gt; $depth+1 ) &amp;&amp; isset( $children_elements[$id]) ) { foreach( $children_elements[ $id ] as $child ){ if ( !isset($newlevel) ) { $newlevel = true; //start the child delimiter $cb_args = array_merge( array(&amp;$output, $depth), $args); call_user_func_array(array(&amp;$this, 'start_lvl'), $cb_args); } $this-&gt;display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); } unset( $children_elements[ $id ] ); } if ( isset($newlevel) &amp;&amp; $newlevel ){ //end the child delimiter $cb_args = array_merge( array(&amp;$output, $depth), $args); call_user_func_array(array(&amp;$this, 'end_lvl'), $cb_args); } //end this element $cb_args = array_merge( array(&amp;$output, $element, $depth), $args); call_user_func_array(array(&amp;$this, 'end_el'), $cb_args); } } /*** Commentlist ***/ function commentlist($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?&gt; &lt;li id="li-comment-&lt;?php comment_ID() ?&gt;"&gt; &lt;div id="comment-&lt;?php comment_ID(); ?&gt;" &lt;?php comment_class('comment_item clear'); ?&gt;&gt; &lt;div class="comment_meta"&gt;Posted on &lt;?php printf( __('%1$s'), get_comment_date()); ?&gt; by &lt;?php printf(__('&lt;cite class="fn"&gt;%s&lt;/cite&gt;'), get_comment_author_link()) ?&gt;&lt;/div&gt; &lt;div class="comment_text"&gt;&lt;?php comment_text() ?&gt;&lt;/div&gt; &lt;/div&gt; &lt;?php } /*** Custom Posts ***/ register_taxonomy( 'works', 'portfolio', array( 'label' =&gt; __('Portfolio Categories'), 'singular_label' =&gt; __('Portfolio Category'), 'hierarchical' =&gt; true, 'query_var' =&gt; true, 'rewrite' =&gt; true, 'show_in_nav_menus' =&gt; true, ) ); register_post_type( 'portfolio', array( 'label' =&gt; __('Portfolio'), 'singular_label' =&gt; __('Work'), 'public' =&gt; true, 'show_ui' =&gt; true, 'capability_type' =&gt; 'post', 'hierarchical' =&gt; false, 'rewrite' =&gt; true, 'query_var' =&gt; true, 'show_in_nav_menus' =&gt; true, 'menu_position' =&gt; 3, 'taxonomies' =&gt; array('portfolio'), 'supports' =&gt; array('title', 'editor', 'author', 'thumbnail', 'custom-fields'), '_builtin' =&gt; false, // It's a custom post type, not built in! )); /*** Images ***/ add_theme_support('post-thumbnails'); update_option('thumbnail_size_w', 305); update_option('thumbnail_size_h', 145); update_option('large_size_w', 785); /*** Misc ***/ function commentdata_fix($commentdata) { if ( $commentdata['comment_author_url'] == 'WWW') { $commentdata['comment_author_url'] = ''; } if ($commentdata['comment_content'] == 'Write your comment') { $commentdata['comment_content'] = ''; } return $commentdata; } add_filter('preprocess_comment','commentdata_fix'); function getTinyUrl($url) { $tinyurl = file_get_contents("http://tinyurl.com/api-create.php?url=".$url); return $tinyurl; } function get_blogurl() { if (get_option('show_on_front') == 'page' &amp;&amp; get_option('page_for_posts') != 0) { $blogpage = get_page(get_option('page_for_posts')); echo $blogpage -&gt; guid; } else { echo get_option('home'); } } function catlist() { ?&gt; &lt;ul class="tags jsddm"&gt; &lt;li&gt; &lt;a href="#"&gt;Blog categories&lt;/a&gt; &lt;ul class="taglist"&gt; &lt;?php wp_list_categories('title_li=&amp;hierarchical=0&amp;'); ?&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;?php } function n_posts_link_attributes(){ return 'class="nextpostslink"'; } function p_posts_link_attributes(){ return 'class="previouspostslink"'; } add_filter('next_posts_link_attributes', 'n_posts_link_attributes'); add_filter('previous_posts_link_attributes', 'p_posts_link_attributes'); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload