Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #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.

    #1078834

    Hey Micheal0424,

    Here is a thread for you to consider

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1079764

    I 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!

    #1080700

    Hi,

    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,
    Rikard

    #1081458

    The link has been posted, thank you.

    #1082166

    Anybody have an idea of how to make this work?

    #1082399

    Can 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.

    #1082505

    Hi 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,
    Nikko

    #1082513

    I 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 3

    Not like it is:
    Category 1
    Category 2
    Category 3

    Thank you for your help!

    Note: View all is okay to be separate.

    #1082529

    Hi,

    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,
    Nikko

    #1082687

    Works perfectly, such a life saver. Thank you for your help!

    #1082861

    One 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.

    #1082884

    Hi Micheal0424,

    You’re welcome :)
    Go to Enfold > General Styling > Quick CSS, then add this css code:

    #top p.cat {
        display: inline-block;
    }

    Best regards,
    Nikko

    #1082887

    No luck, any other ideas?

    #1082891

    Hi Micheal0424,

    Try flushing out the cache.
    This is what I see on my end (screenshot in private content)

    Best regards,
    Nikko

    #1082898

    Okay, thanks!

    #1082908

    Hi Micheal0424,

    Glad that we could help :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘display blog post category when using advance layout editor’ is closed to new replies.