Note that there are some explanatory texts on larger screens.

plurals
  1. POphp errors with custom taxonomy page — WordPress
    primarykey
    data
    text
    <p>I have successfully created a custom taxonomy in WordPress, and I created a page that lists all of the posts under a specified taxonomy, with a file named <code>taxonomy.php</code>. It works, but some of the php isn't printing any text. The page seems to churn out some php errors with error reporting turned on:</p> <pre><code>Notice: Undefined variable: term_name in WEBSITE_ROOT/themes/starkers/taxonomy.php on line 24 </code></pre> <p>The variable is <code>$term_name</code>. Here is the code I have in my <code>taxonomy.php</code> page. I followed <a href="http://net.tutsplus.com/tutorials/wordpress/introducing-wordpress-3-custom-taxonomies/comment-page-1/#comments" rel="nofollow">this tutorial</a>. I thought I followed the tutorial pretty well.</p> <pre><code>&lt;?php get_header(); ?&gt; &lt;?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?&gt; &lt;h1&gt;&lt;?php printf( __( 'Posts classified under: %s', 'starkers' ), '&lt;span&gt;' . $term_name . '&lt;/span&gt;' ); ?&gt;&lt;/h1&gt; &lt;?php $category_description = category_description(); if ( ! empty( $category_description ) ) echo '' . $category_description . ''; get_template_part( 'loop', 'category' ); ?&gt; &lt;?php get_footer(); ?&gt; </code></pre> <p>Basically, it's not printing the taxonomy name after "Posts classified under:"</p> <p>I tried fiddling around with the code, but no luck. If it helps, here is the code I used for <code>functions.php</code> to registering the taxonomy:</p> <pre><code>add_action( 'init', 'build_taxonomies', 0 ); function build_taxonomies() { register_taxonomy( 'quotees', 'post', array( 'hierarchical' =&gt; false, 'label' =&gt; 'quotees', 'query_var' =&gt; true, 'public' =&gt; true, 'rewrite' =&gt; true ) ); } </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