Tagged: ALB, Post meta info
-
AuthorPosts
-
February 23, 2016 at 9:34 pm #587978
Hi!
I’m using ALB when creating my posts. I’ve understood, that post meta infos are not displayed automatically using ALB, so I tried to use the workaround of this post (added to the functions.php of my child theme):
without the author info, but with additional tags info.
My problem is, that the categories are not displayed, despite two categories have been added to the post.
What did I do wrong?In addition I want to get rid of the border between the first fullwidth color section and the main content – is this possible?
Regards,
HellaFebruary 25, 2016 at 12:26 pm #588985Hey 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!
JosueFebruary 25, 2016 at 12:54 pm #589014Hey 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,
HellaFebruary 25, 2016 at 1:25 pm #589032Glad to help and thanks for sharing your implementation.
Best regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.