• Resolved loyalpk

    (@loyalpk)


    below code is not working. it was working in 3.7 and prior version. particular this line.

    $maxitems = $rss->get_item_quantity(30);

    <p class="sidehead" id="hackn">Hacker News 30</p>
    <?php include_once(ABSPATH.WPINC.'/feed.php');
    $rss = fetch_feed('https://news.ycombinator.com/rss');
    $maxitems = $rss->get_item_quantity(30);
    $rss_items = $rss->get_items(0, $maxitems);
    ?>
    <ul>
    <?php if ($maxitems == 0) echo '<li>No items.</li>';
    else
    // Loop through each feed item and display each item as a hyperlink.
    foreach ( $rss_items as $item ) : ?>
    <li class="hackernews">
    <a href='<?php echo $item->get_permalink(); ?>'>
    <?php
    $posttit = $item->get_title();
    if(!empty($posttit)) {
      echo $posttit;
    } else {
      echo "Undefined post title";
    }
    ?></a>
    </li>
    <?php endforeach; ?>
    </ul>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wordpress 3.7.1 breaking site’ is closed to new replies.