Author Alias

Posted in: Newspaper
Post count: 9

Hi,

I need to show Author Alias name instead of Author name. This field was imported from Joomla. I’ve been looking and this comes from your theme that is not using the standard way to display the author name.

In includes/wp_booster/td_module_single_base.php in the function get_author() (line 78) it uses: get_the_author_meta(‘display_name’, $this->post->post_author) whereas it should use of get_the_author().

I could change this on Child theme but I read Wp_booster content is not working on child theme.
How could I fix this?

Thanks in advance,

Post count: 20688

Hi,

Not all the files from the booster folder can be customized in the child theme. However the file you mention can be
https://forum.tagdiv.com/the-child-theme-support-tutorial/
So you can make the modifications you want in a child theme for that file.

Thanks

Post count: 9

Thanks, I changed the file in the Child theme and I fix the problem.

I have another question related to this one… How can I display Author name in all article preview in block.
For example in Block 4 there is a related article where it’s display Author name and Date but in the right column there are more articles that only shows the Date.
I checked Theme Panel and activated Author name, but nothing changes.
I want the author name in all kind of Blocks.

Post count: 9

I found in td_module_6.php and other modules Author name is disabled.
I enabled and now it’s showing the Author name, but not the Author Alias.
What I have to change to display Author Alias in this kind of blocks? You can check http://www.nabarralde.eus to realize the author name in the preview and inside the article it’s not the same.
Thanks,

Post count: 20688

Hi,

Some modules are not supposed to display the author name, that is the case with module 6 you mention. The modules are designed to display the author name of the post not the alias
https://www.screencast.com/t/LcDI4cOoZD
You will probably have to make modifications to the module, in order to display other information. Also the main function may need modifications
https://www.screencast.com/t/wkqxz2lG

Thanks

Post count: 9

Hi,

I know how I have to enable the option to display author name. As you said in module 6 is deactivated by default.

The problem is that I’m not able to display the alias. I changed code in td_module.php but I get always the same name. How can I get the Author Alias of the Post?

This is a must for my client so I’ll be very gratefull if you can provide me as much informacion as you can.

Thanks!

Post count: 9

Hi,

Found the solution, I have to changed this code is td_module.php.

function get_author() {
$buffy = '';

if ($this->is_review === false or td_util::get_option('tds_m_show_review') == 'hide') {
if (td_util::get_option('tds_m_show_author_name') != 'hide') {
$author_alias = get_post_meta($this->post->ID, 'author_alias', true);
$author_name = !empty($author_alias)? $author_alias : get_the_author_meta('display_name', $this->post->post_author);

$buffy .= '<span class="td-post-author-name">';
$buffy .= 'post->post_author) . '">' . $author_name . '' ;
if (td_util::get_option('tds_m_show_author_name') != 'hide' and td_util::get_option('tds_m_show_date') != 'hide') {
$buffy .= ' <span>-</span> ';
}
$buffy .= '</span>';
}

}
return $buffy;

}

td_module.php file is ignored in Child Theme? If I make there the change nothing changes.
Any option to keep this modification and not lost it in the next update?

Thanks

Post count: 20688

That file cannot be modified through the child theme, according to the guide
https://www.screencast.com/t/RHHJFsETYXi
The only way would be to make the modification in the theme file directly. You could update the theme by patch, while checking if the respective file was modified in any when an update is released.
Each theme package will contain a patch folder
https://forum.tagdiv.com/whats-included/

Thanks

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