get only sub category ID

As you only want a select form field that has a categories children, then simply go with wp_list_categories() wp_list_categories( array( ‘child_of’ => ‘your parent cat ID’, ) ); Depending on your use case, you could as well use get_the_category() and its get_the_categories filter apply_filters( ‘get_the_categories’, $categories ); get_the_terms() and its filter (the function is called … Read more

How do I change the sql query for wp_get_archive()

Looking at the source code for wp_get_archives(), there is a filter called getarchives_join which you can use to restrict wp_get_archives() to a specific category You also need to get the current category ID, which is easy, simply use get_queried_object_id() You can try something like this to display archives for the currently viewed category add_filter( ‘getarchives_join’, … Read more

Attachment page per category

Attachments does not have categories, so a simple in_category() or has_category() check will not work. What we will need to do to solve is this issue is the following Get the current attachment object. We will make use of get_queried_object() which will hold the current post object of the attachment being viewed Determine the post … Read more

Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework

It’s not because of the archive_box in cpt-archive-settings.php but because of genesis_taxonomy_archive_options in genesis/lib/admin/term-meta.php. You can remove it using if you place the following in child theme: remove_action( ‘admin_init’, ‘genesis_add_taxonomy_archive_options’ ); Update: Those settings are appearing because of the action genesis_add_taxonomy_archive_options attached to admin_init hook. add_action( ‘admin_init’, ‘genesis_add_taxonomy_archive_options’ ); Which again is like this function … Read more