Click to See Complete Forum and Search --> : How can i read a title of wordpress blog into my website.


ragy
09-05-2011, 02:06 AM
Hello,

i have a website and i want to read the title of a wordpress blog into my web pag.

Note that: the wordpress is not mine (it is general).

How can i read a title of wordpress blog into my website ?

i need the answer quickly please.
thanks

sreelavanya
09-29-2011, 11:35 PM
i have seen the function below on the web..I hope it helps you.

Code PHP:

function getExcerpt($content) {
$text = html_entity_decode($content);
$excerpt = array();
//match all tags
preg_match_all("|<[^>]+>(.*)</[^>]+>|", $text, $p, PREG_PATTERN_ORDER);
for ($x = 0; $x < sizeof($p[0]); $x++) {
//match tags containing "<p>"
if (preg_match('<p>i', $p[0][$x])) {
$strip = strip_tags($p[0][$x]);
if (preg_match("/\./", $strip))
$excerpt[] = $strip;
}
if (isset($excerpt[0])){
preg_match("/([^.]+.)/", $strip,$matches);
return $matches[1];
}
}
return false;
}

$url = 'http://www.tildemark.com/'; //url to scrape
$content = file_get_contents($url);
$title = getMetaTitle($content);
print "title: $title ";


General?

If you want the title of the blog, then why don't you just type it? A title shouldn't change that often?

Or do you mean the titles of the posts of a WP blog?

.......................................
Moderator Kor says: Don't insert links toward commercial sites in your post