SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    WordPress Themes/Templates: Need Overview

    I'm setting up my first WordPress site and want to style my sections (categories) and pages. First, I want to add my own footer and Google AdSense to every page.

    Next, I want to change the section/category home page at MySite/world with my own design. The child pags (e.g. MySite/world/spain) will be a little different still.

    It sounds like I'm going to be working with both Themes and Templates. I've been reading about both on WordPress' site, but I don't yet understand how they work, or what one does first.

    To insert a footer and Google AdSense on every page, would I simply modify a particular template? If I want to change the look of MySite/world, what would I do first?

    Thanks.

  2. #2
    SitePoint Zealot somecallmejosh's Avatar
    Join Date
    Sep 2006
    Location
    CT
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wordpress themes are generally made up of several different files. A header.php, sidebar.php, footer.php, and an index.php which uses server side includes to pull in the content from the remaining files into the page.

    <?php get_footer(); ?> - pulls the contents of the footer.php page into the index.php page.

    <?php get_sidebar(); ?> - pulls the contents of the sidebar.php page into the index.php page.

    I think your understanding of templates refers to each of the pages I just mentioned. You would update the footer.php file to include your Google Adsense script on every page of the site. Or, you could install one of the Adsense plugins listed here: http://www.quickonlinetips.com/archi...oogle-adsense/.

    Download and unzip whatever plugin you choose - make sure to scan it for viruses first. Use an FTP client to upload the plugin to the wp-content/plugins folder. Then login to your administrative console on wordpress, and go to the plugins page. You'll see how to activate the plugin from there.
    Joshua K. Briley
    Website Design and Front End Development

  3. #3
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by somecallmejosh View Post
    wordpress themes are generally made up of several different files. A header.php, sidebar.php, footer.php, and an index.php which uses server side includes to pull in the content from the remaining files into the page.

    <?php get_footer(); ?> - pulls the contents of the footer.php page into the index.php page.
    So I could add my own personal footer by simply locating the footer.php file and inserting a link to my footer, right?

    <?php get_sidebar(); ?> - pulls the contents of the sidebar.php page into the index.php page.

    I think your understanding of templates refers to each of the pages I just mentioned. You would update the footer.php file to include your Google Adsense script on every page of the site. Or, you could install one of the Adsense plugins listed here: http://www.quickonlinetips.com/archi...oogle-adsense/.

    Download and unzip whatever plugin you choose - make sure to scan it for viruses first. Use an FTP client to upload the plugin to the wp-content/plugins folder. Then login to your administrative console on wordpress, and go to the plugins page. You'll see how to activate the plugin from there.
    Thanks for the tip about the AdSense plugin; I'll definitely download that one.

    But how do you scan a plugin for viruses? On my PC, I just used anti-virus software to automatically scan my entire hard drive. Now I'm on a Mac, so I don't use anti-virus software at all.

    Another question: Can I download my entire website via Dreamweaver, then use Dreamwever to publish individual files, plugins, etc.?

    Thanks.

  4. #4
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by geosite View Post
    But how do you scan a plugin for viruses? On my PC, I just used anti-virus software to automatically scan my entire hard drive. Now I'm on a Mac, so I don't use anti-virus software at all.
    I assume somecallmejosh meant to open the plugin up in a text editor and read through the code to check that that it isn't going to do anything nasty to the server. This isn't really an option if you don't know anything about programming/PHP though.

  5. #5
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ryanhellyer View Post
    I assume somecallmejosh meant to open the plugin up in a text editor and read through the code to check that that it isn't going to do anything nasty to the server. This isn't really an option if you don't know anything about programming/PHP though.
    I work with PHP, but I used it for web design, not scanning other people's software for viruses. But i would think the more popular WordPress plugins would be virus free.

  6. #6
    SitePoint Zealot somecallmejosh's Avatar
    Join Date
    Sep 2006
    Location
    CT
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So I could add my own personal footer by simply locating the footer.php file and inserting a link to my footer, right?
    Your footer.php file would contain only the html that makes up your footer. It may look something like

    Code:
    <div id="footer">
         <p>&copy;2009.  Your company name.  All rights reserved.</p>
         <p><a href="http://whatever-link-you-want.com">A link to where ever</a></p>
    </div>
    You can change this to whatever you want... assuming that your changes don't violate any legal agreements that may have been set forth by the designer/developer of the template.

    All you're doing is placing the html for the footer in another file, and then using the <?php get_footer(); ?> statement in the index.php file to include the footer in the main template. The benefit in doing this is in easier management of the website. If you need to change information in your footer, you only have to update it in one location... the footer.php file... when you do so, the all of your pages will be automatically updated.

    I assume somecallmejosh meant to open the plugin up in a text editor and read through the code to check that that it isn't going to do anything nasty to the server. This isn't really an option if you don't know anything about programming/PHP though.
    This is correct. When you download the plugin to your computer, prior to uploading it to your server, use your antivirus software to scan it to make sure it's safe.

    But i would think the more popular WordPress plugins would be virus free.
    I would agree with this, too. I generally take the overly cautious approach and scan anyway.
    Joshua K. Briley
    Website Design and Front End Development

  7. #7
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do most virus scanners check for bad scripts in PHP files? I assume they only checked for potential viruses on the computer the scanner is on, not for web servers.

    On the issue of header.php and footer.php files ... another way to do it is to have a single index.php file which contains both the headerand footer data and then drag the main content into it via conditional comments. I actually prefer working this way, but tend to go with seperate header and footer files when other people will be editing them as it is what people expect.

  8. #8
    SitePoint Zealot somecallmejosh's Avatar
    Join Date
    Sep 2006
    Location
    CT
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do most virus scanners check for bad scripts in PHP files? I assume they only checked for potential viruses on the computer the scanner is on, not for web servers.
    I am suggesting that the files be scanned locally before uploading them to the server. I'm sure there are server grade AV programs. I wouldn't know much about them, however. Sorry.
    Joshua K. Briley
    Website Design and Front End Development

  9. #9
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I knew that's what you meant. My question was whether there are actually any anti-virus programs for home PC's which can actually do this. I've always assumed they were designed for protecting the computer they are on, not web servers.

  10. #10
    SitePoint Zealot somecallmejosh's Avatar
    Join Date
    Sep 2006
    Location
    CT
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ryanhellyer View Post
    No, I knew that's what you meant. My question was whether there are actually any anti-virus programs for home PC's which can actually do this. I've always assumed they were designed for protecting the computer they are on, not web servers.
    Sorry. I misunderstood your question. I'd be interested in learning the answer to this question, too.
    Joshua K. Briley
    Website Design and Front End Development

  11. #11
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by geosite View Post
    I work with PHP, but I used it for web design, not scanning other people's software for viruses. But i would think the more popular WordPress plugins would be virus free.
    I think that is a fairly reasonable assumption.

    There is always a risk though.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •