Flames Posted October 20, 2008 Share Posted October 20, 2008 How can i show the last wordpress blog made from my homepage when the blog location is /blog/? Quote Link to comment https://forums.phpfreaks.com/topic/129210-show-the-last-wordpress-blog-on-a-different-page/ Share on other sites More sharing options...
corbin Posted October 20, 2008 Share Posted October 20, 2008 Read the database. Quote Link to comment https://forums.phpfreaks.com/topic/129210-show-the-last-wordpress-blog-on-a-different-page/#findComment-670379 Share on other sites More sharing options...
Flames Posted October 22, 2008 Author Share Posted October 22, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/129210-show-the-last-wordpress-blog-on-a-different-page/#findComment-672076 Share on other sites More sharing options...
Maq Posted October 22, 2008 Share Posted October 22, 2008 str_replace Quote Link to comment https://forums.phpfreaks.com/topic/129210-show-the-last-wordpress-blog-on-a-different-page/#findComment-672180 Share on other sites More sharing options...
Flames Posted October 23, 2008 Author Share Posted October 23, 2008 which one should i use str_replace, ereg_replace or preg_replace? Quote Link to comment https://forums.phpfreaks.com/topic/129210-show-the-last-wordpress-blog-on-a-different-page/#findComment-672942 Share on other sites More sharing options...
Maq Posted October 23, 2008 Share Posted October 23, 2008 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(). Quote Link to comment https://forums.phpfreaks.com/topic/129210-show-the-last-wordpress-blog-on-a-different-page/#findComment-673254 Share on other sites More sharing options...
corbin Posted October 24, 2008 Share Posted October 24, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/129210-show-the-last-wordpress-blog-on-a-different-page/#findComment-673309 Share on other sites More sharing options...
Flames Posted October 25, 2008 Author Share Posted October 25, 2008 thats where i got heard about ereg and preg replace i was just unsure which was the best i.e. fastest, easiest etc Quote Link to comment https://forums.phpfreaks.com/topic/129210-show-the-last-wordpress-blog-on-a-different-page/#findComment-674499 Share on other sites More sharing options...
corbin Posted October 25, 2008 Share Posted October 25, 2008 As far as speed goes, I believe it goes: replacing a specific character (a char arrray essentially) > str_replace > regular expressions (perl and ereg). Quote Link to comment https://forums.phpfreaks.com/topic/129210-show-the-last-wordpress-blog-on-a-different-page/#findComment-674644 Share on other sites More sharing options...
Flames Posted October 26, 2008 Author Share Posted October 26, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/129210-show-the-last-wordpress-blog-on-a-different-page/#findComment-675208 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.