I need paging on news archives page. Data is coming correctly if display all records on same page. But if i add paging code, then pagination values (such as 1,2,3,...16) coming correctly, but if i click on page 2 then it displays the same post title as on page 1.      &lt;h1 style="margin-left:10px;"&gt;News&lt;/h1&gt;      &lt;ul class="years"&gt;     &lt;?php     $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $all_posts = get_posts(array(     'post_type' =&gt; 'news',  'posts_per_page' =&gt; 20,   'orderby' =&gt; 'date',     'order' =&gt; 'DESC',     'paged='. $paged, ));      // this variable will contain all the posts in a associative array     // with three levels, for every year, month and posts.      $ordered_posts = array();      foreach ($all_posts as $single) {        $year  = mysql2date('Y', $single-&gt;post_date);       $month = mysql2date('F', $single-&gt;post_date);        // specifies the position of the current post       $ordered_posts[$year][$month][] = $single;      }      // iterates the years     foreach ($ordered_posts as $year =&gt; $months) { ?&gt;       &lt;li&gt;         &lt;h3&gt;&lt;?php echo $year ?&gt;&lt;/h3&gt;         &lt;ul class="months"&gt;         &lt;?php foreach ($months as $month =&gt; $posts ) { // iterates the moths ?&gt;           &lt;li&gt;             &lt;h3&gt;&lt;?php printf("%s (%d)", $month, count($months[$month])) ?&gt;&lt;/h3&gt;             &lt;ul class="posts"&gt;               &lt;?php foreach ($posts as $single ) { // iterates the posts ?&gt;                 &lt;li&gt;                   &lt;?php echo mysql2date('F j', $single-&gt;post_date) ?&gt; &lt;a href="&lt;?php echo get_permalink($single-&gt;ID); ?&gt;"&gt;&lt;?php echo get_the_title($single-&gt;ID); ?&gt;&lt;/a&gt;  (&lt;?php echo $single-&gt;comment_count ?&gt;)&lt;/li&gt;                 &lt;/li&gt;                &lt;?php } // ends foreach $posts ?&gt;             &lt;/ul&gt; &lt;!-- ul.posts --&gt;           &lt;/li&gt;         &lt;?php } // ends foreach for $months ?&gt;         &lt;/ul&gt; &lt;!-- ul.months --&gt;         &lt;?php if(function_exists('wp_paginate')) {         wp_paginate();     }  ?&gt;       &lt;/li&gt; &lt;?php     } // ends foreach for $ordered_posts     ?&gt;      &lt;/ul&gt;&lt;!-- ul.years --&gt;   here is the screen shot:-
I have added a custom/secondary query to a template file/custom page template; how can I make WordPress use my custom query for pagination, instead of using the main query loop's pagination?  Addendum  I have modified the main loop query via . Why isn't pagination working, and how do I fix it?
I've always managed my iPhone/iPad/iPod Manually, I recently updated to iTunes 11 and now I can see no way to get my music onto my device.  I used to be able to just drag songs from my library to my device, now there is seemingly no way to do this.  I can view the music on my device by clicking on it on the top right corner of iTunes, but I can't seem to get to a state where I can drag music from my computer onto my device.  I'm using iTunes 11.0.1.12 for Windows if that makes a difference. Most efficient way to test equality of lambda expressions How often is the Golden Ratio actually used in modern design? The  is the stuff of legend () and is . My question is two-fold, really: Is the Golden Ratio really a good tool used in modern design (defined here as 20th century on forward), and if so, how often is it used outside of the aforementioned known uses?  EDIT: To @e100's first comment, examples of modern use of the Golden Ratio would be a great thing to add here if there any documented or arguably conclusive uses of it. Shader nodes are missing? Currently, Stack Exchange’s Markdown parser only allows four-space indents to represent code blocks:      // some code     // another line of code    and other Markdown implementations allow for an alternative syntax, that doesn’t require indenting each code line:  ``` // some code // another line of code ```   This is much more convenient to type out. It would be super useful if Stack Exchange could support this syntax.    By extension, this syntax also allow you to specify the source language right after the opening ```:  ```js // some code // another line of code ```   …which would then enable syntax highlighting for that specific language. Although it’s interesting metadata, I don’t think this feature is needed on Stack Overflow, as the syntax highlighting library works pretty well for various languages.  So, even if you would allow this syntax but ignore the ```language, this would greatly improve my productivity on Stack Exchange.  What do you think?  The moderators are currently collecting feedback regarding this feature, so please post a comment with your thoughts. Good idea? Bad idea? Don’t really care? What do you think are the benefits/drawbacks? Experiences? Let them know! Thanks! Programmatically obtain the phone number of the Android phone How to extract img src, title and alt from html using php? I would like to create a page where all images which reside on my website are listed with title and alternative representation.  I already wrote me a little program to find and load all HTML files, but now I am stuck at how to extract src, title and alt from this HTML:  &lt;img src="/image/fluffybunny.jpg" title="Harvey the bunny" alt="a cute little fluffy bunny" />  I guess this should be done with some regex, but since the order of the tags may vary, and I need all of them, I don't really know how to parse this in an elegant way (I could do it the hard char by char way, but that's painful). Help with packages in java - import does not work How can I perform a t-test (or another hypothesis test) on NPS (Net Promoter Score) results? Here is an explanation of how NPS is calculated:    I'm interested in testing two net promoter scores to determine if they are statistically different. I read a great answer to calculating margin of error for NPS (see link below), but I'm really interested in testing to see if there is a difference between two scores, because I suspect that our results aren't as "different" from year to year as they appear to be.    Is this at all possible? I understand t-tests are typically used to test whether two different record sets are statistically different. But is it possible to test Net Promoter Scores, either with a t-test or some other hypothesis test?  Any ideas you have would be a great help. Thank you! Dobble card game - mathematical background In  there is a deck of 55 cards. Each of them has 8 symbols on it. There is a total of 50 different symbols and each two cards have one and only one in common.  I am wondering, given a total number of symbols N and a number of symbols on each card K, how do you find the biggest number of cards such that:   on each of those cards there are exactly K of the N symbols, every two cards have one and only one symbol in common. What are some practical examples of a constant current source? Please don't state the obvious that nothing is a perfect constant current source.  And please do not give examples of how to create them from components.  I looked at this  which stated the obvious - that you can not have a perfect current source.  So when I say constant current source, I am not referring to the mathematical concept used in circuits, but "natural" components that provide a close approximation to this. Key word is approximation.  A bit of research pulled up one interesting example which was a solar cell.  Is this a valid example?  A google search pulls up a similar Quora question . Which gave the example of a solar cell.  This is a more technical site and I was looking for a more engineering answer not a mathematical or laymen's answer.  Thanks. How do I tell Maven to use the latest version of a dependency? In Maven, dependencies are usually set up like this:  &lt;dependency&gt;   &lt;groupId&gt;wonderful-inc&lt;/groupId&gt;   &lt;artifactId&gt;dream-library&lt;/artifactId&gt;   &lt;version&gt;1.2.3&lt;/version&gt; &lt;/dependency&gt;   Now, if you are working with libraries that have frequent releases, constantly updating the &lt;version&gt; tag can be somewhat annoying. Is there any way to tell Maven to always use the latest available version (from the repository)? Count days between two dates, excluding weekends (MySQL only) Which are safe and unsafe regions in Iran? Now there's a lot of propaganda in the west that leads us to believe Iran is dangerous and travellers shouldn't go there.  Obviously there are major political disagreements between several governments and the Iranian government and this should be taken into account.  But at a human level I have met many Iranians travelling elsewhere in the world and have found them to be friendly, charming, and hospitable. I have also met several western travellers who spent time in Iran, including hitchhiking around the country, who only have wonderful things to say about the country and its people.  As a traveller I've learned to trust the most what I hear from other travellers about a destination, especially ones which prefer similar ways of travel to myself. I've also learned to trust the opinions of inhabitants of countries bordering on the destination country the least.  Yet some people still insist that Iran is not safe for a traveller, or that .  I can look up for myself the general travel advisories issued by governments and disclaimers in WikiVoyage. So please don't regurgitate those an answers.  I want to know from travellers who've been there, from Iranians, or from references to specific incidents targeting foreigners/westers about which parts of Iran are no problem, and which parts should be avoided, even by experienced intrepid travellers.  (I realize any advice won't apply to Israeli citizens unfortunately. I'm Australian.) After updating to 2.81, my previous works (done in 2.80) doesn't show colors This image is what's supposed to look like in Edit Mode/Object Mode(although I still can make these screenshots even after the update by pressing F12 which is rendering) but the following is what my donut looks like now in Blender.  It shows no shadows and colors. The only thing I did is updating blender to 2.81 from 2.80. And I don't know what but something seems off with blender. Sometimes I can't click any objects so I just pressed tab and then now it's all clickable. Seems like I was in edit mode, but to me, it looked exactly like object mode. I don't know what is wrong with it. How do I make my colors show up again? no Get More in Plugin Manager in qgis 2 + ubuntu 13.04 After upgrade of qgis 1.8 to qgis 2.0 I couldn't find the choice "Get more" in Plugin Manager and I can't install plugins. XTerm only display part of some unicodes and Urxvt displays nothing In my case, (U)XTerm does display some unicodes, but only partially. For exmaple: for letters are: 𝒫φϕ𝒟. Here is a screenshot of UXTerm and Urxvt respectively   It seems that the problem is related to the letter space or letter length. By the way, everything is fine with gnome-terminal.  My current .Xresources file is: Xft.dpi:       120 Xft.antialias: true Xft.hinting:   true Xft.rgba:      rgb Xft.autohint:  false Xft.hintstyle: hintslight Xft.lcdfilter: lcddefault  XTerm*faceName:          Fixed XTerm*faceSize:          14 XTerm*reverseVideo:      false XTerm*selectToClipboard: true  UXTerm.vt100*faceName:          Fixed UXTerm.vt100*faceSize:          14 UXTerm.vt100*reverseVideo:      false UXTerm*selectToClipboard: true  URxvt.font:            xft:Fixed:pixelsize=18  URxvt.depth:                      32 URxvt.background:                 #222D31 URxvt*scrollBar:                  false URxvt*mouseWheelScrollPage:       false URxvt*cursorBlink:                true URxvt*background:                 black URxvt*foreground:                 grey URxvt*saveLines:                  5000  How to make XTerm and Urxvt to display those characters correctly? Is it possible? A folder was created in my home folder (not by anyone), and I cannot see the folder contents. She has root privileges, but when the nautilus root access the folder is empty. When I try to remove it, it will appear to remove more than 1 million files from my computer, and I do not know what these files are.  How i can see these files? the name of folder created is "4F8ZBREShQ". I'm scared about it... I need to find algorithm that can calculate centroid A (aka gravity center, geometric center, center of mass) from the figure where circles T1,T2,T3,T4,T5,..,Tn intersect AND length of line R from centroid to farthest corner of mentioned figure   Following information is given:   T1   Latitude    =   56.999883   Longitude   =   24.144473   Radius  =   943 T2   Latitude    =   57.005352   Longitude   =   24.151168   Radius  =   857 T3   Latitude    =   57.005352   Longitude   =   24.163356   Radius  =   714 T4   Latitude    =   56.999042   Longitude   =   24.168506   Radius  =   714 T5   Latitude    =   56.994226   Longitude   =   24.15709    Radius  =   771   Result should look like this:  A Latitude = XX.XXXXXXX    Longitude = XX.XXXXXXX  Radius = XX    As you probably already figured out, I am working on software that can find device location by closest Wifi Access Points or Mobile Base stations, as number of access points or base stations might change, I need an algorithm that can adapt to uncertain amount of points.  There are some similar questions  and , but none of them exactly answers to my question. $\limsup$ and cluster points Let $(x_n)$ be a sequence in $\mathbb R$. We call $y$ a cluster point of $(x_n)$ iff for every neighborhood $N$ of $y$ there are infinitely many $n$ such that $x_n \in N$. Let $C$ denote the set of cluster points of $(x_n)$.   By definition, $\limsup_{n \to \infty} x_n = \inf_n \sup_{k \geq n} x_k$.  Can you show me how to prove $\limsup_n x_n = \sup C$? Thanks.