Skip Navigation

[Resolved] Converting Taxonomy to Post/Page

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by chrisB-30 5 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#1191585

Hello,

I have the taxonomy - Location

Here is an example of the Taxonomy front end - hidden link

I use the following shortcode to display a gallery of dating profiles on the taxonomy pages.

------------------

[wpv-conditional if="( wp_is_mobile() eq '1' )"][wpv-view name="bride-master-view-tablet"][/wpv-conditional][wpv-conditional if="( wp_is_mobile() eq '0' )"][wpv-view name="bride-master-view"][/wpv-conditional][wpv-conditional if="( wp_is_mobile() eq '1' )"][wpv-view name="bride-master-view-tablet"][/wpv-conditional][wpv-conditional if="( wp_is_mobile() eq '0' )"][wpv-view name="bride-master-view"][/wpv-conditional]

-------------------------

You previously helped me set up some custom code to create text on those Location taxonomy archives - like these:

Here is a screenshot of a Location archive - hidden link

The text is entered in a custom field on each of the Locations

While this does work, I am missing some of the core WordPress functionality because of the workaround. i.e. no access to the new Gutenberg editor, no author attached to the article, no publish date or updated date etc.

I believe this is causing my pages to lag in search results - so I would like to have an individual WordPress page/post for each of these Locations.

Is there a way to alter the shortcodes above so that they could load only the correct profiles onto each of the wordpress pages? So, I would create a page - Colombian Brides - and then alter the shortocde for that page to display only profiles from the taxonomy "Colombia"?

Or would I have to create individual views for each of the pages? If so would that slow my site down, I have around 50 Locations and have have 2 different views (mobile and desktop) so it would be 100 different views.

Or is there some other way I could do this?

Thanks

#1191821

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chris

Your Views would include a Query Filter for the taxonomy term, and then when you insert the View onto a page, you pass the term via a shortcode attribute, as described here: https://toolset.com/documentation/user-guides/passing-arguments-to-views/#filters-by-taxonomies

If you edit your View when you set up the Query Filter and opt for a value passed by shortcode attribute, it will suggest the name for the attribute, but you can change this to something else if you want, you just need to make sure the setting in the Query Filter and what you add to your wpv-view shortcode where you insert the View are the same.

You could save yourself a little typing if you make the titles of your pages match the taxonomy terms exactly, so that the page slug and term slug are the same, in which case you can provide the shortcode attribute value with the page slug (wpv-post-slug shortcode).

#1192421

Sorry - I'm a bit rusty with Toolset as I haven't really used it since setting up my site many months ago so I'm a bit confused here.

I created a new view - here are the settings:
hidden link

I created a page - hidden link

And inserted this shortcode on the page:

[wpv-view name="location-shortcode-view"]

The location slug is "benin-brides" as you can see in this screenshot:
hidden link

But it is not serving any entries. What am I missing? Is there supposed to be a 2nd argument in the shortcode?

Thanks

#1192450

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Your first screenshot with the View settings shows a Query Filter where the location is provided by a URL parameter wpvlocation.

That's not what you want.

You need to choose that the value is provided by shortcode attribute. If you stick with the default wpvlocation for the attribute name, then when you insert the View you specify the location, like so:

[wpv-view name="location-shortcode-view" wpvlocation="benin-brides"]

If you are careful to name the pages exactly the same as the location taxonomy terms, instead of having to manually provide the wpvlocation value on each page (e.g. we just provided wpvlocation="benin-brides" on the benin-brides page), you could provide the value using the wpv-post-slug shortcode, e.g.

[wpv-view name="location-shortcode-view" wpvlocation="[wpv-post-slug]"]
#1192622

Ah OK, I get it now.

I think I have everything set up correctly but I'm still not getting any output.

Taxonomy slug:
hidden link

View Setup:
hidden link

I just set the view up to display the post title to keep thinngs simple.

Shortcode on page - I hardcoded the url parameter for troubleshooting purposes:
hidden link

But as you can see - no output:
hidden link

Any ideas?

Here's the staging site login if you want to take a look:

[edit]

Thanks!

#1192661

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chris

I think you are a bit rusty on editing Views.

The very final section, the Output Editor, is not something you normally need to touch, it usually just contains these required shortcodes:

[wpv-filter-meta-html]
[wpv-layout-meta-html]

You had deleted these and put the fields you want output there instead. I restored the required shortcodes and moved your fields to the loop content template, and now it works, if you want to check for yourself.

#1192861

Thanks!