• I would like to change the way tags look on my blog, which uses a Twenty-Sixteen child theme.

    Right now, they look like this:

    Author Name
    Posted on September 16, 2016
    News
    Tag 1, Tag 2, Tag 3, Tag 4

    I want my tags to look like this:

    Author Name
    Posted on September 16, 2016
    News
    Tag 1
    Tag 2
    Tag 3
    Tag 4

    So, basically in a list — though not necessarily with a bullet point — and preferably without the separating comma.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    Add this function in your child theme’s functions.php file,

    
    function twentysixteen_entry_taxonomies() {
    	$categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
    	if ( $categories_list && twentysixteen_categorized_blog() ) {
    		printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
    			_x( 'Categories', 'Used before category names.', 'twentysixteen' ),
    			$categories_list
    		);
    	}
    
    	$tags_list = get_the_tag_list( '<ul><li>','</li><li>','</li></ul>' );
    	if ( $tags_list ) {
    		printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
    			_x( 'Tags', 'Used before tag names.', 'twentysixteen' ),
    			$tags_list
    		);
    	}
    }

    after that, add this style in your child theme’s style.css

    .tags-links ul {
        list-style: outside none none;
        margin: 0;
    }

    It will do the trick ??

    Regards,

    Thread Starter Sal Barry

    (@sal-barry)

    I added the CSS to my child style.css file.

    I created a functions.php file with the code you suggested and uploaded to the folder for my child theme.

    It did not work.

    Does the code need to be on the functions.php file for the twenty-sixteen theme, or should it work if put on a functions.php file in the child theme folder?

    Hi,

    This is the child theme I created for TwentySixteen theme for your requirement, you can test that, https://take.ms/SGEXC and take that as a example, and make the same work in your child theme.

    Regards,

    Thread Starter Sal Barry

    (@sal-barry)

    The code from the functions.php file you gave me worked perfectly.

    Many thanks!

    Hi,

    You’re welcome. ??

    Keep rocking. ??

    -laranz.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show tags as a list’ is closed to new replies.