最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

customization - Can I overwrite custom taxonomy FROM "public" TO "false"

programmeradmin5浏览0评论

I have custom taxonomy within my WordPress installation that I created with a WordPress Plugin called Pods.

For various reasons, I need to set the registering of the loop from "public" to "false" to prevent post looping.

So, can anyone please point me in the right direction to do this?

My Custom Taxonomy is called "Countries" and it lists Countries!

Thanks, all pointers appreciated so that I can figure this one out.

I understand that to register custom taxonomy w/out a plugin you could so something like this:

<?php
add_action( 'init', 'create_book_tax' );

function create_book_tax() {
    register_taxonomy(
        'genre',
        'book',
        array(
            'label' => __( 'Genre' ),
            'rewrite' => array( 'slug' => 'genre' ),
            'hierarchical' => true,
        )
    );
}
?>

So I guess my question is: is there a way to overwrite the settings from "public" to "false' whilst keeping the URL integrity?

What I am trying to achieve is to keep the public URL but remove the loop from my Custom Taxonomy.

I hope that makes sense

发布评论

评论列表(0)

  1. 暂无评论