December 24, 201114 yr Hello i am creating a basic landing page as such for my online store. I am wanting to put the latest post from my wordpress blog onto the webpage that i am making. How do i go about this?
December 24, 201114 yr ^^^ same question as the above... If your landing page and WordPress are running off the same install then it's pretty simple, otherwise your best route is to grab the WP RSS feed and use that to display the posts content.
December 24, 201114 yr Author Different software. I have my store (oscommerce) and then my landing page is just a normal html page. The blog is in the same directory as both. I was thinking i would have to go down the rss feed route
December 26, 201114 yr Different software. I have my store (oscommerce) and then my landing page is just a normal html page. I was thinking i would have to go down the rss feed route I would suggest getting a small PHP script to pull the latest post from the WordPress database because of the overhead. All you need is the latest post and if you pull data from the RSS feed, WordPress first queries the database after running through the plugin framework and processing any actions or filters, then it turns the post data into RSS markup, next you have either a Javascript that gets the browser to request for the RSS and turn it into a part of the page as markup or have a PHP script to do it for you. But then again, if you're not on shared hosting or if you have a good shared hosting service, an RSS feed just might do it for you too.
December 28, 201114 yr If you are trying to put your latest wordpress posts onto a static html page here is how first create a PHP file, call it blogfeeds.php <?php // Include WordPress define('WP_USE_THEMES', false); require('./blog/wp-load.php'); query_posts('showposts=3'); // how many post you want to be displayed function new_excerpt_length($length) { return 15; // the number of words from the post that you want to show } add_filter('excerpt_length', 'new_excerpt_length'); function new_excerpt_mored($more) { return ' <a href="'. get_permalink($post->ID) . '" class="more">Read more</a>'; // the readmore link format } add_filter('excerpt_more', 'new_excerpt_mored'); while (have_posts()): the_post(); ?> <li> <span class="date"><span class="day"><?php the_time('d') ?></span> <span class="month"><?php the_time('M') ?></span></span> <h3><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></h3> <?php the_excerpt(); ?> </li> <?php endwhile; ?> you can then put that file in the root directory now to get the information from your php file into your html fil you would use a little jQuey (there are other ways to do this I just jQuery as its really easy) <script type="text/javascript"> $(document).ready(function(){ $.get("blogfeeds.php", function(result){ $("#blogfeed").html(result); }); }); </script> and for your html you would need a place for where this is going to <ul class="listA" id="blogfeed"> </ul> I hope this helps.
January 7, 201214 yr Since your homepage is static HTML, why not just build it into Wordpress? Wouldn't make it easier not having to manage an additional static homepage? You could set a static homepage in wordpress by creating the page in Pages, and in settings > reading changing the homepage. If the homepage has a different layout than the blog, you could just create a custom template, asign it to the homepage, and do it that way. You could even go as far as pasting your static HTML into th the custom template file, for whatever reason. Edited January 7, 201214 yr by empek
Create an account or sign in to comment