![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
-
AuthorPosts
-
March 14, 2019 at 3:37 am #1078497
I have run in to a problem. I am trying to use the Advance Layout Editor in the blog post and it works great. The problem I am running in to us when it displays the blog it doesn’t show the category or date like I will like it to. If I use the blog posts without the Advance Layout Editor the category and date displays like it should.
How do I make it so the category and date will be displayed when using the Advance Layout Editor?
Your help with this is greatly appreciated, I have gone cross eyed trying to figure this out.
Thank you.
March 14, 2019 at 8:02 pm #1078834Hey Micheal0424,
Here is a thread for you to consider
If you need further assistance please let us know.
Best regards,
VictoriaMarch 18, 2019 at 4:29 am #1079764I used the link you provided to get it working, thank you!
This is what I did:
Added to functions.php
function avs_custom_categories_shortcode() {
$terms = get_the_terms( get_the_ID(), ‘category’ );$output = “<span>”._(‘Dossier-Thema: ‘, ‘avia_framework’).”</span>”;
foreach ( $terms as $term ) {// The $term is an object, so we don’t need to specify the $taxonomy.
$term_link = get_term_link( $term );// If there was an error, continue to the next term.
if ( is_wp_error( $term_link ) ) {
continue;
}// We successfully got a link. Print it out.
$output .= ‘<p class=”cat”>‘ . $term->name . ‘</p>’;
}return $output;
}add_shortcode(‘the_post_categories’, ‘avs_custom_categories_shortcode’);
I added this short code to the page:
[the_post_categories]The categories are showing up now. They are showing up in a column style list, I need them to align horizontally like they normally would.
I tried to add this CSS code:
p.cat { display: inline-block; }It didn’t work.
What can I do to get the categories listed horizontally?
Thank you for any assistance! It is greatly appreciated!
March 20, 2019 at 7:39 am #1080700Hi,
Great, I’m glad that you got it partially working. Could you post a link to where we can see the results you are getting please?
Best regards,
RikardMarch 21, 2019 at 4:21 pm #1081458The link has been posted, thank you.
March 23, 2019 at 8:21 pm #1082166Anybody have an idea of how to make this work?
March 24, 2019 at 11:22 pm #1082399Can somebody please help? I waited 2 days before I posted again just in case posting again makes the wait longer. I really need help though so any help would be greatly appreciated.
Thank you.
March 25, 2019 at 4:54 am #1082505Hi Micheal0424,
We apologize for the delayed response.
Are you trying to align Uncategorized and View All Spotlights? if yes, try to put them in the same textblock.
If that doesn’t work, can you provide a temporary admin access? so we can try to check on it further.
Just post the credentials in private content.Best regards,
NikkoMarch 25, 2019 at 5:11 am #1082513I am using this short code in the text block: [the_post_categories]
I will provide login credentials to make it easier.
Everything is working, just needed them aligned horizontal.
Like this:
Category 1, Category 2, Category 3Not like it is:
Category 1
Category 2
Category 3Thank you for your help!
Note: View all is okay to be separate.
March 25, 2019 at 6:46 am #1082529Hi,
Thanks, I have replaced the code you used with:
function avs_custom_categories_shortcode() { $terms = get_the_terms( get_the_ID(), 'category' ); $count = 0; $output = '<p class="cat">'; foreach ( $terms as $term ) { // The $term is an object, so we don't need to specify the $taxonomy. $term_link = get_term_link( $term ); // If there was an error, continue to the next term. if ( is_wp_error( $term_link ) ) { continue; } if( $count > 0) { $output .= ', '; } // We successfully got a link. Print it out. $output .= '<a href="' . esc_url( $term_link ) . '">' . $term->name . '</a>'; $count++; } $output .= '</p>'; return $output; } add_shortcode('the_post_categories', 'avs_custom_categories_shortcode');
Let us know if you need further assistance.
Best regards,
NikkoMarch 25, 2019 at 2:54 pm #1082687Works perfectly, such a life saver. Thank you for your help!
March 25, 2019 at 10:30 pm #1082861One more question.
I tried to put the short code for the [the_post_categories] after some text in the text block element and it will not stay on the same line, it goes on a separate line.How do I get the short code and the text to stay on the same line together?
Thank you.
March 25, 2019 at 11:31 pm #1082884Hi Micheal0424,
You’re welcome :)
Go to Enfold > General Styling > Quick CSS, then add this css code:#top p.cat { display: inline-block; }
Best regards,
NikkoMarch 25, 2019 at 11:37 pm #1082887No luck, any other ideas?
March 25, 2019 at 11:42 pm #1082891Hi Micheal0424,
Try flushing out the cache.
This is what I see on my end (screenshot in private content)Best regards,
NikkoMarch 25, 2019 at 11:56 pm #1082898Okay, thanks!
March 26, 2019 at 12:35 am #1082908Hi Micheal0424,
Glad that we could help :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘display blog post category when using advance layout editor’ is closed to new replies.