Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [Matthias70] Latest posts from wordpress on home.html

Quote Reply
Re: [Matthias70] Latest posts from wordpress on home.html In reply to
Hi Andy,
I was using the code for years now. But after changing the wordpress template.
The code does not show the last new wordpress entries...
It shows links to two pages. But even this links are wrong!?!
Do you have a idea why?

Code:
sub {
my $prefix = 'wp_';

use DBI;
my $dbh = DBI->connect('DBI:mysql:xxxxxxxx', 'xxxxxxxx', 'xxxxxxxx'
) || die "Could not connect to database: $DBI::errstr";


my $query = qq|SELECT * FROM ${prefix}posts WHERE post_parent < 1 AND post_status = 'publish' ORDER BY ID DESC LIMIT 3|;

my $sth = $dbh->prepare($query) || die $DBI::errstr;
$sth->execute() || die $DBI::errstr;

my @loop;
while (my $hit = $sth->fetchrow_hashref) {
push @loop, $hit;
}

$sth->finish();
$dbh->disconnect();

return { blog_loop => \@loop }

}

Thanks

Matthias
gpaed.de
Subject Author Views Date
Thread Latest posts from wordpress on home.html Matthias70 18199 Jul 20, 2008, 1:30 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17807 Jul 20, 2008, 2:36 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 17739 Jul 20, 2008, 2:54 AM
Post Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17764 Jul 20, 2008, 2:54 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17755 Jul 20, 2008, 6:30 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 17734 Jul 20, 2008, 8:11 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Matthias70 17757 Jul 20, 2008, 8:15 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17735 Jul 20, 2008, 9:04 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 17751 Jul 20, 2008, 9:50 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Matthias70 17769 Jul 29, 2008, 6:53 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17671 Jul 29, 2008, 7:57 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 17740 Jul 29, 2008, 8:12 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Matthias70 17713 Oct 16, 2008, 2:30 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17693 Oct 16, 2008, 2:32 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
hegu 17401 May 17, 2009, 6:54 AM
Thread Re: [hegu] Latest posts from wordpress on home.html
Andy 17406 May 17, 2009, 9:00 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 17386 May 17, 2009, 11:55 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17421 May 17, 2009, 11:36 PM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 17412 May 18, 2009, 9:54 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17388 May 18, 2009, 10:03 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 17318 May 18, 2009, 10:32 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17367 May 18, 2009, 10:40 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 17382 May 18, 2009, 10:57 AM
Post Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17247 May 18, 2009, 11:52 PM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 17305 May 18, 2009, 11:58 PM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 6976 May 19, 2009, 9:51 AM
Post Re: [Matthias70] Latest posts from wordpress on home.html
Andy 6987 May 19, 2009, 9:53 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 6981 May 19, 2009, 10:23 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Matthias70 6552 May 31, 2013, 3:50 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 6514 May 31, 2013, 8:18 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 6411 Jun 1, 2013, 1:35 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 6362 Jun 1, 2013, 2:17 AM
Thread Re: [Andy] Latest posts from wordpress on home.html
Matthias70 6473 Jun 1, 2013, 2:29 AM
Thread Re: [Matthias70] Latest posts from wordpress on home.html
Andy 6368 Jun 1, 2013, 2:40 AM
Post Re: [Andy] Latest posts from wordpress on home.html
Matthias70 6395 Jun 1, 2013, 2:47 AM