Different wordpress 404 template for different post type I want to have different 404 template for each custom post type.  eg. I have post type name event and the link will be domain.com/event/my-event-name  but if it link to page that not have post domain.com/event/xxxxxxx   then it will show 404 page, but I want it different from 404.php template, I try get post type in 404.php but it can't because it not have a post to get from.
Filter to change the content of 404 page I have created custom rewrite rules. These rules now go to 404 page as expected. I can use action hook template_redirect to change the template matching query_var.  But I don't want to create separate template files as the page structure depend on the current theme in use. Rather I just want to change the content and title. I have tried change the content using the_content filter, but it seems the filter doesn't even get called for 404 page.  I also tried loading index.php template and then using the_content filter, but it also doesn't work.  Is there any way to achieve this?
Resistor in series needed with LED string? Show $\inf_f\int_0^1|f'(x)-f(x)|dx=1/e$ for continuously differentiable functions with $f(0)=0$, $f(1)=1$. When closing a question as a duplicate, it is becoming harder and harder to search for a good original as the pool of questions and answers grows and grows.  While the new dupe closing dialog is a huge step forward, it doesn't always work - if you've spent some time on the site, you know there are perfect answers to many new questions but you can't always find them. Or can't be bothered to, as your time is limited.  A way to further improve this could be introducing a vote for canonical answers.  It could, for example, work like this:   Answers get a new icon, the "canonical vote" (signified here by a cannon because I can't think of anything that makes sense right now.)     Only users with a certain minimum rep (maybe 1k+ or 2k+) see this icon. The icon would work like the favourite icon: You can toggle it on or off at any time. The hover message for the icon could read e.g.      This is a "canonical answer": It answers the question asked in the most extensive and general way, and is very likely to benefit other users with the same problem.    Questions that contain an answer with three or more canonical votes get special  treatment:      They show up on the top in search results; maybe even under a special heading ("Questions with canonical answers")  They show up prominently in the "close as dupe" dialog (i.e. the canonical votes influence the metric that is used to determine the questions shown there).  There could be some rewards for users whose answers receive "canonical" votes - maybe a badge if ten of your answers get at least three canonical votes, or a counter of canonical answers in your profile. It would be really interesting as it's a badge that you can't game your way to, but this whole rewarding part is entirely optional.  would be a great safeguard against over-use of this feature.    Dupe (but sans cannon):       Related: How to Change the Origin when moving a Collection Instance I have created an Collection Instance, when I try to move it, the origin(to snap at vertices or edges) is far away from the object, I want to set it.    In the image, the Collection Instance is selected, the cross is far away from the object and I can´t set it using "Set Origin to 3D Cursor"  What Am I missing? "Use Option as Meta key" with ability to type the # symbol I am using Terminal version 2.5, where I have two requirements:  I need to be able to type the Meta key. I need to be able to type the # character, too (Option+3 for the UK keyboard layout)  How can I satisfy both of these? By default, (2) is satisfied, but (1) is not. I can then turn on &quot;Use Option as Meta key&quot;, which satisfies (1), but breaks requirement (2). How can I have both? (It shouldn't be so hard for me to just be able to type.) Edit: what I'm looking for, for example, might be a way to just &quot;Use Option as Meta key&quot; for the left/right Option key, or a way to override the &quot;Use Option as Meta key&quot; for the sole exception of the # character. How can I automatically log out the guest account after a period of inactivity? As part of a kiosk system, I have set up a Guest account on a Mac OS X Snow Leopard computer. This account is cleared every time someone logs off the computer. However, plenty of people don't. Is there any way that I can automatically log out this guest account after a period of inactivity?  I tried using the security preferences pane, but that just causes the confirm logout dialog to show up.  I have hacked around the /System/Library/User Templates/ folder, so I can set the screensaver, desktop background, &amp;c. If something like ScriptSaver can solve my problem, I will gladly use it. Suppose one is trying to find the radius of convergence of  $$ \exp(x)=\sum\limits_{k=0}^{\infty} \frac{x^k}{k!} $$  This "proof" was given in the lecture: $$ \begin{align} r =&amp; \frac{1}{\limsup\limits_{n \rightarrow \infty}\sqrt [n]{|a_n|}} \\ =&amp; \frac{1}{\limsup\limits_{n \rightarrow \infty}\sqrt [n]{\frac{1}{n!}}} \\ =&amp;\lim\limits_{n \rightarrow \infty} \sqrt [n]{n!}\\ r=&amp; \infty \end{align}$$  Other proofs involving the ratio test also seem to inspect the convergence of $\frac{1}{k!}$ instead of $\frac{x^k}{k!}$. Why is one allowed to substitute $\frac{1}{k!}$? I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. &lt;body&gt;     &lt;div&gt;Div to be aligned vertically&lt;/div&gt; &lt;/body&gt;  How can I center a div vertically in all major browsers, including Internet Explorer 6? What is the rule for comma placement before a quotation mark? When should the comma go before and when should it go after the quotation mark? Categories other than "off-topic" should allow custom close reasons Custom close reasons are a great boon to Stack Exchange sites, allowing the community to provide more tailored advice to site-specific situations. Their big problem (aside from being limited to three by default) is that they are all lumped under "off-topic". This is often confusing.  I suggest that all close categories but "exact duplicate" should support customized close reasons &mdash; not just the "off-topic" category.  For example, the recommendation close reason     Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam.   This would make more sense as a child of primarily opinion-based.    Similarly, the "why doesn't this work" close reason     Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: .   This would make more sense as a child of unclear what you're asking.  Similar examples can be given for pretty much any of the Stack Exchange sites. How to avoid ArrayIndexOutOfBoundsException or IndexOutOfBoundsException? I installed ubuntu 16.04 LTS, but there is no ubuntu one software, not in ubuntu software center also..Though it is showing selected in unity tweak tool.How can I get it. Please reply. I know how to rename files in Unix:  $ mv ~/folder/subfolder/file.txt ~/folder/subfolder/file.sh       ^-------this part------^    ^------this part-------^   It takes too long time to repeat ~/folder/subfolder/file twice.  Is there a quicker way? What do damage buffs affect? In Overwatch, there are several ways to buff the damage dealt by a hero: the alternate fire of Mercy's Caduceus Staff, Ana's Nano Boost, and Orisa's Supercharger. Are they all governed by the same rules? What can they affect, or not affect?  This question exists to have a single reference point for the many, many questions that have been asked, instead of having to update each answer individually when game mechanics change Shapefile layer no longer editable (toggle edit option greyed out) in QGIS I am using QGIS 2.16 / Windows 10.  I have a point shapefile which I have been using for a little while that has always been editable.  Today I was editing the layer, saved my edits and left my computer for a few hours. When I came back I was not able to toggle the editing button on the toolbar and when I right click on the layer it longer has toggle editing as an option.  I have googled the problem every way I can think of and have not been able to find an answer to why the layer is suddenly un-editable or how to fix this. Should confidence intervals for linear regression coefficients be based on the normal or $t$ distribution? SQL comma-separated row with Group By clause Calculating de Broglie wavelength I've just installed Ubuntu 14.04 and am trying to install php 5.3. But when I run   apt-get install php5    it's installing php 5.5.9-1ubuntu4. I need to use php 5.3 in the system because the application I'm working on is built with php 5.3.   How can I achieve this? Sort files alphabetically before processing I use the command  find . -type f -exec sha256sum {} \; &gt; sha256SumOutput   to hash every file in a folder hierarchy. Unfortunately, sha256sum doesn't get the file names from find in alphabetical oder. How can this be fixed?  I'd like to have them ordered before they are hashed so they are hashed in alphabetical order (this has a reason).