1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
| <div class="ayu-post"><?php $edit = array ('-' , '/' , '.html');
$sumber = str_replace($edit, ' ', $_SERVER['REQUEST_URI']);
?>
<?php
// Get RSS Feed(s)
include_once(ABSPATH . WPINC . '/feed.php');
$query = $sumber ;
$rss = fetch_feed('http://www.bing.com/search?q=' . str_replace(' ', '+', $query) . '&go=&form=QBLH&filt=all&format=rss');
if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly
// Figure out how many total items there are, but limit it to 10.
$maxitems = $rss->get_item_quantity(5);
// Build an array of all the items, starting with element 0 (first element).
$rss_items = $rss->get_items(0, $maxitems);
endif;
?>
<?php if ($maxitems == 0)
echo ' ';
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) : ?>
<h2 class="postTitle"><a href="http://adf.ly/7498/<?php echo $item->get_permalink(); ?>" target="_blank" rel="nofollow"><?php echo $item->get_title(); ?></a></h2>
<?php echo $item->get_description(); ?>
<?php
$erase = array ('block keyword di sini',';' , '%' , '+' , '-' , '&', ':' , 'amp;' , ' ...' , ' ....' , ' .....' , '–' , '|' , '/' , '[' , ']' , '?' , '$' , ',' , '.' , '«' , '(' , ')', '::' , '~');
$first = str_replace ($erase , '' , $item->get_title());
$encode = urlencode(strtolower($first));
$plus = str_replace ('+' , '-' , $encode);
$minus = array ('--' , '---' , '----');
$link = str_replace ($minus , '-' , $plus);
?>
<a href=<?php bloginfo('url'); ?>/search/<?php echo $link; ?>><?php echo $item->get_title(); ?></a>
<?php endforeach; ?></div> |