View Single Post
Old 05-15-2015, 07:54 AM  
zerovic
Confirmed User
 
zerovic's Avatar
 
Industry Role:
Join Date: Apr 2010
Posts: 1,084
here's another version..sorry, the code is a bit messy, but does the job you need

this will work with links, titles and descriptions.. you set the number of posts, separator and the order you want to display and it will display it to you...

again, the code is messy as hell, but it works

Code:
<?php
include('wp-load.php');
if($_POST['number']) {
query_posts('showposts=' . $_POST['number']);
while (have_posts()) : the_post();

if($_POST['order_1'] == "url") {
echo the_permalink();
}
if($_POST['order_1'] == "title") {
echo get_the_title();
}
if($_POST['order_1'] == "description") {
echo get_the_content();
}

if($_POST['order_1'] != "none") { if($_POST['separator'] == "tab") { echo "\t"; } else { echo $_POST['separator']; } }

if($_POST['order_2'] == "url") {
echo the_permalink();
}
if($_POST['order_2'] == "title") {
echo get_the_title();
}
if($_POST['order_2'] == "description") {
echo get_the_content();
}

if($_POST['order_2'] != "none") { if($_POST['separator'] == "tab") { echo "\t"; } else { echo $_POST['separator']; } }

if($_POST['order_3'] == "url") {
echo the_permalink();
}
if($_POST['order_3'] == "title") {
echo get_the_title();
}
if($_POST['order_3'] == "description") {
echo get_the_content();
}

echo "<br />";

endwhile;

} else {

echo "<form method=\"post\">";
echo "<label>Number Of Posts</label> <input type=\"text\" name=\"number\" /><br />";

echo "<label>Order</label> <select name=\"order_1\"><option value=\"none\">None</option><option value=\"url\">URL</option><option value=\"title\">Title</option><option value=\"description\">Description</option></select>";

echo "<select name=\"order_2\"><option value=\"none\">None</option><option value=\"url\">URL</option><option value=\"title\">Title</option><option value=\"description\">Description</option></select>";

echo "<select name=\"order_3\"><option value=\"none\">None</option><option value=\"url\">URL</option><option value=\"title\">Title</option><option value=\"description\">Description</option></select><br />";

echo "<label>Separator</label> <select name=\"separator\"><option value=\"|\">|</option><option value=\"tab\">TAB</option><option value=\";\">;</option><option value=\":\">:</option></select>";

echo "<input type=\"submit\" value=\"export\" />";
echo "</form>";
}
?>
__________________
php, html, jquery, javascript, wordpress - contact me at contact at zerovic.com
zerovic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote