- This topic is empty.
-
AuthorPosts
-
December 23, 2010 at 4:24 pm #31085JohnnybMember
I’m having a slight problem with my WordPress site and hoping somebody might be able to help me out.
I have a page called ‘Work’ which only displays posts with the category of ‘Work’. I am then sorting those posts using custom taxonomies, which I have listed in the sidebar on the page. I have created the custom taxonomies in functions.php and used a plugin (Taxonomy Widget) to display them in the sidebar, along with all of the tags/terms in each. All is working great, apart from the fact that when I click on any of these terms in the sidebar it isn’t using any of taxonomy.php, archive.php, tag.php, or category.php, it’s using index.php, and I have no idea why. I understand the template hierarchy and that WordPress is using index.php as a last option as it has apparently tried the other templates, but I have taxonomy.php and archive.php present and it isn’t using either.
I tried using another taxonomy plugin as I thought that might have been the problem, but the same thing happens.
Anyone got any ideas? Maybe I’m missing something, as this is the first time I’ve dealt with taxonomies before.
I originally started off using post tags but as I want to have 2 sets of tag categories for each post (Media and Sector) which I want to separate, then I thought it best to create 2 custom taxonomies for these.
Unfortunately I can’t post a link as I’m developing on localhost.
Many many thanks in advance, and Happy Holidays!
December 26, 2010 at 2:05 pm #68773JohnnybMemberAnybody got any suggestions? I might have to resort to using regular tags rather than taxonomies.
December 27, 2010 at 1:21 pm #68520JohnnybMemberNever mind, I followed someone elses advice and changed my permalinks backs to the default, deleted the .htaccess file and then setting permalinks back to my custom structure and it solved this problem. Now the taxonomies link to the correct pages.
November 28, 2011 at 1:14 pm #91448nathan05Memberis it recommended to follow this though … since I am looking to create custom taxonomies … doesnt the .htaccess file secure things? … I also watched Chris’ screen cast #41 and it explained a lot as usual except the way his page.php file he duplicates does not look the same as the page.php file I am looking at in dreamweaver CS5 … and I have the latest version of WP …
November 28, 2011 at 1:24 pm #91450nathan05MemberI just made myself look like a dummy … disregard my last post … I will get my thoughts together … and then ask my question …
November 28, 2011 at 1:38 pm #91452nathan05MemberOk … here is what I am looking to make new taxonomies … I know where the functions.php file is located … but where do i add the code do I add it to the following section of code …
function twentyeleven_widgets_init() {
register_widget( 'Twenty_Eleven_Ephemera_Widget' );
register_sidebar( array(
'name' => __( 'Main Sidebar', 'twentyeleven' ),
'id' => 'sidebar-1',
'before_widget' => '",
'before_title' => '',
',
'after_title' => '
) );
register_sidebar( array(
'name' => __( 'Showcase Sidebar', 'twentyeleven' ),
'id' => 'sidebar-2',
'description' => __( 'The sidebar for the optional Showcase Template', 'twentyeleven' ),
'before_widget' => '",
'before_title' => '',
',
'after_title' => '
) );
register_sidebar( array(
'name' => __( 'Footer Area One', 'twentyeleven' ),
'id' => 'sidebar-3',
'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
'before_widget' => '",
'before_title' => '',
',
'after_title' => '
) );
register_sidebar( array(
'name' => __( 'Footer Area Two', 'twentyeleven' ),
'id' => 'sidebar-4',
'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
'before_widget' => '",
'before_title' => '',
',
'after_title' => '
) );
register_sidebar( array(
'name' => __( 'Footer Area Three', 'twentyeleven' ),
'id' => 'sidebar-5',
'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
'before_widget' => '",
'before_title' => '',
',
'after_title' => '
) );
}
add_action( 'widgets_init', 'twentyeleven_widgets_init' );
Or do I create a whole new section for the following code
function create_my_taxonomies() {
register_taxonomy('example', 'post' array(
'heirarchical'=>false, 'label' =>'example',
'query_var'=>true, 'rewrite' => true));
function create_my_taxonomies() {
register_taxonomy('example2', 'post' array(
'heirarchical'=>false, 'label' =>'example2',
'query_var'=>true, 'rewrite' => true));
}
add_action('init', 'create_my_taxonomies', 0);November 28, 2011 at 2:08 pm #91454nathan05MemberOk … tried adding the new taxonomies under the section
function twentyeleven_widgets_init() {
and I see the option in the sidebar of the new post screen … but once I publish the post … I dont see anything different … is there something I am missing?
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.