示例#1
0
<?php

get_header();
use SandersForPresident\Wordpress\Services\News\NewsFeedService;
$newsFeedService = new NewsFeedService();
$news = array_slice($newsFeedService->getNewsFeed(), 0, 3);
?>
<div class="container blog list">
  <div class="page-container">
    <div class="leftside">
        <h3>Local Actions</h3>
        <button class="add-event">+ Add Event</button>
        <?php 
echo do_shortcode('[eme_events limit=100]');
?>
    </div>
    <div class="rightside">
        <h3>National #MarchOnDNC</h3>
        <?php 
foreach ($news as $item) {
    ?>
          <article<?php 
    if ($item->isRemote()) {
        ?>
 class="official"<?php 
    }
    ?>
>
            <?php 
    if ($item->isRemote()) {
        ?>
示例#2
0
<?php

get_header();
use SandersForPresident\Wordpress\Services\News\NewsFeedService;
$newsFeedService = new NewsFeedService();
$news = $newsFeedService->getNewsFeed();
?>
<div class="container blog list">
  <div class="page-container">
    <div class="page-title">
      <h2>Find out what's going on near you</h2>
      <h1>News</h1>
    </div>

    <?php 
foreach ($news as $item) {
    ?>
      <article>
        <h2>
          <a href="<?php 
    echo $item->getLink();
    ?>
">
            <?php 
    if ($item->isRemote()) {
        ?>
<span style="color: #277cc0;">BERNIE POST:</span><?php 
    }
    ?>
            <?php 
    echo $item->getTitle();