Wordpress Latest Blog Entries Plugin for Website - wordpress

I would like to display my blog entries on my website in an iframe or whatever suggested method is. Can somebody please advice how to do that?
Thanks in advance.

Hi,
There are multiple options to do this I am mentioning three of them:
Menthod # 1
You can create a page template in wordpress and than using that page template create a page. Now you have the URL you can use that page in iFrame on any website.
Method # 2
Create a file at the root level of the server with this code:
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('wp-load.php');
query_posts('showposts=1');
while (have_posts()): the_post(); ?>
<h2><?php the_title(); ?></h2>
<?php the_excerpt(); ?>
<p>Read more...</p>
<?php endwhile; ?>
Now you can call this file in the iFrame and you have the latest posts.
Method # 3
You can use the rss feed from wordpress and either use PHP or jQuery to style it.
Thanks
Peachlabs

Related

simple html site to wordpress and edit visually

I am converting a very simple html site to WordPress. I made a very simple folder like,
custom_theme
header.php
front-page.php
about.php
footer.php
I cut all the code from index.html and spared them into header,footer,front-page,about.
then in the wp dash board i created those page and select the template. The site is working fine.This is the live site
http://www.mannmechanicalhvac.com/
Now i want to edit the content and image from wordpress visually not from code. Is their any possibility to do that?
###thanks in advance.
A very basic example:
<?php while ( have_posts() ) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<div class="page-content"><?php the_content(); ?></div>
<?php endwhile; ?>
the_content() outputs the content which was entered in the editor.
This is a good starter theme: _s from Automattic
or: http://underscores.me/
Recommend to read:
Stepping_into_Templates
Theme_Development
Template_Tags
template-hierarchy
The_Loop

Wordpress showing post info under new pages, but I want it to show only under new posts

I have basic loop to show PHP posts
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<div class="post">
<h2><?php the_title(); ?></h2>
<div class="post-info"><?php echo get_the_date(); ?> - posted by <?php echo get_the_author(); ?> </a></div>
<?php the_content('<button class="show-more">Saznajte više</button>'); ?>
</div>
<?php
endwhile;
else :
echo "<p>No posts</p>";
endif;
It is the line that has <div class="post-info...
Now it is working very well, it shows date and author under post heading, but it also shows that when a new page is created. I understand Wordpress works like blog and it is natural for it to treat new pages as posts, however I want to avoid that behavior. I only want it to be shown under post headings, but not under new page headings. What would you suggest me?
https://developer.wordpress.org/themes/basics/template-hierarchy/
Check this template hierarchy and you'll understand how WordPress call template files.
Basically, WordPress firstly runs index.php and then call different template files. Since you only have index.php, so when rendering pages it all also falls back to index.php.
What you can do is creating a page.php with its own design for WordPress to call properly.

Page layout (page.php) doesn't apply to pages

I made few pages in my admin panel. Then created page.php with this code inside
`<?php get_header(); ?>
<section>
<?php if (have_posts()): while (have_posts()): the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</section>
<?php get_footer(); ?>`
Set one of this pages as "homepage". And when i open site it shows me header, footer... everything it should, but when i try to open any of the other pages, I get 404 page...
Help me please, where i have to search for mistakes?
Thank you
You need to define one of the following: index.php (REQUIRED), home.php, or front-page.php.
Here's the way template inheritance works for the home page:
WordPress looks for front-page.php, regardless of whether or not your site is set up to show a static front page, or your most recent posts
If front-page.php doesn't exist, WordPress looks for home.php
If no home.php is set, WordPress defaults to index.php
You can read more about template inheritance in the codex.

how to display recent 5 posts from wordpress site to magento

I'm having magento ecommerce website & wordpress blog site. I want to display recent 5 blog posts in my magento homepage. I tried with below codes
// Get the last 3 posts.
<?php
require('/the/path/to/your/wp-blog-header.php');
?>
<?php query_posts('showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_title(); ?><br />
<?php endwhile;?>
I copied this file in new .phtml file and i called that file to homepage. But after doing this my homepage is showing only header & breedcrumbs...
Any solution for this problem is appreciated......
Don't integrate on the php side, use the rss feed with a feed reader such as http://www.magentocommerce.com/magento-connect/flagbit-feed-reader.html

How do I make a Wordpress Page act like the default home page displaying multiple posts?

I basically want a Wordpress "Page" that acts just like the home page and loops through recent posts and displays them. How do I do this?
If you go to Settings->Reading and then for "Front Page Shows" select static page, and then select a page from the dropdown, then edit the source code for this file to include a standard WP loop like -
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<h2><?php the_title() ?><h2>
<?php endwhile; endif; ?>
Use the wordpress loop, but you can control which posts show up in the loop using query_posts()
http://codex.wordpress.org/Template_Tags/query_posts

Resources