Once upon...

an evening boring, while I pondered bored yet pensive,
Over many a strange and intriguing page of neglected blogs.
Swiftly, my mind began thinking, thinking of creating
A place of solace, of mapping of my thoughts and creations.
So welcome dear guests, if my words entice you.

The Voice

My name is Sue, simply Sue, an average idealist, a young adult, still uncertain about my future. My art and writings are by no means professional, but my passion for creating, creating, and creating is the living force that makes this site possible.

The Layout

Tested on:
  » Firefox 2.0.0.14, Opera 9.10,
    Netscape 8.1, Safari 3.1.1,
    Internet Explorer 7.0
  » Screen res: 1280x800
  » Color Quality: 32 bit

Affiliates

« Dailies | Apply? »

[ CLOSE ]
Gallery Graphics Anime Forums
AddThis Feed Button Bookmark and Share
Apr 14 2008

Simple Site Map Plugin

I created a site map plugin for Wordpress that simply lists all the pages you have on your site. It also comes with an optional category listing. You can edit the plugin to your liking. It was easy to create since it only has two main functions. The first function sitemap lists the pages using the wordpress generated tag wp_list_pages. I’ve also commented out a categories listing. You can add other listings if you’d like. The second major function generate_sitemap creates a shortcut you can use on any page you create when you go to Write –>Page. All you need to do is insert <– sitemap –> anywhere on that page and hit Publish.

Copy and paste the code below into a text editor such as notepad, and save it as sitemap.php. Then upload it to your site’s plugins folder. Activate the plugin in the Dashboard and create your site map page. To see a working site map, click here. If you have any questions, feel free to ask.

<?php
/*
Plugin Name: Site Map
Plugin Author: Sue
Plugin Description: Generates a site map based on pages but is customizable via plugin editor. You can get to that by clicking on the title of this plugin. Use &amp;lt;!&amp;ndash;&amp;ndash; sitemap &amp;ndash;&amp;ndash;&amp;gt; on any page in code view to display the site map.
Plugin Author URI: http://endless-sonata.net
Plugin URI: /wp-admin/plugin-editor.php?file=sitemap.php
*/
function sitemap() {
echo "<ul>";
wp_list_pages('title_li=');
echo "</ul>";
/*
// optional list categories
echo "<ul>";
wp_list_categories('title_li=');
echo "</ul>";
// you may add any other list options you'd like
*/
}
function generate_sitemap($content) {
if (strpos($content, "<!-- sitemap -->") !== FALSE) {
$content = preg_replace('/<p>\s*<!--(.*)-->\s*<\/p>/i', "<!--$1-->", $content);
$content = str_replace('<!-- sitemap -->', sitemap(), $content);
}
return $content;
}

add_filter('the_content', 'generate_sitemap');
?>
Thanks for your comment: Babyjen, Chien Yee, Vickie, Anya, Marsha, Yara

Posted in Tutorials | by Sue | 6 Comments »

Mar 19 2008

Creating Multiple Widget Sidebars

If you have multiple sidebars, or multiple themes with multiple sidebars, it’s a good idea to use dynamic sidebars. WordPress Widgets (WPW) is like a plugin, but designed to provide a simple way to arrange the various elements of your sidebar content (known as “widgets”) without having to change any code. What’s nice about using widgets is they’re easy to use and you have the contents of all your sidebars on one page so they’re easier to edit. When using different layouts with the same sidebar contents, all you need to do is call the sidebar functions to get the contents. If you want to insert php in your sidebar, there’s a plugin called PHP Exec. Click on that link and scroll down to where it says execphp.zip, and download it.

In order to use widgets, you need to place this bit of code in your sidebar.php or whatever your sidebar page is:

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('graphics') ) : ?>
<?php endif; ?>

Where it says “graphics”, replace it with whatever your sidebar name is mentioned in functions.php below.

You’ll need to make sure you have a functions.php in your theme folder. Inside functions.php, put this:

