B
B
Bestolkovy2016-10-19 08:37:22
metadata
Bestolkovy, 2016-10-19 08:37:22

How to display categories instead of tags in WordPress?

Good afternoon!
Redesigning a WordPress theme. Entries to be displayed in the slider are displayed based on tags. I don't know who came up with this, but it's true.
Found the code that does this. How can I change it to have categories instead of tags?

// Pull all tags into an array.
$tags = array();
$tags_obj = get_tags();
foreach ( $tags_obj as $tag ) {
  $tags[$tag->term_id] = esc_html( $tag->name );
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question