phamthang
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Fixing WordPress
In reply to: how can I get url from image tag in feed with fetch_feed?I found alternative solution for my problem. Instead of using fetch_feed, I used DOMDocument in PHP. This is my code
<?php $rss = new DOMDocument(); $rss->load('http://techdaily.vn/feed/'); $feed = array(); foreach ($rss->getElementsByTagName('item') as $node) { $item = array ( 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, 'image' => $node->getElementsByTagName('image')->item(0)->nodeValue, ); array_push($feed, $item); } $limit = 1; for($x=0;$x<$limit;$x++) { $title = str_replace(' & ', ' & ', $feed[$x]['title']); $link = $feed[$x]['link']; $image = $feed[$x]['image']; ?> <a href="http://techdaily.vn" target="_blank"><img class="logo" src="http://techdaily.s3.amazonaws.com/wp-content/uploads/2014/01/techdaily-logo1.png"></a> <ul> <li class="thumb"> <a href="<?php echo $link; ?>" class="title" target="_blank"> <img src="<?php echo $image; ?>" alt="<?php echo $title; ?>"> </a> </li> <li><a href="<?php echo $link; ?>" class="title" target="_blank"><?php echo $title; ?></a></li> </ul>Wow I just fixed it by myself. I will share the process to fix it here, so if anyone have same problem like me can do it by yourself.
– First deactive plugin WP no category base
– Empty all cache
– Switch to other template
– Empty all cache again
– Switch back to official template
– Empty all cache again.And everything work like charm. I have no ideas what happens, but I took me 3 hours at mid night to fix it.
I tried to update to 3.4.2 but error still appear, even I disable and delete it.
P/s: I used WPML for dual languages, I install Wp no category base support wpml also but it didn’t work.
Viewing 3 replies - 1 through 3 (of 3 total)