Note that there are some explanatory texts on larger screens.

plurals
  1. POWordpress outside loop sort by category and time
    primarykey
    data
    text
    <p>Need help with some Wordpress outside the blog(Im not a blogger..)</p> <p>So I need to get post from my Wordpress blog. I have manage to get the post, but need to sort by category and by time. here is part of my code:</p> <pre><code> &lt;div class="8u skel-cell-mainContent" id="newsfeed"&gt; &lt;!-- Main Content --&gt; &lt;?php if ($_GET['id']) { $id = $_GET['id']; $post = get_post($id); echo "&lt;section&gt;"; echo "&lt;a href='javascript:history.back();'&gt;&amp;#8592;Tilbake&lt;/a&gt;"; echo "&lt;header style='font-size: 30px;'&gt;"; echo "&lt;h2&gt;".$post-&gt;post_title."&lt;/h2&gt;"; echo "&lt;/header&gt;"; echo "&lt;p&gt;".$post-&gt;post_content; echo "&lt;/section&gt;"; } else { while (have_posts()): the_post(); echo "&lt;section&gt;"; echo "&lt;header style='font-size: 30px;'&gt; "; echo the_title('&lt;h2&gt;', '&lt;/h2&gt;'); echo "&lt;/header&gt;"; the_excerpt('&lt;h3&gt;', '&lt;/h3&gt;'); $id = get_the_ID(); echo "&lt;p&gt;&lt;a href='nyheter.php?id=".$id."#newsfeed'&gt;Les mer...&lt;/a&gt;&lt;/p&gt;"; echo "&lt;/section&gt;"; endwhile; } ?&gt; &lt;/div&gt; &lt;div class="4u"&gt; &lt;!-- Right Sidebar --&gt; &lt;section&gt; &lt;header&gt; &lt;h2&gt; &lt;?php the_widget( WP_Widget_Archives, 'title=Arkiv' ); ?&gt; &lt;/h2&gt; &lt;/header&gt; &lt;/section&gt; &lt;section&gt; &lt;header&gt; &lt;h2&gt; &lt;?php the_widget( 'WP_Widget_Categories', 'dropdown=1&amp;count=1', 'title=Kategori' ); ?&gt; &lt;/h2&gt; &lt;/header&gt; &lt;/section&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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. 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