help with Mini-Loop formatting
-
I’ve used the following code to embed the blog’s content on an existing website page. (via https://www.shooflydesign.org/buzz/past/embedding_wordpress.html)
<?php // turn off WordPress themes and include the WordPress core: define('WP_USE_THEMES', false); require($_SERVER['DOCUMENT_ROOT'] . '/blog/wp-blog-header.php'); ?> <?php // get the most recent post(s) in category 1 // change category=1 as needed for whatever page you're embedding // (in this case, just we're getting just one post, but it could be more) $lastposts = get_posts('numberposts=5&category=1'); $content = get_the_content(); // spit out the content of the post(s) foreach($lastposts as $post) { setup_postdata($post); the_title (); the_date (); the_time (); the_author (); the_content(); } ?>
What appears in the test page as a result is the content and postdata described above but with no formatting. Like this:
almost there. . .April 3, 200910:39 amryan test post content here.
Where, “almost there. . .” is the post title. Followed by the date, time and author. aside from the obvious lack of formatting, it’s also missing the date being formatted as described in the WP blog’s theme. I know the injected Mini-Loop code that is being used says, use_themes; false, but is this formatting applied via CSS or some other method?
Must be another method, but where? And what can I do to apply this formatting? And which items in the blog theme’s CSS sheet must I copy over to the original website’s CSS sheet (and without altering the look of the website)?I want the mini-loop to appear as:
https://farm4.static.flickr.com/3311/3409011297_5ca6eece55_o.gif
in the area specified on the existing site.Is all this formatting handles by a php file somewhere in the WP install? How can I get this custom page where I want the Loop to appear to call upon that php file? What do I insert and where?
It’s not in the CSS is it?Obviously, I’m not too well versed in web coding… just enough to think I can figure it out and then get too far ahead and need help. So here I am. :]
Thanks in advance!
- The topic ‘help with Mini-Loop formatting’ is closed to new replies.