MEET SITKA | A super-customizable modern WP theme!

Okay
  Print

Add an email icon to Redwood

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



ADDING AN EMAIL ICON TO YOUR TOP BAR

 

  

Navigate to WP Dashboard > Appearance > Editor > and open up the file titled "header.php".

Beginning on Line 47, you'll see a long list of the various social network icon options.
At the bottom of the list, on the blank Line 61, 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


Navigate to WP Dashboard > Appearance > Editor > "inc" folder > "widgets" folder > and open up "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 21, you'll see a long list of the various social network icon options.
On the blank Line 35, 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

 

Your social share icons are the icons beneath your posts on their singular post page which allow visitors to share your content on their own social media site.  

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 approximately Line 131, where you should see the last line of code for the Google Plus social share icon. It will look like this:

<a target="_blank" href="https://plus.google.com/share?url=<?php the_permalink(); ?>"></a>

Create a new, blank line below this Google Plus code. 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"><i class="fa fa-envelope-o"></i></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 Line 37, you will see the line of code for your Google Plus social share icon. Create a new, blank line below this Google Plus code. You can again copy & paste the above email icon code onto this new, blank line. Edit the dummy text as you'd like and then save changes when finished.