FLiFnotes

July 17, 2009

Playing with WordPress plugins – Part I

Filed under: Uncategorized — Tags: — Deborah Hawkins @ 2:07 am

Quite a while back, I wanted to make a quiz site with questions about PHP, and as I’m still into learning more about WordPress, the only logical thing to do is to develop a plugin that will make WordPress into the perfect CMS for this project.

At this moment, there are 5,855 plugins in the WordPress plugin directory. If so many other people have done it, surely it can’t be too hard, right? But I spent countless hours reading the documentation months ago and never had anything to show for it….

Well, this time I’m going agile. I wrote a post asking “What is 2 + 2?”, added a custom field called “correct” with the value 4, and now have the code to make that answer appear underneath the blog entry. It took me a while to figure out that I needed to pass $content to my function to keep the post from disappearing, but it looks like I’m on my way.


add_action( 'the_content', 'the_pop_quiz' );
function the_pop_quiz($content) {
echo $content;
$flif_pid = get_the_ID();
$pop_quiz_answer = get_post_meta( $flif_pid, 'correct', true );
echo $pop_quiz_answer;
}

bbPress 1.0 is finally here!

Filed under: Projects — Tags: , — Deborah Hawkins @ 1:44 am

Hive Bee Honey
Whoa! Two and a half months since my last blog, but bbPress 1.0 just came out recently and I updated the Chavez360 project with this and WordPress 2.8.1, and I finally have a site that integrates as smoothly as I’d like. The only really important suggestion for anybody about to set this up is to install WordPress completely first, including the new bbPress plugin before going on to the bbPress installation. The process would have been a tad smoother for me if only I had thought to do that.

Powered by WordPress