List with all projects and categories

New Front EN Support Forums Ikebana Theme Support List with all projects and categories

This topic contains 0 replies, has 1 voice, and was last updated by  DaWald 6 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #30163

    DaWald
    Member

    Hello,
    thank you for the great theme. I like to ad a list of all projects of my portfolio with the categories. Something like that:

    Hamburg
    • Parlament Restaurant
    • Fischereihafen Restaurant-Majestätsbeleidigung?
    • Lizzy hätt`s fast verpennt

    GESUNDHEIT
    • Cannabis
    • Männerschnupfen

    Allgemein
    • GLÜCK MACHT DÜCK
    • METOO – Hilten/Hollywood
    • Reeperbahn – in Öl

    How can I realise it? Each time I like to create this, my list shows only posts (blog) with that categories.

    Thanks and regards
    Silva

    The code I use now:

    <?php
    
    //for each category, show all posts
    $cat_args=array(
      'orderby' => 'name',
      'order' => 'ASC'
       );
    $categories=get_categories($cat_args);
      foreach($categories as $category) {
        $args=array(
          'showposts' => -1,
          'category__in' => array($category->term_id),
          'caller_get_posts'=>1
        );
        $posts=get_posts($args);
          if ($posts) {
            echo 'Kategorie: <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> 
     ';
            foreach($posts as $post) {
              setup_postdata($post); ?>
              <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
    
              <?php
            } // foreach($posts
          } // if ($posts
        } // foreach($categories
    ?>
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.