WordPress Wiki

v1.0.4

Rev 06/23/2010

Custom Fields

Using Meta data / Custom fields: http://codex.wordpress.org/Custom_Fields
if meta name is pagename, you can retreive it within the loop:

$pagename = get_post_meta($post->ID, “pagename”, true);

after the: if (have_posts()) : while (have_posts()) : the_post();

Sidebar

Sidebar should be set up in unordered list format. For best results, use same markup used in “default” WP theme. This has a ul id = “sidebar”. Set up following code within sidebar for a dynamic sidebar that has widgets:

<?php if ( !function_exists(‘dynamic_sidebar’)
|| !dynamic_sidebar() ) : ?>

functions.php – controls widgets for sidebar. The “default” functions.php file will work, or the following code can be used:

<?php if ( function_exists(‘register_sidebar’) )
register_sidebar(array(
‘before_widget’ => ‘<li id=”%1$s”
class=”widget %2$s”>’,
‘after_widget’ => ‘</li>’,
‘before_title’ => ‘<h4>’,
‘after_title’ => ‘</h4>’,
));
?>

Widgets to appear in your sidebar can be controlled through the WP interface:

Appearance / Widgets – drag and drop which widgets you’d like to appear.

Permalinks:

http://codex.wordpress.org/Using_Permalinks

Twitter Friendly Links needs to use permalinks

/%postname%/%post_id%

(instructions below may not be EXACT)

Things to remember when enabling Permalinks + SexyBookmarks + Twitter Friendly Links:

  1. .htaccess file (in WordPress root) needs to be writeable
  2. Setup Permalinks prior to installing plugins and make sure they are working correctly
  3. Use: /%year%/%monthnum%/%day%/%postname%/
    1. For Permalink structure
    2. Enable SexyBookMarks (SBM)
    3. Select Twitter Friendly Links (TFL) from Twitter shortlink drop down
      1. SBM will tell you TFL needs to be installed and configured
      2. Install TFL by going to Plug-ins and searching for Twitter Friendly Links
        1. i. Or upload the files and enable it at this point
  4. Click on the configure link in TFL
  5. On the TFL Configuration page choose the following typical configuration
    1. Enable Shortlinks for Pages, Posts
    2. Choose .htaccess caching
    3. Redirection type should be [301]
    4. Save configuration
    5. Go back to Permalinks page and click Save again – this should load the shortlinks into .htaccess
    6. Go back to the TFL configuration page and test the shortlinks on the bottom of the page
    7. If these do not work check the following
      1. .htaccess file is writeable
      2. Download .htaccess and make sure short links are written in the .htaccess file
      3. When you save the TFL configuration, go and save the permalink structure again
        1. i.      Saving the Permalink structure will write to the .htaccess file
        2. Go back to the SBM configuration and save
        3. Go to the public site and make sure SBM is working
          1. a. Click on the twitter link and make sure you can “tweet” the shortlinks

WordPress PHP pages

Each type of “Post” page has a default php page that will display its content. Supposedly you can assign a template to a page and it will overwrite the default php page. This doesn’t always work, so you need to know what files to modify in case this occurs.

Default PHP pages for “Pages”:

Default – Page.php

Default PHP pages for “Posts”:

Blog Home page – Home.php

Individual Post – single.php

Post Category – category.php

Assign “Blog” page to a template, for ITMS PageOfPosts.php was created.

Footer Links

Wp_list_pages : Footer, needed to have all pages listed flat in footer.  link_after- link to image shown after each of the pages.

<?php $new = ‘ \\\\ ‘;

wp_list_pages(‘depth=-1&title_li=&link_before=<li>&link_after=’.$new.’</li>’);?>

Post about adding characters in between <li> items

http://wordpress.org/support/topic/244544

Plugins:

SexyBookMarks (SBM) : Editing the css within the plugins/ sexybookmarks/styles folder will control CSS for SBM divs.