Hi there, is there a way to pull in an archive page slug into a dynamic content field? I can do an archive id, but I can’t seem to figure out if there is a meta key for the slug.
Hi @bobbybosler,
Thanks for reaching out.
Regretfully, there’s no way to pull the archive page slug into a dynamic content field as of the moment. I’ll forward this as a feature request so this might be taken into account in a future release.
Hope that helps.
Thank you.
Hi @bobbybosler,
You’re welcome and it’s our pleasure to help you. if you have any other concerns regarding our theme features, feel free to reach us.
Thank you.
Hi,
I also really need this archive dynamic content field, such as archives titles, archive slug etc. Do you already know if this will be released ?
Hello @kosmoss,
We do not have an ETA yet. Rest assured that our developers have been informed already.
Cheers.
Hi @bobbybosler,
I think I made it using the new looper providers, thanks to this video : https://youtu.be/dfhD5M8A8As?t=433 at 7:23.
Is that what you needed ?
I just wanted to chime in here that a Dynamic Content string for the archive slug will be introduced in the coming release due around the beginning of March. That being said, I wanted to try and give you all something that could at least tide you over in the meantime. The following two options should potentially work for you (but keep in mind that these are not the safest methods and should be replaced with the proper Dynamic Content when the release has been made available:
-
{{dc:query:query_var key="category_name"}}
– This Dynamic Content string can be found under the Query group, and can accept akey
parameter that allows you to access the value of a query variable from theWP_Query
class.category_name
should provide you with the “slug” of a particular archive you’re currently viewing. I even tested it when used on a tag archive, and it still returned an acceptable result, but keep in mind that depending on the post type archive you’re viewing, this might not be the appropriatekey
to use. You can of course look through more information on potential information to access here. -
{{dc:url:segment index="1"}}
– This one is a little more of a hack, but could potentially work. Essentially, this allows us to access a part of the URL’s current path, and output it as content. So, if you were only using this template on your category archives for instance, the path for that should always look something likehttp://example.com/category/{{slug}}/
. Using{{dc:url:segment index="1"}}
will allow you to access that{{slug}}
piece of the URL and use it in your content. This is not as robust though, because if you are using this on a hierarchical term, the index would shift on you, so this is not recommended for those types of scenarios.
Again, neither of these approaches are the “official” or recommended way to do any of this, but it could at least get you by for the time being until the release has been put out. Hopefully that helps to point you all in the right direction…cheers!
I made it using a list looper provider set as ‘Current Post Terms’, then choosing the taxonomy.
Inside the list I added a content with a link set on a URL with this dynamic content : {{dc:term:url}}, then the inner text is {{dc:term:name}}.
Cool, @kosmoss! Yes, the archive Name has been available for a while now, but the Slug has not (which will come in the next release cycle). Cheers!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.