lobos55
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: passing variablestvwlf
Thanks. It is probably the only way to do it, but I had hoped there would be a way to avoid doing it via the URL.Forum: Plugins
In reply to: Display posts from the last 24 hoursis there a way to achieve similar in wp_query?
Forum: Plugins
In reply to: get_post_custom_valuescan be closed
Forum: Plugins
In reply to: get_post_custom_valuesTried this one, but also renders just the first one.
<?php $news = get_post_meta($post->ID, 'Related news', false); ?> <?php foreach ($news as $new) : ?> $post = get_posts('id=$new'); <b><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title();? ></a> </b> <?php endwhile; ?> <?php endif; ?> </div> <?php endforeach; ?>
Forum: Plugins
In reply to: get_post_custom_valuesThis works, but only renders the first value:
<?php $news = get_post_meta($post->ID, 'Related news', true); ?> <?php $my_query = new WP_Query("p=$news"); while ($my_query->have_posts()) : $my_query->the_post(); ?> <b><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></b> <?php endwhile; ?>
Forum: Plugins
In reply to: get_post_custom_valuesSorry, mistake in cut and paste
<?php $news = get_post_custom_values('Related news'); foreach ( $news as $key => $value ) { <?php $my_query = new WP_Query("p=$value"); while ($my_query->have_posts()) : $my_query->the_post(); ?> <b><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>"</a></b> <?php endwhile; ?> } ?>
PS using 2.7.1
Forum: Themes and Templates
In reply to: Page templates gone WP 2.7.1I can see them via ftp. I tried resetting permalinks to default, to no avail.
I do have a testdatabse, still running under 2.7 and there it works like a charm…Forum: Fixing WordPress
In reply to: Display most recent comment for each post in index.php?Alkafy,
Great code. Just one problem, change of the limit does not work, I just get the last comment.
Here my code:<?php $posts = get_posts(“p=3666”);
if($posts) : foreach($posts as $post) : setup_postdata($post);$haochi = mysql_fetch_assoc(mysql_query(“SELECT comment_ID, comment_author, comment_content, comment_date FROM wp_comments WHERE comment_post_ID = ‘”.$post->ID.”‘ AND comment_approved = ‘1’ ORDER BY comment_date DESC LIMIT 10″));echo “<p><b>\n”;
echo $haochi[‘comment_author’];
echo “</b>
\n”;
echo $haochi[‘comment_content’];
echo “
\n”;
echo $haochi[‘comment_date’];
echo “</p>\n”;
endforeach; endif; ?>Any idea why I don’t get more comments?
Thank you for asnwering