Get Categories from ‘Page’
-
I manage to get the ‘category’ and ‘tags’ in Pages by doing so:
add_action( 'init', 'enable_tag_category' ); function enable_tag_category() { register_taxonomy_for_object_type('post_tag', 'page'); register_taxonomy_for_object_type('category', 'page'); }
Now, I am trying to get the categories assigned in the page and not haveing any luck. I tried:
wp_get_object_terms( $pageID, 'category', array('orderby' => 'term_id', 'hide_empty' => false) ); get_object_taxonomies( $page->page_type, 'objects' ); get_terms(array('taxonomy' => 'category','hide_empty' => false));
… but none seem to work. Any suggestions to try out? Thanks.
[I asked this question in stactexchange as well but didn’t get any response]
http://wordpress.stackexchange.com/questions/253569/get-categories-from-pageIf there is another way to enable Tag and Category plus the retrieval method, I am happy to test those out.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Get Categories from ‘Page’’ is closed to new replies.