Add link to article titles on new page?

software development

#1

I’m trying create page that has the titles of articles from a blog, and which also links back to the page where the entire article is listed.

So far I have the first part done. I created a DIV and then inserted from the DATA tab of DreamWeaver - a dynamic table which shows the titles from my WordPress/MySql database.

The problem I have now, is how do I get those titles to become live links to the pages which host the articles.

Is there an easyway to do this with the functions built into DW so I don’t have to get into code? In either case I’d appreciate your guidance on how to do this.

Here the code:

<?php require_once('Connections/WordPress.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $maxRows_test2 = 5; $pageNum_test2 = 0; if (isset($_GET['pageNum_test2'])) { $pageNum_test2 = $_GET['pageNum_test2']; } $startRow_test2 = $pageNum_test2 * $maxRows_test2; mysql_select_db($database_WordPress, $WordPress); $query_test2 = "SELECT post_title FROM wp_posts ORDER BY post_date DESC"; $query_limit_test2 = sprintf("%s LIMIT %d, %d", $query_test2, $startRow_test2, $maxRows_test2); $test2 = mysql_query($query_limit_test2, $WordPress) or die(mysql_error()); $row_test2 = mysql_fetch_assoc($test2); if (isset($_GET['totalRows_test2'])) { $totalRows_test2 = $_GET['totalRows_test2']; } else { $all_test2 = mysql_query($query_test2); $totalRows_test2 = mysql_num_rows($all_test2); } $totalPages_test2 = ceil($totalRows_test2/$maxRows_test2)-1; ?> Untitled Document <?php do { ?> <?php } while ($row_test2 = mysql_fetch_assoc($test2)); ?>
post_title
<?php echo $row_test2['post_title']; ?>
<?php mysql_free_result($test2); ?>

#2

I don’t know about doing it with DW, but if I correctly understand your description of what you are trying to do, that functionality is already built into WordPress (It’s what “Archives” is all about :wink: ),

That, plus exploring the WordPress Codex and forums, for possible output modifications if you wish, builds precisely the kind of article listing you describe. You can do all of that from within wordpress with “pages”, “templates” and modifications to the output of the WP “loop”.

In fact, here is a code snippet suitable for inclusion in a WordPress “page”, that seems to already do what you want :

http://wordpress.org/support/topic/105849

I would use those tools and leave the DW stuff out of the picture altogether (the easiest way is often the best way, too!).

–rlparker