Problem:
I have placed a taxonomy link (for more than one author) in my Content Template using the wpv-post-taxonomy shortcode. Instead of linking to the term archive page, I would like to redirect to a static page.
Solution:
1. This needs to be done using custom shortcode. Please add the following code in your theme’s or child theme’s functions.php file:
function custom_post_taxonomy_fun( $atts ) { extract(shortcode_atts( array( 'site_url' => home_url(), 'taxonomy_slug' => '', 'taonomy_name' => '', ), $atts )); $content = ''; if($taxonomy_slug != '' && $taonomy_name != '') { $tax_slug_array = explode(',', $taxonomy_slug); $tax_name_array = explode(',', $taonomy_name); for($i=0; $i < count($tax_slug_array); $i++) { if($i != 0) $content .= ', '; $content .= '<a href="'.$site_url.trim($tax_slug_array[$i]).'">'.$tax_name_array[$i].'</a>'; } } return $content; } add_shortcode( 'custom_post_taxonomy', 'custom_post_taxonomy_fun' );
2. Then use this shortcode in Content Template like this:
[custom_post_taxonomy taxonomy_slug="[wpv-post-taxonomy type='autor' format='slug']" taonomy_name="[wpv-post-taxonomy type='autor' format='name']" site_url="http://borrador.editorial-zech.es/"]
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | - |
- | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | - |
Supporter timezone: Asia/Karachi (GMT+05:00)
Dieses Thema enthält 3 Antworten, hat 2 Stimmen.
Zuletzt aktualisiert von vor 7 Jahren, 2 Monaten.
Assistiert von: Noman.
Das Forum „Types Community Support“ ist für neue Themen und Antworten geschlossen.