Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Forum: Fixing WordPress
    In reply to: passing variable
    Thread Starter lobos55

    (@lobos55)

    stvwlf
    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.

    is there a way to achieve similar in wp_query?

    Forum: Plugins
    In reply to: get_post_custom_values
    Thread Starter lobos55

    (@lobos55)

    can be closed

    Forum: Plugins
    In reply to: get_post_custom_values
    Thread Starter lobos55

    (@lobos55)

    Tried 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_values
    Thread Starter lobos55

    (@lobos55)

    This 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_values
    Thread Starter lobos55

    (@lobos55)

    Sorry, 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

    Thread Starter lobos55

    (@lobos55)

    I 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…

    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

Viewing 8 replies - 1 through 8 (of 8 total)