If I do a search example.com/?s=london with no wp_query I get results and I can change pages. But if I add a wp_query and do the same search example.com/?s=london if I click to page 2 example.com/page/2/?s=london  I get a 404. Also with a wp_query added if I do a blank search and change pages example.com/page/2/?s= i dont get 404. Its seems that the searched word is doing it but I'm not sure why. Ive tried changing my permalinks so they update but still get the same. This is the wp_query I'm using so you can see.      &lt;?php       $args_a = array(         'post_type'  =&gt; 'post',         'meta_query' =&gt; array(             array(                 'key'     =&gt; 'CurrentLocation',                 'value'   =&gt; $searchm,                 'compare' =&gt; '=',             ),             array(                 'key' =&gt; 'AreaLookingFor',                 'value'   =&gt; $areaihave,                 'type'    =&gt; '',                 'compare' =&gt; '=',                     ),                        ),     'paged' =&gt; get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1,     );      $query_a = new WP_Query( $args_a ); ?&gt;      &lt;?php if ( $query_a-&gt;have_posts() ) : ?&gt;          &lt;?php while ( $query_a-&gt;have_posts() ) : $query_a-&gt;the_post();      get_template_part( 'template-parts/post/content', 'excerpt' );            endwhile; ?&gt;       next_posts_link( 'Next', $query_a-&gt;max_num_pages );      previous_posts_link( 'Previous' ); ?&gt;          &lt;?php wp_reset_postdata(); ?&gt;      &lt;?php else : ?&gt;         &lt;p&gt;&lt;?php _e( 'No homes matched your criteria' ); ?&gt;&lt;/p&gt;     &lt;?php endif; ?&gt;
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?
How to install Ubuntu on portable external Hard Drive? OS: Windows 7. I want install Linux Ubuntu on portable external Hard Drive USB 2.0. I read a variety of methods, but I'm confused by contradictory advices and methods. Actually, installing Ubuntu on anything other than clean PC looks much more complicated than installing Windows. I need to have Ubuntu package + Python 2.7 + C compiler installed. My external hard drive is partially filled, I need to keep all files.   Will Ubuntu run entirely on external hardrive, without writing anythinhg to Windows system folders and to registry?  Can anyone post detailed guide how install Ubuntu on external hard drive? How to get access to USB-storage from an application installed as Snap? I have Ubuntu 18.04 LTS installed. I inserted USB-flash to my laptop. It was automounted to /media/username/DISKLABEL and opened in Nautilus. I can read and write objects to it. How can I access it from the application, which is installed as Snap? I tried snaps of the following applications such as gedit, arduino-mhall119, organize-my-files. All them show me errors if I navigate to /media folder:    Could not read the contents of Media Error opening the directory of '/media': permission denied  Output of active Snap  is below: $ snap interfaces  | grep -v &quot;.*-$&quot; Slot                             Plug :browser-support                 organize-my-files :core-support                    core:core-support-plug :cups-control                    gedit :desktop                         gedit,organize-my-files :desktop-legacy                  gedit,organize-my-files :gsettings                       gedit,organize-my-files :home                            arduino-mhall119,gedit,organize-my-files :network                         arduino-mhall119,gedit,organize-my-files,pulsemixer :opengl                          organize-my-files :pulseaudio                      organize-my-files,pulsemixer :unity7                          arduino-mhall119,gedit,organize-my-files :wayland                         gedit :x11                             arduino-mhall119,organize-my-files,pulsemixer gnome-3-26-1604:gnome-3-26-1604  gedit gtk-common-themes:gtk3-themes    gedit gtk-common-themes:icon-themes    gedit gtk-common-themes:sound-themes   gedit -                                arduino-mhall119:serial-port -                                gedit:avahi-observe -                                gedit:mount-observe  Updates:  connecting mount-observe to Gedit with snap connect gedit:mount-observe does not help. it seems that we need special Snap with support of  interface. How to apply for US passport card when I already have passport book? I have a US passport book, and I would like to apply for a US passport card (to have in addition to my passport book).  If I apply using form DS-82, submitting my current passport book as proof of citizenship, does it get returned to me still valid, or does it get cancelled?  Is it possible to apply for a passport card using form DS-11 and avoid sending in my current valid passport book (submitting a birth certificate instead)?  I would prefer answers with official sources, which I have not been able to find myself on the US State Dept website or on the forms themselves (which are written quite ambiguously). Prevent monitor from losing signal after screen saver / lock activates After the screen saver activates, or after I manually lock the screen via Ctrl+Alt+L, I see a blank black screen with just the date / time in the upper right corner. A few seconds after that, my HP flat screen monitor(s) lose the video signal and display ugly hopping "No Input Signal" boxes.  I'd like to keep the blank black screen (It's less distracting, consumes about as much power, and allows me to unlock faster, as the monitors don't have to re-sync), so Ubuntu should keep driving the video output while the screen is locked.  How can I configure this? I'm using Ubuntu 14.04.3 LTS with the Gnome Classic Fall-back. Graphics card is NVIDIA with the open source Nouveau driver, but I also see this with an external HP NL571AA USB graphics adapter. How to find out if my system is i386 or x86_64 before installing Ubuntu? Error Message:      "A reboot is pending. Please restart before starting Visual Studio".    I installed Visual Studio (Visual Basic 2015 and SQL 2015) and after what looked like a successful install I then got the "Reboot" window.   Not expecting it I had a bunch of things open. So I closed a bunch a bunch of things, and did the reboot myself.   Now I cannot run Visual Basic because it ONLY gives me the above error message in the pop-up window. It won't even let me do a re-install.   All it does is keep giving me the above error message.   If you have any advice that's better than a complete uninstall/reinstall I'm sure everyone in my situation would benefit from it.  How can I resolve this issue? What's the correct way to do division using a backslash? If I write $a/bc + d$, will that be equal to $(a/(bc))+d$?   Basically, if I place a slash, will I divide by what's directly behind the slash $(b)$, the term that's behind the slash $(bc)$, or everything after the slash $(bc+d)$? Is an automorphism of the field of real numbers the identity map? Is an automorphism of the field of real numbers $\mathbb{R}$ the identity map? If yes, how can we prove it?  Remark An automorphism of $\mathbb{R}$ may not be continuous. I would like to have a paper's bibliography entries inside its .tex file instead of outside in a .bib file. Is this possible with biblatex?  My reason for asking this is that I want to find the most convenient way to produce documents that uses biblatex from just one file to make collaboration on papers easier and to be able to handle submissions of papers to journals. Is "Smaug" pronounced "Smog"? Did Tolkien the linguist intend for the name of the dragon Smaug to be pronounced "Smog" [IPA: /smɒɡ/ or /smɔːɡ/]? The trailer for the second installment of The Hobbit trilogy pronounces the word (pronounced 'sma-ow-g' [IPA: /smaʊɡ/]) entirely differently than the way I have been reading it for all these many years. I tried running the following statement:  INSERT INTO VOUCHER (VOUCHER_NUMBER, BOOK_ID, DENOMINATION) SELECT (a.number, b.ID, b.DENOMINATION)  FROM temp_cheques a, BOOK b WHERE a.number BETWEEN b.START_NUMBER AND b.START_NUMBER+b.UNITS-1;   which, as I understand it, should insert into VOUCHER each record from temp_cheques with the ID and DENOMINATION fields corresponding to entries in the BOOK table (temp_cheques comes from a database backup, which I'm trying to recreate in a different format). However, when I run it, I get an error:  Error: Operand should contain 1 column(s) SQLState:  21000 ErrorCode: 1241   I'm running this in SQuirrel and have not had issues with any other queries. Is there something wrong with the syntax of my query?  EDIT:  The structure of BOOK is:  ID  int(11) START_NUMBER    int(11) UNITS   int(11) DENOMINATION    double(5,2)   The structure of temp_cheques is:  ID  int(11) number  varchar(20) Nice proofs of $\zeta(4) = \frac{\pi^4}{90}$? Do a "git export" (like "svn export")? I've been wondering whether there is a good "git export" solution that creates a copy of a tree without the .git repository directory. There are at least three methods I know of:   git clone followed by removing the .git repository directory.  alludes to this functionality but starts with "Just read the desired tree into the index..." which I'm not entirely sure how to do.  is a third party script that essentially does a git clone into a temporary location followed by rsync --exclude='.git' into the final destination.   None of these solutions really strike me as being satisfactory. The closest one to svn export might be option 1, because both those require the target directory to be empty first. But option 2 seems even better, assuming I can figure out what it means to read a tree into the index. test fails because of TestMethod do not support getContent call My below test fails because of Run Failures: TestRangehoodObjectionSheet.RangehoodObjectionSheetTest Methods defined as TestMethod do not support getContent call. I added the Blob thinking it might resolve but it doesn't work. What could be the problem here? Have I used the Blob correctly?  @isTest public with sharing class TestRangehoodObjectionSheet {      static testMethod void RangehoodObjectionSheetTest() {             String Build                = NBATRecords.getIdFromDeveloperName('Plan_Reviews__c','Building_Plan_Review');             Account a = new Account(Name = 'Test1' ,Type = 'Lead Acct',BillingState = 'CA',Industry = 'Business Services');             insert a;              Establishment_Record__c er = new Establishment_Record__c(Account__c=a.Id ,Project_Name__c = 'TestPreet',PremiseStreet__c='Manhattan ave',PremiseBorough__c='Manhattan',PremiseState__c='NY',PremisePostalCode__c='11102',Referral_Source__c='311',Data_Source__c='CAMIS',Phase__c='Initiate',Business_Status__c='Open' );             insert er;              Application__c ap = new Application__c(Establishment_Record__c=er.Id,Job_Number__c='222222222');             insert ap;              Plan_Reviews__c pr = new Plan_Reviews__c(Application__c =ap.Id ,DOB_Job_Number__c='222222222',RecordTypeId =Build,Objections__c='Pipe size not indicated');             insert pr;             PageReference pageRef = Page.RangehoodObjectionSheet;              Test.setCurrentPage(pageRef);               Blob content = Test.isRunningTest() ? Blob.valueOf('UNIT.TEST') : pageRef.getContent();              Plan_Reviews__c              p   = new Plan_Reviews__c(id=pr.Id);                ApexPages.StandardController sc  = new ApexPages.standardController(p);             System.assertNotEquals(sc,null);             RangehoodObjectionExtention    ext = new RangehoodObjectionExtention(sc);              ext.Savecopy();       } }   Actual class for the test:  public with sharing class RangehoodObjectionExtention { private final ApexPages.StandardController controller; private final Id                           planreviewID; public String imageURL{get;set;} public List&lt;String&gt; objlist {get;set;}  public string currentdate {get; set;}    public RangehoodObjectionExtention (ApexPages.StandardController stdController) {         controller   = stdController;         planreviewID = (Id)controller.getRecord().get('Id');         Date dt = Date.today();         currentdate = dt.format();         list&lt;Plan_Reviews__c&gt; prlist = [select FDNY_Objections__c from Plan_Reviews__c where id = :planreviewID limit 1];         string obj;         for(Plan_Reviews__c pr: prlist){            obj = pr.FDNY_Objections__c;             }         if(obj!=null){            list&lt;string&gt; objections = obj.split(';');             integer i =1;            objlist = new list&lt;string&gt;();            for(string o : objections){               objlist.add(i++ +'. '+o);            }         }         imageURL='/servlet/servlet.FileDownload?file=';         List&lt; document &gt; documentList=[select name from document where Name='RangehoodObjectionLogo'];         if(documentList.size()&gt;0)         {            imageURL=imageURL+documentList[0].id;         }       }          public PageReference Savecopy(){       PageReference p = Page.RangehoodObjectionSheet;       blob b = ApexPages.currentPage().getContentAsPDF ();       Attachment a = new Attachment();       a.body = b;       a.name = 'Rangehood Objection sheet Issued '+currentdate+'.pdf';       a.parentid = planreviewID;        insert a;        PageReference pref = new PageReference('/'+planreviewID);       return pref;    } } Photon energy - momentum in matter $E = h\nu$ and $P = h\nu/c$ in vacuum. If a photon enters water, its frequency $\nu$ doesn't change. What are its energy and momentum: $h\nu$ and $h\nu/c$ ? Since part of its energy and momentum have been transferred to water, it should be less.  If water's refractive index is $n$, are the energy and momentum equal to $h\nu/n$ and $h\nu/c/n$ ? Sometimes when I am debugging code in Eclipse it happens that although I can see and inspect class member variables without any difficulty I am unable to inspect the values of variables declared locally within functions. As an aside, any parameters to the current function lose their 'real' names and instead one sees their values listed in the Variables window as arg0, arg1, arg2, etc but at least the values are visible.  This is occurring at present in relation to classes defined within the core JDK. I have verified that the installed and current JRE is a JDK.  Is anybody able to shed some light on this behaviour? How do you remove the axis multiplier? Help with this trigonometry problem Prove the given identity.  $$\left(\sin\frac {9\pi}{70}+ \sin\frac {29\pi}{70} - \sin\frac {31\pi}{70}\right) \left(\sin\frac {\pi}{70}-\sin\frac {11\pi}{70} - \sin\frac {19\pi}{70}\right) =\frac {\sqrt {5} -4}{4}$$  Please help, I could not gather enough ideas, even on how to get to the first step. I thought of using the transformation formula (from sum to product) but did not find a fruitful result.   UPDATE 1.:  $\left(-\frac{1 +\sqrt{5}}{8} + \frac{1}{8} \sqrt{14\left(5 - \sqrt{5} \right)}\right)\left(-\frac{ 1+ \sqrt{5}}{8} -\frac{1}{8} \sqrt{14 \left(5 -\sqrt{5} \right)}\right) $,    I noticed that Alexis had got to this point.  Can anyone explain me how did he get here, with calculations. Please help.  Thanks in Advance. Recently I installed Ubuntu 12.10 x64 Server Edition on my PC. Unfortunately, I attempted to install a lightweight desktop but due to the fact that I have an old graphics card, the PC does not perform so well. I am thinking of re-installing an Ubuntu version but I do not want to lose the contents in my home folder. Is there any way to do that with a Live CD? If I have random variables $X_1,X_2,\ldots,X_n$ that are Poisson distributed with parameters $\lambda_1, \lambda_2,\ldots, \lambda_n$, what is the distribution of $Y=\left\lfloor\frac{\sum_{i=1}^n X_i}{n}\right\rfloor$ (i.e. the integer floor of the average)?  A sum of Poissons is also Poisson, but I am not confident enough in statistics to determine if it is the same for the case above.