WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Posts organized by category on non WordPress page (1 post)

  1. murphycarpenter
    Member
    Posted 1 year ago #

    Hi There!

    Before I start, I'd like to make note that I'm not exactly a developer. I tend to feel most comfortable in the front end environment (HTML/CSS) and with overall design. So I apologize if I seem dense when it comes to coding!

    Regardless-- I currently have a website (which was not coded by me) that has a WordPress "feed" in a accordion slider on the home page-- see it at horizontaldrill.com-- the posts are under "What's New at DTD"

    It is using this code to get the information

    $query = "SELECT wp_posts.ID, wp_posts.post_title FROM wp_posts, wp_term_relationships WHERE wp_term_relationships.object_id = wp_posts.ID AND wp_term_relationships.term_taxonomy_id = 4 AND wp_posts.post_status='publish' ORDER BY wp_posts.post_date DESC";
    
    $result = runQuery($query);
    
    $num = mysql_num_rows($result);

    And this code to display the information

    <?php
    	  if ($num != 0) {
    		  $counter = 0;
    		  while ($counter < 8) {
    			  $title = mysql_result($result, $counter, "wp_posts.post_title");
    			  $id = mysql_result($result, $counter, "wp_posts.ID");
    			  ?>
                  <p><a href="/news/#<?php echo $id; ?>"><?php echo $title; ?></a></p>
                  <?php
    			  $counter++;
    		  }
    	  }
    	  ?>

    When one clicks the links in the accordion, it takes them to this page: http://horizontaldrill.com/news/

    Basically, we're looking to create a new blog posts section that is identical to this, but completely separate. We want the latest posts to be somewhere on the home page and we want the posts to have their own page like the news page.

    I've tried several methods of achieving this, but so far I've been relatively unsuccessful. Any suggestions?

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic