• Hello, im working on some sort of “category” menu in the header.

    This menu, it’s an ul list, and i use

    get_categories('include_last_update_time=1
    &orderby=ID
    &hierarchical=0
    &include=4,158,151,28,12');

    I also want that this menu show a little icon if the category was updated (from one week ago to today)
    thats why i need the “include_last_update_time” but it doesn’t exist (i also checked the whole array response)

    well if this option doesn’t exists i need to do a custom query to also know the date of the last post (from each category).
    How can i do what i need?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try something like this. It creates a home link to the left, followed by a list of links across the page.

    You create a category of 3 (say) and then create subcategories in it. The subcategory links only are displayed. You can then add and subtract subcategories from within the Admin Panel, and the links across the top of the page will change appropriately.

    <div id="outer-horizontal-nav">
    <div id="inner-horizontal-nav">
    
    <ul class="child-categories">
    <li class="cat-item home-link"><a href="<?php echo get_option('home'); ?>/">Home</a></li>
    <?php wp_list_categories('child_of=3&title_li=&orderby=id&order=asc'); ?>
    </ul>
    
    </div>    <?/*  outer nav*/?>
    </div> <?/*  inner  nav*/?>

    Your css might then be:

    div#outer-horizontal-nav {position:relative; height:2.5em; background:transparent url(images/outer-horizontal-nav.gif) left 0px repeat-x;padding:0;margin:0;width:100%;}
    
    div#inner-horizontal-nav {position:relative;left:4px;font-size:0.9em;margin:0;height:1.4em;padding:0;font-weight:bold;} 
    
    div#inner-horizontal-nav  ul.child-categories {border:0;padding:0;margin:0;text-indent:0;}
    
    div#inner-horizontal-nav li.cat-item {background:transparent none;border:0px solid gray;padding:0 14px 0 14px;display:inline;list-style-type:none;text-indent:0;}
    
    div#inner-horizontal-nav li.cat-item a:link {color:black;text-decoration:none;padding:0;margin:0;text-indent:0;font-weight:bold;}
    div#inner-horizontal-nav li.cat-item  a:visited {color:black;text-decoration:none;padding:0;margin:0;text-indent:0;font-weight:bold;}
    div#inner-horizontal-nav li.cat-item   a:hover {color:gray;text-decoration:none;padding:0;margin:0;text-indent:0;font-weight:bold;}
    Thread Starter grmv

    (@grmv)

    I know with that i can do some sort of “category menu”, but what about the last_updated_time ?

    thanks!

    Presumably from here

    https://codex.www.ads-software.com/Template_Tags/wp_list_categories

    show_last_updated will give you the information you need

    echo=0 will keep it in a variable

    I’m not skilled enough to work it out any furuther

    ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Categories and last updated time’ is closed to new replies.