intro to wordpress development: tweaking your theme

Post on 06-Sep-2014

4.981 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

WordCamp Louisville 2011

TRANSCRIPT

Tweaking Your Theme

• Guide new users to become more familiar with their theme• Tips to tweaking design• Share resources with easy to understand tutorials for

helping users customize their themes• Why code snippets can be a better choice than plugins• A touch on child theming

 

You need to be familiar with WordPress (basic concepts of taxonomy, the loop, and at least the required functions to get a theme working. You need to be familiar with PHP, HTML, CSS, and making graphics.

Basic• 404.php• archives.php• comments.php • footer.php• functions.php • header.php• index.php• page.php• search.php • sidebar.php• single.php

Others • author.php• category.php• home.php

  More template files to consider at above link.

 

<!-- Start the Loop. --> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>  <div class="post" id="post-<?php the_ID(); ?>">  <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>  <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small> <div class="entry"> <?php the_content(); ?> </div> <p class="postmetadata">Posted in <?php the_category(', '); ?></p></div> <?php endwhile; else: ?>  <p>Sorry, no posts matched your criteria.</p> <?php endif; ?>

http://codex.wordpress.org/Child_Themes A child theme basically overwrites some of the active parent theme to add style or certain functionalities not originally developed or designed in the original theme.  

Plugins are great and normally versatile when you are changing from theme to another theme. Code snippets are theme specific. While plugins are awesome, code snippets can cut down data resources and memory with your web host.  While adding snippets to another theme each time you change your theme is tedious, you are saving yourself grief from your host. Those of you with quickly growing sites will eventually have this issue and seek memcache, CDN and/or bigger hosting service plans. Do yourself a favor and give yourself a plugin diet.

Code Snippet to limit excerpt lengthadd_filter('excerpt_length', 'my_excerpt_length');function my_excerpt_length($len) { return 100; }

Code Snippet for Post Thumbnailadd_theme_support( 'post-thumbnails' );set_post_thumbnail_size( 150, 150, true ); // Normal post thumbnailsadd_image_size( 'single-post-thumbnail', 400, 9999 ); // Permalink

thumbnail size

These simple things go in the functions.php template file.

• WPhacks.com• JustinTadlock.com• Themeshaper.com• WPBeginner.com• WPAddict.net• Digwp.com• Perishablepress.com• WPRecipes.com

 

nile@blondish.net Twitter: @blondishnet OR @wpaddict Facebook: fb.com/NileFlores or

fb.com/WPAddict

top related