SlideShare a Scribd company logo
1 of 23
Download to read offline
Section 1: Creating Dynamic Subject Guides
Laura Slavin and Joshua Dodson walk through using WordPress custom post types for

subject guides at the Lincoln Memorial University Carnegie -Vincent Library.


Like most academic libraries, Carnegie-Vincent Library (CVL) built web pages from the ground

up. Over the years it became apparent that the current form and design of these pages did not

meet the needs of the students, faculty, staff, and community at large. The format and design of

the website had become antiquated. Library staff spent hours revising the pages often repeating

the same changes on page after page. The users of the pages were inundated with a huge amount

of information with poor navigational options.



The librarians at CVL were just beginning to embrace the concept of Web 2.0. They wanted the

opportunity to be more involved with the website users by collaborating with students when

helping them with a research question or information literacy. The other requirement was that a

dynamic subject guide be created so that duplication of entry is eliminated. This also allows

librarians to provide subject expertise via the web.



How did we begin? The first step was to convince university administration that WordPress is a

good solution for the library's web design needs. This was not a hard sell. Administration was

pleased with our demonstrations and appreciated the fact that almost of the work will be in the

library with very little help needed from our information services department. Soon we were

beginning the famous five minute install. 1
The installation was successfully completed thanks to the expertise of our then Technical

Services Technician, Joshua Dodson. A web committee was formed and training sessions were

held for all librarians and staff. WordPress proved to be all that we anticipated and more.



The most innovative creation of our Technical Services Technician was the dynamic subject

guides. Joshua was able to take the custom post type functionality of WordPress and create a

dynamic component that updated our ability to add and control content in our WordPress

installation. Over the past two years, WordPress enhanced their capabilities making it easier to

provide this type of functionality. As this is the most innovative of our WordPress endeavors at

CVL, below is a step-by-step guide for creating dynamic subject guides using the latest

enhancements in WordPress.



A Subject Guide in WordPress

It is easy to create a subject guide using WordPress, especially with the new custom post types in

the WordPress core.




INSERT IMAGE [Chapter4_Part1_1.png]

CAPTION [Once you setup the subject guides as a custom post type, there will be an additional

area in your WordPress Dashboard for you to add and edit subject guides and the related

taxonomies ("Subjects" and "Subject Tags").]




INSERT IMAGE [Chapter4_Part1_2.jpg]
CAPTION [You are able to go into the "Subject Guides" screen to make modifications to the

subject guide posts that you create.]




As you add a new subject guide, you will want to treat each one as a post that will be categorized

within at least one subject. Your full subject guides will actually be displayed by subject when

utilizing the full potential of this system. It is best to add a title, a description within the post

body area, the website address or linked internet resource under the "Subject Guide Options"

screen, the subject categories and sub-categories that this post will fall under, and the appropriate

"Subject Tags." The subject categories are hierarchical, so you will most likely only need to

select one of the sub-categories per parent category. You will need to be sure to plan out the

structure of your hierarchy before you begin creating the subject guides. You will save yourself

much time later on if you plan first. Also, the subject tags are much less structured and can

provide additional places to describe the content in a way that will not interfere with the

hierarchy that you designate. The tags are a good place to add all of the extra metadata that there

is no clear place for beforehand.




INSERT IMAGE [Chapter4_Part1_3.jpg]


CAPTION [When you need to add or edit the subject categories, it will be very similar to adding

and editing the normal WordPress post categories. It uses a comparable structure. One thing to

note is that the description that is added here will be displayed later on in the subject guide

template. Be sure to add an informative description if you choose to utilize this feature.]
INSERT IMAGE [Chapter4_Part1_4.jpg]


CAPTION [When you need to add or edit the subject categories, it will be very similar to adding

and editing the normal WordPress post categories. It uses a comparable structure. One thing to

note is that the description that is added here will be displayed later on in the subject guide

template. Be sure to add an informative description if you choose to utilize this feature.]




INSERT IMAGE [Chapter4_Part1_5.jpg]


