MD. Atiqur Rahman MD. Atiqur Rahman - 2 years ago 100
PHP Question

Display category list without link wordpress

I was trying to list category names .

returns a list of the categories but the problem is automatics links. I do not need the links.

It is possible to disable the links by JavaScript but I have to do some event firing with JS .

So , I need to retrieve the category list without the automatic anchor tags.

Any idea ?

Answer Source

You can achieve this using the wordpress function get_categories(), this should work :


  foreach (get_categories() as $category){
    echo "<li>";
    echo $category->name;
    echo "</li>";
  } ?>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download