please how do i display my blog posts on mybb portal
(2017-08-26, 05:16 PM)Papergoddess Wrote: please i have a main site , i want to display the blog latest posts on mybb portal  just like displaying only the mainsite post titles . 

forum :

That can be kinda hard.

did you use one database for both wordpress and mybb or do they both have their own? (did you use softaculous or did you do a install yourself).

Is it on the same server?

I can probably do the script for you, i need details tho.

Also, is it global or is it only on index, portal or such.

$mysqli = new mysqli('localhost', 'root', 'password', 'dbname');
 * This is the "official" OO way to do it,
 * BUT $connect_error was broken until PHP 5.2.9 and 5.3.0.
if ($mysqli->connect_error) {
    die('Connect Error (' . $mysqli->connect_errno . ') '
            . $mysqli->connect_error);
$query3 = $mysqli->query("SELECT * FROM `wp_posts` WHERE `post_type` = 'post' LIMIT 0,5");

if ($query3->num_rows > 0) {

    while ($result = $db->fetch_array($query3)) {

        $data1 = $result['post_title'];
        $data0 = $result['id'];
		$date = $result['post_date'];
        echo "<div class='row bootstrap snippets'>
        <div class='col-md-9 col-sm-7'>
        <h2><a href='/personal/".$result[post_name]."'>$data1</a> <small>$date</small> $data0</h2>
        </div> ";
        echo "</div>";

else {
    echo "<h2>Sorry Nothing Found</h2>";

just change it to what you wish for it to be designed as.

Change root to your db username, password to your password and dbname to your database name.

[Image: screen.png]

this is what I came up with. But, this is for index file.

if you need this in global i could do it for you. But you be best to add this to the index.php file. If you wish, i could do that. But I would need your index file.

Messages In This Thread
RE: please how do i display my blog posts on mybb portal - by leroymcqy - 2017-09-01, 07:31 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)