Help with tags, please
-
I’m the webmaster of http://www.seosumo.com and we hired some russian guys who made our pages.php to show posts along with the page. They didn’t use recommended WP loop coding but custom, so now I don’t know how to fix the mess (I’m not a php programmer)
Can anyone help me out with this? You ca se the result at http://seosumo.com/who-we-are
The problem is in line 67 (post_tag). Only thing I can say it’s not right.
_______________________________________________________________
<?php /* Template Name: Pages */ ?> <?php get_header(); // ************************************************************** // MOD // ************************************* ; get list of last posts class cst_mod_last_posts { var $cst_host; var $cst_db; var $cst_user; var $cst_pw; var $aPosts; //------ get array with posts function get_posts() { //------- get info $cst_host = DB_HOST; $cst_db = DB_NAME; $cst_user = DB_USER; $cst_pw = DB_PASSWORD; // $iCID = mysql_connect( $this->cst_host, $this->cst_user, $this->cst_pw ); // $bSelDB = mysql_select_db( $this->cst_db, $iCID ); $sSQL = " SELECT wp_posts. * , wp_term_taxonomy.term_id FROM wp_posts INNER JOIN wp_term_relationships ON ( wp_posts.ID = wp_term_relationships.object_id ) INNER JOIN wp_term_taxonomy ON ( wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id ) WHERE 1 =1 AND wp_term_taxonomy.taxonomy = 'category' AND wp_posts.post_type = 'post' AND ( wp_posts.post_status = 'publish' ) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC, term_id "; $iRID = mysql_query( $sSQL ); //--------- set values $iCatIDCheck = -1; $this->aPosts = array(); //--------- get reads if ( $iRID ) { while ( $aData = mysql_fetch_array( $iRID )) { $iCatId = $aData['term_id']; //---- if new cat - use new cat as current; add item to data if ( $iCatId != $iCatIDCheck ) { $this->aPosts[] = $aData; $iCatIDCheck = $iCatId; } } } }//------------------------ //---- display post function display_posts() { foreach ( $this->aPosts as $key => $aItem ) { echo '<div class="entry multipost" id="post-' . $aItem['ID'] . '"> <span class="postinfo">' . $aItem['post_date'] . '</span> <div class="postheader"> <span class="postinfo"></span> <h1 class="typeface-js"><a href="/?p=' . $aItem['ID'] . '" rel="bookmark">' . $aItem['post_title'] . '</a></h1> <span class="postinfo">Filed under: <a href="/?cat=' . $aItem['term_id'] . '" title="View all posts in category" rel="category">category</a> </span> </div> ' . $aItem['post_content'] . ' <div class="postfooter postinfo">Tags: ' . the_terms( $aItem['ID'], 'post_tag', __('Tags: '), ', ', ' — ' ) . ' </div> <!-- end Entry --></div>'; } } }; //------------------------ end of class //------- begin code $cst_cLastPosts = new cst_mod_last_posts(); $cst_cLastPosts->get_posts(); // MOD end ************************************* ?> <div id="mainContent" class="showtab1"> <div id="maincontent1"> <h2 class="maintabs"> <big><b>Sumo</b></big> <small><a href="javascript:void(0);" onclick="switch_main(2)">Latest Articles</a></small> <small><a href="javascript:void(0);" onclick="switch_main(3)">SEO Tools</a></small> </h2> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="entry" id="post-<?php the_ID(); ?>"> <h1 class="typeface-js"><?php the_title(); ?></h1> <?php the_content(__('(more...)')); ?> <?php endwhile; else: ?> <div class="entry"> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?> <!-- end #entry --></div> <div class="footer"><hr /></div> </div> <div id="maincontent2"> <h2 class="maintabs"> <small><a href="javascript:void(0);" onclick="switch_main(1)">Sumo</a></small> <big><b>Latest Articles</b></big> <small><a href="javascript:void(0);" onclick="switch_main(3)">SEO Tools</a></small> </h2> <?php // MOD $cst_cLastPosts->display_posts(); // MOD end ?> <!-- maincontent2 --></div> <div id="maincontent3"> <h2 class="maintabs"> <small><a href="javascript:void(0);" onclick="switch_main(1)">Sumo</a></small> <small><a href="javascript:void(0);" onclick="switch_main(2)">Latest Articles</a></small> <big><b>SEO Tools</b></big> </h2> <div class="entry"> <h1>SEO Tools</h1> <p>This page is under construction and it will be up soon.</p> <!-- end Content 3 --></div> <div class="footer"><hr /></div> <!-- end Content3 --></div> <!-- end mainContent --> </div> <?php include(TEMPLATEPATH.'/sidebars.php'); ?> <br class="clearfloat" /> <!-- end #maincontainer --></div> <?php get_footer(); ?>________________________________________________________________________
-
Hi, there. You’re in the wrong place and need to be at wordpress.org for help with that.
https://en.forums.wordpress.com/topic/please-read-me-first-before-posting?replies=1
-
Sorry, I forgot to mention: Posts appear on second tab named “Articles” and the tags appear at the top, outside and before the expected div.
-
Please read ella’s reply. You are in the wrong forum. Self-hosted blogs are supported over at http://worpdress.ORG/support/ .
-
- The topic ‘Help with tags, please’ is closed to new replies.