To retrieve the "qqcpat" taxonomies of a post in WordPress on a single page, you can use the get_the_terms() function. Here's an example code snippet:
\

<?php\
// Get the current post ID\
$post_id = get_the_ID();\
\
// Retrieve the &#x27;qqcpat&#x27; taxonomies for the post\
$terms = get_the_terms($post_id, &#x27;qqcpat&#x27;);\
\
if ($terms && !is_wp_error($terms)) {\
    foreach ($terms as $term) {\
        echo &#x27;&lt;a href=&quot;&#x27; . get_term_link($term) . &#x27;&quot;&gt;&#x27; . $term->name . &#x27;&lt;/a&gt;&#x27;;\
    }\
}\
?>\
```\
\
Make sure to replace `&#x27;qqcpat&#x27;` with the actual taxonomy slug you want to retrieve. You can place this code snippet in your single page template file, such as `single.php`, to display the taxonomies for each post.
How to Get 'qqcpat' Taxonomies of a WordPress Post on a Single Page

原文地址: https://www.cveoy.top/t/topic/qbWP 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录