<?php
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'journal',
'before_widget' => '<div id="sidebar">', // Removes <li>
'after_widget' => '</div>', // Removes </li>
'before_title' => '<p class="navi>', // Replaces <h2>
'after_title' => '</p>', // Replaces </h2>
));
register_sidebar(array('name'=>'about',
'before_widget' => '<div id="sidebar">', // Removes <li>
'after_widget' => '</div>', // Removes </li>
'before_title' => '<p class="navi>', // Replaces <h2>
'after_title' => '</p>', // Replaces </h2>
));
register_sidebar(array('name'=>'archive',
'before_widget' => '<div id="sidebar">', // Removes <li>
'after_widget' => '</div>', // Removes </li>
'before_title' => '<p class="navi>', // Replaces <h2>
'after_title' => '</p>', // Replaces </h2>
));
register_sidebar(array('name'=>'gallery',
'before_widget' => '<div id="sidebar">', // Removes <li>
'after_widget' => '</div>', // Removes </li>
'before_title' => '<p class="navi>', // Replaces <h2>
'after_title' => '</p>', // Replaces </h2>
));
register_sidebar(array('name'=>'graphics',
'before_widget' => '<div id="sidebar">', // Removes <li>
'after_widget' => '</div>', // Removes </li>
'before_title' => '<p class="navi>', // Replaces <h2>
'after_title' => '</p>', // Replaces </h2>
));
?>

Make modifications where it says “journal”, “about”, etc. Also you can chose different tags before where it shows comments such as //Replaces…The number of calls to register_sidebar depends on the number of sidebars you have.

Now when you go to wp-admin, under “Presentation”, there should be a link to “Widgets”. From there you can drag boxes under “Available Widgets” onto a sidebar box. Some widgets allow you to edit the contents or settings. Click on the icon on the right of the widget box in a sidebar to see what you can edit. Click on the “X” when you’re done editing. Don’t forget to “Save Changes”. To view changes, refresh your browser, or delete your cache and refresh again if you don’t see the changes.

Thanks for your comment: Skogul, Ann, Chien Yee, Crystal, Destiny, Munin

Posted in Tutorials | by Sue | 6 Comments »

Jan 24 2008

Creating a RSS Feeds Page

Have you ever wondered if there’s a way to create a page that displays all your friends’ recent entries so you don’t have to visit their sites individually every time you want to see if they have updates? Well, I have created just the post for you. I still need to find a way to display full entries though, and possibly categories the entries fall under, the author’s name, and a comments link with the number of comments already posted. Basically, I’m looking for something like Livejournal’s friends page or Xanga’s subscriptions page.

Here’s the bit of code you will be needing:

<?php
require_once (ABSPATH . WPINC . '/rss-functions.php');
$url = 'http://sue.com/feed/';
$rss = fetch_rss( $url );
if ( $rss ) {
echo "<h4>" . $rss->channel['title'] . "</h4>";
$i = 1;
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
$pubdate = $item['pubdate'];
$author = $item['author'];
$category = $item['category'];
$description = $item['description'];
echo "<span style=\"font-size:16px\">$title</span><br /><b>$pubdate</b><br /><div style=\"padding:0 20px 0 20px\">$description</div>";
if ($i == 1 ) break;
$i = $i + 1;
}}?>

The only part you really need to change is the part that says
http://sue.com/feed/
Change that to whatever URL the feed page is to your friend’s web site. Usually they provide a link for you. If you have Firefox, you can view that page by clicking on the orange square icon on the very right of the address bar. Otherwise you can right click and view source to find where it says link rel=”alternate” and find the URL of the feed after that. Be sure it ends with rss, or feed. Somehow atom feeds don’t work with this code.

For each new feed URL you want on the page, you’ll need to copy and paste that code again and insert the URL.

For an example of a working Friends/Affiliates page, click here.

Edit on 1.30.2008: To display full entry feeds, use this bit of code in place of where it says $description = $item['description'];

$isset = $item['content']['encoded'];

and replace where it says $description with $isset.

To display the author’s name use this:

$author = $item['dc']['creator'];

And be sure to include echo “Author: $author”;

Oh yeah, and here are the instructions for how to apply the code:

To set up the dailies page, you need to create a template. Let’s call it “Feed”. To create a template, basically copy the code from page.php or if you don’t have that use index.php, but delete wherever they call the comments function, the date, and anything else you don’t want to show up on your dailies page.

Create feed.php with that copied code from page.php or index.php. At the top you should write <?php /* Template Name: Feed */ ?> or whatever you want the template name to be. Then you should paste that bit of code I mentioned in this post in place of where it says <?php the_content(); ?> or something similar to that.

Create as many duplicates of that bit of code as there are feeds you want to read from people. It only creates one entry per site. Be sure to replace the URL with whatever feed URL you want. After that, save the feed.php, and upload it on your server under your theme’s folder.

Then create a page in Wordpress, and name it “Dailies” or something like that. Be sure to select the template “Feed”. You don’t have to write anything on that page. Hit publish, and you should be able to view that page.

Thanks for your comment: Roz, Katie, bec, Destiny, Kimberly, lisadragon, Sue, Brenda, Yara, Angela, stanch, Xuan, Chien Yee

Posted in Tutorials | by Sue | 18 Comments »

Page 1 of 212»