TLC Developer Help

TLC Developer Help

This page will document the changes made to the Organic Non-Profit theme purchased for the new TLC website.  In the future, if a new theme is implemented or the current theme is updated, these changes would need to be made again.

The following are notes in the programmatic customization of this website, particularly in customizing the theme, functions, or plugins. This should prove helpful to future developers or maintainers of this site. If the theme is updated, these customizations will need to be applied again.

0. Several styles were modified, some new styles were added. To make these changes, the original style.css stylesheet (that shipped with the theme) was kept the same. Changes were made in the default Appearance -> Edit CSS window, to override the default styles.

1. home.php was edited in order to modify the mid-right block section of the home page to accommodate the latest blog posts. The idea was to list the latest three blog posts, then provide a link to read all past blog posts. In order to do that, a page must be created whose main content would be listed in this home page block, and would use a custom template that listed the latest 3 blog posts. Unfortunately, the latest three blog posts on that page was not included in the home page section (likely because the last 3 blog posts was being displayed through the template file php code and was not included in the database as the body content for that page.) Therefore, the home.php page must be edited to display the latest 3 blog posts (simulating what the page template displays) and also add a button at the bottom linking to the main blog.

The following begins around line 85 in home.php:

<div class="information">

<a class="feature-img" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php esc_attr(the_title_attribute()); ?>"><?php the_post_thumbnail( 'featured-medium' ); ?></a>

<div class="text-holder">
  <h2 class="title text-center"><?php the_title(); ?></h2>
  <?php the_excerpt(); ?>

<ul>
  <?php wp_get_archives('type=postbypost&limit=3&format=html'); ?>
</ul>

  <div class="align-center text-center">
    <a class="organic-btn white-btn" href="http://69.195.124.94/~tlcforsc/wordpress/category/tlc-blog/" rel="bookmark" title="<?php esc_attr(the_title_attribute()); ?>"><span class="btn-holder"><?php _e("Read More", 'organicthemes'); ?></span></a>
  </div>

</div>
</div>

2. index.php was customized to display default leaf image on blog posts. The following lines were added at line 6, between div class container and row:

	<?php if ( has_post_thumbnail()) { ?>
		<div class="feature-img page"><?php the_post_thumbnail( 'featured-large' ); ?></div>
	<?php } else { ?>
		<div class="feature-img page"><img src="<?php bloginfo('template_directory'); ?>/images/default-page.png" alt="<?php the_title(); ?>" /></div>
	<?php } ?>

3. archive.php also had the same problem. This page is used for listing of posts that belong to a certain category. WordPress will first look for a file named category.php or category-ID.php and will use archive.php if the others do not exist. The following lines were added at line 6:

	<?php if ( has_post_thumbnail()) { ?>
		<div class="feature-img page"><?php the_post_thumbnail( 'featured-large' ); ?></div>
	<?php } else { ?>
		<div class="feature-img page"><img src="<?php bloginfo('template_directory'); ?>/images/default-page.png" alt="<?php the_title(); ?>" /></div>
	<?php } ?>

4. header.php was customized to allow more flexibility in the logo and search box layout and design. TLC logo display was modified and social media icons were added near the search box. Length of the search box was also increased to accommodate the new icon list. The following changes were made:

<h1 class="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" 
      title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?>
      </a></span>
</h1>

…was changed to…

<h1 class="site-title">
<img src="http://tlcforscc.org/wp-content/uploads/2013/04/logo.png" style="float:left;height:150px;margin-top:-40px;">
<span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
The Land Conservancy for <br> Southern Chester County</a></span>
</h1>

and

<h4 class="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h4>

…was changed to…

<h4 class="site-title">
<img src="http://tlcforscc.org/wp-content/uploads/2013/04/logo.png" style="float:left;height:150px;margin-top:-40px;">
<span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<?php bloginfo( 'name' ); ?></a></span>
</h4>

and, this line was added after