Block 15 – how to add date?

Posted in: Newspaper
Post count: 14

Hi,

how do I add date under title in “Block 15” similiar to “Block 4”?

Post count: 1043

This will involve editing theme files and it would be better if you use a child theme to prevent the changes being lost when updating the main theme.
1. Go to Newspaper>Includes>Modules and look for td_module_mx4.php (main theme). Then open it and replace the code inside it with this and save.

<?php
class td_module_mx4 extends td_module {
function __construct($post, $module_atts = array()) {
//run the parrent constructor
parent::__construct($post, $module_atts);
}
function render() {
ob_start();
$title_length = $this->get_shortcode_att(‘mx4_tl’);
?>

<div class=”<?php echo $this->get_module_classes();?>”>
<div class=”td-module-image”>
<?php echo $this->get_image(‘td_218x150’);?>
<?php if (td_util::get_option(‘tds_category_module_mx4’) == ‘yes’) { echo $this->get_category(); }?>
</div>

<?php echo $this->get_title($title_length); ?>
<?php echo $this->get_date();?>

</div>

<?php
return ob_get_clean();
}
}

2. If you use a child theme, create a similar path inside the child theme. To do this, create a folder called ‘includes” inside the child theme, open the modules folder and create another folder inside it called ‘modules’, and finally, create a PHP file with the extension td_module_mx4.php inside the modules folder. Open the created php file and paste the code above and save. Go to your theme and see the changes.

Post count: 14

It was so simple :-), You are star. Anyway to all others who wants the same function remember to use “‘” instead of “’”.

Post count: 1043

You are welcome.

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.