Jump to content

Archived

This topic is now archived and is closed to further replies.

Flames

Show the last wordpress blog on a different page.

Recommended Posts

How can i show the last wordpress blog made from my homepage when the blog location is /blog/?

Share this post


Link to post
Share on other sites

done all though it was a bit strange to get right, although WP blogs have things like [caption] (and am assuming there are others) which aren't transferred into html, so the problem is how could i get rid of the [caption] tags when echoing the value but still have it in the database otherwise it ruins the quality of the WP blog itself.

Share this post


Link to post
Share on other sites

which one should i use str_replace, ereg_replace or preg_replace?

Share this post


Link to post
Share on other sites

Sometimes it's helpful to read about the functions on php.net.  This is what it says about str_replace():

 

If you don't need fancy replacing rules (like regular expressions), you should always use this function instead of ereg_replace()  or preg_replace().

Share this post


Link to post
Share on other sites

You could also just use the WP parsing function/class, but chances are if you're asking how to get content from WP on a different page, you might have issues porting it.

Share this post


Link to post
Share on other sites

thats where i got heard about ereg and preg replace i was just unsure which was the best i.e. fastest, easiest etc

Share this post


Link to post
Share on other sites

As far as speed goes, I believe it goes:  replacing a specific character (a char arrray essentially) > str_replace > regular expressions (perl and ereg).

Share this post


Link to post
Share on other sites

so close, the function replaces [caption (notice without the ]), and [/caption], but the problem is in the caption tag theres other information like [caption id=1" name="2" width="3] and this causes a problem because 1,2 or 3 can have any value.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.