0

I'm trying to figure out how I can rewrite a taxonomy slug. I am using the filter plugin Facet (which is great btw). I have projects in a taxonomy (called Topics in this website) and the filtered projects archive page looks like this: http://localhost:8888/SMIT/projects/?fwp_topic=food. Basically this shows all the projects filtered on the topic "Food".

So projects can be added to the custom taxonomy Topics. I want the topics to link to the filtered Projects Archive page by passing the Topic slug into the url.

What is the best way to do this? I've searched online for hours now, it would be so good if someone can help me.

Thanks in advance! Ferre

0

You posted up your localhost which no one will be able to see. When you say filter plugin Facet. Forgive me if I assume wrong when I think you mean FacetWP. Your question involves a bit more depth than you may realize if you're doing what I think you are doing. I can start you it the right direction though :)

You have two thing to set up for just the FacetWP plugin: Facets and Template

Facet:

Setting up your facet is pretty straight forward. You will select your facet option type > Then you select your data source

Data Source is where you will select your taxonomy. You can also use a field type here if you were needing to change it's value based on some input.

Other options > use default.

I would recommend CPT UI to create your custom post types.

Use CPT Layout Injector to make a page template that you will use for your archive. This is where though field options come in useful.

And Custom Field Suite for custom fields or something more robust like Advanced Custom Fields.

Template:

Divided into two section: Query argument and Display Code

Query argument

<?php
  return array(
  "post_type" => "Topics",
  "post_status" => "publish",
  "orderby" => "date",
  "order" => "DESC",
  "posts_per_page" => 10

);

Display Code

<?php while ( have_posts() ): the_post(); ?>
<p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
<?php endwhile; ?>

The support for this plugin is excellent. They will get back to you very quickly and they're extremely friendly. Just make sure to come up with something where you are stuck on finishing a query and they will definitely be willing to help you.

Here is an hour long tutorial that helped me tremendously. I hope it helps you as well. If you watch between 12-48 min is where it is the best. But if you don't truly understand.. than listen to what he says the first 12 minutes!

https://www.sean-barton.co.uk/2016/05/divi-cpt-builder-acf-module-release-video/

  • Hi Daniel, thank you so much for your answer! I'm off work today but I'm gonna implement it tomorrow. Thanks again a million times for making the effort to answer! – Ferre Mekelenkamp Sep 10 '17 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.