ejm
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: how to exclude one category from links on sidebarThat seems so code heavy! Is there really no way to just exclude one? Or could I do something like this?
<?php wp_get_links('1,2,3,5,6,7', 'name'); // show alphabetically, include all but category 4 ?>Forum: Fixing WordPress
In reply to: how to exclude one category from recent posts?Thanks for the warning about the query_posts solution. Currently, my sidebar DOES occur after the Loop. If I make a change to place it before the loop, I’ll try to remember rather than panic.
Thank you again for the help.
Forum: Fixing WordPress
In reply to: how to exclude one category from recent posts?Excuse me for replying to myself…
Finally!!! I applied rembem’s solution outlined at http://wordpress.org/support/topic/52819
This is the code that I have placed on my sidebar that excludes category 4 from showing up in the recent posts list:
<li id="recent_posts"><h2><?php _e('recent posts '); ?></h2>
<ul>
<?php $temp_query = $wp_query; query_posts('&cat=-4'); //ejm exclude category 4 ?>
<?php while (have_posts()) { the_post(); ?>
<li><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to “<?php the_title(); ?>”"><?php the_title(); ?></a></li>
<?php } $wp_query = $temp_query; ?>
</ul>
</li>with the added advantage that I no longer have to use the recent-posts plugin.
Thanks all for your patience. And many thanks to rembem for outlining the solution that worked for me too.
Forum: Fixing WordPress
In reply to: how to exclude one category from recent posts?I thought I’d try mkallen’s solution that is explained at
http://codex.wordpress.org/Template_Tags/query_postsRats. It does not exclude the category from the “recent posts list” on the sidebar. (recent-posts plugin)
Forum: Fixing WordPress
In reply to: how to exclude one category from recent posts?Let me preface that I’m never thrilled to just apply code without really knowing what it means. But I’ve just now tried your coding, Otto42, and got a major error message.
WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '<= '' AND (post_status = 'publish') AND wp_posts.ID = wp_post2c]
SELECT DISTINCT * FROM wp_posts, wp_post2catWHERE post_date <= '' AND (post_status = 'publish') AND wp_posts.ID = wp_post2cat.post_id AND wp_post2cat.category_id !=4GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT HOW_MANY_POSTS_YOU_WANTWarning: Invalid argument supplied for foreach() in ../wp-content/themes/ejm/sidebar.php on line 37I have just checked and these are the versions I am running.
PHP version: 4.3.11
MySQL version: 4.0.26It looks like I’ll have to do some more staring at various pages.
Even more than I did before, I wholeheartedly agree with Stahn, who wrote, “It would have been SO MUCH easier if get_archives had an option to exclude categories…” in the Exclude Category from Recent Posts in sidebar thread.
Forum: Fixing WordPress
In reply to: how to exclude one category from recent posts?Thank you both for your replies.
You’re absolutely right, Otto42, there isn’t a get_recent_posts() function. I had forgotten that I have the recent-posts plugin installed. Until a few moments ago, it was version 1.05 I just downloaded the latest version and installed that in hopes that there might be something there. Alas no. And there doesn’t seem to be anything useful (to me, anyway) in the read-me file either.
I see that wp codex: Displaying Posts Using a Custom Select Query says I must have at least one post with Custom Fields data.[… and …]created a Page and associated a Page Template with that page.
It just doesn’t get easier does it? :^/
Have you placed that code on your theme index.php, mkallen?
Forum: Themes and Templates
In reply to: Calendar QuestionI suppose that is possible but I’m afraid that I really don’t know the answer, Ben.
Maybe there is something that will help in the codex?
http://codex.wordpress.org/Troubleshooting
or
http://codex.wordpress.org/Customizing_Your_Sidebar
All the best!!
(When you do find a solution, it might not be a bad idea to come in here and post it for others who may find themselves with the same problem)
Forum: Themes and Templates
In reply to: Calendar QuestionTry replacing all of that with simply:
………………
<?php get_calendar(); ?>
……………….Or if you have your calendar on your sidebar housed in a list, use the following:
………………….
<li id="calendar"><?php _e('Calendar'); ?>
<?php get_calendar(); ?>
</li>
………………….Forum: Fixing WordPress
In reply to: eventcalendar 3.0.4 not showing future eventsYou’re most welcome, Ciryaquen. I’m glad it works now.
Forum: Fixing WordPress
In reply to: eventcalendar 3.0.4 not showing future eventsYes, it is a little confusing, isn’t it? What is meant is that the lines that have the + are the lines of code that are to be added. But the + signs do not belong in the coding itself. I found the instructions to be a little awkward as well….
Allow me to rephrase it:
First, just in case a mistake is made, make a copy of wp-includes/classes.php and name it untouched_classes.php. Now open wp-includes/classes.php in a text editor (notepad) and FIND
if (mysql2date('U', $this->posts[0]->post_date_gmt) > mysql2date('U', $now)) { //it's future dated
$this->is_preview = true;AFTER that, using “copy and paste”, add the following:
/* DIRTY FUTURE-POSTS HACK FOR EC3 */
if (function_exists('ec3_get_calendar')) {
global $ec3;
$ec3_post_0_is_event = intval($wpdb->get_var(
"SELECT COUNT(0) FROM $wpdb->post2cat WHERE post_id="
.$this->posts[0]->ID." AND category_id=$ec3->event_category"));
if ($ec3_post_0_is_event) {
$this->is_preview = false;
}
}
if ($this->is_preview)
/* DIRTY FUTURE-POSTS HACK FOR EC3 */Save and upload the file to your wordpress folder.
Hope that helps!
Forum: Fixing WordPress
In reply to: eventcalendar 3.0.4 not showing future eventsExcuse me for replying to myself…
I have FINALLY got the event calendar to work. It turns out that one must “publish” the post so that it will appear on the calendar.
Suggested rewording for the end of “== How to make an Event Post ==” that may save other literal people like me from a world of grief:
………………………………………………
: set the date and time of your event and click <del>’Save'</del> ‘Publish‘.
:……………………………………………………….Forum: Fixing WordPress
In reply to: daylight savings timeExcuse me for replying to myself. I’ve done further searching and am getting a little closer. I have now successfully got the figured out how to get the title spec on acronym to have the value “GMT – 0400” when it is surrounding EDT:
<acronym title="<?php echo gmdate(T). strftime('%z', $t) . '">'. date(T); ?></acronym>But I have not found where the_time() is defined in wordpress so that I can add the acronym tag. Perhaps I’m going to have to resort to using
<?php date(H:i) ?> <acronym title="<?php echo gmdate(T). strftime('%z', $t) . '">'. date(T); ?></acronym>except that now this produces GMT – 0500 instead of GMT – 0400 in the title spec for EDT (Eastern Daylight Time)
Forum: Fixing WordPress
In reply to: daylight savings timeI have been unsuccessful in my search for how to surround the Timezone with a titled acronym tag. For instance, if I wanted to produce:
<acronym title="Eastern Daylight Time">EDT</acronym>This is as close as I have come….
<acronym <?php echo 'title="'. date(T). '">' . date(T); ?></acronym>But that just puts the acronym itself into the title spec rather than the full wording of the TimeZone. Any ideas? (I’ve tried searching on php.net but being relatively green at php, I cannot decipher most of what I see there)
Forum: Fixing WordPress
In reply to: Comments Link Still Appears When Comments Are Disabled For The PostIt took me a while to figure out which file to edit on my wordpress blog because I use a completely different template. (Just in case others are as dim as I, the file that is to be altered is index.php in the theme folder.)
This is what I have now (that works beautifully):
<?php
// disable comments link if comments are disabled
if ('open' == $post->comment_status) : ?>
<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
<?php endif;
// end of disabling comments link if comments are disabled
?>However, the coding looks decidedly unwieldy. I’m not very savvy about php. How do I achieve something the same in a cleaner way?
Forum: Fixing WordPress
In reply to: custom database error messagedanielos wrote:
……………………………………
: The CSS info for the database error
: messages isn’t in wp-db.php file.
:…………………………….There is a CSS section. It is at the bottom of includes/wp-db.php
look just below the following coding:
function bail($message) { // Just wraps errors in a nice header and footer