コード例 #1
0
function pib_rss_news()
{
    // Get RSS Feed(s)
    include_once ABSPATH . WPINC . '/feed.php';
    // Get a SimplePie feed object from the specified feed source.
    $rss = fetch_feed('http://pinterestplugin.com/feed/');
    if (!is_wp_error($rss)) {
        // Checks that the object is created correctly
        // Figure out how many total items there are, but limit it to 5.
        $maxitems = $rss->get_item_quantity(3);
        // Build an array of all the items, starting with element 0 (first element).
        $rss_items = $rss->get_items(0, $maxitems);
    }
    ?>

	<ul>
		<?php 
    if ($maxitems == 0) {
        ?>
			<li><?php 
        _e('No items.', 'pib');
        ?>
</li>
		<?php 
    } else {
        ?>
			<?php 
        // Loop through each feed item and display each item as a hyperlink.
        foreach ($rss_items as $item) {
            ?>
				<li>
					&raquo; <a href="<?php 
            echo esc_url($item->get_permalink()) . pib_campaign_url('sidebar_link', 'blog_post_link');
            ?>
" target="_blank" class="external">
						<?php 
            echo esc_html($item->get_title());
            ?>
</a>
				</li>
			<?php 
        }
        ?>
		<?php 
    }
    ?>
	</ul>
	
	<?php 
}
コード例 #2
0
function pib_settings_sidebar_lite()
{
    ?>

    <div class="postbox">
        <?php 
    pib_handlediv();
    ?>
        <h3 class="hndle pib-hndle"><?php 
    _e('Spread the Word', 'pib');
    ?>
</h3>
        
        <div class="inside">
            <p><?php 
    _e('Like this plugin? A share would be awesome!', 'pib');
    ?>
</p>
            
            <table id="share_plugin_buttons">
                <tr>
                    <td><?php 
    echo pib_share_twitter();
    ?>
</td>
                    <td><?php 
    echo pib_share_pinterest();
    ?>
</td>
                </tr>
                <tr>
                    <td><?php 
    echo pib_share_facebook();
    ?>
</td>
                    <td><?php 
    echo pib_share_gplus();
    ?>
</td>
                </tr>
            </table>
            
            <p>
                &raquo; <a href="http://wordpress.org/extend/plugins/pinterest-pin-it-button/" target="_blank" class="external">
                    <?php 
    _e('Rate it on WordPress', 'pib');
    ?>
</a>
            </p>
        </div>
    </div>

    <div class="postbox">
        <?php 
    pib_handlediv();
    ?>
        <h3 class="hndle pib-hndle"><?php 
    _e('Plugin Support', 'tpp');
    ?>
</h3>
        
        <div class="inside">
            <p>
                &raquo; <a href="http://pinterestplugin.com/support<?php 
    echo pib_campaign_url('sidebar_link', 'support_pib_lite');
    ?>
" target="_blank" class="external">
                <?php 
    _e('Support & Knowledge Base', 'pib');
    ?>
</a>
            </p>
            <p>
                <?php 
    _e('Priority support provided to licensed users only.', 'pib');
    ?>
            </p>
        </div>
    </div>
    
    <div class="postbox">
        <?php 
    pib_handlediv();
    ?>
        <h3 class="hndle pib-hndle"><?php 
    _e('More Pinterest Plugins', 'pib');
    ?>
</h3>
        
        <div class="inside">
            <ul>
                <li>&raquo; <a href="<?php 
    echo PIB_UPGRADE_URL_BASE . pib_campaign_url('sidebar_link', 'pro_upgrade');
    ?>
" target="_blank" class="external">"Pin It" Button Pro</a></li>
                <li>&raquo; <a href="http://pinterestplugin.com/top-pinned-posts/<?php 
    echo pib_campaign_url('sidebar_link', 'top_pinned_posts');
    ?>
" target="_blank" class="external">Top Pinned Posts</a></li>
                <li>&raquo; <a href="http://pinterestplugin.com/follow-button<?php 
    echo pib_campaign_url('sidebar_link', 'follow_button');
    ?>
" target="_blank" class="external">"Follow" Button</a></li>
                <li>&raquo; <a href="http://pinterestplugin.com/pinterest-block<?php 
    echo pib_campaign_url('sidebar_link', 'pinterest_block');
    ?>
" target="_blank" class="external">Pinterest Block</a></li>
            </ul>
        </div>
    </div>

    <?php 
    pib_newsletter_subscribe();
    ?>

    <?php 
    pib_plugin_news();
    ?>
    

    <?php 
}