Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

S

schneiderbrett

@schneiderbrett
About
Posts
10
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Shortcode to show list of project-related categories/tags on Project Page itself
    S schneiderbrett
    Feb 3, 2022, 4:25 PM

    And last question resolved again. Here the code:

    function createPostListSubCatWork() {
    	global $post;
    	$categories = wp_get_object_terms( $post->ID, 'category', [ 'parent' => 1, 'number' => 99 ] );
        $categoryOutput = [];
    
        if (!empty($categories)) {
            array_push($categoryOutput, '<ul class="_Default">');
            foreach($categories as $category) {
                array_push($categoryOutput, '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </br> ');
            }
            array_push($categoryOutput, '</ul>');
        }
    
        return implode('', $categoryOutput);
    }
    add_shortcode('work_cats_pg', 'createPostListSubCatWork');
    
    • List categories for the current post: [work_cats_pg]
    • The categories should be children of category 1.
    • No more than 99 positions should be displayed.

    Source which kinde resolved it for me: https://wordpress.stackexchange.com/questions/330128/display-a-list-of-subcategories-from-specific-category-a-post-belongs-to

    Best regards,
    Amadezs

    General Discussion

  • Any way to implement tags?
    S schneiderbrett
    Jan 5, 2022, 7:53 PM

    Awesome! Thank you very much :)

    General Discussion tags

I also code custom websites or custom Lay features.
💿 Email me here: 💿
info@laytheme.com

Before you post:
  1. When using a WordPress Cache plugin, disable it or clear your cache.
  2. Update Lay Theme and all Lay Theme Addons
  3. Disable all Plugins
  4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

This often solves issues you might run into

When you post:
  1. Post a link to where the problem is
  2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
  3. If the problem is difficult to explain, post screenshots / link to a video to explain it
Online Users
Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
laytheme.com
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Recent
  • Tags
  • Popular
  • Users
  • Search