Deprecated: Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead. in /var/www/html/wp-includes/functions.php on line 5383

List with all projects and categories

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

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.