| Welcome to Webforumz.com. |
|
Jan 21st, 2008, 00:39
|
#1 (permalink)
|
|
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 367
|
Using wordpress posts in a static page
Hi
I have started using wordpress recently, I need to know that can I get new posts headlines and use them on other pages than wordpress itself ?
If yes how ?
Thanks
|
|
|
Jan 21st, 2008, 23:50
|
#2 (permalink)
|
|
Reputable Member
Join Date: Jan 2008
Location: Pasig
Posts: 106
|
Re: Using wordpress posts in a static page
What do you mean? you want your blog to be seen in other page beside wordpress? I don't if it is possible...but you can place your link to the pages of your site going to your posts...
|
|
|
Jan 21st, 2008, 23:52
|
#3 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: Using wordpress posts in a static page
It is possible but you need to hack WP for it.
I haven't hacked it in ages so i can't remember the functions.
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Jan 21st, 2008, 23:55
|
#4 (permalink)
|
|
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 367
|
Re: Using wordpress posts in a static page
I mean for example i have a website named : www.somedomain.com and wordpress is installed in subdomain named : blog.somedomain.com
All i need is that put links to new posts on www.somedomain.com
|
|
|
Jan 22nd, 2008, 00:00
|
#5 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: Using wordpress posts in a static page
I'll have a look at this tomorrow, I still have a dev installation of WP on my server.
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Jan 22nd, 2008, 00:04
|
#6 (permalink)
|
|
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 367
|
Re: Using wordpress posts in a static page
Thanks 
|
|
|
Jan 22nd, 2008, 07:38
|
#7 (permalink)
|
|
Section Manager - Website Critique
Join Date: May 2007
Location: inside the outside
Posts: 1,095
|
Re: Using wordpress posts in a static page
why not just subscribe to the wordpress rss feed and place these on your static pages?
http://rssfeedreader.com/
|
|
|
Jan 22nd, 2008, 11:09
|
#8 (permalink)
|
|
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 367
|
Re: Using wordpress posts in a static page
yes thanks, i just use feedburner to create those links for my site...
But just wondering if it is possible to create these links manually or not ?
|
|
|
Jan 22nd, 2008, 20:18
|
#9 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: Using wordpress posts in a static page
To create them manually? Then you just link to them like any of other link.
Did you mean dynamically?
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Jan 22nd, 2008, 20:21
|
#10 (permalink)
|
|
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 367
|
Re: Using wordpress posts in a static page
Yes I mean dynamically !
But now I am using feedburner to link to them...
|
|
|
Jan 25th, 2008, 14:12
|
#11 (permalink)
|
|
Reputable Member
Join Date: Sep 2007
Location: Manchester
Age: 25
Posts: 131
|
Re: Using wordpress posts in a static page
- PHP: Select all
<?php $how_many=3; //How many posts do you want to show require_once("wp-config.php"); // Change this for your path to wp-config.php file ?>
<? $news=$wpdb->get_results("SELECT `ID`,`post_title`,`post_content`, `post_date` FROM $wpdb->posts WHERE `post_type`=\"post\" AND `post_status`= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many); foreach($news as $np){ //echo ("$np->post_date<br />"); list ($y, $m, $d) = split('[/.-]', substr($np->post_date, 0, 10)); echo "Posted on: $d-$m-$y<br />"; print ("<a href=\""); echo get_permalink($np->ID); print ("\">$np->post_title</a><br />"); if (strlen($np->post_content) > 65) { echo (substr("$np->post_content", 0, 65)."... "); } else { echo ("$np->post_content<br />"); } print ("<a href=\""); echo get_permalink($np->ID); print ("\">» Read More</a><br /><br />"); } ?>
I did this for the website of the company I work for. I think that should work. Although this particular part is in an include so if it doesn't work you may need to fiddle with it a bit, although at the moment it looks fine 
|
|
|
Jan 25th, 2008, 15:42
|
#12 (permalink)
|
|
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 367
|
Re: Using wordpress posts in a static page
Thanks man, I will try that but now the feedburner is working fine... 
|
|
|
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|