The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other WordPress: Problem with custom post type and taxonomy

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #42271

    Hi everyone,

    recently, I started working on my personal blog based on wordpress. I want to share my snippets with other people, so I created a page (snippets.php) that I use to list all the snippets. Moreover, I registered a custom post type called ‘snippet’ and added single-snippet.php to my theme folder. The page displaying all snippets works great, and so does the template responsible for displaying individual snippets.

    So now when I go to http://localhost/projects/my_wordpress/snippets/ I see all the snippets.

    When I click on one of them I go to e.g. http://localhost/projects/my_wordpress/snippets/border-radius

    Then I decided I’d like to register custom taxonomy so that I can group my snippets. I did it, but then I got stuck. At the very bottom of the page displaying a snippet I placed a link to a page displaying all the snippets from a given group. I created the link using

    ID, ‘language’, $before = ”, $sep = ‘, ‘, $after = ” ); ?>

    When I click the link I am redirected to: http://localhost/projects/my_wordpress/language/css/ but I see no posts displayed and WP uses index.php to display them (in fact it doesn’t display them but it uses index.php). How can I change it so that WP uses taxonomy-language.php to display a list of all the snippets related to a given language?

    I hope you get what I mean :)


Viewing 1 post (of 1 total)
  • The forum ‘Other’ is closed to new topics and replies.