Close

Account

Documentation

Forum

Menu

How to add Author and Date to Modules

  • Post count: 26
    kirtok
    February 14, 2018 at 5:06 pm #28731

    Hello,

    I’m trying to add Author and Date information with icons to JNews – Module 23 and Author Information to JNews – Module 22. Can you guide me?

    Thanks

    Post count: 8754
    Adek
    February 15, 2018 at 9:27 am #28741

    Hi kirtok,

    Please try to change this file /wp-content/themes/jnews/class/Module/Block/Block_22_View.php then find this line (27) " . $this->post_meta_2($post) . " replace with this " . $this->post_meta_3($post) . ".

    For the icon, you need to edit this file /wp-content/themes/jnews/class/Module/ModuleViewAbstract.php then find this line (488) $output .= get_theme_mod('jnews_show_block_meta_author', true) ? "<div class=\"jeg_meta_author\"><span class=\"by\">" . jnews_return_translation('by', 'jnews', 'by') . "</span> <a href=\"{$author_url}\">{$author_name}</a></div>" : ""; replace with this $output .= get_theme_mod('jnews_show_block_meta_author', true) ? "<div class=\"jeg_meta_author\"><i class=\"fa fa-user\"></i> <span class=\"by\">" . jnews_return_translation('by', 'jnews', 'by') . "</span> <a href=\"{$author_url}\">{$author_name}</a></div>" : "";. You can change the icon as you need (we’re using FontAwesome for the icon).

    Thank you

    Post count: 26
    kirtok
    February 22, 2018 at 7:27 pm #28907

    Thank you, it looks great.

    Is it possible to add author image before name?

    Post count: 8754
    Adek
    February 23, 2018 at 11:29 am #28939

    You can try to use get_avatar function to get author image. For complete information, you can check this article https://codex.wordpress.org/Function_Reference/get_avatar

    Thank you

You must be logged in to reply to this topic.