Created
November 8, 2017 09:59
-
-
Save lynt-smitka/1e3ebed04366bc86445229e9b18b646b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<?php | |
include "wp-config.php"; | |
$conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); | |
if ($conn->connect_error) { | |
die("Nepripojilo se to: " . $conn->connect_error); | |
} | |
$sql = "SELECT ID, post_title, post_content FROM wp_posts WHERE post_type IN ('post','page')"; | |
$result = $conn->query($sql); | |
while($row = $result->fetch_assoc()) { | |
echo "\n<!-----POST----->\n"; | |
echo "<h1>#{$row['ID']}#{$row['post_title']}</h1>\n"; | |
echo $row['post_content']; | |
} | |
$conn->close(); | |
?> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment