Skip to content

two or three post information under image #68

@Eike-L

Description

@Eike-L

Hello,
how can I show two or three post information under image, eg. Tags, date and number of comments?
The responsible files for it found. What do I need to change the files?

content.php

<?php
	if(get_theme_mod('portfolio_post_show_tags', '1') == '1') {
		$tag_list = get_the_tag_list('<ul class="tags-links"><li>',', </li><li>','</li></ul>');
   		if ($tag_list) {
    	echo $tag_list;
    	}
	}
?>

customizer/sanitization.php

function portfolio_meta_types($value) {
	$types = array(
		'tags',
		'categories',
		'date',
		'title'
	);
	
	if(in_array($value, $types)) {
		return $value;
	}
	
	return null;
}

theme-customizer.php

	$wp_customize->add_setting(
	    'portfolio_meta_type',
	    array(
	        'default'   => 'tags',
	        'capability' => 'edit_theme_options',
	        'sanitize_callback' => 'portfolio_meta_types'
	    )
	);

    $wp_customize->add_control(
        'portfolio_meta_type',
        array(
            'section'  => 'static_front_page',
            'label'    => __('Post information under image', 'portfolio'),
            'type'     => 'select',
            'choices'  => array(
            	'tags' => __('Post tags', 'portfolio'),
            	'categories' => __('Post categories', 'portfolio'),
            	'date' => __('Post date', 'portfolio'),
            	'title' => __('Post title', 'portfolio')
            )
       	 )
    );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions