Adding tags and categoreis to pages
-
Hello, found some generatepress code that works great for posts to add date and tags and categories. Now I am using add categories to pages plugin and I want to display these on pages aswell. Thi following code works great for posts, and gives updated date to pages. What can I add to it to see my tags and categories on pages aswell?
add_filter( 'generate_header_entry_meta_items', function( $items ) { if ( is_single() ) { $items = array( 'date', 'author', 'categories', 'tags' ); } return $items; } ); add_action( 'generate_after_entry_header', 'tu_page_meta' ); function tu_page_meta() { if ( is_singular( 'page' ) ) : ?> <div class="entry-meta"> <?php generate_posted_on(); ?> </div><!-- .entry-meta --> <?php endif; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Adding tags and categoreis to pages’ is closed to new replies.