Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #587978
    #588985

    Hey Hella!

    You’d need to add a shortcode for categories too:

    function custom_shortcode_func2() {
    	ob_start();
            echo the_category( ', ' );
    	$output = ob_get_clean();
        return $output;
    }
    add_shortcode('the_category', 'custom_shortcode_func2');

    Shortcode:
    [the_category]

    Cheers!
    Josue

    #589014

    Hey Josue,

    thank you very much!
    I’ve put this together to one construct, because it’s easier for me to use:

    function postmeta_shortcode_func() {
    	ob_start();
    	echo "<span class='post-meta-infos'>";
    	echo "<time class='date-container minor-meta updated'>".get_the_time(get_option('date_format'))."</time>";
    	echo "<span class='text-sep text-sep-date'>/</span>";
    
    	    if ( get_comments_number() != "0" || comments_open() ){
    
    	    echo "<span class='comment-container minor-meta'>";
    	    comments_popup_link(  "0 ".__('Comments','avia_framework'),
    	                          "1 ".__('Comment' ,'avia_framework'),
    	                          "% ".__('Comments','avia_framework'),'comments-link',
    	                          "".__('Comments Disabled','avia_framework'));
    	    echo "</span>";
    	    echo "<span class='text-sep text-sep-comment'>/</span>";
    	    }
    
            echo '<span class="blog-categories minor-meta">'.__('in','avia_framework')." ";
            echo the_category( ', ' );
    	echo "</span><span class='text-sep text-sep-date'>/</span>";
    
            echo "<span class='tags-container minor-meta'>";
    	echo the_tags(''.__('Schlagworte: ','avia_framework').'');
    	echo '</span>';
    
    	echo '</span>';
    
    	$output = ob_get_clean();
        return $output;
    }
    add_shortcode('the_post_meta', 'postmeta_shortcode_func');

    Shortcode:
    [the_post_meta]

    Thanks,
    Hella

    #589032

    Glad to help and thanks for sharing your implementation.

    Best regards,
    Josue

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.