Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 7th, 2013, 08:38 AM
mcleare mcleare is offline
 
Join Date: Mar 2011
Posts: 77
Default Using Datafeedr on Home Page with Wordpress Blog?

Hi, I have my datafeedr store set to appear on my homepage. I was just wondering if there is any way I could get my recent wordpress blogposts to appear on the homepage also? - (below datafeedr store)
  #2  
Old February 7th, 2013, 09:14 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

Sure, you could add a Text module to your store's front page view and then add some core WP code to the Text module which will pull in recent posts.

Check out this link for examples: http://codex.wordpress.org/Function_...t_recent_posts

Eric
  #3  
Old February 7th, 2013, 09:41 AM
mcleare mcleare is offline
 
Join Date: Mar 2011
Posts: 77
Default

Quote:
Originally Posted by Eric View Post
Hi,

Sure, you could add a Text module to your store's front page view and then add some core WP code to the Text module which will pull in recent posts.

Check out this link for examples: http://codex.wordpress.org/Function_...t_recent_posts

Eric
Thanks Eric, any idea how I could get it to show the full post text rather than just the title? sorry my php skills are very poor

I have

<h2>Blog</h2>
<ul>
<?php
$args = array( 'numberposts' => '5' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a> </li> ';
}
?>
</ul>


so I guess I need to get <?php the_content(); ?> in somewhere?
  #4  
Old February 7th, 2013, 09:44 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

I don't think so because you're not in a WP Loop... at least this doesn't appear to be a Loop.

I think you need to use:
PHP Code:
$recent["post_content"
Eric
  #5  
Old February 7th, 2013, 10:09 AM
mcleare mcleare is offline
 
Join Date: Mar 2011
Posts: 77
Default

cant seem to get $recent["post_content"] to fit without throwing up errors
  #6  
Old February 7th, 2013, 10:22 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

What errors are you getting?
  #7  
Old February 7th, 2013, 10:26 AM
mcleare mcleare is offline
 
Join Date: Mar 2011
Posts: 77
Default

sorry, im just not sure where to fit it in exactly, could you tell me where exactly it would go in the following

<h2>Blog</h2>
<ul>
<?php
$args = array( 'numberposts' => '5' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a> </li> ';
}
?>
</ul>

or maybe I need something different. I thought some of the options here might help - http://codex.wordpress.org/Function_Reference/get_posts
  #8  
Old February 7th, 2013, 10:31 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

Try this:
PHP Code:
<h2>Blog</h2>
<ul>
<?php
$args 
= array( 'numberposts' => '5' );
$recent_posts wp_get_recent_posts$args );
foreach( 
$recent_posts as $recent ){
    echo 
'<li>';
        echo 
'<a href="' get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >';
            echo 
$recent["post_title"];
        echo 
'</a><br />';
        echo 
$recent["post_content"];
    echo 
'</li> ';
}
?>
</ul>
Eric
  #9  
Old February 7th, 2013, 10:41 AM
mcleare mcleare is offline
 
Join Date: Mar 2011
Posts: 77
Default

Thanks, thats works except no paragraph breaks for some reason? the rest of the formatting is ok
  #10  
Old February 7th, 2013, 10:54 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

This should work:
Code:
<h2>Blog</h2>
<ul>
<?php
$args = array( 'numberposts' => '5' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
    echo '<li>';
        echo '<a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >';
            echo $recent["post_title"];
        echo '</a><br />';
        echo apply_filters('the_content', $recent["post_content"]);
    echo '</li> ';
}
?>
</ul>
But this might give you better formatting (no list):
Code:
<h2>Blog</h2>
<?php
$args = array( 'numberposts' => '5' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
    echo '<div>';
        echo '<h3>';
          echo '<a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >';
              echo $recent["post_title"];
        echo '</a>';
      echo '</h3>';
        echo apply_filters('the_content', $recent["post_content"]);
    echo '</div> ';
}
?>
Eric
  #11  
Old February 7th, 2013, 11:15 AM
mcleare mcleare is offline
 
Join Date: Mar 2011
Posts: 77
Default

2nd one works great. Thanks.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot edit home page in WP CMS when datafeedr is on guilloch Questions 1 March 13th, 2012 08:18 AM
Use datafeedr feed outside wordpress blog? lhong1 Questions 1 December 5th, 2011 07:05 PM


All times are GMT -5. The time now is 01:12 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.