Problems With Wordpress
I'm using the Wordpress Theme 'Branford Magazine' with the 'Nimbo Sidebar,' and I am trying to add the plugin 'Quotes-Collection,' so that I might add daily tips to my blog. I'm using Wordpress 2.8
The sidebar already contains information such as 'archive' an ad block, all the usual info you'd find on a standard sidebar.
My problem is this when I go to WP Admin » Appearance » Widgets, and drag the 'Random Quote' widget into the sidebar the quote shows OK but everything else disapears and quote is sitting, pretty as you like, right at the top of the sidebar. Where have I gone wrong? What to do?
I'm not stuck on using plugins or widgets in fact I had tried this bit of code which I picked up from Robert Plank HERE, which means I can put my tips anywhere I want, but it was showing up faulty.
Anyway here is the code:
Code placed in my sidebar.php
<li>
<h3>Random Tips</h3>
<?php require("tips.php"); ?>
<ul class="subnav">
</ul>
</li>
A text file called tips.txt containing something like
tip #1
tip#2
tip#3
and so on. Each tip on a new line.
And finally a file called tips.php with the following code
<?php
$hash = floor(time() / (60*60*24));
srand($hash);
$tips = array_map("trim", file("tips.txt"));
$tip = $tips[array_rand($tips)];
echo $tip;
?>
Unfortunately I get errors something like this:
Warning: file(tips.txt) [function.file]: failed to open stream: No such file or directory ..../mywebsite.com/public_html/wp-content/themes/branford with mimbo sidebar/tips.php on line 6
Warning: array_map() [function.array-map]: Argument #2 should be an array in .../mywebsite.com/public_html/wp-content/themes/branford with mimbo sidebar/tips.php on line 6
All the code is placed in the Branford Magazine directory.
Any suggestions on the plugin, any suggestions on the code above. I actually prefer doing the job by code as I feel I have more control over what happens.
Kevin
The 2nd Amendment, 1789 - The Original Homeland Security.
Gun control means never having to say, "I missed you."