Joshua Sigar
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Italics Pushing Down MenuHave a nice read 🙂
http://positioniseverything.net/explorer/italicbug-ie.htmlForum: Plugins
In reply to: is there a get_comment() function?There’s no get_comment.
Here’s how WP fetches comments. (File: comment-functions.php; function: comments_template.)
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND ( comment_approved = '1' OR ( comment_author = '$author_db' AND comment_author_email = '$email_db' AND comment_approved = '0' ) ) ORDER BY comment_date");Forum: Plugins
In reply to: get_post method not workingForum: Plugins
In reply to: get_post method not workingIt expects a variable.
$my_idis a variable;7is not.Forum: Plugins
In reply to: get_post method not workingTry this
<?php
$my_id = 7;
$post_id_7 = get_post($my_id);
$title = $post_id_7->post_title;
?>Forum: Fixing WordPress
In reply to: Exclude Cat on Main Page in 2.0That’s weird. Anyway, let’s just try another method.
Delete the if-statement and the closing bracket.
Add the following right before the Loop begins.<?php $wp_query->set('cat', '-4'); ?>
<?php query_posts(''); ?>Forum: Fixing WordPress
In reply to: Exclude Cat on Main Page in 2.0On home page, you don’t want to show posts of category 4, is that it?
<?php if (is_home() && !in_category(4)) { ?>Forum: Fixing WordPress
In reply to: Showing only 1 post from a specific topic on homepageUse the following plugin. (The instruction in on the file)
http://dev.wp-plugins.org/file/front-page-cats/trunk/front_page_cats.php?rev=57&format=rawForum: Plugins
In reply to: How do I install plugin with Mac Firefox?It’s on the wordpress site. Go to where you uploaded the WP files the first time and you should see the following directories as well as some other files.
wp-admin
wp-content
wp-includesBrowse
wp-contentdirectory and you should find thepluginsdirectoryForum: Fixing WordPress
In reply to: Merge 2 blogs to oneI can of corse install some other blog, import from WP, and then import back, but it’s actually a bit too stupid.
As far as I know, that’s the only solution available right now.
Forum: Plugins
In reply to: WP Role ManagerThere’s something similar http://asymptomatic.net/2005/12/31/2189/role-manager-plugin/
Forum: Fixing WordPress
In reply to: Call Posts By Number of Comments<?php
$circle_first = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE comment_count > 0");foreach ($circle_first as $post) :
setup_postdata($post);
the_title();
endforeach;
?>Forum: Fixing WordPress
In reply to: Knowing the last post in the loop?Inside the Loop…
<?php
if ($wp_query->current_post == $wp_query->post_count) :
// I'm the last post in the Loop
endif;
?>Forum: Fixing WordPress
In reply to: if(is_latest()) exist?The following solution makes my previous solution obsolete.
What you want to do is
(Before the Loop begins)
1. Get one latest post with template tag get_posts
2. Get the date of that latest post.
(Inside the Loop)
3. Compare the current post’s date with latest post’s dateSo, step 1 and 2 would be…
<?php
$latest_post = get_posts('numberposts=1');
$latest_date = $latest_post[0]->post_date;
?>and step 3…
<?php
if ($latest_date == $post->post_date) :
echo "LATEST";
endif;
?>Forum: Fixing WordPress
In reply to: if(is_latest()) exist?You could probably do something like the following inside the Loop.
if ($wp_query->current_post == 0 && is_home()) // latest post
{}
EDIT: make sure to use that code only in the front page
EDIT2: ok. I edited the code above. should be more bulletproof now.