Oleander - A Blog & Shop WordPress Theme

Add an email icon to Oleander

To add an email icon to your Oleander social icons which would allow visitors to send you an email, you can follow these steps:

 


ADDING AN EMAIL ICON TO YOUR TOP BAR

 

  

If you'r running the latest versions of WordPress, you can navigate to WP Dashboard > Appearance > Editor and open the file titled "header.php". 

Beginning on Line 35, you'll see a long list of the various social network icon options.  At the bottom of the list, on the blank Line 49, you can copy and paste the following bit of code:


<a href="mailto:YOUR-EMAIL-ADDRESS-HERE?subject=ADD-SUBJECT-LINE-TEXT-HERE &body=ADD-DEFAULT-BODY-TEXT-HERE" target="_blank"><i class="fa fa-envelope-o"></i></a>

 



There are three optional elements within the above code that you can replace in order to customize how the email looks when a user clicks on the email icon:

Mail to: Replace the "YOUR-EMAIL-ADDRESS-HERE" dummy text in the code with the email address you would like the emails to automatically be addressed to.

Subject: Replace the "ADD-SUBJECT-LINE-TEXT-HERE" dummy text with the text you'd like to automatically appear in the email's subject line.

Body: Replace the "ADD-DEFAULT-BODY-TEXT-HERE" dummy text with any text you'd like to automatically appear in the body of the email. If you'd like the email body to be blank, you can simply remove the dummy text.

Be sure to save the "header.php" file when you're done making changes.



ADDING AN EMAIL ICON TO YOUR SOCIAL ICON WIDGET

 


To add the email icon to your social icon widget, we'll need to access the "social_widget.php" theme file. 

Navigate to WP Dashboard > Appearance > Editor  > "inc" folder > "widgets" folder > and open up the file titled "social_widget.php".

Beginning on Line 60 is a long list of the available social networks.  Create a new, blank line immediately following the last option for "RSS" and before the closing "/div" tag.  

On this blank line, copy and paste the following:


<a href="mailto:YOUR-EMAIL-ADDRESS-HERE?subject=ADD-SUBJECT-LINE-TEXT-HERE &body=ADD-DEFAULT-BODY-TEXT-HERE" target="_blank"><i class="fa fa-envelope-o"></i></a>

 



To customize the "to" address, subject line, and body text of the email that will pop up for users, follow the previously noted steps above. 

When you're finished, be sure to save any changes to the "social_widgets.php" file.




ADDING AN EMAIL ICON TO YOUR FOOTER AREA

 



To add an email social icon to your footer, navigate to WP Dashboard > Appearance > Editor > and open up the file titled "footer.php". 

Beginning on Line 33, you'll see a long list of the various social network icon options.  On the blank Line 47, copy & paste the following code:

<a href="mailto:YOUR-EMAIL-ADDRESS-HERE?subject=ADD-SUBJECT-LINE-TEXT-HERE &body=ADD-DEFAULT-BODY-TEXT-HERE" target="_blank"><i class="fa fa-envelope-o"></i> <span>Email</span></a>



To customize the "to" address, subject line, and body text of the email that will pop up for users, follow the previously noted steps above. When you're finished, be sure to save any changes to the "footer.php" file.


ADDING AN EMAIL ICON TO YOUR SOCIAL SHARE ICONS

 

Social share icons are the icons that appear beneath your posts which allow visitors to share your content on their social media network. 

To add an email icon to your social share icons, navigate to WP Dashboard > Appearance > Editor > and open the file titled "content.php". 

Scroll down to blank Line 130, which is a blank line right after the last social share icon line of code for Google Plus:

On this blank line, you can copy & paste in the following code:

<a href="mailto:?subject=ADD-SUBJECT-LINE-TEXT-HERE &body=Check out this article: <?php the_permalink(); ?>" target="_blank"</a>

Feel free to adjust the ADD-SUBJECT-LINE-TEXT-HERE dummy text in the above code to whatever text you'd like to automatically appear in the person's email subject line. 

You can also replace the dummy "Check out this article:" text in the above code if you'd rather have it say something else in the person's email body. The post's URL will then be automatically inserted. 

Please remember to save changes to the file when finished. 

This will add the email share icon to your posts. 

To also add the email share icon to your pages, you can navigate to WP Dashboard > Appearance > Editor > and open the file titled "content-page.php". 

On blank Line 33, copy & paste the above email icon code. Edit the dummy text as you'd like and then save changes when finished.