Title: zerohc's Replies | WordPress.org

---

# zerohc

  [  ](https://wordpress.org/support/users/zerohc/)

 *   [Profile](https://wordpress.org/support/users/zerohc/)
 *   [Topics Started](https://wordpress.org/support/users/zerohc/topics/)
 *   [Replies Created](https://wordpress.org/support/users/zerohc/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/zerohc/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/zerohc/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/zerohc/engagements/)
 *   [Favorites](https://wordpress.org/support/users/zerohc/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Easy Contact doesn’t work](https://wordpress.org/support/topic/easy-contact-doesnt-work/)
 *  [zerohc](https://wordpress.org/support/users/zerohc/)
 * (@zerohc)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/easy-contact-doesnt-work/#post-1091235)
 * kharles and beckerartography:
 * I landed here with the same issue.
 * I took a look at the code for the plugin and found the problem. The message only
   includes the form submitter’s information in one place — the “Reply-To:” field.
 * So if you reply to the email, you’ll see the submitter’s name and email address
   in the To: field.
 * I want the email to have the submitter’s information in the From: field (name
   and email address), and also have the info in the body of the email. Here’s what
   I did:
 * 1. Open econtact.php, in the easy-contact folder (make a copy first in case something
   breaks)
 * 2. Around line 233, look for:
 * `$headers .= "From: $from_name <$from_email>\r\n";`
 * and replace with:
 * `$headers .= "From: $user\r\n";`
 * That will change the email header information and display the submitter’s info
   in the From: field.
 * 3. Around line 250, look for:
 * `$message .= __( 'Website: ', 'easy_contact' ) . strip_tags(trim($_POST['ec_url']))."\
   n\n---\n";`
 * and insert these 2 lines just before it:
 *     ```
       $message      .=  __( 'Name: ', 'easy_contact' ) . strip_tags(trim($_POST['ec_name'])) . "\n\n";
       $message      .=  __( 'Email: ', 'easy_contact' ) . strip_tags(trim($_POST['ec_email'])) . "\n\n";
       ```
   
 * 4. Save and replace the original file on the server.
 * The email you receive will now look like:
 * _Here is the message…_
 * —
    Name: _person’s name_
 * Email: _person’s email_
 * Website: _person’s URL_
 * —
    _All the other info (IP, referrer, etc)_
 * I’ve tested it out, and this works properly…
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How do I customize template via “$post_author” variable???](https://wordpress.org/support/topic/how-do-i-customize-template-via-post_author-variable/)
 *  [zerohc](https://wordpress.org/support/users/zerohc/)
 * (@zerohc)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/how-do-i-customize-template-via-post_author-variable/#post-1060971)
 * Hi Michael,
 * I think I’m trying to do the same thing the OP was looking for, but to no avail…
   I’m trying to add a conditional statement to header.php that tests if the post
   is written by a particular author. This would only apply to actual post pages(
   that use single.php) and not to the homepage (index.php) or archives (archive.
   php). The code would then call a specific CSS stylesheet based on the author’s
   name:
 *     ```
       <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/style
       <?php
         $author = get_the_author();
         if ($author=="John") {
           echo "-john";
         } elseif ($author=="Jake") {
           echo "-jake";
         }
       ?>
       .css" type="text/css" media="screen" />
       ```
   
 * If the author is John, the stylesheet that would be called would be ‘style-john.
   css’, ‘style-jake.css’ for Jake, and ‘style.css’ if there’s no author (for index.
   php and archive.php).
 * I haven’t been able to get this to work, in the <head> section of header.php.
   BTW, I’m testing this all out on the default Kubrick template.
 * I’ve been able to get WordPress to echo the name of the author at the very top
   of the page using this:
 *     ```
       <?php
         $author = get_the_author();
         echo $author;
       ?>
       ```
   
 * When viewing a single post, it will show the author’s name right at the top of
   the page before the header. If you’re on the homepage, nothing displays, which
   is exactly how I want it.
 * If I drop this code into header.php anywhere before the opening <body> tag, nothing
   displays at all.
 * I’ve tried all of this with the code you suggested, but I get the same thing.
 * Any tips? Is what I want to do even possible? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)