Note that there are some explanatory texts on larger screens.

plurals
  1. PONew blog posts not loaded automatically
    primarykey
    data
    text
    <p>I am working on a mobile app to load all my blog posts from wordpress using json api. I just noticed that when I publish a new post, it does not automatically appear on my mobile.</p> <p>How do i get the page to load new posts when the home button is clicked:</p> <p>code: .js</p> <pre><code>function listPosts(data) { $(document).on("pagebeforeshow", "#blog", function() { $(this).find(".ui-listview-filter input").val("").trigger("change"); }); var output='&lt;ul data-role="listview" data-filter="true"&gt;'; $.each(data.posts,function(key,val) { output += '&lt;li&gt;'; output += '&lt;a href="#bpost" onclick="displayPost(' + val.id + ')"&gt;'; output += '&lt;h3&gt;' + val.title + '&lt;/h3&gt;'; output += '&lt;p&gt;' + val.excerpt + '&lt;/div&gt;'; output += '&lt;/a&gt;'; output += '&lt;/li&gt;'; }); // go through each post output+='&lt;/ul&gt;'; $('#postlist').html(output); } // lists all the posts </code></pre> <p>Code: .html</p> <pre><code>&lt;div id="blog" data-role="page"&gt; &lt;div data-role="header" class="sys_hd" data-position="fixed" data-id="sys_header" &gt; &lt;h1&gt;Sysadmin Posts&lt;/h1&gt; &lt;/div&gt;&lt;!-- header --&gt; &lt;div data-theme="c" data-role="content" id="postlist"&gt; &lt;/div&gt;&lt;!-- content --&gt; &lt;div data-role="footer" data-position="fixed" data-id="sys_footer" &gt; &lt;div data-role="navbar" &gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#blog" class="sys_ft"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#blog" class="sys_ft"&gt;Disclaimer&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- navbar --&gt; &lt;/div&gt;&lt;!-- footer --&gt; &lt;/div&gt;&lt;!-- page --&gt; </code></pre> <p>Thanks</p>
    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.
 

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