uladk
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Problem: Only one post shown per month in archiveI made a custom archives.php template that was a combination of
wp_get_archives('type=monthly')andwp_get_archives('type=postbypost')so each month also showed its ‘postbypost.’The code:
<?php
global $month, $wpdb;
$now = current_time('mysql');
$arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM " . $wpdb->posts . " WHERE post_date <'" . $now . "' AND post_status='publish' AND post_password='' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC");
if ($arcresults) {
foreach ($arcresults as $arcresult) {
$url = get_month_link($arcresult->year, $arcresult->month);
$text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year);
echo get_archives_link($url, $text, '','<h5>','</h5>');
$thismonth = zeroise($arcresult->month,2);
$thisyear = $arcresult->year;
$arcresults2 = $wpdb->get_results("SELECT ID, post_date, post_title, post_excerpt, comment_status FROM " . $wpdb->posts . " WHERE post_date LIKE '$thisyear-$thismonth-%' AND post_status='publish' AND post_password='' ORDER BY post_date DESC");
if ($arcresults2) {
echo"<ul class='arc'>";
foreach ($arcresults2 as $arcresult2) {
if ($arcresult2->post_date != '0000-00-00 00:00:00') {
$url = get_permalink($arcresult2->ID);
$arc_title = $arcresult2->post_title;
$excerpt_arc = $arcresult2->post_excerpt;
if ($arc_title) $text = strip_tags($arc_title);
else $text = $arcresult2->ID;
echo "<p class='trig trigger'>".get_archives_link($url, $text, '');
$comments = mysql_query("SELECT * FROM " . $wpdb->comments . " WHERE comment_post_ID=" . $arcresult2->ID);
$comments_count = mysql_num_rows($comments);
if ($arcresult2->comment_status == "open" OR $comments_count > 0) echo ' ['.$comments_count.']';
echo "
";
echo"<div class='excerpt'>";
echo"$excerpt_arc
";
echo"<p class='viewarc' style='text-align: right;'><a href=$url>View article</a>
";
echo"</div>";
}
}
echo"</ul>";
}
}
}
?>
The result:
http://www.designlegion.com/rave/archives/Forum: Fixing WordPress
In reply to: Problem: Only one post shown per month in archiveNever mind, fixed it.
Forum: Fixing WordPress
In reply to: Archive index showing both month and postanyone?
Forum: Fixing WordPress
In reply to: Index page for PagesEDIT: Working index Page
Forum: Fixing WordPress
In reply to: Index page for PagesThanks for your reply. I found a better solution actually. Here’s what I was wanting to accomplish:
If you rollover the menu on the left (top 2 only work so far) you’ll see each Page is pulled into the index with their comments and comment reply field without reloading the page.
Forum: Fixing WordPress
In reply to: Showing specific pages with comments in an external pageThat worked mate. Thankyou very much.
I did try that before also but I see the problem I had. I have the last part of my loop code in my right menu div tag. Since I wanted the pages displayed in the center column I had started another loop inside the first loop so it was invalid!
The only problem now is that inserting pages into that one has somehow messed with my postdata sections. I don’t see the comment notification anymore
Forum: Fixing WordPress
In reply to: Showing specific pages with comments in an external pageI tried that, still the first page displays. Here’s what I have:
<?php query_posts('page_id=4'); ?>
<?php query_posts('page_id=5'); ?><?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
loop code, etc
Thanks for you help
Forum: Fixing WordPress
In reply to: Showing specific pages with comments in an external pageI’ve been using the query_posts as suggested but cannot pull multiple pages. Here’s the code I’ve used:
<?php query_posts('page_id=1,4,6'); ?>
Only the first page displays.Any thoughts?
Forum: Fixing WordPress
In reply to: Showing specific pages with comments in an external pageCheers mate! I was going to use wordpress pages as a backup but wasn’t sure how to change the left navigation. Now I can do that by creating custom page templates. Problem partially solved.
What I need to know now is can I have one master page which can pull in all the content of other specific pages, with their comments and reply fields. I aim to have each pulled in page as a section that users can comment on. It would be like this current page (roll over the left menu) but with comments and a reply field under each section.
Thanks!