Doodlebee
Forum Replies Created
-
Forum: Installing WordPress
In reply to: Error during WordPress InstallationSounds like perhaps your server is running PHP4 by default. (My host does this too – they have *both* PHP4 and PHP5 on the server, but they run PHP4 by default.) WordPress, I believe, now requires PHP5.
You can usually get around this by adding:
AddHandler x-httpd-php5 .php
to your .htaccess file.
Forum: Plugins
In reply to: Modifying the loopYou can edit the Loop to display anything you want. The Default them is there an en example of hat tags are available to you. But in any theme, you can edit what output is displayed.
To display images, however, you’re looking for smething more customized. You cannot generally (well, you *could*, but it would require some extra work on the server’s part) just place an image within the post content and strip everything away to display the image. What usually used is either a plugin or a custom query and meta data.
I can’t tell you what plugin to use – since I generally just write my own code for this type of thing. But I’m sure there are several out there. Personally, I use custom fields and the get_post_meta() function to pull the images into the Loop and display the title and image (which link to the post and full content). if I want to limit how many posts are displayed (and/or in a particular category), I’ll use query_posts for that.
Hope that helps!
Forum: Fixing WordPress
In reply to: Show author only once?prob’ly so 🙂 But I also had to use this for other things as well – as it turned out, it’s developed even further than this, and is way more complicated because of what I needed it for. Instead of boosting this one again, I’m going to be posting about the whole thing on my site – maybe making a plugin of my own on it.
*believe me* – I looked at yours 😉 I didn’t want to code it all about if I didn’t have to – but the requirements of the project made it necessary!
Forum: Fixing WordPress
In reply to: How to show tag images?If you only want it to display once, then you just need to “count” it. If it’s displayed more than your count, it’ll stop.
<?php if(have_posts()) : ?> <div class="contentbox"> <h2><?php single_tag_title(); ?></h2> <p><?php while(have_posts()) : the_post(); $posttags = get_the_tags(); if ($posttags) { $count = '1'; foreach($posttags as $tag) { if($count == '1') { echo '<img src="http://www.colbee.hu/img/' . $tag->slug . '.png" alt="' . $tag->name . '" />'; } $count++; } } ?></p> <?php echo tag_description(); endwhile;?> </div> <?php endif; ?>Kay -already have fixes. If you were in a a category that had child categories, then it would list the subcategory posts as part of the current category you’re in. There was also no classes set to determine if you were in a current category or not (for styling purposes). I fixed both these issues with the following changes…
find this part:
foreach($posts as $post) { setup_postdata($post); $thelist .= '<li><a href="' . get_permalink($post->ID) . '" rel="bookmark" title="Permanent Link to ' . get_the_title() . '">' . get_the_title() . '</a></li>' . "\n"; }and replace it with this:
foreach($posts as $post) { setup_postdata($post); $postlink = get_the_ID(); if($postlink == $thispost) { $linkclass = ' class="current-post"'; } else { $linkclass = ''; } if(in_category($cat)) { $thelist .= '<li class="' . $class . '"><a' . $linkclass . ' href="' . get_permalink($post->ID) . '" rel="bookmark" title="Permanent Link to ' . get_the_title() . '">' . get_the_title() . '</a></li>' . "\n"; } }and there you go 🙂
Forum: Fixing WordPress
In reply to: Complex category function – Relative conditionsForum: Fixing WordPress
In reply to: How to show tag images?Sorry for the delay with this – been busy. 🙂
You don’t have this within the Loop. Right now, you’re basically asking it to display code on a “tag” page – but it doesn’t know what to display because it’s not within the Loop. (The first instruction at the top says “This must be performed within the Loop” – no loopie, no lovie 😉
try this:
<?php if(have_posts()) : ?> <div class="contentbox"> <h2><?php single_tag_title(); ?></h2> <p><?php while(have_posts()) : the_post(); $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo '<img src="http://www.colbee.hu/img/' . $tag->slug . '.png" alt="' . $tag->name . '" />'; } } ?></p> <?php echo tag_description(); endwhile;?> </div> <?php endif; ?>That’s off the top of my head, and it may or may not result in some funkiness – but it should be enough to get you started.
Forum: Fixing WordPress
In reply to: Show author only once?That *is* weird – my post is right above yours…(I can see it)
How bizarre.
Forum: Everything else WordPress
In reply to: Why was my topic closed?Dunno if it was a bug, or if someone saw this and re-opened it – but I got to post my solution 🙂 Thanks!
Forum: Fixing WordPress
In reply to: Show author only once?Yep – here it is:
$root = $_SERVER['DOCUMENT_ROOT']; $path = get_bloginfo('home'); function list_page_authors() { global $post, $root, $path; $output = array(); if(have_posts()) : while(have_posts()): the_post(); $id = get_the_author_meta('ID'); $id_arr[] = $id; endwhile; endif; $clean = array_unique($id_arr); $count = '1'; foreach($clean as $id) { $first = get_the_author_meta('first_name', $id); $last = get_the_author_meta('last_name', $id); $name = $first . ' ' . $last; $position = get_the_author_meta('position', $id); $description = get_the_author_meta('description', $id); $url = get_the_author_meta('user_url', $id); $img = '/wp-content/gravatars/' . $first . '_' . $last . '.jpg'; if(file_exists($root . $img)) { $myimg = '<img class="avatar" src="' . $path . $img . '" alt="' . $name . '" />'; } else { $myimg = get_avatar( $post ); } ?> <div class="authorinfo<?php if($count == '1') { echo ' first';} ?>"> <?php echo $myimg; ?> <h5><?php echo $name;?></h5> <h6><?php echo $position; ?></h6> <p><?php echo $description; ?></p> <?php if($url != '') { ?><a class="more-link" href="<?php echo $url; ?>">read more</a><?php } ?> </div> <?php $count ++; } }Forum: Requests and Feedback
In reply to: Stoping user from embedding abusive images in postsUse Role Manager or Role Scoper (I think Scoper is better for 2.8…but both are good). You can change what people are allowed to do with that.
Forum: Fixing WordPress
In reply to: Using categories as a base of navigation?I have googled and googled a solution for this, cant find nothing, nada!
then you’re not looking for the right thing 😉
I think you’ve answered your own question. If it’s all static content, use Pages and subPages. However, if it’s a running (and frequently updated) section – like “news” or “articles”, then use categories.
i do WP as a CMS all the time, and usually end up doing a combination. If the client wants a “news” or “articles” section (sometimes even “portfolio”), and/or a blog, I reserve categories for those parts. Everything else is static, so it’s Pages.
Forum: Plugins
In reply to: In Template – Alternate sidebar if no widgets assignedA working example of *exactly* what you’re looking for is included in the default theme’s sidebar.php file.
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('left-side-widgets') ) : ?> put your default "show this stuff if no widgets are activated" stuff here <?php endif; ?>No, I see you’ve named a sidebar widget section – so if you want stuff to show up on all other pages that *aren’t* using “left-side-widgets” then just edit that a bit:
<?php if( !dynamic_sidebar('left-side-widgets') ) { ?> put the stuff for a sidebar if the page isn't using the left side widgets <?php } else { ?> display the default stuff that shows if you're on a page that uses left-sidebar-widgets, but no widgets are pulled in yet <?php } ?>Forum: Everything else WordPress
In reply to: my website pages don’t displayForum: Fixing WordPress
In reply to: Hackers editing files?Did you contact your host about this? If your file permissions are correct, and you’ve gone as far as changing your database password (and possibly the name) then I’d say someone else on the server has a back door left open, and the hacker is gaining access through some other site – possibly wreaking havoc on the entire server. The hoist should be made aware of this so they can track it down and fix it.