Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
virgilio
tagDiv Member

Can i Change More From Author to “Popular Last (7 days)” or “Popular All Time” in this line:

https://drive.google.com/a/engiefactory.com/file/d/0B1F0KKmFkXg0RGhFZ2R3OWl2d2s/view?usp=sharing

  • This reply was modified 9 years by virgilio.
  • This reply was modified 9 years by virgilio.
  • This reply was modified 9 years by virgilio.
virgilio
tagDiv Member

Hi, how can you do that? i need to do the same.

Thanks!

virgilio
tagDiv Member

Ready!

i can get the solution, just put a new function inside of td_module.php

function get_author_id() {
$buffy = get_the_author_meta(‘id’, $this->post->post_author);
return $buffy;
}

and then call this at td_module_2.php

<div class=”td-module-meta-info”>
<?php if (td_util::get_option(‘tds_category_module_16’) == ‘yes’) { echo $this->get_category(); }?>
<?php echo $this->get_author();?>
<?php echo $this->get_author_id();?> //<—— READY
<?php echo $this->get_date();?>
<?php echo $this->get_comments();?>
</div>

virgilio
tagDiv Member

Hi Bodgan,

Thanks for your help, but get_the_author_meta() in that case don’t show me the id of the author of the post in that loop, here the complete code:

<?php

/**
* this module is for Especialistas
* Class td_module_200
*/

class td_module_200 extends td_module {

function __construct($post) {
//run the parrent constructor
parent::__construct($post);
}

function render() {
ob_start();
?>

<div class=”<?php echo $this->get_module_classes();?>”>
<?php
// i need print here the id of author
$id_foto = get_the_author_meta(‘ID’);
userphoto($id_foto);
?>
<div class=”item-details”>
<?php echo $this->get_title();?>

<div class=”td-module-meta-info”>
<?php if (td_util::get_option(‘tds_category_module_16’) == ‘yes’) { echo $this->get_category(); }?>
<?php echo $this->get_author();?>
<?php echo $this->get_date();?>
<?php echo $this->get_comments();?>
</div>
</div>

</div>

<?php return ob_get_clean();
}

}

virgilio
tagDiv Member

Hi Catalin,

Thanks for your help, i find solution to take a template following this instructions from codex https://codex.wordpress.org/Post_Type_Templates

virgilio
tagDiv Member

Bogdan,

Thanks for your help, i work with a child theme of newspaper so i have the folder newspaper-child, and the td_config.php are inside of newspaper/includes/td_config.php so:
– i need to copy this folder “includes” into my child theme folder?
– i can add the code for custom-template.php registration over the newspaper folder? in that case what root i need to use for “file” parameter ‘file’ => td_global::$get_template_directory . ‘/single_template_1.php’ ?

thanks again!

Viewing 6 posts - 1 through 6 (of 6 total)