{"id":1026,"date":"2025-11-10T10:51:13","date_gmt":"2025-11-10T15:51:13","guid":{"rendered":"https:\/\/dox.opentechnologies.ca\/?p=1026"},"modified":"2025-11-10T17:32:03","modified_gmt":"2025-11-10T22:32:03","slug":"inspiro-theme-customization-avatar-in-byline","status":"publish","type":"post","link":"https:\/\/dox.opentechnologies.ca\/index.php\/2025\/11\/10\/inspiro-theme-customization-avatar-in-byline\/","title":{"rendered":"Inspiro Theme Customization | Avatar in byline"},"content":{"rendered":"\n<p>The following code was used to add a 35px by 35px image to the byline of an single post page.  The approach used is to modify the theme template tag &#8220;inspiro_single_entry_meta&#8221; to add the author avatar in front of the byline. <\/p>\n\n\n\n<pre class=\"wp-block-verse\">This article applies to WordPress Inspiro v2.1.4 by WPZOOM<\/pre>\n\n\n\n<p>Locate the file \/inc\/template-tags.php and locate the section &#8220;inspiro_single_entry_meta&#8221; and replace it with below code;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if ( ! function_exists( 'inspiro_single_entry_meta' ) ) :\n        \/**\n         * Prints HTML with meta information for the current post-date\/time and author.\n         *\/\n        function inspiro_single_entry_meta() {\n                $catlinks = '';\n\n                \/* translators: Used between list items, there is a space after the comma. *\/\n                $separate_meta = __( ', ', 'inspiro' );\n\n                \/\/ Get Categories for posts.\n                $categories_list = get_the_category_list( $separate_meta );\n\n                if ( inspiro_categorized_blog() &amp;&amp; $categories_list ) {\n                        $catlinks = sprintf(\n                                '&lt;span class=\"entry-categories cat-links\"&gt;%s %s&lt;\/span&gt;',\n                                __( 'in', 'inspiro' ),\n                                $categories_list\n                        );\n                }\n\n                $author_id = get_the_author_meta( 'ID' );\n                $avatar = get_avatar( $author_id, 32, '', '', array( 'class' =&gt; 'entry-author-avatar' ) );\n                $byline = $avatar . ' ' . inspiro_author_link();\n\n                $datetime = sprintf(\n                        '&lt;span class=\"entry-date\"&gt;%s %s&lt;\/span&gt;',\n                        __( 'on', 'inspiro' ),\n                        inspiro_time_link()\n                );\n                \/\/ Finally, let's write all of this to the page.\n                echo wp_kses(\n                        $byline . $catlinks . $datetime,\n                        array(\n                                'a'    =&gt; array(\n                                        'href'  =&gt; array(),\n                                        'title' =&gt; array(),\n                                        'class' =&gt; array(),\n                                ),\n                                'img'  =&gt; array(       \/\/ &lt;--- add this\n                                    'src'    =&gt; array(),\n                                    'class'  =&gt; array(),\n                                    'alt'    =&gt; array(),\n                                    'height' =&gt; array(),\n                                    'width'  =&gt; array(),\n                                ),\n                                'time' =&gt; array(\n                                        'datetime' =&gt; array(),\n                                        'class'    =&gt; array(),\n                                ),\n                                'span' =&gt; array(\n                                        'class' =&gt; array(),\n                                ),\n                        )\n                );\n        }\nendif;<\/code><\/pre>\n\n\n\n<p>Add the following to the theme CSS to style and tweak to your requirements. Its a good idea not to exceed 32px for wrapping of the article meta data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* Author avatar in post meta header *\/\n.entry-meta .entry-author-avatar {\n    width: 32px;                \/* match get_avatar() size *\/\n    height: 32px;\n    border-radius: 40%;         \/* make it circular *\/\n    vertical-align: middle;     \/* align with text *\/\n    margin-right: 6px;          \/* space between avatar and author name *\/\n    display: inline-block;      \/* ensure inline alignment *\/\n}\n\n\/* Optional: adjust spacing if categories\/date wrap awkwardly *\/\n.entry-meta .entry-categories,\n.entry-meta .entry-date {\n    margin-left: 10px;\n    font-size: 0.9em;           \/* slightly smaller than title *\/\n    color: #666;                \/* match meta color *\/\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following code was used to add a 35px by 35px image to the byline of an single post page. The approach used is to modify the theme template tag &#8220;inspiro_single_entry_meta&#8221; to add the author avatar in front of the byline. This article applies to WordPress Inspiro v2.1.4 by WPZOOM Locate the file \/inc\/template-tags.php and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/dox.opentechnologies.ca\/index.php\/2025\/11\/10\/inspiro-theme-customization-avatar-in-byline\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;Inspiro Theme Customization | Avatar in byline&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":751,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,41],"tags":[108],"class_list":["post-1026","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web","category-wordpress","tag-custom-theme"],"_links":{"self":[{"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/posts\/1026","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/comments?post=1026"}],"version-history":[{"count":11,"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/posts\/1026\/revisions"}],"predecessor-version":[{"id":1087,"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/posts\/1026\/revisions\/1087"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/media\/751"}],"wp:attachment":[{"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/media?parent=1026"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/categories?post=1026"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dox.opentechnologies.ca\/index.php\/wp-json\/wp\/v2\/tags?post=1026"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}