All posts in WordPress

Twenty Eleven Child Theme

Download Twenty Eleven Child Theme (zip 25kb)

Child Theme screenshot

Have Questions? Of Course You Do.

What is a Child Theme: A WordPress child theme is a theme that inherits the functionality of another theme, called the parent theme, and allows you to modify, or add to, the functionality of that parent theme.

Why do I need a child Theme? When there is an update to the core features in the parent theme, you can update the theme without affecting the customizations that you’ve made in the Child Theme.

How do I activate the Child Theme? WordPress Child Themes are located in /wp-content/themes/ just like any other WordPress Theme. And they’re also activated from the WordPress admin like any other theme.

Dashboard - Appearance - Themes - Upload - Add new Theme

Installing a new theme

I don’t use twenty eleven, can I still use your style theme? Yes, just open the “style.css” and update the following lines to suit your own installation.

Theme Name: Twenty Eleven Child Theme 
Theme URI: http://theme.wordpress.com/themes/twentyeleven/
Description: Child theme for customizing Twenty Eleven.
Version: 1.0
Author: WordPress Ann Arbor
Author URI: http://wordpressannarbor.com/
Template: twentyeleven

@import url("../twentyeleven/style.css");

A quick explanation of each line:

  • Theme Name: (required) Child theme name.
  • Theme URI: (optional) Child theme webpage.
  • Description:(optional) What this theme is. E.g.: My first child theme. Hurrah!
  • Version: (optional) Child theme version. E.g.: 0.1, 1.0, etc.
  • Author: (optional) Author name.
  • Author URI: (optional) Author webpage.
  • Template: (requireddirectory name of parent theme, case-sensitive.
  • @import url(“../twentyeleven/style.css”); Change twentyeleven to the directory name of parent theme, case-sensitive
Goog Luck, if you have any questions please leave comment below.

How to write a great bug report

jetpack

Jetpack sent an email “How to write a great bug report” on Nov 18, 2011. I wanted to share Scott Burkun’s post, because I found it very interesting and I plan to share it with my clients.

We know you don’t like bugs. We don’t like them either. But as they’re an unavoidable part of software, it’d be good for us to share how best to report issues to us to speed things along.

In short, here’s a great rule: If we can’t reproduce the bug, we can’t fix the bug.

When you report a bug to us, here’s what happens:

  1. We read the bug report
  2. One of us tries to reproduce the bug
  3. If we can reproduce it, we investigate what’s broken and fix it.
  4. But if we can’t reproduce the bug…

Often bug reports don’t include enough information. Meaning we have go back and ask for details so we can investigate. If you want to increase the odds we fix an issue, and fix it fast, help us out.

A great bug report include the following:

  1. What were you trying to do?
  2. What did you click on or do last?
  3. What happened / what did you see?
  4. What browser are you using?
  5. What version of WordPress?
  6. What hosting provider? (And if you know, what version of PHP do they use?)

You don’t need to be verbose. A sentence for each is often just fine.  And bug reports that show screenshots for #3 are incredibly useful, as we can see exactly what you saw.

We work hard to have you deal with as few issues as possible, but if you want to improve the odds we can fix your issue fast, please take a extra minute to write a bug report that’s easier for us to use.  Thanks.

My WordCamp Detroit 2011 Matlib

madlib

(I’ll update this later today.)

This weekend I met ___________ who has been working with WordPress for ___________ years. He/She specializes in ___________. After this weekend I must visit ___________ and download ___________ for my WordPress site. I didn’t know WordPress can be used for ___________. I must learn more about ___________ because it ___________. On Monday I will reach out to ___________ about ___________. I think WordCamp Detroit was ___________.

 

Visit WordCamp Detroit.

WordCamp Detroit 2011

Wordcamp Detroit

Have you got your tickets yet for WordCamp Detroit?

You can purchase tickets for the two-day event (Nov 12 – 13, 2011) for $40. Compared to other tech conferences that is a bargain.

WordCamp Detroit have an exciting line up of speakers, personally I’m looking forward to the “WordPress Community Workshop” session on Sunday.

P.S. (disclosure) I’m one of the WordCamp Detroit Organizers.

WordPress Cheat Sheets

wordpress-cheat-sheets

http://wp.tutsplus.com put together a couple of useful WordPress Cheat sheets. Check ‘em out!

Template Hierarchy Map

Template Heirarchy Map

This particular cheat sheet is a glossed up version of the WordPress Template Hierarchy. It shows the full priority list of how template files within your theme are loaded.

Theme Anatomy Model

Theme Anatomy Model

This is simply a rough diagram to give you an idea of what makes up the most generic of WordPress themes out there! A quick visual model that can be a great helper when trying to wrap your brain around what goes into a WordPress theme.

The Loop Visual Model

The Loop Visual Model

The Loop is easily one of the most powerful and crucial pieces of WordPress to understand, and while there’s a lot already written about it, it’s also just nice to have a quick reference for the loop in the event that you need a fast refresher.

The Loop Code Snippet

The Loop Code Snippet

The Loop is used by WordPress to display each of your posts. Using The Loop, WordPress processes each of the posts to be displayed on the current page and formats them according to how they match specified criteria within The Loop tags.

Exclude Pages from WordPress Search Results

If you want to Exclude specific pages such as /Thank-You/ and /Cancel-Order/ from your WordPress internal search, you can add the following code to your function.php file.

Note: just replace 12,14, with your Page ID’s


// Remove About Page from WP Search Results //
function mySearchFilter($query) {
if ($query->is_search) {
$query->set('post__not_in', array(2,451));
}
return $query;
}
add_filter('pre_get_posts','mySearchFilter');

WordPress Conditional Tags

The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches. For example, you might want to display some text above the series of posts, but only on the main page of your site, with the is_home() Conditional Tag, that task is made easy.

Common Conditional Tags

is_home()
When the main blog page is being displayed.

is_front_page()
When the front of the site is displayed

is_single()
When any single Post (or attachment, or custom Post Type) page is being displayed.

is_page()
When any Page is being displayed.

is_category()
When any Category archive page is being displayed.

is_tag()
When any Tag archive page is being displayed.

is_author()
When any Author page is being displayed.

Example Conditional Code

<?php  if ( is_page( 'is_front_page' ) ) {   ?>
This Conditional Tags would only appear on your site's homepage.
<?php  } ?>

Shopp ecommerce Checkout Validation

If you have Shopp ecommerce plugin installed and your checkout page is not giving you error alerts.

Go To: checkout.php in the form tag change it to

"class="shopp validate validation-alerts"

Permalink Performance

Make sure to end your structure with either %post_id% or %postname% 

(e.g. /%year%/%monthnum%/%day%/%postname%/)

so that each permalink points to an individual post.

For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text “page slug” as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties).

So, it is best to have at least two path segments in your post’s permalink structure such as /%year%/%postname%/ or even /posts/%postname%/(Some people recommend /%post_id%/%postname%/ which works for performance reasons but others recommend against it because it is unfriendly to users in the many contexts in which users interact with URLs.) 

Read More Link after Blog Post Excerpt [...]

I was a little annoyed the only way that users could continue reading my posts was to click on the blog title or the post image. I did not feel this was 100% user friendly or intuitive for the reader.

I needed to replace [...] at the end of the blog excerpt, with a link and some text that made more sense such as “Read more” or Continue Reading”.

The problem:

Notice how the excerpt text ended with [...]

[...]

The Solution

Notice how the excerpt text now ends with …Continue Reading… which also links to the rest of the post.

continue reading excerpt

The Fix.

I opened my WordPress “functions.php” file and added the follow code