New Landing How can we help? Atelier Avatar image and year in posts in homepage

Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Atelier
  • #210570
    macarri80
    Member
    Post count: 15

    Hi,
    it’s a very simple question, but I can’t find where to upload an image to use as avatar in posts.

    And I would like to show the year in the blog posts that appears at the bottom of the homepage.

    Thanks

    #210886
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    1) You need a Gravitar assosiated with the email address you use to manage your WordPress site: https://en.gravatar.com/.

    2) Not a simple modification. Please activate your child theme, within the functions.php file please add this:

    	/* DATE FIGURE OVERLAY
    	================================================== */
    	function sf_override_date_figure_overlay() {
    		global $post, $sf_options;
    		$remove_dates  = $sf_options['remove_dates'];
    
    		if ($remove_dates) {
    			return;
    		}
    
    		$post_date_month = get_the_date('M');
    		$post_date_day = get_the_date('d');
    		$post_date_year = get_the_date('Y');
    		return '<div class="date-overlay narrow-date-block"><span class="month">'.$post_date_month.'</span><span class="day">'.$post_date_day.'<span class="month">'.$post_date_year.'</span></div></div>';
    
    	}
    	add_filter( 'sf_override_before_recent_post_thumb', 'sf_date_figure_overlay', 30 );

    Thanks,
    David

    #210923
    macarri80
    Member
    Post count: 15

    Hi David,

    thanks for your reply.

    1) Perfect, I didn’t know that.

    2) I’ve pasted the code in function.php in folder Atelier Child Theme but nothing different happens in homepage. I’ve also tried deleting the cache. You can edit the file from WP admin if you need to test.

    #211311
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Have you added anything else to your theme functions, I cannot view the site.

    Please add your FTP details so I can take a look at the functions.php file.

    – David.

    #211314
    macarri80
    Member
    Post count: 15
    This reply has been marked as private.
    #211323
    David Martin – Support
    Moderator
    Post count: 20834

    Appologioes, there were two errors in my code. First was the filter name, second was a double closing div.

    Here is the tested working new code which I have added to your functions.php file.:

         function sf_override_date_figure_overlay() {
         global $post, $sf_options;
         $remove_dates  = $sf_options['remove_dates'];
         
         if ($remove_dates) {
         return;
         }
         
         $post_date_month = get_the_date('M');
         $post_date_day = get_the_date('d');
         $post_date_year = get_the_date('Y');
         return '<div class="date-overlay narrow-date-block"><span class="month">'.$post_date_month.'</span><span class="day">'.$post_date_day.'<span class="month">'.$post_date_year.'</span></div>';
         
         }
         add_filter( 'sf_before_recent_post_thumb', 'sf_override_date_figure_overlay', 30 );
    #211325
    macarri80
    Member
    Post count: 15

    Perfect, thanks!

    #211326
    David Martin – Support
    Moderator
    Post count: 20834

    Great, no problem!

    -David.

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register