Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I understand what you're trying to do ... first, you shouldn't need a foreach loop since you're only planning to use one result row. Second, why not directly access the values of $newestPost as an associative array? See where I've added "$newestPost['theTitle']" to replace "the_title()", and I've done similarly for the the author and content as well. </p> <pre><code>if ($newestPost) { ?&gt; &lt;header class="entry-header"&gt; &lt;div class="entry-meta"&gt; &lt;?php echo '&lt;span class="entry-day"&gt;'.get_the_date('j').'&lt;/span&gt;&lt;br&gt;&lt;span class="entry-month"&gt;'.get_the_date('M').'&lt;/span&gt;'; ?&gt; &lt;/div&gt; &lt;div class="title-box"&gt; &lt;h2 class="blog-title"&gt;&lt;a href="&lt;?php //the_permalink(); ?&gt;"&gt;&lt;?php $newestPost['theTitle']; ?&gt;&lt;/a&gt;&lt;/h2&gt; &lt;?php echo '&lt;a href="'.get_author_posts_url( get_the_author_meta( 'ID' ) ).'"&gt;'.$newestPost['theAuthor']).'&lt;/a&gt;'; ?&gt; &lt;/div&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;/header&gt; &lt;div class="entry-content"&gt; &lt;?php echo $newestPost['theContent']; ?&gt; &lt;/div&gt; &lt;?php } //endif ?&gt; </code></pre> <p>You would need to replace 'theTitle' etc with whatever is in your db schema. Hope that helps, I'm not big into WP so I might be missing something important but this seems universally applicable. </p> <p>EDIT: It looks like using mysql_fetch_array is <a href="http://php.net/manual/en/function.mysql-fetch-array.php" rel="nofollow">no longer recommended</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload