Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.9k views
in Q2A Core by

 

Hello;
I run a website on 'Question2Answer' and I have a blog on the same website at
 
www.mysite.com/blog ( wordpress)
 
I want to show my blog's recent posts on side panel of my 'Question2Answer' website
 
However i might use google feedburner but i want to use something .which show direct url for my blog posts and not through a third party gateway .
 
Please tell me about some html codes or something .
 
Thanks in Advance !

1 Answer

0 votes
by

You could use your Wordpress installation to output the posts and then you embed them on Q2A (Admin->Layout->Custom HTML in sidebar box on every page) in a frame. (Instead of installing new software or using external services.)

You probably want to have the posts without the WP header, footer and sidebar. So you could make a new file in the folder of your active WP theme, call it "page-list.php" or something else, paste in it a code like

<?php
/*
Template Name: Display Posts
*/

function new_excerpt_length($length) {
    return 10;
}
add_filter('excerpt_length', 'new_excerpt_length');
?>

<div style="font-family: Arial, Helvetica, sans-serif; font-size:10px; width:150px;">
    <?php query_posts('posts_per_page=5'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <p><a href="<?php the_permalink(); ?>" style="text-decoration:none; font-weight: bold; color:#000; font-size: 1.2em;"><?php the_title(); ?></a><br />
    <b><?php the_date(); ?>:</b> <?php echo get_the_excerpt(); ?></p>
    <?php endwhile; endif; ?>
</div>
 

Then you create in WP a new page with the template "Display Posts" (probably good to exclude this WP page from indexing in robots.txt), and you use the permalink of that page in a frame on your Q&A website. Something like:

<iframe src="http://www.mysite.com/blog/display-posts/"></iframe>

There could also be WP plugins that do the same but I'm not aware of any. Or you install some software on your own server, but it would basically not do anything else than your wordpress.

...