WordPress.org

Support

Support » How-To and Troubleshooting » Disable/Change the url of the link | wp_list_categories

Disable/Change the url of the link | wp_list_categories

  • Here there,

    wp_list_categories is showing a fine list of my categories.

    1. I want to disable the link by replacing the url g.e.

    <a href="http://urltocat">cat</a>

    into

    <a href="#">cat</a>

    how is this possible? the codex won’t tel me

Viewing 8 replies - 1 through 8 (of 8 total)
  • Still searching for a solution, anyone found something?

    It seems this is the only way to get some attention to my post 🙂

    maybe its just me, and it probably is. but try describing in some more detail what it is youre trying to do, like i said its probably just me, but i dont really know what youre talking about.. disbale the link… what link? detail detail detail..

    Hi Applesfaceman,

    Apologies for not being clear enough than.

    this code

    wp_list_categories('sort_column=name&sort_order=asc&style=list&children=true&hierarchical=true&title_li=0&show_count=0&echo=0&current_category=1');

    prints a list with links of my categories and subcategories like:

    <li class="cat-item cat-item-13"><a href="http://www.website.com/category/multimedia">multimedia</a>

    What i need is:

    <li class="cat-item cat-item-13"><a href="#">multimedia</a>

    So my question is how to make that possible with the wp_list_categories function?

    you want to list specific categories relevant to the page the user is on? this sounds like what im trying to do too and have had no luck hopefully your post here will get some lookers and some good ol fashion wp help

    i try to disable a redirection to another page by clicking. on click link > dont go anywhere, stay on current page.

    you ever get it figured out? Im trying to do the same thing. need it for some jquery tab action.

    Yep, figured it out.

    $cat = get_query_var('cat');
    
    foreach(get_categories('parent=0&exclude=15') as $category)	{
    
    echo '<li class="parent-item"><a class="name" href="#">' . $category->name.'</a></li>';
    											}

    hope it helps you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Disable/Change the url of the link | wp_list_categories’ is closed to new replies.
Skip to toolbar