CAPTION [Similarly to the categories, the subject tags are very similar to the standar d

WordPress post tags. You can add and modify the tags by clicking "Subject Tags" on the left

side of the WordPress Dashboard under "Subject Guides."




INSERT IMAGE [Chapter4_Part1_6.jpg]


CAPTION [The A-Z Subject List will display all of the parent categories that have been created

for the subject guides. When you click on the parent category, then the 2nd level categories, or

sub-categories, will be listed with the descriptions and the posts under them.]




INSERT IMAGE [Chapter4_Part1_7.jpg]
CAPTION [The Subject Guide Index will list all of the posts that have been created as a subject

guide. This will list all of the posts, regardless of category. When you click on an individual post

it will take you to the page for that item, which includes a description of the item and also the

full list of categories and tags that has been assigned to this item.]




INSERT IMAGE [Chapter4_Part1_8.jpg]


CAPTION [An example subject guide post's individual listing.]




The complete subject guide, when brought together reveals the following functionality, which

includes the page title, category descriptions, sub-categories, and each post that has been added

beneath each sub-category. Note that this example is using simple theming options based on the

WordPress default Twenty Ten theme. You are able to include additional customizations as you

see fit by using CSS, JavaScript, and by modifying the PHP and (X)HTML that is described

below.




INSERT IMAGE [Chapter4_Part1_9.jpg]


CAPTION [An individual subject guide for philosophy.]
Using Custom Post Types to Create Dynamic Subject Guides in WordPress

To preserve functionality and maintain compatibility with the current WordPress theme, we will

begin by creating a child theme. The newest default theme at the time of this writing is Twenty

Ten, the HTML5 compatible and very flexible theme. We will use this as our base and create a

child theme so that we can take advantage of its rich structure and syntax. Creating child themes

has never been easier. First create a folder called “sg-theme” (or name it anything else you would

like) and a style.css file within the folder. The only requirement is that the stylesheet contain the

following lines:


        /*
       Theme Name: Subject Guide 2010
       Theme URI:
       Description: Subject Guide 2010 Child Theme
       Author: Joshua Dodson and Laura Slavin
       Author URI:
       Template: twentyten
       Version: 1.0
       */



WordPress will look for this file first to verify that it is actually a regular theme or a child theme.

Since we used the “Template: twentyten” declaration, WordPress now knows that we are going

to inherit the functionality of the Twenty Ten theme, but add some pieces to it ourselves. Note

that it is important that both this folder and the original Twenty Ten folder reside in your

“themes” folder within the “wp-content” folder.

At this point it is not necessary to add anything else to the stylesheet, but since we want to

maintain the look and feel of the original theme for our example we will add the style import

declaration below:


       @import url('../twentyten/style.css');
To provide the full functionality of a dynamic subject guide through the use of the new

WordPress custom post types we will need to add a few additional files to our new theme folder

“sg-theme.” We will add five additional files to the “themes” folder and one file to the “plugins”

folder found inside of the “wp-content” folder.



Writing the Plugin

Let’s start with the plugin that will enable the custom post types and provide the core

functionality. Below is the code for the plugin with the explanations embedded as comments

throughout the PHP.


Note that the opening lines (Plugin Name, etc.) is what WordPress automatically looks for to

determine if the file is a plugin file or not.


        <?php
        /*
        Plugin Name: Subject Guide Plugin
        Plugin URI:
        Description: Subject Guide Custom Post Types for WordPress
        3.0 and above.
        Author: Joshua Dodson and Laura Slavin
        Version: 1.0
        Author URI: http://betterwebstrategy.net
        */

        class subject_guide10 {
            var $meta_fields = array('sg10-website-address');
            function subject_guide10()
            {
         /*
        The following code will register our subject guide custom
        post types and defines all of the variations of the term
        that we specify, namely "Subject Guide."
        */
                register_post_type('subject_guide', array(
'labels' => array(
                 'name' => __( 'Subject Guides' ),
                 'singular_name' => __( 'Subject Guide' ),
                 'add_new' => __( 'Add New' ),
                 'add_new_item' => __( 'Add New Subject
Guide' ),
                 'edit' => __( 'Edit' ),
                 'edit_item' => __( 'Edit Subject Guide' ),
                 'new_item' => __( 'New Subject Guide' ),
                 'view' => __( 'View Subject Guide' ),
                 'view_item' => __( 'View Subject Guide' ),
                 'search_items' => __( 'Search Subject
Guides' ),
                 'not_found' => __( 'No Subject Guides
found' ),
                 'not_found_in_trash' => __( 'No Subject
Guides found in Trash' ),
                 'parent' => __( 'Parent Subject Guide' ),
                 ),
             'singular_label' => __('Subject Guide'),
             'public' => true,
// This designates that we use the UI in the admin panel.
             'show_ui' => true,
// This specifies that it is a custom post type, not a
built in post type.
             '_builtin' => false,
             '_edit_link' => 'post.php?post=%d',
             'capability_type' => 'post',
             'hierarchical' => false,
//This will set up our permalink structure.
             'rewrite' => array("slug" => "subject-guide"),
             'query_var' => "subject_guide",
//This specifies the capabilities that we are going to
allow the subject guide to have.
             'supports' => array('title','author', 'editor',
'revisions')
        ));

        add_filter("manage_edit-subject_guide_columns",
array(&$this, "edit_columns"));
        add_action("manage_posts_custom_column",
array(&$this, "custom_columns"));
/*
The following will register our subject guide custom
taxonomies. The first taxonomy will register as
hierarchical categories. The second taxonomy will register
in a similar fashion as tags. Both of these will allow for
adding the appropriate meta data to the post.
*/
        register_taxonomy("subject",
array("subject_guide"), array("hierarchical" => true,
"label" => "Subjects", "singular_label" => "Subject",
"rewrite" => true));
        register_taxonomy("subject_tag",
array("subject_guide"), array("hierarchical" => false,
"label" => "Subject Tags", "singular_label" => "Subject
Tag", "rewrite" => true));
/*
Initiate the admin interface.
*/
        add_action("admin_init", array(&$this,
"admin_init"));
        add_action("template_redirect", array(&$this,
'template_redirect'));
        add_action("wp_insert_post", array(&$this,
"wp_insert_post"), 10, 2);
    }
/*
The following will designate columns for how the custom
taxonomies and the description will appear in the "Edit
Subject Guide" page.
*/
    function edit_columns($columns)
    {
        $columns = array(
            "title" => "Subject Guide Title",
            "sg10_description" => "Description",
            "sg10_website_address" => "Website Address",
            "sg10_subjects" => "subjects",
            "sg10_subject_tags" => "Subject Tags"
        );

        return $columns;
    }

/*
The following function specifies the content that will be
displayed within the columns for "Edit Subject Guide" that
we setup in the above code.
*/
    function custom_columns($column)
    {
        global $post;
        switch ($column)
{
       //This will take the excerpt of the custom post and use it
       for the description.
                   case "sg10_description":
                        the_excerpt();
                        break;
       //This will display the custom URL that we use to link our
       custom post to an internet resource.
                   case "sg10_website_address":
                        $custom = get_post_custom();
                        echo $custom["sg10-website-address"][0];
                        break;
       //This will use the hierarchical meta data for the custom
       post type.
                   case "sg10_subjects":
                        $subjects = get_the_terms(0, "subject");
                        $subjects_html = array();
                        if ($subjects) {foreach ($subjects as
       $subject)
                            array_push($subjects_html, '<a href="'
       . get_term_link($subject->slug, "subject") . '">' .
       $subject->name . '</a>');
                            echo implode($subjects_html, ", ");}
                        break;
       //This will use the subject guide tags that we create.
                   case "sg10_subject_tags":
                        $subject_tags = get_the_terms(0,
       "subject_tag");
                        $subject_tags_html = array();
                        if ($subject_tags) { foreach ($subject_tags
       as $subject_tag)
                            array_push($subject_tags_html, '<a
       href="' . get_term_link($subject_tag->slug, "subject_tag")
       . '">' . $subject_tag->name . '</a>');
                            echo implode($subject_tags_html, ", ");
       }
                        break;
               }
           }
       /*


The following function is an optional function that will create a redirection to take place under

specific conditions. This ultimately supplies our designated templates if the page that the user is

viewing is one of the subject guide pages. Our taxonomy-subject.php example that we will
discuss later on takes that place of the last statement by using the inherent template hierarchy

structure of WordPress. The following code will ultimately change the natural structure, or

modify it as necessary.


       */
       function template_redirect()
       {
           global $wp;
           $custom_types = array("subject_guide");
           if (in_array($wp->query_vars["post_type"],
       $custom_types))
           {
               if($wp->query_vars["name"]):
                    include(STYLESHEETPATH . "/single-subject-
       guide.php");
                    die();
               else:
                    include(STYLESHEETPATH . "/category-
       subject.php");
                    die();
               endif;
           }
       }

       /*
        When a post is created or updated, this function will loop
       through all of the post data .
       */
           function wp_insert_post($post_id, $post = null)
           {
               if ($post->post_type == "subject_guide")
               {
                   foreach ($this->meta_fields as $key)
                   {
                       $value = @$_POST[$key];
                       if (empty($value))
                       {
                           delete_post_meta($post_id, $key);
                           continue;
                       }
       /*
       This determines whether it is an array, or string, and
       updates or adds the meta data for the post.
       */
if (!is_array($value))
                   {
                       if (!update_post_meta($post_id, $key,
$value))
                          {
                              add_post_meta($post_id, $key,
$value);
                          }
                   }
                   else
                   {
                          delete_post_meta($post_id, $key);
                          foreach ($value as $entry)
                              add_post_meta($post_id, $key,
$entry);
                   }
               }
           }
    }
/*
This function will allow us to create custom meta boxes for
the "Edit Subject Guide" page.
*/
     function admin_init()
     {
          add_meta_box("sg10-meta", "Subject Guide Options",
array(&$this, "meta_options"), "subject_guide", "normal",
"high");
     }
/*
The following function will specify the content and display
for our subject guide in the admin screen.
*/
     function meta_options()
     {
          global $post;
          $custom = get_post_custom($post->ID);
          $website_address = $custom["sg10-website-
address"][0];
?>
<p>
   <label>Website Address:</label>
   <br />
   <input name="sg10-website-address" value="<?php echo
$website_address; ?>" />
</p>
<?php
}
       }
       /*


       Now we are finished setting up how WordPress will handle
       all of our subject guide custom post types and the meta
       data and other taxonomies that are associated with it. All
       that is left to do is to initiate the plugin, which will be
       taken care of in the following lines.

       */
       add_action("init", "subject_guide10Init");
       function subject_guide10Init() { global $sg10; $sg10 = new
       subject_guide10(); }

       ?>

Creating the Templates

The plugin will do most of the heavy lifting for us on the admin-side. Now we need to specify

how we are going to display the contents of our subject guide custom posts. We will handle this

through our templates. Since we are using a child theme, WordPress will look at our custom

folder first and display the content that we specify for our templates. After it looks at our child

theme folder, WordPress will look for the rest of the functionality in the parent theme folder.



Subject Guide Taxonomy Template

Using the built-in WordPress theme structure we will create a file called taxonomy-subject.php

We will use the categorization to display the subjects, so that when one clicks on the category,

then all of the posts classified as that subject and all of the sub-categories with their respective

posts will be displayed in a hierarchical fashion.



Note that there is a lot going on in this example. This is really the bread and butter of the subject
guide system in terms of the way it is displayed. This example does most of the heavy lifting for

us.


       <?php
       /*
       taxonomy-subject.php takes advantage of the internal
       taxonomy template system of WordPress. Since our custom
       taxonomy is "subject," WordPress will look at the taxonomy-
       [custom taxonomy name here].php file structure and use this
       file for the look and feel of our 1st level subject
       categories.
       */
       // We will start by setting the variables and getting the
       header.
       $term = get_term_by( 'slug', get_query_var( 'term' ),
       get_query_var( 'taxonomy' ) );
       $tax = get_query_var( 'taxonomy' );
       get_header(); ?>
       <div id="container">
          <div id="content" role="main">
            <h1 class="page-title"><?php echo $term->name; ?></h1>
            <?php if ($term->description) { ?>
            <blockquote><?php echo $term->description;
       ?></blockquote>
            <?php } ?>
            <?php
       /*
       If there are sub-categories, then retrieve them and display
       them as a Heading 2 and also display the description of the
       category.
       */
                        if (get_term_children($term->term_id, $tax)
       != null) {
                            $term_children = get_terms(
                                $tax,
                                array(
                                     'child_of' => $term->term_id,
                                )
                            );
                            foreach ($term_children as $term_child)
       {
                                echo '<h2>' . $term_child->name .
       '</h2>';
                                  if ($term_child->description) { ?>
            <blockquote><?php echo $term_child->description;
?></blockquote>
    <?php }
                        query_posts(array(
                            'subject' => $term_child->slug,
                            'orderby' => 'title',
                            'order' => 'ASC',
                            )
                        );
/*
This will look through all of the posts that are
categorized with the sub-category and display the title of
the post as a link to the subject URL (not the permalink to
the post), and also will display the content of the post--
this will allow any additional information, links, or
images of the post to be displayed.
*/
                          if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <h3 <?php post_class(); ?>>
      <?php global $post;
                              $custom =
get_post_custom($post->ID);
                              $website_address =
$custom["sg10-website-address"][0];
                              ?>
      <a href="<?php if($website_address) { echo
$website_address; } else { the_permalink(); } ?>">
      <?php the_title(); ?>
      </a> </h3>
    <?php the_content(); ?>
    <?php endwhile; ?>
    <?php endif;
                     }
/*
If there are no sub-categories, then only the post titles
for the top level custom taxonomy will be displayed.
*/
                 } else {
                     if (have_posts()) : ?>
    <ul>
      <?php while (have_posts()) : the_post(); ?>
      <li <?php post_class(); ?>> <a href="<?php
the_permalink(); ?>">
         <?php the_title(); ?>
         </a> </li>
      <?php endwhile; ?>
    </ul>
<?php endif;
                                 }
                                 ?>
           </div>
           <!-- #content -->

       </div>
       <!-- #container -->
       <?php get_sidebar(); ?>
       <?php get_footer(); ?>


Subject Guide Index

This template lists all of the subject guide posts across all categories (subjects) and displays the

URL of the internet resource next to it. When the post title link is clicked on, it will take you to

the single page listing of the post resource.


       <?php
       /* Template Name: Subject Guide Index */
       get_header(); ?>
       <div id="container">
         <div id="content" role="main">
            <ul>
              <?php
        global $post;
        $tmp_post = $post;
        $myposts = get_posts(array(
        'post_type'        => 'subject_guide',
        'numberposts'       => -1,
        'orderby' => 'title',
        'order'      => 'ASC',
       ));
        foreach($myposts as $post) :
           setup_postdata($post);
        ?>
              <?php global $post;
                         $custom = get_post_custom($post->ID);
                         $website_address = $custom["sg10-website-
       address"][0];
                     ?>
              <li><a href="<?php the_permalink() ?>" rel="bookmark"
       title="Permanent Link to <?php the_title(); ?>">
                 <?php the_title(); ?>
</a> - <?php echo $website_address; ?></li>
              <?php endforeach; ?>
              <?php $post = $tmp_post; ?>
           </ul>
         </div>
         <!-- #content -->
       </div>
       <!-- #container -->
       <?php get_sidebar(); ?>
       <?php get_footer(); ?>

The "Subject Guide A-Z List" template and the "Subject Guide Category" template will take on

very basic functionality from the standard Twenty Ten loop. We will use our functions.php file

to make some modifications to this to provide additional functionality. Note that the "Subject

Guide A-Z List" template takes on the page loop functionality, while the "Subject Guide

Category" template uses the single post loop.



Subject Guide A-Z List


       <?php
       /* Template Name: Subject Guide Subject A-Z List */
       get_header(); ?>
         <div id="container">
           <div id="content" role="main">

                   <?php get_template_part( 'loop', 'page' ); ?>

           </div><!-- #content -->
         </div><!-- #container -->
         <?php get_sidebar(); ?>
       <?php get_footer(); ?>

Subject Guide Category


       <?php
       /* Template Name: Subject Guide Category */
       get_header(); ?>
         <div id="container">
           <div id="content" role="main">
<?php get_template_part( 'loop', 'single' ); ?>

           </div><!-- #content -->
         </div><!-- #container -->
         <?php get_sidebar(); ?>
       <?php get_footer(); ?>

Functions.php

To bring everything together we will use a custom functions.php file.


       <?php
       /*
       This function will include additional classes to the built-
       in body class. This allows for additional styling of the
       subject guide posts within the CSS stylesheet.
       */
       function taxonomy_body_class( $classes ) {
           if( is_tax() ) {
               global $taxonomy;
               if( !in_array( $taxonomy, $classes ) )
                    $classes[] = "taxonomy " . "taxonomy-
       ".$taxonomy;
               }
           return $classes;
       }
       add_filter('body_class','taxonomy_body_class');

       /*
       The following two functions will allow us to pull the full
       taxonomy list of terms that are associated with each of our
       subject guide posts.
       */
       function sg_get_terms( $id = '' ) {
          global $post;
          if ( empty( $id ) )
            $id = $post->ID;
          if ( !empty( $id ) ) {
            $post_taxonomies = array();
            $post_type = get_post_type( $id );
            $taxonomies = get_object_taxonomies( $post_type ,
       'names' );
            foreach ( $taxonomies as $taxonomy ) {
              $term_links = array();
              $terms = get_the_terms( $id, $taxonomy );
if ( is_wp_error( $terms ) )
        return $terms;
      if ( $terms ) {
        foreach ( $terms as $term ) {
           $link = get_term_link( $term, $taxonomy );
           if ( is_wp_error( $link ) )
             return $link;
           $term_links[] = '<a href="' . $link . '" rel="' .
$taxonomy . '">' . $term->name . '</a>';
        }
      }
      $term_links = apply_filters( "term_links-$taxonomy" ,
$term_links );
      $post_terms[$taxonomy] = $term_links;
    }
    return $post_terms;
  } else {
    return false;
  }
}
function sg_get_terms_list( $id = '' , $echo = true ) {
  global $post;
  if ( empty( $id ) )
    $id = $post->ID;
  if ( !empty( $id ) ) {
    $my_terms = sg_get_terms( $id );
    if ( $my_terms ) {
      $my_taxonomies = array();
      foreach ( $my_terms as $taxonomy => $terms ) {
        $my_taxonomy = get_taxonomy( $taxonomy );
        if ( !empty( $terms ) )           $my_taxonomies[] =
'<span class="' . $my_taxonomy->name . '-links">' . '<span
class="entry-utility-prep entry-utility-prep-' .
$my_taxonomy->name . '-links">' . $my_taxonomy->labels-
>name . ': ' . implode( $terms , ', ' ) . '</span></span>';
      }
      if ( !empty( $my_taxonomies ) ) {
        $output = '<ul>' . "n";
        foreach ( $my_taxonomies as $my_taxonomy ) {
           $output .= '<li>' . $my_taxonomy . '</li>' .
"n";
        }
        $output .= '</ul>' . "n";
      }
      if ( $echo )
        echo $output;
      else
return $output;
      } else {
        return;
      }
    } else {
      return false;
    }
}


/*
This will apply a filter that will insert the subject list
within the "Subject Guide A-Z List" template.
*/
add_filter('the_content','insert_subject_list');
function insert_subject_list($content) {
    if ( is_page_template('subject-guide-subject-a-z.php')
) {
        echo $content;

          $args = array(
      'orderby'            => 'name',
      'order'              => 'ASC',
      'show_last_update'   => 0,
      'style'              => 'list',
      'show_count'         => 0,
      'hide_empty'         => 1,
      'use_desc_for_title' => 1,
      'child_of'           => 0,
      'hierarchical'       => true,
      'title_li'           => __( 'Subjects' ),
      'number'             => NULL,
      'echo'               => 1,
      'depth'              => 1,
      'current_category'   => 0,
      'pad_counts'         => 0,
      'taxonomy'           => 'subject' );
      wp_list_categories( $args );

}    else {return $content;}
}
/*
Here we will apply a filter that modifies the single
subject guide item display to also show the full taxonomy
listing for that item.
*/
add_filter('the_content','insert_custom_taxonomy');
function insert_custom_taxonomy($content) {
           if (is_singular('subject_guide')) {
               echo $content;

                  $content.= "<div class='taxonomy'>";
                  $content.= sg_get_terms_list();
                  $content.= "</div>";
       }       else {return $content;}
       }
       ?>




Creating dynamic subject guides using WordPress will add a level of usability to your library

website. You will be able to add and manage content with greater efficiency. As we discovered

at Lincoln Memorial University Carnegie-Vincent Library, these guides also help involve

librarians and users.



Using WordPress gives CVL a professional, functional presence on the web. What is exciting

about WordPress is that it is evolving and improving. No matter the size of your library or your

specific needs, WordPress will almost always provide for you a solution. With the step-by-step

guide we've provided, we hope you will take the time to experiment with our response to a

specific need at our library and that you will then branch out and utilize the multifaceted

capabilities of WordPress.


More Information

This is really just the tip of the iceberg. We fully expect that WordPress will release even more

customizable functionality in future releases. The WordPress Codex is the top resource for all

things WordPress. It is best to look there first for the definitive word on how to use the

WordPress functions and capabilities that were mentioned. With that said, there are many
additional resources on the web that will provide tips and different approaches. WordPress is

expanding into a fully functional content management system--it has been for a while. The

beauty in using and customizing a system like WordPress is that the more people who use it, the

more support will be provided. The full community of support in WordPress is a remarkable

thing. You never know when your question will be answered by another user who has

experienced the same issues, or even one of the lead developers.



Please look at the following references and resources for more information on using WordPress

and custom post types.


• WordPress Custom Post Types on the WordPress Codex
  http://codex.wordpress.org/Custom_Post_Types
• Showing custom post types on your home/blog page
  http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-blog-
  page
• Custom post types in WordPress
  http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress
• Custom Post Types in WordPress 3.0
  http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0/
         Extending Custom Post Types in WordPress 3.0

       http://kovshenin.com/archives/extending-custom-post-types-in-wordpress-3-0/


This has been presented to the best of our knowledge. As with all open source code, the core

WordPress functionality may change and leave sections of the code represented above as

nonfunctional. If you choose to implement the ideas expressed herein, please research WordPress

further and share your findings with the WordPress community. The authors do not guarantee

exact results as expressed herein.



Bios
Laura Slavin is the Technical Services Librarian at Lincoln Memorial University Carnegie -

Vincent Library. She earned her Masters in Library and Information Science from the

University of South Florida School of Library and Information Science and her Masters in

Business Administration from Lincoln Memorial University.



Joshua Dodson is a Web Analytics Strategist for Stamats, Inc. in Cedar Rapids, IA.



Laura and Joshua have published and presented numerous times on WordPress and the use and

customization of other open source software for over two years.

More Related Content

What's hot

Building a Mobile Drupal Site
Building a Mobile Drupal SiteBuilding a Mobile Drupal Site
Building a Mobile Drupal SiteMark Jarrell
 
Wordpress (Theme,Widget,plugins)
Wordpress (Theme,Widget,plugins)Wordpress (Theme,Widget,plugins)
Wordpress (Theme,Widget,plugins)Rathod Shukar
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016David Brattoli
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 Evan Mullins
 
How to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsHow to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsSingsys Pte Ltd
 
Wordpress 101 - The Basics by Jack Davenport
Wordpress 101 - The Basics by Jack DavenportWordpress 101 - The Basics by Jack Davenport
Wordpress 101 - The Basics by Jack DavenportJäck Davenpørt
 
Making your Drupal fly with Apache SOLR
Making your Drupal fly with Apache SOLRMaking your Drupal fly with Apache SOLR
Making your Drupal fly with Apache SOLRExove
 
EECI 2010 - The Power of ExpressionEngine's Dynamic Templates
EECI 2010 - The Power of ExpressionEngine's Dynamic TemplatesEECI 2010 - The Power of ExpressionEngine's Dynamic Templates
EECI 2010 - The Power of ExpressionEngine's Dynamic TemplatesFortySeven Media
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsAmanda Giles
 
WordPress for Entrepreneurs Management of your own website
WordPress for Entrepreneurs Management of your own websiteWordPress for Entrepreneurs Management of your own website
WordPress for Entrepreneurs Management of your own websiteLaurence Svekis ✔
 
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 ThemeMinimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 ThemeSuzanne Dergacheva
 
SynapseIndia wordpress installation training module
SynapseIndia wordpress installation training moduleSynapseIndia wordpress installation training module
SynapseIndia wordpress installation training moduleSynapseIndia
 
Introduction to WordPress Slides from WordCamp 2012 by Gary A. Bacon
Introduction to WordPress Slides from WordCamp 2012 by Gary A. BaconIntroduction to WordPress Slides from WordCamp 2012 by Gary A. Bacon
Introduction to WordPress Slides from WordCamp 2012 by Gary A. BaconGary Bacon
 
Alice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu
 
Getting to Know WordPress May 2015
Getting to Know WordPress May 2015Getting to Know WordPress May 2015
Getting to Know WordPress May 2015Anthony Hortin
 
WordPress: An Introduction
WordPress: An IntroductionWordPress: An Introduction
WordPress: An Introductionsounddelivery
 

What's hot (20)

Building a Mobile Drupal Site
Building a Mobile Drupal SiteBuilding a Mobile Drupal Site
Building a Mobile Drupal Site
 
Wordpress (Theme,Widget,plugins)
Wordpress (Theme,Widget,plugins)Wordpress (Theme,Widget,plugins)
Wordpress (Theme,Widget,plugins)
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
 
How to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsHow to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy Steps
 
Wordpress 101 - The Basics by Jack Davenport
Wordpress 101 - The Basics by Jack DavenportWordpress 101 - The Basics by Jack Davenport
Wordpress 101 - The Basics by Jack Davenport
 
Making your Drupal fly with Apache SOLR
Making your Drupal fly with Apache SOLRMaking your Drupal fly with Apache SOLR
Making your Drupal fly with Apache SOLR
 
EECI 2010 - The Power of ExpressionEngine's Dynamic Templates
EECI 2010 - The Power of ExpressionEngine's Dynamic TemplatesEECI 2010 - The Power of ExpressionEngine's Dynamic Templates
EECI 2010 - The Power of ExpressionEngine's Dynamic Templates
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable Needs
 
WordPress for Entrepreneurs Management of your own website
WordPress for Entrepreneurs Management of your own websiteWordPress for Entrepreneurs Management of your own website
WordPress for Entrepreneurs Management of your own website
 
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 ThemeMinimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
 
SynapseIndia wordpress installation training module
SynapseIndia wordpress installation training moduleSynapseIndia wordpress installation training module
SynapseIndia wordpress installation training module
 
Beginning WordPress
Beginning WordPressBeginning WordPress
Beginning WordPress
 
Introduction to WordPress Slides from WordCamp 2012 by Gary A. Bacon
Introduction to WordPress Slides from WordCamp 2012 by Gary A. BaconIntroduction to WordPress Slides from WordCamp 2012 by Gary A. Bacon
Introduction to WordPress Slides from WordCamp 2012 by Gary A. Bacon
 
Alice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu - WordPress For Beginners
Alice Phieu - WordPress For Beginners
 
Getting to Know WordPress May 2015
Getting to Know WordPress May 2015Getting to Know WordPress May 2015
Getting to Know WordPress May 2015
 
Wordcampnigeria
WordcampnigeriaWordcampnigeria
Wordcampnigeria
 
W pthemes
W pthemesW pthemes
W pthemes
 
WordPress Theming 101
WordPress Theming 101WordPress Theming 101
WordPress Theming 101
 
WordPress: An Introduction
WordPress: An IntroductionWordPress: An Introduction
WordPress: An Introduction
 

Viewers also liked

Music video directory
Music video directoryMusic video directory
Music video directory06ah2
 
Agropaisales Ibiza y Formentera. Raquel González
Agropaisales Ibiza y Formentera. Raquel GonzálezAgropaisales Ibiza y Formentera. Raquel González
Agropaisales Ibiza y Formentera. Raquel Gonzálezaderlapalma
 
Marketing product launch
Marketing product launchMarketing product launch
Marketing product launchAabhas Rastogi
 
H114 Meeting 16: What is Class?
H114 Meeting 16: What is Class?H114 Meeting 16: What is Class?
H114 Meeting 16: What is Class?6500jmk4
 
SPIW03 Taking the Geek out of SharePoint Project Governance
SPIW03 Taking the Geek out of SharePoint Project GovernanceSPIW03 Taking the Geek out of SharePoint Project Governance
SPIW03 Taking the Geek out of SharePoint Project Governance21apps
 

Viewers also liked (6)

Tese doutorado
Tese doutoradoTese doutorado
Tese doutorado
 
Music video directory
Music video directoryMusic video directory
Music video directory
 
Agropaisales Ibiza y Formentera. Raquel González
Agropaisales Ibiza y Formentera. Raquel GonzálezAgropaisales Ibiza y Formentera. Raquel González
Agropaisales Ibiza y Formentera. Raquel González
 
Marketing product launch
Marketing product launchMarketing product launch
Marketing product launch
 
H114 Meeting 16: What is Class?
H114 Meeting 16: What is Class?H114 Meeting 16: What is Class?
H114 Meeting 16: What is Class?
 
SPIW03 Taking the Geek out of SharePoint Project Governance
SPIW03 Taking the Geek out of SharePoint Project GovernanceSPIW03 Taking the Geek out of SharePoint Project Governance
SPIW03 Taking the Geek out of SharePoint Project Governance
 

Similar to Slavin-Dodson Piece, With Code.

Step by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginStep by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginMainak Goswami
 
Writing your own WordPress themes and plugins
Writing your own WordPress themes and pluginsWriting your own WordPress themes and plugins
Writing your own WordPress themes and pluginsStephanie Wells
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteBrendan Sera-Shriar
 
Easy Guide to WordPress Theme Integration
Easy Guide to WordPress Theme IntegrationEasy Guide to WordPress Theme Integration
Easy Guide to WordPress Theme IntegrationSankhala Info Solutions
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 
Streamlining Your Template Structures When Building Themes
Streamlining Your Template Structures When Building ThemesStreamlining Your Template Structures When Building Themes
Streamlining Your Template Structures When Building ThemesCameron Jones
 
advance theme development
advance theme developmentadvance theme development
advance theme development1amitgupta
 
Child Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesChild Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesDamien Carbery
 
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...WP Engine
 
Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Joe Querin
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...Denise Williams
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017Amanda Giles
 
Child Themes in WordPress
Child Themes in WordPressChild Themes in WordPress
Child Themes in WordPressJeff Cohan
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...LinnAlexandra
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012Joe Querin
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25New Tricks
 
How to create your own WordPress plugin
How to create your own WordPress pluginHow to create your own WordPress plugin
How to create your own WordPress pluginJohn Tighe
 
Word press Plugins by WordPress Experts
Word press Plugins by WordPress ExpertsWord press Plugins by WordPress Experts
Word press Plugins by WordPress ExpertsYameen Khan
 
Using Wordpress with Reclaim Hosting
Using Wordpress with Reclaim HostingUsing Wordpress with Reclaim Hosting
Using Wordpress with Reclaim HostingCindy Royal
 

Similar to Slavin-Dodson Piece, With Code. (20)

Step by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginStep by step guide for creating wordpress plugin
Step by step guide for creating wordpress plugin
 
Writing your own WordPress themes and plugins
Writing your own WordPress themes and pluginsWriting your own WordPress themes and plugins
Writing your own WordPress themes and plugins
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media Institute
 
Easy Guide to WordPress Theme Integration
Easy Guide to WordPress Theme IntegrationEasy Guide to WordPress Theme Integration
Easy Guide to WordPress Theme Integration
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Streamlining Your Template Structures When Building Themes
Streamlining Your Template Structures When Building ThemesStreamlining Your Template Structures When Building Themes
Streamlining Your Template Structures When Building Themes
 
advance theme development
advance theme developmentadvance theme development
advance theme development
 
Child Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesChild Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notes
 
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
 
Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015Responsive Theme Workshop - WordCamp Columbus 2015
Responsive Theme Workshop - WordCamp Columbus 2015
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
Child Themes in WordPress
Child Themes in WordPressChild Themes in WordPress
Child Themes in WordPress
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25
 
WordPress Plugins
WordPress PluginsWordPress Plugins
WordPress Plugins
 
How to create your own WordPress plugin
How to create your own WordPress pluginHow to create your own WordPress plugin
How to create your own WordPress plugin
 
Word press Plugins by WordPress Experts
Word press Plugins by WordPress ExpertsWord press Plugins by WordPress Experts
Word press Plugins by WordPress Experts
 
Using Wordpress with Reclaim Hosting
Using Wordpress with Reclaim HostingUsing Wordpress with Reclaim Hosting
Using Wordpress with Reclaim Hosting
 

More from ALATechSource

Liven Up Baby and Toddler Storytimes with Sign Language (March 2019)
Liven Up Baby and Toddler Storytimes with Sign Language (March 2019)Liven Up Baby and Toddler Storytimes with Sign Language (March 2019)
Liven Up Baby and Toddler Storytimes with Sign Language (March 2019)ALATechSource
 
Dealing with Mental Health on the Front Lines: Part 1
Dealing with Mental Health on the Front Lines: Part 1Dealing with Mental Health on the Front Lines: Part 1
Dealing with Mental Health on the Front Lines: Part 1ALATechSource
 
Serving Children with Autism Spectrum Disorder: Part 2 (Feb. 2019)
Serving Children with Autism Spectrum Disorder: Part 2 (Feb. 2019)Serving Children with Autism Spectrum Disorder: Part 2 (Feb. 2019)
Serving Children with Autism Spectrum Disorder: Part 2 (Feb. 2019)ALATechSource
 
Using Visual Arts in Early Childhood Programming
Using Visual Arts in Early Childhood ProgrammingUsing Visual Arts in Early Childhood Programming
Using Visual Arts in Early Childhood ProgrammingALATechSource
 
Serving Children with Autism Spectrum Disorder (Feb. 2019)
Serving Children with Autism Spectrum Disorder (Feb. 2019)Serving Children with Autism Spectrum Disorder (Feb. 2019)
Serving Children with Autism Spectrum Disorder (Feb. 2019)ALATechSource
 
Library Website Rehab: Promotional Webinar
Library Website Rehab: Promotional WebinarLibrary Website Rehab: Promotional Webinar
Library Website Rehab: Promotional WebinarALATechSource
 
Taking STEAM Programs to the Next Level
Taking STEAM Programs to the Next LevelTaking STEAM Programs to the Next Level
Taking STEAM Programs to the Next LevelALATechSource
 
Creating a Digital Media Space for Today's Teens: Part 2 (Jan. 2019)
Creating a Digital Media Space for Today's Teens: Part 2 (Jan. 2019)Creating a Digital Media Space for Today's Teens: Part 2 (Jan. 2019)
Creating a Digital Media Space for Today's Teens: Part 2 (Jan. 2019)ALATechSource
 
Creating a Social Media Policy for Your Library (January 2019)
Creating a Social Media Policy for Your Library (January 2019)Creating a Social Media Policy for Your Library (January 2019)
Creating a Social Media Policy for Your Library (January 2019)ALATechSource
 
Creating a Digital Media Space for Today's Teens: Part 1 (Jan. 2019)
Creating a Digital Media Space for Today's Teens: Part 1 (Jan. 2019)Creating a Digital Media Space for Today's Teens: Part 1 (Jan. 2019)
Creating a Digital Media Space for Today's Teens: Part 1 (Jan. 2019)ALATechSource
 
Working with Individuals Affected by Homelessness: An Empathy-Driven Approach...
Working with Individuals Affected by Homelessness: An Empathy-Driven Approach...Working with Individuals Affected by Homelessness: An Empathy-Driven Approach...
Working with Individuals Affected by Homelessness: An Empathy-Driven Approach...ALATechSource
 
Fake News, Real Concerns: Developing Information-Literate Students (December ...
Fake News, Real Concerns: Developing Information-Literate Students (December ...Fake News, Real Concerns: Developing Information-Literate Students (December ...
Fake News, Real Concerns: Developing Information-Literate Students (December ...ALATechSource
 
Offering Service and Support to the LGBTQIA Community and Allies (Nov. 2018)
Offering Service and Support to the LGBTQIA Community and Allies (Nov. 2018)Offering Service and Support to the LGBTQIA Community and Allies (Nov. 2018)
Offering Service and Support to the LGBTQIA Community and Allies (Nov. 2018)ALATechSource
 
Library Director Bootcamp: Getting the Skills You Need, Part 3 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 3 (Nov. 2018)Library Director Bootcamp: Getting the Skills You Need, Part 3 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 3 (Nov. 2018)ALATechSource
 
Engaging Learners through Active Instruction and Assessment
Engaging Learners through Active Instruction and AssessmentEngaging Learners through Active Instruction and Assessment
Engaging Learners through Active Instruction and AssessmentALATechSource
 
Library Director Bootcamp: Getting the Skills You Need, Part 2 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 2 (Nov. 2018)Library Director Bootcamp: Getting the Skills You Need, Part 2 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 2 (Nov. 2018)ALATechSource
 
AL Live: What Do the Midterms Mean for Your Library? (November 2018)
AL Live: What Do the Midterms Mean for Your Library? (November 2018)AL Live: What Do the Midterms Mean for Your Library? (November 2018)
AL Live: What Do the Midterms Mean for Your Library? (November 2018)ALATechSource
 
Library Director Bootcamp: Getting the Skills You Need, Part 1 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 1 (Nov. 2018)Library Director Bootcamp: Getting the Skills You Need, Part 1 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 1 (Nov. 2018)ALATechSource
 
Prepare for the Future: Tech Strategies You Need to Know (November 2018)
Prepare for the Future: Tech Strategies You Need to Know (November 2018)Prepare for the Future: Tech Strategies You Need to Know (November 2018)
Prepare for the Future: Tech Strategies You Need to Know (November 2018)ALATechSource
 
Write and Cite “Chicago Style”: Helping Students and Patrons Understand The C...
Write and Cite “Chicago Style”: Helping Students and Patrons Understand The C...Write and Cite “Chicago Style”: Helping Students and Patrons Understand The C...
Write and Cite “Chicago Style”: Helping Students and Patrons Understand The C...ALATechSource
 

More from ALATechSource (20)

Liven Up Baby and Toddler Storytimes with Sign Language (March 2019)
Liven Up Baby and Toddler Storytimes with Sign Language (March 2019)Liven Up Baby and Toddler Storytimes with Sign Language (March 2019)
Liven Up Baby and Toddler Storytimes with Sign Language (March 2019)
 
Dealing with Mental Health on the Front Lines: Part 1
Dealing with Mental Health on the Front Lines: Part 1Dealing with Mental Health on the Front Lines: Part 1
Dealing with Mental Health on the Front Lines: Part 1
 
Serving Children with Autism Spectrum Disorder: Part 2 (Feb. 2019)
Serving Children with Autism Spectrum Disorder: Part 2 (Feb. 2019)Serving Children with Autism Spectrum Disorder: Part 2 (Feb. 2019)
Serving Children with Autism Spectrum Disorder: Part 2 (Feb. 2019)
 
Using Visual Arts in Early Childhood Programming
Using Visual Arts in Early Childhood ProgrammingUsing Visual Arts in Early Childhood Programming
Using Visual Arts in Early Childhood Programming
 
Serving Children with Autism Spectrum Disorder (Feb. 2019)
Serving Children with Autism Spectrum Disorder (Feb. 2019)Serving Children with Autism Spectrum Disorder (Feb. 2019)
Serving Children with Autism Spectrum Disorder (Feb. 2019)
 
Library Website Rehab: Promotional Webinar
Library Website Rehab: Promotional WebinarLibrary Website Rehab: Promotional Webinar
Library Website Rehab: Promotional Webinar
 
Taking STEAM Programs to the Next Level
Taking STEAM Programs to the Next LevelTaking STEAM Programs to the Next Level
Taking STEAM Programs to the Next Level
 
Creating a Digital Media Space for Today's Teens: Part 2 (Jan. 2019)
Creating a Digital Media Space for Today's Teens: Part 2 (Jan. 2019)Creating a Digital Media Space for Today's Teens: Part 2 (Jan. 2019)
Creating a Digital Media Space for Today's Teens: Part 2 (Jan. 2019)
 
Creating a Social Media Policy for Your Library (January 2019)
Creating a Social Media Policy for Your Library (January 2019)Creating a Social Media Policy for Your Library (January 2019)
Creating a Social Media Policy for Your Library (January 2019)
 
Creating a Digital Media Space for Today's Teens: Part 1 (Jan. 2019)
Creating a Digital Media Space for Today's Teens: Part 1 (Jan. 2019)Creating a Digital Media Space for Today's Teens: Part 1 (Jan. 2019)
Creating a Digital Media Space for Today's Teens: Part 1 (Jan. 2019)
 
Working with Individuals Affected by Homelessness: An Empathy-Driven Approach...
Working with Individuals Affected by Homelessness: An Empathy-Driven Approach...Working with Individuals Affected by Homelessness: An Empathy-Driven Approach...
Working with Individuals Affected by Homelessness: An Empathy-Driven Approach...
 
Fake News, Real Concerns: Developing Information-Literate Students (December ...
Fake News, Real Concerns: Developing Information-Literate Students (December ...Fake News, Real Concerns: Developing Information-Literate Students (December ...
Fake News, Real Concerns: Developing Information-Literate Students (December ...
 
Offering Service and Support to the LGBTQIA Community and Allies (Nov. 2018)
Offering Service and Support to the LGBTQIA Community and Allies (Nov. 2018)Offering Service and Support to the LGBTQIA Community and Allies (Nov. 2018)
Offering Service and Support to the LGBTQIA Community and Allies (Nov. 2018)
 
Library Director Bootcamp: Getting the Skills You Need, Part 3 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 3 (Nov. 2018)Library Director Bootcamp: Getting the Skills You Need, Part 3 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 3 (Nov. 2018)
 
Engaging Learners through Active Instruction and Assessment
Engaging Learners through Active Instruction and AssessmentEngaging Learners through Active Instruction and Assessment
Engaging Learners through Active Instruction and Assessment
 
Library Director Bootcamp: Getting the Skills You Need, Part 2 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 2 (Nov. 2018)Library Director Bootcamp: Getting the Skills You Need, Part 2 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 2 (Nov. 2018)
 
AL Live: What Do the Midterms Mean for Your Library? (November 2018)
AL Live: What Do the Midterms Mean for Your Library? (November 2018)AL Live: What Do the Midterms Mean for Your Library? (November 2018)
AL Live: What Do the Midterms Mean for Your Library? (November 2018)
 
Library Director Bootcamp: Getting the Skills You Need, Part 1 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 1 (Nov. 2018)Library Director Bootcamp: Getting the Skills You Need, Part 1 (Nov. 2018)
Library Director Bootcamp: Getting the Skills You Need, Part 1 (Nov. 2018)
 
Prepare for the Future: Tech Strategies You Need to Know (November 2018)
Prepare for the Future: Tech Strategies You Need to Know (November 2018)Prepare for the Future: Tech Strategies You Need to Know (November 2018)
Prepare for the Future: Tech Strategies You Need to Know (November 2018)
 
Write and Cite “Chicago Style”: Helping Students and Patrons Understand The C...
Write and Cite “Chicago Style”: Helping Students and Patrons Understand The C...Write and Cite “Chicago Style”: Helping Students and Patrons Understand The C...
Write and Cite “Chicago Style”: Helping Students and Patrons Understand The C...
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Slavin-Dodson Piece, With Code.

  • 1. Section 1: Creating Dynamic Subject Guides Laura Slavin and Joshua Dodson walk through using WordPress custom post types for subject guides at the Lincoln Memorial University Carnegie -Vincent Library. Like most academic libraries, Carnegie-Vincent Library (CVL) built web pages from the ground up. Over the years it became apparent that the current form and design of these pages did not meet the needs of the students, faculty, staff, and community at large. The format and design of the website had become antiquated. Library staff spent hours revising the pages often repeating the same changes on page after page. The users of the pages were inundated with a huge amount of information with poor navigational options. The librarians at CVL were just beginning to embrace the concept of Web 2.0. They wanted the opportunity to be more involved with the website users by collaborating with students when helping them with a research question or information literacy. The other requirement was that a dynamic subject guide be created so that duplication of entry is eliminated. This also allows librarians to provide subject expertise via the web. How did we begin? The first step was to convince university administration that WordPress is a good solution for the library's web design needs. This was not a hard sell. Administration was pleased with our demonstrations and appreciated the fact that almost of the work will be in the library with very little help needed from our information services department. Soon we were beginning the famous five minute install. 1
  • 2. The installation was successfully completed thanks to the expertise of our then Technical Services Technician, Joshua Dodson. A web committee was formed and training sessions were held for all librarians and staff. WordPress proved to be all that we anticipated and more. The most innovative creation of our Technical Services Technician was the dynamic subject guides. Joshua was able to take the custom post type functionality of WordPress and create a dynamic component that updated our ability to add and control content in our WordPress installation. Over the past two years, WordPress enhanced their capabilities making it easier to provide this type of functionality. As this is the most innovative of our WordPress endeavors at CVL, below is a step-by-step guide for creating dynamic subject guides using the latest enhancements in WordPress. A Subject Guide in WordPress It is easy to create a subject guide using WordPress, especially with the new custom post types in the WordPress core. INSERT IMAGE [Chapter4_Part1_1.png] CAPTION [Once you setup the subject guides as a custom post type, there will be an additional area in your WordPress Dashboard for you to add and edit subject guides and the related taxonomies ("Subjects" and "Subject Tags").] INSERT IMAGE [Chapter4_Part1_2.jpg]
  • 3. CAPTION [You are able to go into the "Subject Guides" screen to make modifications to the subject guide posts that you create.] As you add a new subject guide, you will want to treat each one as a post that will be categorized within at least one subject. Your full subject guides will actually be displayed by subject when utilizing the full potential of this system. It is best to add a title, a description within the post body area, the website address or linked internet resource under the "Subject Guide Options" screen, the subject categories and sub-categories that this post will fall under, and the appropriate "Subject Tags." The subject categories are hierarchical, so you will most likely only need to select one of the sub-categories per parent category. You will need to be sure to plan out the structure of your hierarchy before you begin creating the subject guides. You will save yourself much time later on if you plan first. Also, the subject tags are much less structured and can provide additional places to describe the content in a way that will not interfere with the hierarchy that you designate. The tags are a good place to add all of the extra metadata that there is no clear place for beforehand. INSERT IMAGE [Chapter4_Part1_3.jpg] CAPTION [When you need to add or edit the subject categories, it will be very similar to adding and editing the normal WordPress post categories. It uses a comparable structure. One thing to note is that the description that is added here will be displayed later on in the subject guide template. Be sure to add an informative description if you choose to utilize this feature.]
  • 4. INSERT IMAGE [Chapter4_Part1_4.jpg] CAPTION [When you need to add or edit the subject categories, it will be very similar to adding and editing the normal WordPress post categories. It uses a comparable structure. One thing to note is that the description that is added here will be displayed later on in the subject guide template. Be sure to add an informative description if you choose to utilize this feature.] INSERT IMAGE [Chapter4_Part1_5.jpg] CAPTION [Similarly to the categories, the subject tags are very similar to the standar d WordPress post tags. You can add and modify the tags by clicking "Subject Tags" on the left side of the WordPress Dashboard under "Subject Guides." INSERT IMAGE [Chapter4_Part1_6.jpg] CAPTION [The A-Z Subject List will display all of the parent categories that have been created for the subject guides. When you click on the parent category, then the 2nd level categories, or sub-categories, will be listed with the descriptions and the posts under them.] INSERT IMAGE [Chapter4_Part1_7.jpg]
  • 5. CAPTION [The Subject Guide Index will list all of the posts that have been created as a subject guide. This will list all of the posts, regardless of category. When you click on an individual post it will take you to the page for that item, which includes a description of the item and also the full list of categories and tags that has been assigned to this item.] INSERT IMAGE [Chapter4_Part1_8.jpg] CAPTION [An example subject guide post's individual listing.] The complete subject guide, when brought together reveals the following functionality, which includes the page title, category descriptions, sub-categories, and each post that has been added beneath each sub-category. Note that this example is using simple theming options based on the WordPress default Twenty Ten theme. You are able to include additional customizations as you see fit by using CSS, JavaScript, and by modifying the PHP and (X)HTML that is described below. INSERT IMAGE [Chapter4_Part1_9.jpg] CAPTION [An individual subject guide for philosophy.]
  • 6. Using Custom Post Types to Create Dynamic Subject Guides in WordPress To preserve functionality and maintain compatibility with the current WordPress theme, we will begin by creating a child theme. The newest default theme at the time of this writing is Twenty Ten, the HTML5 compatible and very flexible theme. We will use this as our base and create a child theme so that we can take advantage of its rich structure and syntax. Creating child themes has never been easier. First create a folder called “sg-theme” (or name it anything else you would like) and a style.css file within the folder. The only requirement is that the stylesheet contain the following lines: /* Theme Name: Subject Guide 2010 Theme URI: Description: Subject Guide 2010 Child Theme Author: Joshua Dodson and Laura Slavin Author URI: Template: twentyten Version: 1.0 */ WordPress will look for this file first to verify that it is actually a regular theme or a child theme. Since we used the “Template: twentyten” declaration, WordPress now knows that we are going to inherit the functionality of the Twenty Ten theme, but add some pieces to it ourselves. Note that it is important that both this folder and the original Twenty Ten folder reside in your “themes” folder within the “wp-content” folder. At this point it is not necessary to add anything else to the stylesheet, but since we want to maintain the look and feel of the original theme for our example we will add the style import declaration below: @import url('../twentyten/style.css');
  • 7. To provide the full functionality of a dynamic subject guide through the use of the new WordPress custom post types we will need to add a few additional files to our new theme folder “sg-theme.” We will add five additional files to the “themes” folder and one file to the “plugins” folder found inside of the “wp-content” folder. Writing the Plugin Let’s start with the plugin that will enable the custom post types and provide the core functionality. Below is the code for the plugin with the explanations embedded as comments throughout the PHP. Note that the opening lines (Plugin Name, etc.) is what WordPress automatically looks for to determine if the file is a plugin file or not. <?php /* Plugin Name: Subject Guide Plugin Plugin URI: Description: Subject Guide Custom Post Types for WordPress 3.0 and above. Author: Joshua Dodson and Laura Slavin Version: 1.0 Author URI: http://betterwebstrategy.net */ class subject_guide10 { var $meta_fields = array('sg10-website-address'); function subject_guide10() { /* The following code will register our subject guide custom post types and defines all of the variations of the term that we specify, namely "Subject Guide." */ register_post_type('subject_guide', array(
  • 8. 'labels' => array( 'name' => __( 'Subject Guides' ), 'singular_name' => __( 'Subject Guide' ), 'add_new' => __( 'Add New' ), 'add_new_item' => __( 'Add New Subject Guide' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Subject Guide' ), 'new_item' => __( 'New Subject Guide' ), 'view' => __( 'View Subject Guide' ), 'view_item' => __( 'View Subject Guide' ), 'search_items' => __( 'Search Subject Guides' ), 'not_found' => __( 'No Subject Guides found' ), 'not_found_in_trash' => __( 'No Subject Guides found in Trash' ), 'parent' => __( 'Parent Subject Guide' ), ), 'singular_label' => __('Subject Guide'), 'public' => true, // This designates that we use the UI in the admin panel. 'show_ui' => true, // This specifies that it is a custom post type, not a built in post type. '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, //This will set up our permalink structure. 'rewrite' => array("slug" => "subject-guide"), 'query_var' => "subject_guide", //This specifies the capabilities that we are going to allow the subject guide to have. 'supports' => array('title','author', 'editor', 'revisions') )); add_filter("manage_edit-subject_guide_columns", array(&$this, "edit_columns")); add_action("manage_posts_custom_column", array(&$this, "custom_columns")); /* The following will register our subject guide custom taxonomies. The first taxonomy will register as hierarchical categories. The second taxonomy will register in a similar fashion as tags. Both of these will allow for
  • 9. adding the appropriate meta data to the post. */ register_taxonomy("subject", array("subject_guide"), array("hierarchical" => true, "label" => "Subjects", "singular_label" => "Subject", "rewrite" => true)); register_taxonomy("subject_tag", array("subject_guide"), array("hierarchical" => false, "label" => "Subject Tags", "singular_label" => "Subject Tag", "rewrite" => true)); /* Initiate the admin interface. */ add_action("admin_init", array(&$this, "admin_init")); add_action("template_redirect", array(&$this, 'template_redirect')); add_action("wp_insert_post", array(&$this, "wp_insert_post"), 10, 2); } /* The following will designate columns for how the custom taxonomies and the description will appear in the "Edit Subject Guide" page. */ function edit_columns($columns) { $columns = array( "title" => "Subject Guide Title", "sg10_description" => "Description", "sg10_website_address" => "Website Address", "sg10_subjects" => "subjects", "sg10_subject_tags" => "Subject Tags" ); return $columns; } /* The following function specifies the content that will be displayed within the columns for "Edit Subject Guide" that we setup in the above code. */ function custom_columns($column) { global $post; switch ($column)
  • 10. { //This will take the excerpt of the custom post and use it for the description. case "sg10_description": the_excerpt(); break; //This will display the custom URL that we use to link our custom post to an internet resource. case "sg10_website_address": $custom = get_post_custom(); echo $custom["sg10-website-address"][0]; break; //This will use the hierarchical meta data for the custom post type. case "sg10_subjects": $subjects = get_the_terms(0, "subject"); $subjects_html = array(); if ($subjects) {foreach ($subjects as $subject) array_push($subjects_html, '<a href="' . get_term_link($subject->slug, "subject") . '">' . $subject->name . '</a>'); echo implode($subjects_html, ", ");} break; //This will use the subject guide tags that we create. case "sg10_subject_tags": $subject_tags = get_the_terms(0, "subject_tag"); $subject_tags_html = array(); if ($subject_tags) { foreach ($subject_tags as $subject_tag) array_push($subject_tags_html, '<a href="' . get_term_link($subject_tag->slug, "subject_tag") . '">' . $subject_tag->name . '</a>'); echo implode($subject_tags_html, ", "); } break; } } /* The following function is an optional function that will create a redirection to take place under specific conditions. This ultimately supplies our designated templates if the page that the user is viewing is one of the subject guide pages. Our taxonomy-subject.php example that we will
  • 11. discuss later on takes that place of the last statement by using the inherent template hierarchy structure of WordPress. The following code will ultimately change the natural structure, or modify it as necessary. */ function template_redirect() { global $wp; $custom_types = array("subject_guide"); if (in_array($wp->query_vars["post_type"], $custom_types)) { if($wp->query_vars["name"]): include(STYLESHEETPATH . "/single-subject- guide.php"); die(); else: include(STYLESHEETPATH . "/category- subject.php"); die(); endif; } } /* When a post is created or updated, this function will loop through all of the post data . */ function wp_insert_post($post_id, $post = null) { if ($post->post_type == "subject_guide") { foreach ($this->meta_fields as $key) { $value = @$_POST[$key]; if (empty($value)) { delete_post_meta($post_id, $key); continue; } /* This determines whether it is an array, or string, and updates or adds the meta data for the post. */
  • 12. if (!is_array($value)) { if (!update_post_meta($post_id, $key, $value)) { add_post_meta($post_id, $key, $value); } } else { delete_post_meta($post_id, $key); foreach ($value as $entry) add_post_meta($post_id, $key, $entry); } } } } /* This function will allow us to create custom meta boxes for the "Edit Subject Guide" page. */ function admin_init() { add_meta_box("sg10-meta", "Subject Guide Options", array(&$this, "meta_options"), "subject_guide", "normal", "high"); } /* The following function will specify the content and display for our subject guide in the admin screen. */ function meta_options() { global $post; $custom = get_post_custom($post->ID); $website_address = $custom["sg10-website- address"][0]; ?> <p> <label>Website Address:</label> <br /> <input name="sg10-website-address" value="<?php echo $website_address; ?>" /> </p> <?php
  • 13. } } /* Now we are finished setting up how WordPress will handle all of our subject guide custom post types and the meta data and other taxonomies that are associated with it. All that is left to do is to initiate the plugin, which will be taken care of in the following lines. */ add_action("init", "subject_guide10Init"); function subject_guide10Init() { global $sg10; $sg10 = new subject_guide10(); } ?> Creating the Templates The plugin will do most of the heavy lifting for us on the admin-side. Now we need to specify how we are going to display the contents of our subject guide custom posts. We will handle this through our templates. Since we are using a child theme, WordPress will look at our custom folder first and display the content that we specify for our templates. After it looks at our child theme folder, WordPress will look for the rest of the functionality in the parent theme folder. Subject Guide Taxonomy Template Using the built-in WordPress theme structure we will create a file called taxonomy-subject.php We will use the categorization to display the subjects, so that when one clicks on the category, then all of the posts classified as that subject and all of the sub-categories with their respective posts will be displayed in a hierarchical fashion. Note that there is a lot going on in this example. This is really the bread and butter of the subject
  • 14. guide system in terms of the way it is displayed. This example does most of the heavy lifting for us. <?php /* taxonomy-subject.php takes advantage of the internal taxonomy template system of WordPress. Since our custom taxonomy is "subject," WordPress will look at the taxonomy- [custom taxonomy name here].php file structure and use this file for the look and feel of our 1st level subject categories. */ // We will start by setting the variables and getting the header. $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); $tax = get_query_var( 'taxonomy' ); get_header(); ?> <div id="container"> <div id="content" role="main"> <h1 class="page-title"><?php echo $term->name; ?></h1> <?php if ($term->description) { ?> <blockquote><?php echo $term->description; ?></blockquote> <?php } ?> <?php /* If there are sub-categories, then retrieve them and display them as a Heading 2 and also display the description of the category. */ if (get_term_children($term->term_id, $tax) != null) { $term_children = get_terms( $tax, array( 'child_of' => $term->term_id, ) ); foreach ($term_children as $term_child) { echo '<h2>' . $term_child->name . '</h2>'; if ($term_child->description) { ?> <blockquote><?php echo $term_child->description;
  • 15. ?></blockquote> <?php } query_posts(array( 'subject' => $term_child->slug, 'orderby' => 'title', 'order' => 'ASC', ) ); /* This will look through all of the posts that are categorized with the sub-category and display the title of the post as a link to the subject URL (not the permalink to the post), and also will display the content of the post-- this will allow any additional information, links, or images of the post to be displayed. */ if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <h3 <?php post_class(); ?>> <?php global $post; $custom = get_post_custom($post->ID); $website_address = $custom["sg10-website-address"][0]; ?> <a href="<?php if($website_address) { echo $website_address; } else { the_permalink(); } ?>"> <?php the_title(); ?> </a> </h3> <?php the_content(); ?> <?php endwhile; ?> <?php endif; } /* If there are no sub-categories, then only the post titles for the top level custom taxonomy will be displayed. */ } else { if (have_posts()) : ?> <ul> <?php while (have_posts()) : the_post(); ?> <li <?php post_class(); ?>> <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a> </li> <?php endwhile; ?> </ul>
  • 16. <?php endif; } ?> </div> <!-- #content --> </div> <!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?> Subject Guide Index This template lists all of the subject guide posts across all categories (subjects) and displays the URL of the internet resource next to it. When the post title link is clicked on, it will take you to the single page listing of the post resource. <?php /* Template Name: Subject Guide Index */ get_header(); ?> <div id="container"> <div id="content" role="main"> <ul> <?php global $post; $tmp_post = $post; $myposts = get_posts(array( 'post_type' => 'subject_guide', 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC', )); foreach($myposts as $post) : setup_postdata($post); ?> <?php global $post; $custom = get_post_custom($post->ID); $website_address = $custom["sg10-website- address"][0]; ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_title(); ?>
  • 17. </a> - <?php echo $website_address; ?></li> <?php endforeach; ?> <?php $post = $tmp_post; ?> </ul> </div> <!-- #content --> </div> <!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?> The "Subject Guide A-Z List" template and the "Subject Guide Category" template will take on very basic functionality from the standard Twenty Ten loop. We will use our functions.php file to make some modifications to this to provide additional functionality. Note that the "Subject Guide A-Z List" template takes on the page loop functionality, while the "Subject Guide Category" template uses the single post loop. Subject Guide A-Z List <?php /* Template Name: Subject Guide Subject A-Z List */ get_header(); ?> <div id="container"> <div id="content" role="main"> <?php get_template_part( 'loop', 'page' ); ?> </div><!-- #content --> </div><!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?> Subject Guide Category <?php /* Template Name: Subject Guide Category */ get_header(); ?> <div id="container"> <div id="content" role="main">
  • 18. <?php get_template_part( 'loop', 'single' ); ?> </div><!-- #content --> </div><!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?> Functions.php To bring everything together we will use a custom functions.php file. <?php /* This function will include additional classes to the built- in body class. This allows for additional styling of the subject guide posts within the CSS stylesheet. */ function taxonomy_body_class( $classes ) { if( is_tax() ) { global $taxonomy; if( !in_array( $taxonomy, $classes ) ) $classes[] = "taxonomy " . "taxonomy- ".$taxonomy; } return $classes; } add_filter('body_class','taxonomy_body_class'); /* The following two functions will allow us to pull the full taxonomy list of terms that are associated with each of our subject guide posts. */ function sg_get_terms( $id = '' ) { global $post; if ( empty( $id ) ) $id = $post->ID; if ( !empty( $id ) ) { $post_taxonomies = array(); $post_type = get_post_type( $id ); $taxonomies = get_object_taxonomies( $post_type , 'names' ); foreach ( $taxonomies as $taxonomy ) { $term_links = array(); $terms = get_the_terms( $id, $taxonomy );
  • 19. if ( is_wp_error( $terms ) ) return $terms; if ( $terms ) { foreach ( $terms as $term ) { $link = get_term_link( $term, $taxonomy ); if ( is_wp_error( $link ) ) return $link; $term_links[] = '<a href="' . $link . '" rel="' . $taxonomy . '">' . $term->name . '</a>'; } } $term_links = apply_filters( "term_links-$taxonomy" , $term_links ); $post_terms[$taxonomy] = $term_links; } return $post_terms; } else { return false; } } function sg_get_terms_list( $id = '' , $echo = true ) { global $post; if ( empty( $id ) ) $id = $post->ID; if ( !empty( $id ) ) { $my_terms = sg_get_terms( $id ); if ( $my_terms ) { $my_taxonomies = array(); foreach ( $my_terms as $taxonomy => $terms ) { $my_taxonomy = get_taxonomy( $taxonomy ); if ( !empty( $terms ) ) $my_taxonomies[] = '<span class="' . $my_taxonomy->name . '-links">' . '<span class="entry-utility-prep entry-utility-prep-' . $my_taxonomy->name . '-links">' . $my_taxonomy->labels- >name . ': ' . implode( $terms , ', ' ) . '</span></span>'; } if ( !empty( $my_taxonomies ) ) { $output = '<ul>' . "n"; foreach ( $my_taxonomies as $my_taxonomy ) { $output .= '<li>' . $my_taxonomy . '</li>' . "n"; } $output .= '</ul>' . "n"; } if ( $echo ) echo $output; else
  • 20. return $output; } else { return; } } else { return false; } } /* This will apply a filter that will insert the subject list within the "Subject Guide A-Z List" template. */ add_filter('the_content','insert_subject_list'); function insert_subject_list($content) { if ( is_page_template('subject-guide-subject-a-z.php') ) { echo $content; $args = array( 'orderby' => 'name', 'order' => 'ASC', 'show_last_update' => 0, 'style' => 'list', 'show_count' => 0, 'hide_empty' => 1, 'use_desc_for_title' => 1, 'child_of' => 0, 'hierarchical' => true, 'title_li' => __( 'Subjects' ), 'number' => NULL, 'echo' => 1, 'depth' => 1, 'current_category' => 0, 'pad_counts' => 0, 'taxonomy' => 'subject' ); wp_list_categories( $args ); } else {return $content;} } /* Here we will apply a filter that modifies the single subject guide item display to also show the full taxonomy listing for that item. */ add_filter('the_content','insert_custom_taxonomy');
  • 21. function insert_custom_taxonomy($content) { if (is_singular('subject_guide')) { echo $content; $content.= "<div class='taxonomy'>"; $content.= sg_get_terms_list(); $content.= "</div>"; } else {return $content;} } ?> Creating dynamic subject guides using WordPress will add a level of usability to your library website. You will be able to add and manage content with greater efficiency. As we discovered at Lincoln Memorial University Carnegie-Vincent Library, these guides also help involve librarians and users. Using WordPress gives CVL a professional, functional presence on the web. What is exciting about WordPress is that it is evolving and improving. No matter the size of your library or your specific needs, WordPress will almost always provide for you a solution. With the step-by-step guide we've provided, we hope you will take the time to experiment with our response to a specific need at our library and that you will then branch out and utilize the multifaceted capabilities of WordPress. More Information This is really just the tip of the iceberg. We fully expect that WordPress will release even more customizable functionality in future releases. The WordPress Codex is the top resource for all things WordPress. It is best to look there first for the definitive word on how to use the WordPress functions and capabilities that were mentioned. With that said, there are many
  • 22. additional resources on the web that will provide tips and different approaches. WordPress is expanding into a fully functional content management system--it has been for a while. The beauty in using and customizing a system like WordPress is that the more people who use it, the more support will be provided. The full community of support in WordPress is a remarkable thing. You never know when your question will be answered by another user who has experienced the same issues, or even one of the lead developers. Please look at the following references and resources for more information on using WordPress and custom post types. • WordPress Custom Post Types on the WordPress Codex http://codex.wordpress.org/Custom_Post_Types • Showing custom post types on your home/blog page http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-blog- page • Custom post types in WordPress http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress • Custom Post Types in WordPress 3.0 http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0/ Extending Custom Post Types in WordPress 3.0 http://kovshenin.com/archives/extending-custom-post-types-in-wordpress-3-0/ This has been presented to the best of our knowledge. As with all open source code, the core WordPress functionality may change and leave sections of the code represented above as nonfunctional. If you choose to implement the ideas expressed herein, please research WordPress further and share your findings with the WordPress community. The authors do not guarantee exact results as expressed herein. Bios
  • 23. Laura Slavin is the Technical Services Librarian at Lincoln Memorial University Carnegie - Vincent Library. She earned her Masters in Library and Information Science from the University of South Florida School of Library and Information Science and her Masters in Business Administration from Lincoln Memorial University. Joshua Dodson is a Web Analytics Strategist for Stamats, Inc. in Cedar Rapids, IA. Laura and Joshua have published and presented numerous times on WordPress and the use and customization of other open source software for over two years.