Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1325339
    Arns
    Participant

    Hi there,

    I am using your template for many sites. On my own page, I want to show current posts from different WordPress sites. How is that possible. I am for all my pages admin.

    Best regards,

    Christian

    #1325359
    Arns
    Participant

    Okay I found that for recent post. Where do I have to put these code in?

    <?php
    	$db_username = '#######';
    	$db_password = '#######';
    	$db_database = '#######';  
    
    	$blog_url = 'http://www.#######.com/#######/blog/'; //base folder for the blog. Make SURE there is a slash at the end  
    
    	//connect to the database
    	$con = mysql_connect(localhost, $db_username, $db_password);
    	@mysql_select_db($db_database) or die("Unable to select database");
    	$query = "Select * FROM wp_posts WHERE post_type='post' AND post_status='publish' ORDER BY id DESC LIMIT 2";
    
    	$query_result = mysql_query($query);  
    
    	while($row = mysql_fetch_array($query_result))
        {
        ?>
    
        <div class="blog_cont"> <a>"><b><?php echo $row['post_title'] ?></b></a><br clear="all" />
          <span><?php if (strlen($row['post_content']) > 40) { echo substr($row['post_content'], 0, 120) . '...'; } ?></span> <a>">Read More ยป</a> </div>
        <?php }
    	  @mysql_close($con);
    	?>
    #1325368
    Darshana
    Moderator

    Hi there,

    Thanks for writing in! Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.

    However you may find the following information useful to implement such idea (https://css-tricks.com/using-the-wp-api-to-fetch-posts/).

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1325339 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>