Tag Archives: Wordpress

WordPress 3.8 & Twenty Fourteen Theme

I just upgraded to WordPress 3.8 and decided to stay with my trend of using the default themes when possible.

I did setup a Twenty Fourteen Child Theme so I could make modifications. The only change I made so far is to the footer file so I could add my copyright.

The main idea is that I want my site to be flexible enough to change easily and being able to switch to the default theme at any time pretty much assures me I have everything set to make easy changes.

This was the easiest change I have seen when it comes to using the theme that ships with WordPress. The only real change I needed was to go into the Menu option and save the location of the menu. Previously that was a little more work and required rebuilding the menu.

 

How To Disable A Parent Item Link on WordPress Menu

While working on a Client site recently it became apparent we needed to make the top level Parent link not go anywhere. As an example if you have a menu item named Products, and under it you have 10 product pages you may want that top item not to be active.

Disable WordPress Menu Parent ItemThere are several plugins you can install that will do different things with these links, however, the simpliest method is to apply a # to the link. From the Admin sidebar, select Menus. Under Custom Links insert a # in the URL, and give the menu item a Label. Add the custom menu item to the menu and then place your children links under it.

Now from any page the Top item will have a link, but it will simply stay on the current page.

 

Add Author to RSS Feed in WordPress

If you have multiple authors on a WordPress blog you may want to add the Author name to the RSS feed title.

Although the standard RSS feed file in WordPress contains the author if you view the RSS feed you will not be able to see the Author name through standard readers as it is not converted.

A good example is to look at a WordPress feed that uses Google Reader and you will not see the Author listed.

One solution of course is to change the WordPress Feed files, however, if you do this every time you update WordPress your change will get written over. The easier and better solution is to add the small snippet of code below to your WordPress Themes function file.

 

function wp_titlerss($content) {
global $wp_query;
$content = $content." by ".get_the_author();
return $content;
}

add_filter('the_title_rss', 'wp_titlerss');

 

 

Static HTML to WordPress Conversion Case Study

Converting older static html sites to WordPress is one of the most popular things for me to work on. Seems there are still a lot of older sites that have no CMS system and when people decide to finally convert these sites WordPress is one of the most popular options.

I used my holiday time to convert one of my own static sites. I wanted to use it as a case study in procedure and time. The site I converted was my Scripts and Database site, CyberCoded.com. This is one of my older sites and I have been too busy to convert it so I continued to manually add pages as needed.

I have about 10 hours invested in the whole process to convert this site. The bulk of the time is in the custom coding of a WordPress Theme from scratch to match an older site. There were 12 pages when I started and as some of the pages had different extensions I decided to convert the site using my favorite WordPress permalink structure and then redirect the old pages.

I used my Blank WordPress Theme so that I could start with a clean slate and match the design to the old site.

Here are the steps I took.

  1. Installed WordPress in a Sub Folder
    • Set Privacy setting to OFF while I developed the site in a sub folder.
    • Modified the permalink to my favorite which is /%postname%/
  2. Installed the Blank theme in the WordPress Themes folder.
    • I used FTP to upload the files into a new theme folder in WordPress.
  3. Copied and matched elements from the old Style.css file into the WordPress Style.css
    • The blank theme has an empty CSS file.
    • The Body and Links were the only elements called out in the old CSS file.
    • Added Wrapper, Content, Header and Footer Divs to CSS.
  4. Copied the Index.php file to home.php so I could have a custom Home page that would match the old page.
    • Simply copying the file like this makes a new home page with the home.php file.
  5. Modified the WordPress code in the Home page to show each category and posts as lists.
    • Stripped out the common WordPress Loop
    • Created new code that loops through the categories and list each post per category.
    • Set the Category to sort in Descending order.
    • Set the Post titles to sort Title in ascending order
  6. Created an Analytics.php file in the WordPress Theme to use throughout the site.
    • Retrieved the code from Google to use for analytics.php
  7. Created a Header.php file within the WordPress Theme to add common header elements.
    • Modified the Title so that it would be SEO friendly, very similar to most popular SEO plugins.
    • Added a call to analytics.php file
  8. Created a footer.php file in WordPress to add a common footer.
    • Used the code from the old static footer file for contact and info.
  9. Created Single.php page
  10. Created my Categories to match old site.
    • The old site had headers for each item type which I converted to Categories.
  11. Copied each page from the old site into Textpad and removed any code that would interfere with WordPress.
  12. Pasted each page into WordPress as a Post.
  13. Created Tag Page.
    • Tag page list the excerpt for each Post that is tagged.
  14. Created custom 404 page.
    • The 404 page shows a tag cloud to visitors.
  15. Created Search page.
    • Search page only shows title for a matched post.
  16. Widgetized and added a sidebar.
    • Create and set widgets in the functions.php file.
    • Add sidebar.php and corresponding code to use widgets.
    • Added a Facebook Like button.
    • Added RSS Button and link.
  17. Copied the index.php from the WordPress sub folder to the root and modified the code to use WordPress from the Sub Folder.
  18. Changed the Site Address within WordPress Admin to set the site in the root while leaving WordPress installed in the sub folder.
  19. Redirected the old pages to the new WordPress pages using PHP header calls.
  20. Installed and setup XML Sitemap Generator for WordPress Plugin

ALL DONE !

I copied the old Index file so we can see a before and after look.

Original Page versus New WordPress Site.

Most of the time was in the Theme setup. Each page took about 5 minutes to convert the content to a WordPress Post.

12 Pages, 10 hours

Think I will send my wife a bill and see if it gets paid, lol…

Convert HTML to WordPress

This is the second post I have written on this topic, the first post was Convert Static HTML Site to WordPress Easily. In that first post I covered a very simple way to convert a static HTML site to WordPress.

After almost 2 years of answering questions on that post I thought it was time to discuss the issue again.

I have done a dozen or so conversions since that post and I have found that some sites really need to take a fresh start approach to get the best result. The main reason for this is that a lot of older HTML sites are built with outdated techniques and WordPress has made some great advancements.

On these sites I create a sub folder for the WordPress install, such as /wp. This gives us designated area to work and learn WordPress without interfering with the original design. The hardest task may be getting a theme to match your original design, but I would suggest taking this time to update your original design. There are so many good WordPress Themes this should not be a problem. Once your theme is in place you can copy and paste your original content to the new install matching the page names. Depending on your original file extensions you may need to set the permalinks in WordPress.

Once this development is complete it is easy to change the Site address (URL) in WordPress to show the new site in the root. (Make sure to backup the original first!) Here is the link from the WordPress Admin panel that explains this.

If you need to learn WordPress and want to take a little time without being pressured to get the new site in place this is the best option I have found.