• Hi, I need to match first page than category in wordpress, when the url is the same. I′v tried a lot and still does not work properly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I think it isn’t possible. You can only create a blog article (posts) with a head category and a subcategory. Like: domain.com/music/pop. Music is the head category and pop the subcategory.

    Maybe you can try this plug-in. I haven’t any experience with it.

    Thread Starter masterr77

    (@masterr77)

    The plugin does something else that I don′t want. But it′s really bad that wordpress can not make nice looking category.

    I just want to add comments and rating widget to category page and it is not possible to add comments to category, so I wanted to create a page with the same url as category does and hide the category page and just show the “article” page.

    Moderator bcworkz

    (@bcworkz)

    If the URL you want is example.com/category/my-cat/, then WP will load the category archive template to show posts in my-cat. There might be a way to redirect such a request to a page with the slug “my-cat”, but any such hidden category archive scheme I can think of would make managing categories rather convoluted.

    If you are OK with an URL like example.com/my-cat/ then you can create a page with the slug “my-cat” and it will be output. In order for this page to display all posts in the my-cat category you would need to create a custom page template that makes a secondary query and runs the Loop.

    If you must have an URL like example.com/category/my-cat/, you could do things in the reverse of what you were thinking. Create a page with the slug “my-cat”. No need to link anything to this page, we just want to make use of its post ID, not its content. In a sense this page is “hidden”. Alter the normal category archive template to output the comment form, comments, and ratings for that hidden page.

    You will need a hidden page for each category term, but the associated comments and ratings can be handled dynamically from the category archive template if you maintain some sort of equivalence table or array where each category term is associated with the post ID of the corresponding hidden page.

    When the category archive template loads, the current category is known. Go to the equivalence table to get the associated post ID for use in outputting the comments and ratings for that page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘match first page than category’ is closed to new replies.