qid
int64
4
8.14M
question
stringlengths
20
48.3k
answers
list
date
stringlengths
10
10
metadata
list
input
stringlengths
12
45k
output
stringlengths
2
31.8k
1,309
<p>As it is December 2012, we are now going to reset our Community Promotion Ads for the new year.</p> <h3>What are Community Promotion Ads?</h3> <p>Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this question is the vetting process...
[ { "answer_id": 1310, "author": "Grace Note", "author_id": 7667, "author_profile": "https://wordpress.meta.stackexchange.com/users/7667", "pm_score": 4, "selected": false, "text": "<p><a href=\"http://twitter.com/stackwordpress\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgu...
2012/12/10
[ "https://wordpress.meta.stackexchange.com/questions/1309", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/7667/" ]
As it is December 2012, we are now going to reset our Community Promotion Ads for the new year. ### What are Community Promotion Ads? Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this question is the vetting process. Images of the...
[![Follow us on Twitter](https://i.stack.imgur.com/vJ4jA.png)](http://twitter.com/stackwordpress)
2,403
<p>I always thought the markdown <code>&gt;</code> was a shortcut for HTML’s <code>&lt;blockquote&gt;</code>. However, there appears to be differences. Compare this …</p> <pre><code>&gt; This is `monospace` markdown </code></pre> <blockquote> <p>This is <code>monospace</code> markdown</p> </blockquote> <p>With thi...
[ { "answer_id": 2404, "author": "fuxia", "author_id": 73, "author_profile": "https://wordpress.meta.stackexchange.com/users/73", "pm_score": 2, "selected": false, "text": "<p>Use <code>&lt;code&gt;</code>, not <code>&lt;pre&gt;</code> when you want to show code in a HTML blockquote.</p>\n...
2013/02/28
[ "https://wordpress.meta.stackexchange.com/questions/2403", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/-1/" ]
I always thought the markdown `>` was a shortcut for HTML’s `<blockquote>`. However, there appears to be differences. Compare this … ``` > This is `monospace` markdown ``` > > This is `monospace` markdown > > > With this … ``` <blockquote>This is `monospace` markdown</blockquote> ``` > This is `monospace` ma...
Markdown is normally not converted when located within block-level HTML elements. It's a mild annoyance at times. Some extended versions of Markdown provide some utility for making this work; for example, [PHP Markdown Extra](http://michelf.ca/projects/php-markdown/extra/#markdown-attr) adds this ability by checking fo...
2,496
<p>I suggest the namespace <code>WPSE</code> for the code snippets we use in our answers.</p> <p>Namespaces are a <a href="http://php.net/manual/en/language.namespaces.php" rel="nofollow">feature of PHP 5.3</a>; WordPress core <a href="http://codex.wordpress.org/Hosting_WordPress" rel="nofollow">requires just PHP 5.2....
[ { "answer_id": 2497, "author": "Stephen Harris", "author_id": 9364, "author_profile": "https://wordpress.meta.stackexchange.com/users/9364", "pm_score": 4, "selected": false, "text": "<p>I like the idea, but I don't think it'll work.</p>\n\n<p>The premise is that because an answer on the...
2013/05/30
[ "https://wordpress.meta.stackexchange.com/questions/2496", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/73/" ]
I suggest the namespace `WPSE` for the code snippets we use in our answers. Namespaces are a [feature of PHP 5.3](http://php.net/manual/en/language.namespaces.php); WordPress core [requires just PHP 5.2.4](http://codex.wordpress.org/Hosting_WordPress) currently. But even [PHP 5.3 development has stopped](http://php.ne...
I like the idea, but I don't think it'll work. The premise is that because an answer on the stack exchange site does not work for them (because they are using outdated php), they will upgrade. This assumes one of the following, with decreasing credibility * They can upgrade their PHP installation - *most users run o...
2,564
<p>When I'm viewing a user's profile (i.e.: <a href="https://wordpress.stackexchange.com/users/2744/kingkool68">kingkool68</a>), even a Moderator's profile (like <a href="https://wordpress.stackexchange.com/users/847/rarst">Rarst</a>), it's not there. But when in my profile I can see:</p> <pre><code>helpful flags 21...
[ { "answer_id": 2565, "author": "kaiser", "author_id": 385, "author_profile": "https://wordpress.meta.stackexchange.com/users/385", "pm_score": 2, "selected": false, "text": "<blockquote>\n <p>Does it lead to a badge or some reputation up?</p>\n</blockquote>\n\n<p>You get the gold <a hre...
2013/09/09
[ "https://wordpress.meta.stackexchange.com/questions/2564", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/22728/" ]
When I'm viewing a user's profile (i.e.: [kingkool68](https://wordpress.stackexchange.com/users/2744/kingkool68)), even a Moderator's profile (like [Rarst](https://wordpress.stackexchange.com/users/847/rarst)), it's not there. But when in my profile I can see: ``` helpful flags 21 ``` Eventually I got that, it's t...
> > Why the count is important? > > > If I am not mistaken the flag allowance (how much you can flag in a day) is tied to that stat. > > Does it lead to a badge or some reputation up? > > > There are two badges for 80 ([Deputy](https://wordpress.stackexchange.com/help/badges/67/deputy)) and 500 ([Marshal](ht...
2,588
<p>Today I tried a text with <code>bold+normal</code> face in a single word. When I separated them as <code>bold + normal</code> &mdash; I can write them, like:<br/> <strong>got</strong> me.</p> <p>But if I join them like: "gotme" and try to bold the part "got" only, but "me" will remain normal, then I can't achieve t...
[ { "answer_id": 2589, "author": "Rarst", "author_id": 847, "author_profile": "https://wordpress.meta.stackexchange.com/users/847", "pm_score": 4, "selected": true, "text": "<p>Sometimes it's just easier to use HTML than deal with intricate combination of Markdown. Remember - the purpose o...
2013/09/25
[ "https://wordpress.meta.stackexchange.com/questions/2588", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/22728/" ]
Today I tried a text with `bold+normal` face in a single word. When I separated them as `bold + normal` — I can write them, like: **got** me. But if I join them like: "gotme" and try to bold the part "got" only, but "me" will remain normal, then I can't achieve that, see here below: \**got*\*me It simply create...
Sometimes it's just easier to use HTML than deal with intricate combination of Markdown. Remember - the purpose of Markdown is quick and productive, not rich elaborate formatting. ``` <strong><em>nano</em>design</strong> ``` > > ***nano*design** > > >
3,709
<p>It's the time of the year again, namely it is December 2013, and so we shall now refresh our Community Promotion Ads for the new year.</p> <h3>What are Community Promotion Ads?</h3> <p>Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose ...
[ { "answer_id": 3710, "author": "Grace Note", "author_id": 7667, "author_profile": "https://wordpress.meta.stackexchange.com/users/7667", "pm_score": 3, "selected": false, "text": "<p><a href=\"http://twitter.com/stackwordpress\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgu...
2013/12/06
[ "https://wordpress.meta.stackexchange.com/questions/3709", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/7667/" ]
It's the time of the year again, namely it is December 2013, and so we shall now refresh our Community Promotion Ads for the new year. ### What are Community Promotion Ads? Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this questio...
[![QueryPosts.com - better WordPress code reference](https://i.stack.imgur.com/yBBjW.png)](http://queryposts.com/)
3,876
<p>Again and again there are people who are new, haven't read the FAQ and post off-topic or badly researched questions. I am not here to complain but to find the best way to help them while not telling them off too much and instead encouraging them to improve there question-asking.</p> <ul> <li>What would be the best ...
[ { "answer_id": 3877, "author": "Stephen Harris", "author_id": 9364, "author_profile": "https://wordpress.meta.stackexchange.com/users/9364", "pm_score": 3, "selected": false, "text": "<p>There will always be low-quality, badly researched or even off-topic questions. While this can be fru...
2014/06/10
[ "https://wordpress.meta.stackexchange.com/questions/3876", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/47733/" ]
Again and again there are people who are new, haven't read the FAQ and post off-topic or badly researched questions. I am not here to complain but to find the best way to help them while not telling them off too much and instead encouraging them to improve there question-asking. * What would be the best wording to do ...
There will always be low-quality, badly researched or even off-topic questions. While this can be frustrating, it's important to remember that such questions don't necessarily represent a laziness, or indifference to your time/the site's aim (e.g. I'll just post a Q. and get someone to do the work for me), or a disrega...
3,933
<p>As we got quite some questions dealing with migrating other CMS or custom databases to WordPress, we need a guide on how to attach the minimum needed data. Those posts have some views, but there are simply too many different systems out there to have an expert for everything. So <strong>if you want to keep your ques...
[ { "answer_id": 3935, "author": "John Reid", "author_id": 62150, "author_profile": "https://wordpress.meta.stackexchange.com/users/62150", "pm_score": 3, "selected": false, "text": "<p>To get the SQL command to <strong>recreate a table</strong> use <code>SHOW CREATE TABLE</code> as it wou...
2014/11/04
[ "https://wordpress.meta.stackexchange.com/questions/3933", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/385/" ]
As we got quite some questions dealing with migrating other CMS or custom databases to WordPress, we need a guide on how to attach the minimum needed data. Those posts have some views, but there are simply too many different systems out there to have an expert for everything. So **if you want to keep your question open...
To get the SQL command to **recreate a table** use `SHOW CREATE TABLE` as it would be more useful than just seeing the table structure with `DESCRIBE`. If the question is potentially complex then it's easy for the readers to quickly recreate the database just by a copy / paste of the output. The result would have to b...
3,949
<p>The dawn of a new year, 2015, now approaches, or has already approached, either way it means that it is now time to reset our Community Promotion Ads!</p> <h3>What are Community Promotion Ads?</h3> <p>Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sideb...
[ { "answer_id": 3950, "author": "Grace Note", "author_id": 7667, "author_profile": "https://wordpress.meta.stackexchange.com/users/7667", "pm_score": 3, "selected": false, "text": "<p><a href=\"http://twitter.com/stackwordpress\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgu...
2015/01/01
[ "https://wordpress.meta.stackexchange.com/questions/3949", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/7667/" ]
The dawn of a new year, 2015, now approaches, or has already approached, either way it means that it is now time to reset our Community Promotion Ads! ### What are Community Promotion Ads? Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose...
[![Follow us on Twitter](https://i.stack.imgur.com/jKuRp.png)](http://twitter.com/stackwordpress)
4,118
<p>It's 2016 now, and we've <a href="https://meta.stackexchange.com/questions/272563/were-standardizing-the-sidebar-width-at-300px-on-all-sites">made some changes to the sidebar size</a>. As such, we can now restart the Community Promotion Ads for 2016!</p> <p>Keep in mind, we have updated some of the guidelines compa...
[ { "answer_id": 4119, "author": "Grace Note", "author_id": 7667, "author_profile": "https://wordpress.meta.stackexchange.com/users/7667", "pm_score": 4, "selected": false, "text": "<p><a href=\"http://twitter.com/stackwordpress\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgu...
2016/01/15
[ "https://wordpress.meta.stackexchange.com/questions/4118", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/7667/" ]
It's 2016 now, and we've [made some changes to the sidebar size](https://meta.stackexchange.com/questions/272563/were-standardizing-the-sidebar-width-at-300px-on-all-sites). As such, we can now restart the Community Promotion Ads for 2016! Keep in mind, we have updated some of the guidelines compared to previously - t...
[![Follow us on Twitter](https://i.stack.imgur.com/0avZe.png)](http://twitter.com/stackwordpress)
4,146
<p>A few years ago, this site was called <a href="https://wordpress.meta.stackexchange.com/questions/2630/a-better-name-for-our-site">WordPress Answers</a>. After much negotiation, the Community team agreed to rename it to <a href="https://wordpress.meta.stackexchange.com/questions/3745/site-name-the-final-chapter">Wor...
[ { "answer_id": 4147, "author": "Jon Ericson", "author_id": 35055, "author_profile": "https://wordpress.meta.stackexchange.com/users/35055", "pm_score": 4, "selected": false, "text": "<p>I'm writing this as an answer and not in the question itself because I'd love to see some counter-evid...
2016/03/25
[ "https://wordpress.meta.stackexchange.com/questions/4146", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/35055/" ]
A few years ago, this site was called [WordPress Answers](https://wordpress.meta.stackexchange.com/questions/2630/a-better-name-for-our-site). After much negotiation, the Community team agreed to rename it to [WordPress Development](https://wordpress.meta.stackexchange.com/questions/3745/site-name-the-final-chapter). T...
I'm writing this as an answer and not in the question itself because I'd love to see some counter-evidence. You see, I'm skeptical that name changes will make any difference to the way sites are used. (This doesn't mean I haven't [suggested the move](https://hermeneutics.meta.stackexchange.com/questions/552/a-roadmap-t...
4,193
<p>I'm relatively new as an active user here, so I'm still in the honeymoon phase where tackling 20,000 unanswered questions looks like fun.</p> <p>So, I thought I'd get together some ideas/tips/motivation to take this on.</p> <p><em>Obviously</em> it's not going to be realistic to get that down to 0, but I thought w...
[ { "answer_id": 4194, "author": "Tim Malone", "author_id": 46066, "author_profile": "https://wordpress.meta.stackexchange.com/users/46066", "pm_score": 5, "selected": true, "text": "<p>Update answer below with the following:</p>\n\n<ul>\n<li><a href=\"https://www.google.com.au/search?q=cu...
2016/06/29
[ "https://wordpress.meta.stackexchange.com/questions/4193", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/46066/" ]
I'm relatively new as an active user here, so I'm still in the honeymoon phase where tackling 20,000 unanswered questions looks like fun. So, I thought I'd get together some ideas/tips/motivation to take this on. *Obviously* it's not going to be realistic to get that down to 0, but I thought we could do our best and ...
Update answer below with the following: * [date of update](https://www.google.com.au/search?q=current%20time%20utc) (**Date**) * [# questions with no upvoted or accepted answers](https://wordpress.stackexchange.com/unanswered/tagged/?tab=newest) (**NoVotes**) + *can also be useful to sort by your [favourite tags](htt...
4,328
<p>It is a bit late into this new year, being that we're already in the second month, but we are now cycling the Community Promotion Ads for 2017!</p> <h3>What are Community Promotion Ads?</h3> <p>Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The...
[ { "answer_id": 4329, "author": "Grace Note", "author_id": 7667, "author_profile": "https://wordpress.meta.stackexchange.com/users/7667", "pm_score": 2, "selected": false, "text": "<p><a href=\"http://twitter.com/stackwordpress\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgu...
2017/02/02
[ "https://wordpress.meta.stackexchange.com/questions/4328", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/7667/" ]
It is a bit late into this new year, being that we're already in the second month, but we are now cycling the Community Promotion Ads for 2017! ### What are Community Promotion Ads? Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of thi...
[![WP-CLI - The command line interface for WordPress](https://i.stack.imgur.com/H65sB.png)](https://wp-cli.org/)
4,353
<p>I have a question that I would like to ask on WPSE, but fear that it leans towards the "Bad Subjective" end of <a href="https://stackoverflow.blog/2010/09/29/good-subjective-bad-subjective/">Good Subjective, Bad Subjective</a> spectrum.</p> <p>So, I thought I'd ask here whether it would be appropriate to ask it on ...
[ { "answer_id": 4354, "author": "Howdy_McGee", "author_id": 7355, "author_profile": "https://wordpress.meta.stackexchange.com/users/7355", "pm_score": 4, "selected": true, "text": "<p><a href=\"https://wordpress.stackexchange.com/q/258277/7355\">Usually</a> broad topics like \"Best Practi...
2017/03/03
[ "https://wordpress.meta.stackexchange.com/questions/4353", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/113496/" ]
I have a question that I would like to ask on WPSE, but fear that it leans towards the "Bad Subjective" end of [Good Subjective, Bad Subjective](https://stackoverflow.blog/2010/09/29/good-subjective-bad-subjective/) spectrum. So, I thought I'd ask here whether it would be appropriate to ask it on WPSE. If not appropri...
[Usually](https://wordpress.stackexchange.com/q/258277/7355) broad topics like "Best Practices" are [closed](https://wordpress.stackexchange.com/search?tab=newest&q=%5Bbest-practices%5D%20is%3Aquestion%20closed%3Ayes) as being opinionated or too broad but I've been seeing them more and more. I think a better way to ask...
4,464
<p>It's almost February in 2018, which isn't supposed to be the proper time to cycle these, but for this year it'll be once again, so we'll be refreshing the <strong>Community Promotion Ads</strong> for this year now!</p> <h3>What are Community Promotion Ads?</h3> <p>Community Promotion Ads are community-vetted adver...
[ { "answer_id": 4465, "author": "Grace Note", "author_id": 7667, "author_profile": "https://wordpress.meta.stackexchange.com/users/7667", "pm_score": 2, "selected": false, "text": "<p><a href=\"http://twitter.com/stackwordpress\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgu...
2018/01/29
[ "https://wordpress.meta.stackexchange.com/questions/4464", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/7667/" ]
It's almost February in 2018, which isn't supposed to be the proper time to cycle these, but for this year it'll be once again, so we'll be refreshing the **Community Promotion Ads** for this year now! ### What are Community Promotion Ads? Community Promotion Ads are community-vetted advertisements that will show up ...
[![WP-CLI - The command line interface for WordPress](https://i.stack.imgur.com/hWVql.png)](https://wp-cli.org/)
4,510
<p>From <a href="https://wordpress.stackexchange.com/help/on-topic">What topics can I ask about here?</a>, I think asking about unworkable JS code on WP is not off-topic, because the code should work in principle. But to make sure, is it on-topic?</p> <p>Below is the draft.</p> <hr> <p>The below js code is meant to ...
[ { "answer_id": 4511, "author": "fuxia", "author_id": 73, "author_profile": "https://wordpress.meta.stackexchange.com/users/73", "pm_score": 4, "selected": true, "text": "<p>Your problem is on-topic if it can happen in a WordPress context only. So if you are using WordPress’ JavaScript AP...
2018/08/21
[ "https://wordpress.meta.stackexchange.com/questions/4510", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/64282/" ]
From [What topics can I ask about here?](https://wordpress.stackexchange.com/help/on-topic), I think asking about unworkable JS code on WP is not off-topic, because the code should work in principle. But to make sure, is it on-topic? Below is the draft. --- The below js code is meant to [swapping a word back and for...
Your problem is on-topic if it can happen in a WordPress context only. So if you are using WordPress’ JavaScript API in your code, it is on-topic, and if you don't, like in your example, it is not.
4,546
<p>2019 is here! And with the new year, as usual, comes a new iteration of <strong>Community Promotion Ads</strong>! Let’s refresh these for the coming year :)</p> <h3>What are Community Promotion Ads?</h3> <p>Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right...
[ { "answer_id": 4547, "author": "JNat", "author_id": 69863, "author_profile": "https://wordpress.meta.stackexchange.com/users/69863", "pm_score": 2, "selected": false, "text": "<p><a href=\"http://twitter.com/stackwordpress\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.co...
2019/01/23
[ "https://wordpress.meta.stackexchange.com/questions/4546", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/69863/" ]
2019 is here! And with the new year, as usual, comes a new iteration of **Community Promotion Ads**! Let’s refresh these for the coming year :) ### What are Community Promotion Ads? Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of thi...
[![WP-CLI - The command line interface for WordPress](https://i.stack.imgur.com/KIZm9.png)](https://wp-cli.org/)
4,673
<p>2020 has come! But… oops, where did the time go? It’s already March! Belated as it is, it’s time for a refresh of <strong>Community Promotion Ads</strong>!</p> <h3>What are Community Promotion Ads?</h3> <p>Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right ...
[ { "answer_id": 4668, "author": "Howdy_McGee", "author_id": 7355, "author_profile": "https://wordpress.meta.stackexchange.com/users/7355", "pm_score": 3, "selected": false, "text": "<p>I don't see any harm in doing so. Hopefully users will think twice when adding the tag. +1</p>\n" }, ...
2020/03/05
[ "https://wordpress.meta.stackexchange.com/questions/4673", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/69863/" ]
2020 has come! But… oops, where did the time go? It’s already March! Belated as it is, it’s time for a refresh of **Community Promotion Ads**! ### What are Community Promotion Ads? Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this...
I don't see any harm in doing so. Hopefully users will think twice when adding the tag. +1
4,685
<p>I've been looking through all the tags that have posts (most having posts this year). There are very many that are automatically off-topic and more that it would be hard to make an on-topic post for. I counted 62 off-topic or probably off-topic tags.</p> <pre><code> adsense advanced-custom-fields amazon andr...
[ { "answer_id": 4686, "author": "Tom J Nowell", "author_id": 736, "author_profile": "https://wordpress.meta.stackexchange.com/users/736", "pm_score": 2, "selected": false, "text": "<p>The problem here is that any user with a particular level of reputation can recreate the tags, so deletin...
2020/04/07
[ "https://wordpress.meta.stackexchange.com/questions/4685", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/109240/" ]
I've been looking through all the tags that have posts (most having posts this year). There are very many that are automatically off-topic and more that it would be hard to make an on-topic post for. I counted 62 off-topic or probably off-topic tags. ``` adsense advanced-custom-fields amazon android apache ...
A tag is serving two purposes: finding content and hiding content. And the latter is what prevents us from deleting or merging tags. Many users have blocked for example the tag `woocommerce`, because they are annoyed by those questions. If we remove the tag, their question list will suddenly get polluted with that agai...
1
<p>I want to use HTML5 in my WordPress theme, how do I turn off wptexturize?</p> <p>I don't mind WP adding breaks, but I want them to be <code>&lt;br&gt;</code> and not <code>&lt;br /&gt;</code>. How do I get control over how those breaks show up in my code?</p> <p><strong>EDIT:</strong> I only really care about the ...
[ { "answer_id": 10, "author": "thomasjo", "author_id": 23, "author_profile": "https://wordpress.stackexchange.com/users/23", "pm_score": 3, "selected": false, "text": "<p>This can be disabled in e.g. the theme's <strong>function.php</strong> file by taking advantage of the <code>remove_fi...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/1", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/12/" ]
I want to use HTML5 in my WordPress theme, how do I turn off wptexturize? I don't mind WP adding breaks, but I want them to be `<br>` and not `<br />`. How do I get control over how those breaks show up in my code? **EDIT:** I only really care about the `<br>` tag issue, I don't mind the typographic changes it makes....
Line breaks are added by `wpautop()`, not `wptexturize()`. `wpautop()` is also the function that automatically adds paragraph tags. You're better off fixing the `<br />`'s than you are replacing the filter. Since `wpautop()` runs at priority 10, you can just hook in after that and fix it. ``` add_filter( 'the_content...
9
<p>I've read a few tutorials on how to add the functionality of the custom menus added in version 3.0 to my theme but they all seem to differ somewhat, and I'm not sure whether they contain superfluous code. In addition I read that the code to register your theme as menu-compatible changed between the RC and the public...
[ { "answer_id": 16, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 4, "selected": true, "text": "<p>The easiest way is to use the <code>register_nav_menus</code> function.This should be hooked into <code>'after_setu...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/9", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/25/" ]
I've read a few tutorials on how to add the functionality of the custom menus added in version 3.0 to my theme but they all seem to differ somewhat, and I'm not sure whether they contain superfluous code. In addition I read that the code to register your theme as menu-compatible changed between the RC and the public re...
The easiest way is to use the `register_nav_menus` function.This should be hooked into `'after_setup_theme'`: ``` function my_cool_menu_function(){ register_nav_menus( array( 'primary' => 'Primary Navigation' )); } add_action( 'after_setup_theme', 'my_cool_menu_function' ); ``` Then, in your theme, simply c...
13
<p>If I write a private plugin, is there any way to use the WordPress auto-update mechanism to update it?</p> <p>I want to encapsulate the functionality, but it's specific to my own 5 or so blogs, so it's not a good candidate for the public plugins resource. But I love the easy-updating mechanism.</p> <p>Is there a w...
[ { "answer_id": 44, "author": "Annika Backstrom", "author_id": 66, "author_profile": "https://wordpress.stackexchange.com/users/66", "pm_score": 6, "selected": false, "text": "<p>Looks like the applicable code is in <code>wp-includes/update.php</code>, <code>wp_update_plugins()</code>:</p...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/13", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/12/" ]
If I write a private plugin, is there any way to use the WordPress auto-update mechanism to update it? I want to encapsulate the functionality, but it's specific to my own 5 or so blogs, so it's not a good candidate for the public plugins resource. But I love the easy-updating mechanism. Is there a way to do this?
Since Wordpress v5.8, it is a lot simpler to create yourself a basic version of custom plugin update functionality. ### Step 1 Create JSON file on your server. It will contain info about latest version number of your plugin(s) and link to ZIP file(s) for Wordpress to automatically download it when update is triggered...
21
<p>In the Reading Settings, there is place to set the number of posts shown that affects the number of posts shown in all contexts. I'd like to show instead a certain number of posts on the homepage, and a different number of posts on pages like archive, search results, etc. </p> <p><img src="https://i.stack.imgur.com...
[ { "answer_id": 37, "author": "chrismccoy", "author_id": 70, "author_profile": "https://wordpress.stackexchange.com/users/70", "pm_score": 0, "selected": false, "text": "<p>you could do a custom loop using query_posts, and specify the number of posts by is_home, is_archive, etc.</p>\n\n<p...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/21", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/43/" ]
In the Reading Settings, there is place to set the number of posts shown that affects the number of posts shown in all contexts. I'd like to show instead a certain number of posts on the homepage, and a different number of posts on pages like archive, search results, etc. ![reading-settings-blog-pages-show-at-most-pe...
I believe the best way to do this in a plugin is to run the following sample function when the `pre_get_posts` action hook is encountered. The `$wp_query` object is available, meaning your conditional tags are available, but before WordPress gets the posts, which means you are changing query vars prior to the first que...
23
<p>Below is an example. 3 classes attached to each item, except current item, which has 6. Can I pare this down somehow?</p> <pre><code>&lt;ul id="menu-global-nav" class="sf-menu"&gt; &lt;li id="menu-item-63" class="menu-item menu-item-type-post_type current-menu-item page_item page-item-5 current_page_item menu-item-...
[ { "answer_id": 41, "author": "EAMann", "author_id": 46, "author_profile": "https://wordpress.stackexchange.com/users/46", "pm_score": 2, "selected": false, "text": "<p>I wouldn't recommend paring it down. Yes, the markup might look bloated, but this is the <em>only</em> way you can real...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/23", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/30/" ]
Below is an example. 3 classes attached to each item, except current item, which has 6. Can I pare this down somehow? ``` <ul id="menu-global-nav" class="sf-menu"> <li id="menu-item-63" class="menu-item menu-item-type-post_type current-menu-item page_item page-item-5 current_page_item menu-item-63"><a href="#">Home</a...
I'm going against the majority on this one :) Yes, it can be a good idea to strip it down. Personally I'm keeping only the `current-xxx` type classes and replacing them with `active`~~, and `active-parent` (for active parent or ancestor items).~~ Why? * around the web, *active* has became the standard class for acti...
43
<p>In particular in table <code>wp_options</code>. After almost 2 years of blog production it seems increased a lot, and I don't know how many crap is in there.</p> <p>Do you know a plugin that works with WordPress 3.0 or safe query to run to search orphan keys/rows?</p>
[ { "answer_id": 51, "author": "EAMann", "author_id": 46, "author_profile": "https://wordpress.stackexchange.com/users/46", "pm_score": 2, "selected": false, "text": "<p>This won't necessarily remove issues with <code>wp_options</code> but I've used <a href=\"http://wordpress.org/extend/pl...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/43", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/36/" ]
In particular in table `wp_options`. After almost 2 years of blog production it seems increased a lot, and I don't know how many crap is in there. Do you know a plugin that works with WordPress 3.0 or safe query to run to search orphan keys/rows?
There is no query that will be 100% certain to delete everything unused and not delete those things because any theme or plugin can add options to the `wp_options` table. Still, with a little effort you can get a pretty good idea of what's not in use and then manually decide which of those things to delete and which no...
45
<p>When editing one of my custom post types I want to be able to list all entries by a custom field instead of the date they are published (which, for a custom post type probably isn't relevant). I got a lead from the comments of a blog post about custom post types and the author said it was possible and that he even m...
[ { "answer_id": 159, "author": "MikeSchinkel", "author_id": 89, "author_profile": "https://wordpress.stackexchange.com/users/89", "pm_score": 7, "selected": true, "text": "<p>As you can probably imagine by the lack of answers provided, the solution is not exactly trivial. What I've done i...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/45", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/69/" ]
When editing one of my custom post types I want to be able to list all entries by a custom field instead of the date they are published (which, for a custom post type probably isn't relevant). I got a lead from the comments of a blog post about custom post types and the author said it was possible and that he even made...
As you can probably imagine by the lack of answers provided, the solution is not exactly trivial. What I've done is create a somewhat self-contained example that assumes a custom post type of "`movie`" and custom field key of "*Genre*". ***Disclaimer***: this works with WP3.0 but I can't be sure it will work with earl...
48
<p>How can I stop WordPress from prompting me to enter FTP information when doing updates?</p>
[ { "answer_id": 49, "author": "artlung", "author_id": 12, "author_profile": "https://wordpress.stackexchange.com/users/12", "pm_score": 6, "selected": true, "text": "<p>If you edit your <code>wp-config.php</code> file you can preload these FTP settings as constants read by WordPress. Keep...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/48", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/12/" ]
How can I stop WordPress from prompting me to enter FTP information when doing updates?
If you edit your `wp-config.php` file you can preload these FTP settings as constants read by WordPress. Keep in mind, on a shared host, you should be mindful of possible security implications. [See Editing **`wp-config.php`**](http://codex.wordpress.org/Editing_wp-config.php) for more information. Your settings will...
60
<p>I have a spreadsheet (XLS) of names, email addresses, and passwords from another content management system. Is there a way to import these folks as users (I think subscriber level, but some may be Editors as well) into WordPress?</p>
[ { "answer_id": 69, "author": "Annika Backstrom", "author_id": 66, "author_profile": "https://wordpress.stackexchange.com/users/66", "pm_score": 4, "selected": true, "text": "<p>A new file, <code>import.php</code>:</p>\n\n<pre><code>&lt;?php\n\ndefine('WP_INSTALLING', true); // this is re...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/60", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/12/" ]
I have a spreadsheet (XLS) of names, email addresses, and passwords from another content management system. Is there a way to import these folks as users (I think subscriber level, but some may be Editors as well) into WordPress?
A new file, `import.php`: ``` <?php define('WP_INSTALLING', true); // this is required. i forget why! include '/path/to/wordpress/wp-load.php'; include ABSPATH . WPINC . '/registration.php'; // wp_insert_user() $userdata = array('user_login' => 'jdoe', 'user_pass' => 'foobar'); $user_id = wp_insert_user($userdata);...
119
<p>I do development on one box and use a second for production. Right now I just dump the database and then do a find a replace for the URL changes; then copy over the files and import the new SQL.</p> <p>Are there better ways of doing this?</p>
[ { "answer_id": 139, "author": "Vid Luther", "author_id": 34, "author_profile": "https://wordpress.stackexchange.com/users/34", "pm_score": 3, "selected": false, "text": "<p>I am personally addressing this issue with my project on Github, called <a href=\"http://github.com/vluther/Autopre...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/119", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/105/" ]
I do development on one box and use a second for production. Right now I just dump the database and then do a find a replace for the URL changes; then copy over the files and import the new SQL. Are there better ways of doing this?
**@Insanity5902**: Deployment of a WordPress site from one box to another has been a PITA since day one I started working with WordPress. (Truth-be-told it was a PITA with Drupal for 2 years before I started with WordPress so the problem is certainly not exclusively with WordPress.) It bothered me that every time I ne...
136
<p>How can I instruct wordpress to use a filename other than 'styles.css' for my main stylesheet - for example, styles-1.css? I'd like to do this for versioning and caching purposes. </p>
[ { "answer_id": 141, "author": "David Thomas", "author_id": 84, "author_profile": "https://wordpress.stackexchange.com/users/84", "pm_score": 0, "selected": false, "text": "<p>I'm not sure if this has changed for WP3, so I'm not wholly sure, but one way is to edit the relevant php file di...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/136", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/119/" ]
How can I instruct wordpress to use a filename other than 'styles.css' for my main stylesheet - for example, styles-1.css? I'd like to do this for versioning and caching purposes.
`Style.css` is required for your WordPress theme. That's where WordPress gets the theme name and meta information for the Appearance >> Themes menu from. That said, you don't actually have to use `style.css` in your theme at all. I know of several readily available themes that don't use it, and I only use it in a handf...
137
<p>I've recently upgraded to WordPress 3.0, and am having a lot of problems with the autocomplete function when editing posts via 'quick edit' (e.g. /wp-admin/edit.php) - for example, editing tags. The autocomplete box often obscures the textbox I'm trying to enter text into, and sometimes gets 'left behind' once the '...
[ { "answer_id": 191, "author": "Ben Everard", "author_id": 29, "author_profile": "https://wordpress.stackexchange.com/users/29", "pm_score": 1, "selected": false, "text": "<p>You can either disable it in your browser or route around the WP source and slap this <code>autocomplete</code> at...
2010/08/11
[ "https://wordpress.stackexchange.com/questions/137", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/119/" ]
I've recently upgraded to WordPress 3.0, and am having a lot of problems with the autocomplete function when editing posts via 'quick edit' (e.g. /wp-admin/edit.php) - for example, editing tags. The autocomplete box often obscures the textbox I'm trying to enter text into, and sometimes gets 'left behind' once the 'upd...
I have a solution I tested, and it works. The autocomplete for the tags is currently done via an ajax request to the file admin-ajax.php. The solution I would suggest is to block the processing of the request so that it does not return any result. I would do : ``` function no_tag_suggest() { if( DOING_AJAX == tru...
174
<p>I need to have an alternating (even, odd...) class on posts to provide alternate highlights on a column. The best thing would be to attach this to the post_class() so that it's on every instance of post_class(). Below is the code I have at this point to achieve this effect.</p> <pre><code>&lt;?php // setting othe...
[ { "answer_id": 176, "author": "artlung", "author_id": 12, "author_profile": "https://wordpress.stackexchange.com/users/12", "pm_score": 1, "selected": false, "text": "<p>This works, it passes in the additional class into <a href=\"http://codex.wordpress.org/Template_Tags/post_class\" rel...
2010/08/12
[ "https://wordpress.stackexchange.com/questions/174", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/141/" ]
I need to have an alternating (even, odd...) class on posts to provide alternate highlights on a column. The best thing would be to attach this to the post\_class() so that it's on every instance of post\_class(). Below is the code I have at this point to achieve this effect. ``` <?php // setting other variables for...
You should add the following code in `functions.php`: ``` add_filter ( 'post_class' , 'my_post_class' ); global $current_class; $current_class = 'odd'; function my_post_class ( $classes ) { global $current_class; $classes[] = $current_class; $current_class = ($current_class == 'odd') ? 'even' : 'odd'; ...
175
<p>Use case:</p> <p>I have a post type that relates to a music show. The 'show time' is grabbed through the post publish date which is set to some time in the future. I've found a function that takes future dated blog posts and leaves the date but marks the post as published on save but haven't been able to figure how...
[ { "answer_id": 203, "author": "Jan Fabry", "author_id": 8, "author_profile": "https://wordpress.stackexchange.com/users/8", "pm_score": 2, "selected": false, "text": "<p>I think this action gets called by <a href=\"http://core.trac.wordpress.org/browser/branches/3.0/wp-includes/post.php#...
2010/08/12
[ "https://wordpress.stackexchange.com/questions/175", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/141/" ]
Use case: I have a post type that relates to a music show. The 'show time' is grabbed through the post publish date which is set to some time in the future. I've found a function that takes future dated blog posts and leaves the date but marks the post as published on save but haven't been able to figure how to custom...
Awesome combining both the answers from Mike and Jan I came up with this which works only on the post type in question. We don't need the conditional of show because the 'future\_show' hook only grabs the post type of show and updates that. ``` <?php function setup_future_hook() { // Replace native future_...
194
<p>I would like to have a single post on my front page (always the latest), but let normal paging work. So the front page has post 1, the next page should have post 2-11 (1-10 is fine too), then 12-21 or 11-20, and so on. I know I can <a href="https://wordpress.stackexchange.com/questions/21/show-a-different-number-of-...
[ { "answer_id": 198, "author": "Hinek", "author_id": 154, "author_profile": "https://wordpress.stackexchange.com/users/154", "pm_score": 2, "selected": false, "text": "<p>Ok, maybe this is a strange or complicated way to do this, but I had a similar problem (I wanted to display a welcome ...
2010/08/12
[ "https://wordpress.stackexchange.com/questions/194", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/8/" ]
I would like to have a single post on my front page (always the latest), but let normal paging work. So the front page has post 1, the next page should have post 2-11 (1-10 is fine too), then 12-21 or 11-20, and so on. I know I can [change the number of posts depending on the context](https://wordpress.stackexchange.co...
I solved it using [the `offset` query parameter](http://core.trac.wordpress.org/browser/branches/3.0/wp-includes/query.php#L2327). This allowed me to edit the query in the `pre_get_posts` hook, and seems to be the cleanest way to do this, without a new query. Now the home page shows only one post, and `page/2/` shows p...
206
<p>In my plugin, I want to test to see if jQuery or Prototype (or both) are going to be loaded by another plugin. So, have <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script"><code>wp_enqueue_script('jquery')</code></a> or <code>wp_enqueue_script('prototype')</code> has already been called.</p> <...
[ { "answer_id": 208, "author": "Jan Fabry", "author_id": 8, "author_profile": "https://wordpress.stackexchange.com/users/8", "pm_score": 2, "selected": false, "text": "<p>To make sure your code runs after jQuery or Prototype is loaded, use the <code>$deps</code> parameter to <code>wp_enqu...
2010/08/12
[ "https://wordpress.stackexchange.com/questions/206", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/12/" ]
In my plugin, I want to test to see if jQuery or Prototype (or both) are going to be loaded by another plugin. So, have [`wp_enqueue_script('jquery')`](http://codex.wordpress.org/Function_Reference/wp_enqueue_script) or `wp_enqueue_script('prototype')` has already been called. I have code appropriate to my plugin in f...
Use `wp_script_is()` to check if a script is in the queue. ``` function add_my_scripts() { $doing_jquery = wp_script_is('jquery', 'queue'); $doing_prototype = wp_script_is('prototype', 'queue'); var_dump($doing_jquery, $doing_prototype); } add_action('wp_print_scripts', 'add_my_scripts'); ```
219
<p>what the best way to include images from the template's images folder? is it by using <code>get_bloginfo('template_url')</code>? I understood that its better to hard code the path to the images folder since this way you save function calls in PHP..</p> <p>any thoughts?</p>
[ { "answer_id": 225, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 0, "selected": false, "text": "<p>Well, it depends what kind of development you're doing. If you're doing plugin development, you need to use the f...
2010/08/12
[ "https://wordpress.stackexchange.com/questions/219", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/20/" ]
what the best way to include images from the template's images folder? is it by using `get_bloginfo('template_url')`? I understood that its better to hard code the path to the images folder since this way you save function calls in PHP.. any thoughts?
The easiest and simplest way to do it is define a unique variable in your theme's `functions.php` file. Such as: ``` <?php $theme_name_images = get_bloginfo('stylesheet_directory') . '/images/'; ?> ``` No need for classes as a previous answer suggested. EDIT: It should be get\_bloginfo, instead of bloginfo(), as V...
248
<p>About a month ago I started a WordPress blog on a hosted server related to a hobby. So, I am new to this at present.</p> <p>Since I'm concerned about security, one thing I did was to install the plugin WP Security Scan. According to the plugin results, my site checks out except that I get this in the results as a r...
[ { "answer_id": 254, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 0, "selected": false, "text": "<p>I always include a .htaccess file in wp-admin, even if I never put anything in it, since it negates the root dire...
2010/08/12
[ "https://wordpress.stackexchange.com/questions/248", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/6/" ]
About a month ago I started a WordPress blog on a hosted server related to a hobby. So, I am new to this at present. Since I'm concerned about security, one thing I did was to install the plugin WP Security Scan. According to the plugin results, my site checks out except that I get this in the results as a red flag: ...
***UPDATE***: When I first posted my answer I missed the crux of the question; my answer was about `.htaccess` security in general and is now listed below the double line (look down if it interests you.) Unfortunately I don't have specific experience with securing `/wp-admin/` using `.htaccess` so I'll simply list the ...
272
<p>I recently wrote my first WP plugin that adds a shortcode for embedding a custom jquery image gallery into posts. It's primarily just dumps a good chunk of HTML into the post, along with javascript necessary for initialization. </p> <p>However, I had to build the HTML output procedurally, as a string in PHP. This k...
[ { "answer_id": 274, "author": "EAMann", "author_id": 46, "author_profile": "https://wordpress.stackexchange.com/users/46", "pm_score": 2, "selected": false, "text": "<p>That depends on the type of HTML and JS.</p>\n<h3>JavaScript</h3>\n<p>First of all, separate the dynamic parts from the...
2010/08/12
[ "https://wordpress.stackexchange.com/questions/272", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/167/" ]
I recently wrote my first WP plugin that adds a shortcode for embedding a custom jquery image gallery into posts. It's primarily just dumps a good chunk of HTML into the post, along with javascript necessary for initialization. However, I had to build the HTML output procedurally, as a string in PHP. This kind of tag...
@Byran M. I tend to use two constructs I don't often see other WordPress developers using often, which surprises me, but I like them a lot. 1.) Heredocs ------------ You can store large blocks of text as [**heredocs**](http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) string...
277
<p>I'd like to show post comments on their own page without the parent post. I know I can use wp_list_comments() on the single post page and pass a callback function to use my own comment display markup. I plan to do this so I can include a link with each comment that will show that comment on it's own page.</p> <p>...
[ { "answer_id": 278, "author": "Todd Perkins", "author_id": 134, "author_profile": "https://wordpress.stackexchange.com/users/134", "pm_score": 3, "selected": true, "text": "<p>You could probably just create a new page in WordPress, and give that page a custom template. Then the url woul...
2010/08/12
[ "https://wordpress.stackexchange.com/questions/277", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/58/" ]
I'd like to show post comments on their own page without the parent post. I know I can use wp\_list\_comments() on the single post page and pass a callback function to use my own comment display markup. I plan to do this so I can include a link with each comment that will show that comment on it's own page. If this we...
You could probably just create a new page in WordPress, and give that page a custom template. Then the url would just be whatever it normally would be to get to that page. The only difference is that the custom template you are using would be setup to accept the comment\_id via the querystring, and then just get the de...
307
<p>Where can I find a list of all the WordPress hooks and over-ridable functions (pluggable, scriptable, etc)? </p> <p><strong>Edit:</strong> Plugin is <a href="https://wordpress.stackexchange.com/questions/307/where-can-i-find-a-list-of-wordpress-hooks/339#339">listed here</a>.</p>
[ { "answer_id": 310, "author": "Jan Fabry", "author_id": 8, "author_profile": "https://wordpress.stackexchange.com/users/8", "pm_score": 2, "selected": false, "text": "<p>The Codex has an <a href=\"http://codex.wordpress.org/Plugin_API/Action_Reference\" rel=\"nofollow\">Action Reference<...
2010/08/13
[ "https://wordpress.stackexchange.com/questions/307", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/172/" ]
Where can I find a list of all the WordPress hooks and over-ridable functions (pluggable, scriptable, etc)? **Edit:** Plugin is [listed here](https://wordpress.stackexchange.com/questions/307/where-can-i-find-a-list-of-wordpress-hooks/339#339).
@Arlen: As Keith S points out [Adam Brown's List of Hooks](http://adambrown.info/p/wp_hooks) is the defacto resource of hooks for WordPress. However, it's not perfect: * It doesn't show the hooks in order of when they are called, * It doesn't provide file name or line number where invoked, * It doesn't provide a numbe...
346
<p>While I've been able to get this working for normal WP categories I've been unable to get it working for custom taxonomies.</p> <p>I'd like to loop through each custom taxonomy (categories in my case) and produce a number of posts for each.</p> <p>An example of the output would be:</p> <pre><code>Category 1 post...
[ { "answer_id": 359, "author": "bueltge", "author_id": 170, "author_profile": "https://wordpress.stackexchange.com/users/170", "pm_score": -1, "selected": false, "text": "<p>Please check this example; create a own loop for your taxonomie. You can also use this in a foreach-loop to use all...
2010/08/14
[ "https://wordpress.stackexchange.com/questions/346", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/141/" ]
While I've been able to get this working for normal WP categories I've been unable to get it working for custom taxonomies. I'd like to loop through each custom taxonomy (categories in my case) and produce a number of posts for each. An example of the output would be: ``` Category 1 post from category one post from...
I thought I would provide another answer as the above one is a little hacky, also I added another layer that gets all taxonomies for a post\_type. ``` $post_type = 'post'; // Get all the taxonomies for this post type $taxonomies = get_object_taxonomies( (object) array( 'post_type' => $post_type ) ); foreach( $taxono...
351
<p>I have a plugin that, among other things, has a javascript file that requires a few user specific settings. What would be the best way to get those settings into javascript from the plugin's settings parameters?</p> <p>In other words, if I make those settings part of the settings page where the user can enter them,...
[ { "answer_id": 353, "author": "nobody", "author_id": 25, "author_profile": "https://wordpress.stackexchange.com/users/25", "pm_score": 1, "selected": false, "text": "<p>There are a couple of ways that you could do this, one of which I've done before, the other I haven't, but I have used ...
2010/08/14
[ "https://wordpress.stackexchange.com/questions/351", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/77/" ]
I have a plugin that, among other things, has a javascript file that requires a few user specific settings. What would be the best way to get those settings into javascript from the plugin's settings parameters? In other words, if I make those settings part of the settings page where the user can enter them, how would...
better is, you use the functions of WP for this, a example for multilanguage: ``` add_action( 'admin_enqueue_scripts', 'add_scripts' ); function add_scripts($where) { wp_localize_script( 'post2media', 'post2media_strings', $this->localize_vars() ); } function localize_vars() { $strings...
361
<p>Is there an API I can call, inside my plug-in, to determine the plug-in's version?</p> <p>I just want to have my plug-in emit a html comment with it's own version number ... for diagnostic purposes.</p>
[ { "answer_id": 366, "author": "Annika Backstrom", "author_id": 66, "author_profile": "https://wordpress.stackexchange.com/users/66", "pm_score": 2, "selected": false, "text": "<p>There is in the admin screens: <code>get_plugin_data()</code>. In templates, I think you will need the plugin...
2010/08/14
[ "https://wordpress.stackexchange.com/questions/361", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/38/" ]
Is there an API I can call, inside my plug-in, to determine the plug-in's version? I just want to have my plug-in emit a html comment with it's own version number ... for diagnostic purposes.
**@david**: Both @Adam Backtrom and @Viper007Bond give some good advice so I thought I'd take their advice and see if I couldn't implement something, see below. What follows iS a plugin called ***WP Active Plugins Data*** that parses the header metadata for all active plugins anytime any plugin is activated and it sto...
381
<p>I wish to create something like <a href="http://www.crunchbase.com/"><strong>CrunchBase.com</strong></a> with WordPress.org (So to have one website that is a "database", and another one, which is a blog, that connects to it).</p> <p>Is it possible? and how?</p> <p>Thanks, Tal</p>
[ { "answer_id": 382, "author": "Callan", "author_id": 181, "author_profile": "https://wordpress.stackexchange.com/users/181", "pm_score": 2, "selected": false, "text": "<p>There's no reason it can't be done, using custom post types and the appropriate templating to make it suit... but whe...
2010/08/15
[ "https://wordpress.stackexchange.com/questions/381", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/161/" ]
I wish to create something like [**CrunchBase.com**](http://www.crunchbase.com/) with WordPress.org (So to have one website that is a "database", and another one, which is a blog, that connects to it). Is it possible? and how? Thanks, Tal
**@Tal Gailili**: *Absolutely*, WordPress would be a great platform for a CrunchBase clone! Use Custom Post Type and Custom Taxonomies ------------------------------------------ What you want to look at are *Custom Post Types* and *Custom Taxonomies* [see [**this answer**](https://wordpress.stackexchange.com/questio...
390
<p>What is a plugin lifetime within a deployed instance of WordPress?</p> <p>Namely:</p> <ul> <li>do plugins modify existing files or do they only use defined extension points within WordPress?</li> <li>are plugins allowed to modify database schema (e.g. add new columns)?</li> <li>how does Wordpress make sure that pl...
[ { "answer_id": 392, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 2, "selected": false, "text": "<p>Plugins in WordPress do what the code says. To answer specifically to your questions,</p>\n\n<ol>\n<li>They shoul...
2010/08/16
[ "https://wordpress.stackexchange.com/questions/390", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/155/" ]
What is a plugin lifetime within a deployed instance of WordPress? Namely: * do plugins modify existing files or do they only use defined extension points within WordPress? * are plugins allowed to modify database schema (e.g. add new columns)? * how does Wordpress make sure that plugin uninstall always leaves WP in ...
Short answer: * Plugins do not modify existing files, they hook into WordPress via an exposed API. * Plugins can modify database schema. * Plugins don't have to uninstall cleanly. Plugin Hooks ============ Plugins hook into WordPress at specific point exposed by the WordPress core. <http://codex.wordpress.org/Plugi...
391
<p>By default, WordPress strips out any content that might be unescaped HTML in comments from unregistered users, which is good to protect against XSS, but it unnecessarily extends that filtering into <code>&lt;pre&gt;</code> elements too. On my blog, where almost every post generates comments that benefit from HTML c...
[ { "answer_id": 397, "author": "john010117", "author_id": 143, "author_profile": "https://wordpress.stackexchange.com/users/143", "pm_score": 1, "selected": false, "text": "<p>Although this might be a little more than you're looking for, <a href=\"http://wordpress.org/extend/plugins/wp-sy...
2010/08/16
[ "https://wordpress.stackexchange.com/questions/391", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/132/" ]
By default, WordPress strips out any content that might be unescaped HTML in comments from unregistered users, which is good to protect against XSS, but it unnecessarily extends that filtering into `<pre>` elements too. On my blog, where almost every post generates comments that benefit from HTML code snippets, that fi...
a small solution; the highlighting was in my blog via javascript ``` function pre_esc_html($content) { return preg_replace_callback( '#(<pre.*?>)(.*?)(</pre>)#imsu', create_function( '$i', 'return $i[1].esc_html($i[2]).$i[3];' ), $content ); } add_filter( 'the_content', 'pre_esc_ht...
436
<p>Is there way to have multiple WYSIWYG editors for a custom post type? For example, if I had a 2 column layout I wanted to have one editor for one column and another editor for the other.</p>
[ { "answer_id": 438, "author": "kevtrout", "author_id": 58, "author_profile": "https://wordpress.stackexchange.com/users/58", "pm_score": 0, "selected": false, "text": "<p>The default editor, tinymce, is loaded by a function in wp-admin/includes/post.php called wp_tiny_mce(); <a href=\"h...
2010/08/17
[ "https://wordpress.stackexchange.com/questions/436", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/151/" ]
Is there way to have multiple WYSIWYG editors for a custom post type? For example, if I had a 2 column layout I wanted to have one editor for one column and another editor for the other.
Say your custom post type was called `Properties`, you would add the box to hold your additional tinyMCE editor using code similar to this: ``` function register_meta_boxen() { add_meta_box("wysiwyg-editor-2", "Second Column", "second_column_box", "properties", "normal", "high"); } add_action('admin_menu',...
441
<p>So I'm using Starkers to base my next WP theme on and I've run into a small issue, I was including my own version of jQuery in the <code>header.php</code> file but when inspecting my site using Firebug I noticed jquery was being downloaded twice, I did a bit of digging and noticed that not only was I including the f...
[ { "answer_id": 442, "author": "Annika Backstrom", "author_id": 66, "author_profile": "https://wordpress.stackexchange.com/users/66", "pm_score": 4, "selected": true, "text": "<p>From the wording of your question, you must be adding scripts by writing <code>&lt;script&gt;</code> tags in y...
2010/08/17
[ "https://wordpress.stackexchange.com/questions/441", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/29/" ]
So I'm using Starkers to base my next WP theme on and I've run into a small issue, I was including my own version of jQuery in the `header.php` file but when inspecting my site using Firebug I noticed jquery was being downloaded twice, I did a bit of digging and noticed that not only was I including the file but so was...
From the wording of your question, you must be adding scripts by writing `<script>` tags in your template. Add your own scripts via [`wp_enqueue_script()`](http://codex.wordpress.org/Function_Reference/wp_enqueue_script) in your template's `functions.php`, appropriately setting dependences on jQuery, and `wp_head()` wi...
444
<p>I'm trying to set up a custom post type following <a href="http://net.tutsplus.com/tutorials/wordpress/rock-solid-wordpress-3-0-themes-using-custom-post-types/">this tutorial</a>. However, I'm a bit confused as how/where to implement <code>update_post_meta()</code>. The tutorial suggests this pattern:</p> <pre><cod...
[ { "answer_id": 445, "author": "hakre", "author_id": 178, "author_profile": "https://wordpress.stackexchange.com/users/178", "pm_score": 0, "selected": false, "text": "<p>Prior updating check whether or not the current post is of your post-type. That would ensure you don't save it for all...
2010/08/17
[ "https://wordpress.stackexchange.com/questions/444", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/119/" ]
I'm trying to set up a custom post type following [this tutorial](http://net.tutsplus.com/tutorials/wordpress/rock-solid-wordpress-3-0-themes-using-custom-post-types/). However, I'm a bit confused as how/where to implement `update_post_meta()`. The tutorial suggests this pattern: ``` add_action('save_post', 'save_my_m...
``` function save_my_metadata($ID = false, $post = false) { if($post->post_type != 'your_post_type') return; update_post_meta($ID, 'my_metadata', $_POST['my_metadata']); } ``` That should work. Just replace 'your\_post\_type' with the name of the post type. Also, little known fact: the 'save\_post' ho...
452
<p>From the WordPress support forums:</p> <blockquote> <p>Hi, this is my website <a href="http://www.mp3ojax.com" rel="nofollow">http://www.mp3ojax.com</a>. I want to insert permalinks on the images on main page</p> <p>This is the code:</p> </blockquote> <pre><code>&lt;a href="&lt;?php the_permalink() ?&gt; &l...
[ { "answer_id": 453, "author": "nobody", "author_id": 25, "author_profile": "https://wordpress.stackexchange.com/users/25", "pm_score": 3, "selected": true, "text": "<p>There isn't really enough code as an example to fully understand if there is any additional issues, but the main thing w...
2010/08/17
[ "https://wordpress.stackexchange.com/questions/452", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/172/" ]
From the WordPress support forums: > > Hi, this is my website <http://www.mp3ojax.com>. I want to insert permalinks on the images on main page > > > This is the code: > > > ``` <a href="<?php the_permalink() ?> <?php endif; ?> <?php $metadataContent = ob_get_clean(); ?> <?php if (trim($metadataContent) != ''): ...
There isn't really enough code as an example to fully understand if there is any additional issues, but the main thing which is causing the URL's to not work is the fact that the opening anchor tag is not closed. Adding a `">` to the end of the first line should fix the issue. In addition the `art-PostMetadataHeader` d...
456
<p><em>(<strong>Moderator's note:</strong> The original title was "How can I create create and use a custom template for custom post types in the Genesis theme framework?")</em></p> <p>I'm using the Genesis theme framework, with an almost completely 'stock' child theme. I have the <a href="http://wordpress.org/extend...
[ { "answer_id": 457, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 0, "selected": false, "text": "<p>Take a look at how Matt Wiebe does it in his \"Smarter Custom Post Types\" plugin:</p>\n\n<p><a href=\"http://som...
2010/08/17
[ "https://wordpress.stackexchange.com/questions/456", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/49/" ]
*(**Moderator's note:** The original title was "How can I create create and use a custom template for custom post types in the Genesis theme framework?")* I'm using the Genesis theme framework, with an almost completely 'stock' child theme. I have the [WP Easy Post Types](http://wordpress.org/extend/plugins/easy-post-...
Turns out I was wrong, Genesis does support using the `page_posttype.php` method of creating a custom template. It turned out to be very simple. Here's the contents of my page\_members.php file (located in the child theme folder): ``` <?php /* Template Name: Members */ remove_action('genesis_loop', 'genesis_do_loop')...
462
<p>The question is <em>How do I make the header on the Twenty Ten theme less tall?</em> That question was asked over at the LinkedIn WordPress group that is hidden from search engines so I thought I'd copy my answer to here. </p> <p>I've also made it a community wiki so it doesn't pass reputation to me.</p>
[ { "answer_id": 463, "author": "MikeSchinkel", "author_id": 89, "author_profile": "https://wordpress.stackexchange.com/users/89", "pm_score": 4, "selected": true, "text": "<p>To make the header on the Twenty Ten theme less tall (i.e. a height with fewer pixels) put this code at the bottom...
2010/08/17
[ "https://wordpress.stackexchange.com/questions/462", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/89/" ]
The question is *How do I make the header on the Twenty Ten theme less tall?* That question was asked over at the LinkedIn WordPress group that is hidden from search engines so I thought I'd copy my answer to here. I've also made it a community wiki so it doesn't pass reputation to me.
To make the header on the Twenty Ten theme less tall (i.e. a height with fewer pixels) put this code at the bottom of your theme's "`functions.php`" file (being sure to change the number `180` to whatever height you want): ``` <?php add_action('twentyten_header_image_height','yoursite_header_image_height'); functio...
468
<p>I've got a project where I need to build a store locator for a client. </p> <p>I'm using a custom post type "<code>restaurant-location</code>" and I have written the code to geocode the addresses stored in postmeta using the <a href="http://code.google.com/apis/maps/documentation/geocoding/" rel="nofollow">Google G...
[ { "answer_id": 470, "author": "hakre", "author_id": 178, "author_profile": "https://wordpress.stackexchange.com/users/178", "pm_score": 0, "selected": false, "text": "<p>Just pre-calculate the distances between all entities. I would store that into a database table on it's own, with the ...
2010/08/17
[ "https://wordpress.stackexchange.com/questions/468", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/89/" ]
I've got a project where I need to build a store locator for a client. I'm using a custom post type "`restaurant-location`" and I have written the code to geocode the addresses stored in postmeta using the [Google Geocoding API](http://code.google.com/apis/maps/documentation/geocoding/) (heres the link that [geocodes...
What precision do you need? if it's a state/national wide search maybe you could do a lat-lon to zip lookup and have precomputed distance from zip area to zip area of the restaurant. If you need accurate distances that won't be a good option. You should look into a [**Geohash**](http://en.wikipedia.org/wiki/Geohash) s...
477
<p>I'm using the following template code to display attachment links:</p> <pre><code>$args = array( 'post_type' =&gt; 'attachment', 'numberposts' =&gt; -1, 'post_status' =&gt; null, 'post_parent' =&gt; $main_post_id ); $attachments = get_posts($args); foreach ($attachments as $attachment) { the_a...
[ { "answer_id": 479, "author": "Joe Hoyle", "author_id": 150, "author_profile": "https://wordpress.stackexchange.com/users/150", "pm_score": 7, "selected": true, "text": "<p>As far as I know, WordPress has nothing built in for this, I would just do:</p>\n\n<p><code>filesize( get_attached_...
2010/08/18
[ "https://wordpress.stackexchange.com/questions/477", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/119/" ]
I'm using the following template code to display attachment links: ``` $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $main_post_id ); $attachments = get_posts($args); foreach ($attachments as $attachment) { the_attachment_link($attachment...
As far as I know, WordPress has nothing built in for this, I would just do: `filesize( get_attached_file( $attachment->ID ) );`
487
<p>Is there anyway to create blogs with 2 depths using multisite? I want to have an installation in root and blogs with 2 depths. Something like:</p> <pre><code>/ - WP installation: root aggregate /foo - WP installation: aggregate for a topic /foo/item - WP installation: blog for an item </code></pre> <...
[ { "answer_id": 492, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 1, "selected": false, "text": "<p>I don't think Multisite allows multi-depth sites (like, a child site of a site?), but there's no reason you can't...
2010/08/18
[ "https://wordpress.stackexchange.com/questions/487", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/88/" ]
Is there anyway to create blogs with 2 depths using multisite? I want to have an installation in root and blogs with 2 depths. Something like: ``` / - WP installation: root aggregate /foo - WP installation: aggregate for a topic /foo/item - WP installation: blog for an item ``` Trouble is that multisit...
Answering your first question, yes it is absolutely possible to have one installation of WordPress running 'within' another (i.e. installed at example.com and example.com/child). I have something like that running right now.
496
<p>I am using <code>register_taxonomy_for_object_type()</code> to add the Category taxonomy field to Media uploads (attachments). I'm using this code to do so:</p> <pre><code>add_action('init', 'reg_tax'); function reg_tax() { register_taxonomy_for_object_type('category', 'attachment'); } </code></pre> <p>This wor...
[ { "answer_id": 497, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 1, "selected": false, "text": "<p>This is difficult/complicated if you want to use WordPress' default category box. For one thing, the metabox does...
2010/08/18
[ "https://wordpress.stackexchange.com/questions/496", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/184/" ]
I am using `register_taxonomy_for_object_type()` to add the Category taxonomy field to Media uploads (attachments). I'm using this code to do so: ``` add_action('init', 'reg_tax'); function reg_tax() { register_taxonomy_for_object_type('category', 'attachment'); } ``` This works and adds a simple text field for C...
**Edit: 12/09/2017 See this answer for a more up to date solution to this:** [How to use taxonomies on attachments with the new Media Library?](https://wordpress.stackexchange.com/questions/76720/how-to-use-taxonomies-on-attachments-with-the-new-media-library) I'm going to answer my own question here as I have managed...
500
<p><em><strong>Disclaimer:</em></strong> I am brand spanking new to WP. </p> <p>I am using the <a href="http://nathanstaines.com/archive/starkers-html5-v3" rel="noreferrer">Starkers HTML5 framework theme</a>. In the <code>functions.php</code> I see this code:</p> <pre><code>function starkers_widgets_init() { // Ar...
[ { "answer_id": 501, "author": "john010117", "author_id": 143, "author_profile": "https://wordpress.stackexchange.com/users/143", "pm_score": 4, "selected": true, "text": "<p>You just call <a href=\"http://codex.wordpress.org/Function_Reference/get_sidebar\"><code>get_sidebar()</code></a>...
2010/08/18
[ "https://wordpress.stackexchange.com/questions/500", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/193/" ]
***Disclaimer:*** I am brand spanking new to WP. I am using the [Starkers HTML5 framework theme](http://nathanstaines.com/archive/starkers-html5-v3). In the `functions.php` I see this code: ``` function starkers_widgets_init() { // Area 1, located at the top of the sidebar. register_sidebar( array( 'name' =...
You just call [`get_sidebar()`](http://codex.wordpress.org/Function_Reference/get_sidebar) from `index.php` and it loads the theme file `sidebar.php`. [`register_sidebar()`](http://codex.wordpress.org/Function_Reference/register_sidebar), on the other hand, is used for widgets where plugins and such want to dynamicall...
515
<p>After a certain amount of time WP logs out all users and forces them to log back in again. For development environments on my local machine this is obnoxious and absolutely unnecessary.</p> <p>Is there an API-driven way of disabling the auto-logout indefinitely? Ideally I'd like something I can add to <code>wp-conf...
[ { "answer_id": 516, "author": "curtismchale", "author_id": 141, "author_profile": "https://wordpress.stackexchange.com/users/141", "pm_score": 2, "selected": false, "text": "<p>This has more to do with how you're browser stores cookies. When you login it should be saving the cookie and W...
2010/08/18
[ "https://wordpress.stackexchange.com/questions/515", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/175/" ]
After a certain amount of time WP logs out all users and forces them to log back in again. For development environments on my local machine this is obnoxious and absolutely unnecessary. Is there an API-driven way of disabling the auto-logout indefinitely? Ideally I'd like something I can add to `wp-config.php` along w...
By default, the "Remember Me" checkbox makes you get remembered for 14 days. This is filterable though. This code will change that value: ``` add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' ); function keep_me_logged_in_for_1_year( $expirein ) { return 31556926; // 1 year in seconds } ```
531
<p>Previously, I was able to selectively load child pages for a currently-selected parent page using logic such as:</p> <pre><code>if( $post-&gt;post_parent ) { $children = wp_list_pages("title_li=&amp;child_of=".$post-&gt;post_parent."&amp;echo=0"); } else { $children = wp_list_pages("title_li=&amp;child_of=".$p...
[ { "answer_id": 537, "author": "jessegavin", "author_id": 193, "author_profile": "https://wordpress.stackexchange.com/users/193", "pm_score": 4, "selected": true, "text": "<p>I created a Widget named Page Sub Navigation (clever I know) that is working for me.</p>\n\n<p>If you install this...
2010/08/18
[ "https://wordpress.stackexchange.com/questions/531", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/61/" ]
Previously, I was able to selectively load child pages for a currently-selected parent page using logic such as: ``` if( $post->post_parent ) { $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); } else { $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); } if ($chil...
I created a Widget named Page Sub Navigation (clever I know) that is working for me. If you install this, you can just drag the widget to one of your widget areas and ***BAM*** it works. ``` <?php /* Plugin Name: Page Sub Navigation Plugin URI: http://codegavin.com/wordpress/sub-nav Description: Displays a list of ch...
535
<p>I have a standard dynamic sidebar using <code>register_sidebar</code> and <code>dynamic_sidebar</code> and I need the last widget in the sidebar (which will not have a set number of widgets) to have a distinct class (<code>'last_widget'</code>) added to the <code>&lt;li&gt;</code> that wraps it. What's the best way ...
[ { "answer_id": 540, "author": "MikeSchinkel", "author_id": 89, "author_profile": "https://wordpress.stackexchange.com/users/89", "pm_score": 4, "selected": true, "text": "<p>Hi <strong>John</strong>:</p>\n\n<p>I think this is what you are looking for (I'd explain the code be I think it's...
2010/08/18
[ "https://wordpress.stackexchange.com/questions/535", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/11/" ]
I have a standard dynamic sidebar using `register_sidebar` and `dynamic_sidebar` and I need the last widget in the sidebar (which will not have a set number of widgets) to have a distinct class (`'last_widget'`) added to the `<li>` that wraps it. What's the best way to do this?
Hi **John**: I think this is what you are looking for (I'd explain the code be I think it's self-explanatory; let me know if not): ``` <?php add_filter('dynamic_sidebar_params','my_dynamic_sidebar_params'); function my_dynamic_sidebar_params($params) { $sidebar_id = $params[0]['id']; $sidebar_widgets = wp_get...
536
<p>I have a 3.0.1 site with <code>MULTISITE</code> enabled and would like one of the sites to live at <code>/blog</code>, but when I try to create a new site with that path, I get this error:</p> <pre><code>The following words are reserved for use by WordPress functions and cannot be used as blog names: page, comments...
[ { "answer_id": 538, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 3, "selected": true, "text": "<p>You can't.</p>\n\n<p>That's part of the main site's permalink structure. There's no way to get around it. You can ...
2010/08/18
[ "https://wordpress.stackexchange.com/questions/536", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/210/" ]
I have a 3.0.1 site with `MULTISITE` enabled and would like one of the sites to live at `/blog`, but when I try to create a new site with that path, I get this error: ``` The following words are reserved for use by WordPress functions and cannot be used as blog names: page, comments, blog, files, feed ``` How can I ...
You can't. That's part of the main site's permalink structure. There's no way to get around it. You can find more information here: <http://core.trac.wordpress.org/ticket/13527>
556
<p>I've already added my scripts, but I wanted to know the preferred way.<br> I just put a <code>&lt;script&gt;</code> tag directly in the <code>header.php</code> of my template.</p> <p>Is there a preferred method of inserting external or custom js files?<br> How would I bind a js file to a single page? (I have the ho...
[ { "answer_id": 562, "author": "MikeSchinkel", "author_id": 89, "author_profile": "https://wordpress.stackexchange.com/users/89", "pm_score": 7, "selected": true, "text": "<h2>Use <code>wp_enqueue_script()</code> in your theme</h2>\n\n<p>The basic answer is to use <a href=\"http://codex.w...
2010/08/19
[ "https://wordpress.stackexchange.com/questions/556", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/255/" ]
I've already added my scripts, but I wanted to know the preferred way. I just put a `<script>` tag directly in the `header.php` of my template. Is there a preferred method of inserting external or custom js files? How would I bind a js file to a single page? (I have the home page in mind)
Use `wp_enqueue_script()` in your theme --------------------------------------- The basic answer is to use [`wp_enqueue_script()`](http://codex.wordpress.org/Function_Reference/wp_enqueue_script) in an `wp_enqueue_scripts` hook for front end `admin_enqueue_scripts` for admin. It might look something like this (which a...
558
<p>I didn't know this site exists. So, I asked it on <a href="https://webapps.stackexchange.com/questions/5539/how-to-prevent-plugin-theme-installation-failures-on-wordpress">WebApps</a></p> <p>I didn't get a solution still. :-(</p> <hr> <p>I am unable to install any theme/plugin to my WordPress 3.0</p> <pre><code>...
[ { "answer_id": 563, "author": "hakre", "author_id": 178, "author_profile": "https://wordpress.stackexchange.com/users/178", "pm_score": 2, "selected": true, "text": "<p>It's either the configuration of the path where WordPress is installed (you don't have the right path setup) or if the ...
2010/08/19
[ "https://wordpress.stackexchange.com/questions/558", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/258/" ]
I didn't know this site exists. So, I asked it on [WebApps](https://webapps.stackexchange.com/questions/5539/how-to-prevent-plugin-theme-installation-failures-on-wordpress) I didn't get a solution still. :-( --- I am unable to install any theme/plugin to my WordPress 3.0 ``` Downloading install package from http://...
It's either the configuration of the path where WordPress is installed (you don't have the right path setup) or if the path is correct, you don't have got enough permissions to modify the file system. So as this answer is very broad, that's because it is of a very technical nature that is bound to your concrete hostin...
566
<p>I did some quick looking around, but my PHP skills are pretty nascent. I am sure there is just a package that needs installing.</p> <p>Edit to add additional information about the setup:</p> <p>Using:</p> <pre><code>yum info php </code></pre> <p>I get the version of PHP as 5.1.6:</p> <pre><code>Name : ph...
[ { "answer_id": 568, "author": "Annika Backstrom", "author_id": 66, "author_profile": "https://wordpress.stackexchange.com/users/66", "pm_score": 1, "selected": false, "text": "<p><code>wp-admin/options-general.php</code> outputs the following error message:</p>\n\n<blockquote>\n <p>Unfo...
2010/08/19
[ "https://wordpress.stackexchange.com/questions/566", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/272/" ]
I did some quick looking around, but my PHP skills are pretty nascent. I am sure there is just a package that needs installing. Edit to add additional information about the setup: Using: ``` yum info php ``` I get the version of PHP as 5.1.6: ``` Name : php Arch : i386 Version : 5.1.6 ``` More in...
Upgrade to PHP 5.2 or above =========================== The Error Message you see is by WordPress. It's very misleading what it basically saying is, that you need a PHP version >= 5.2 for that feature to work. Please look into your operating systems documentation or contact technical support on how to update your PHP...
569
<p>I am trying to use tips from <strong><a href="https://wordpress.stackexchange.com/questions/556/what-is-the-best-way-to-add-custom-javascript-files-to-the-site">here</a></strong> to add my JS file.</p> <p>I put the following in the functions.php of atahualpa theme I've got installed</p> <pre><code>function lektor_...
[ { "answer_id": 571, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 4, "selected": true, "text": "<p><code>TEMPLATEPATH</code> is a directory path, not a url. You'll need to use <code>get_template_directory_uri()</c...
2010/08/19
[ "https://wordpress.stackexchange.com/questions/569", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/255/" ]
I am trying to use tips from **[here](https://wordpress.stackexchange.com/questions/556/what-is-the-best-way-to-add-custom-javascript-files-to-the-site)** to add my JS file. I put the following in the functions.php of atahualpa theme I've got installed ``` function lektor_init() { if (true) { wp_enqueue_script(...
`TEMPLATEPATH` is a directory path, not a url. You'll need to use `get_template_directory_uri()`.
578
<p>I have created a Custom Post Type called <code>'listing'</code> and added a Custom Taxonomy called <code>'businesses'</code>. I would like to add a dropdown list of Businesses to the admin list for the Listings.</p> <p>Here is what this functionality looks like in admin list for Posts <em>(I would like the same for...
[ { "answer_id": 582, "author": "MikeSchinkel", "author_id": 89, "author_profile": "https://wordpress.stackexchange.com/users/89", "pm_score": 8, "selected": true, "text": "<p><strong>UPDATE:</strong> I've included a new complete answer but even so I've left my original response at the bot...
2010/08/19
[ "https://wordpress.stackexchange.com/questions/578", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/242/" ]
I have created a Custom Post Type called `'listing'` and added a Custom Taxonomy called `'businesses'`. I would like to add a dropdown list of Businesses to the admin list for the Listings. Here is what this functionality looks like in admin list for Posts *(I would like the same for my Custom Post Type):* ![Categori...
**UPDATE:** I've included a new complete answer but even so I've left my original response at the bottom to which the first few comments reference. --- Hi **@tarasm**: Although I said it shouldn't be hard it is a little involved. But before we dig into the code... The Screenshots: ================ ...let's check o...
591
<p>This is a strange question, but I want to know how I can access the Date and Time settings </p> <pre><code>Admin &gt; Settings &gt; General &gt; Date Format Admin &gt; Settings &gt; General &gt; Time Format </code></pre> <p>I am using the <a href="http://www.ama3.com/anytime">Any+Time jQuery plugin</a> as a date...
[ { "answer_id": 592, "author": "scribu", "author_id": 205, "author_profile": "https://wordpress.stackexchange.com/users/205", "pm_score": 7, "selected": true, "text": "<pre><code>get_option('date_format');\nget_option('time_format');\n</code></pre>\n" }, { "answer_id": 593, "a...
2010/08/19
[ "https://wordpress.stackexchange.com/questions/591", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/193/" ]
This is a strange question, but I want to know how I can access the Date and Time settings ``` Admin > Settings > General > Date Format Admin > Settings > General > Time Format ``` I am using the [Any+Time jQuery plugin](http://www.ama3.com/anytime) as a date/time selector for the editor view for a custom post type...
``` get_option('date_format'); get_option('time_format'); ```
596
<p>I am adding a new "Custom Post Type" named "Seminar". I am defining three custom fields</p> <ol> <li>Location</li> <li>StartTime</li> <li>EndTime</li> </ol> <p>StartTime and EndTime are going to store dates (surprise, surprise). I am wondering if there's any way to tell WordPress to treat these like dates so that ...
[ { "answer_id": 607, "author": "Joe Hoyle", "author_id": 150, "author_profile": "https://wordpress.stackexchange.com/users/150", "pm_score": 3, "selected": true, "text": "<p>Hia.</p>\n\n<p>Basically no. But, you can order by meta_value in WP_Query, so you can sort. I am not sure what form...
2010/08/19
[ "https://wordpress.stackexchange.com/questions/596", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/193/" ]
I am adding a new "Custom Post Type" named "Seminar". I am defining three custom fields 1. Location 2. StartTime 3. EndTime StartTime and EndTime are going to store dates (surprise, surprise). I am wondering if there's any way to tell WordPress to treat these like dates so that I can sort by them and stuff. I am ver...
Hia. Basically no. But, you can order by meta\_value in WP\_Query, so you can sort. I am not sure what format you are storing the dates as, but it will need to be something that MySQL can order by, a simple Unix timestamp would be fine, you would do: ``` $query = new WP_Query( 'post_type=seminar&meta_key=start_time&m...
639
<p>Does anyone have any tips for creating an image-centric custom post type?</p> <p>To elaborate, my blog has rotating header images, shown below:</p> <p><img src="https://dl.dropbox.com/u/146967/20100820.sixohthree-header.jpg" alt="Blog header showing random images"></p> <p>The two images in the top left are random...
[ { "answer_id": 641, "author": "goldenapples", "author_id": 290, "author_profile": "https://wordpress.stackexchange.com/users/290", "pm_score": 4, "selected": false, "text": "<pre><code>function register_header_image() {\n register_post_type( 'header-image', \n ...
2010/08/20
[ "https://wordpress.stackexchange.com/questions/639", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/66/" ]
Does anyone have any tips for creating an image-centric custom post type? To elaborate, my blog has rotating header images, shown below: ![Blog header showing random images](https://dl.dropbox.com/u/146967/20100820.sixohthree-header.jpg) The two images in the top left are randomized, and exist as attachments to a sp...
``` function register_header_image() { register_post_type( 'header-image', array( 'label'=>'Header Images', 'name'=>'Header Images', 'singular_name'=>'Header Image', 'publi...
646
<p>I'm trying to remove the last separator (normally a <code>&lt;br/&gt;</code> tag but I changed it to "//") from the last link from wp_list_categories.</p> <p>Basically I want this:</p> <p>Category 1 // Category 2 // Category 3 //</p> <p>to look like this:</p> <p>Category 1 // Category 2 // Category 3</p> <p>Her...
[ { "answer_id": 648, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 3, "selected": true, "text": "<p>Change the last line to this:</p>\n\n<pre><code>$output = strtr( wp_list_categories( 'include='.$cat_ids.'&amp;tit...
2010/08/20
[ "https://wordpress.stackexchange.com/questions/646", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/325/" ]
I'm trying to remove the last separator (normally a `<br/>` tag but I changed it to "//") from the last link from wp\_list\_categories. Basically I want this: Category 1 // Category 2 // Category 3 // to look like this: Category 1 // Category 2 // Category 3 Here's the current code I'm using: ``` <?php $cat_a...
Change the last line to this: ``` $output = strtr( wp_list_categories( 'include='.$cat_ids.'&title_li=&style=none&echo=0' ), array( '<br />' => ' // ' ) ); echo preg_replace( '@\s//\s\n$@', '', $output ); ```
651
<p>Going to upgrade WordPress 2.7.1 to 3.0.1 along with all plugins, any tips to do without trouble?</p> <p><strong>Edit: 7 September</strong></p> <p>Dashboard is showing "New version available" for both, WordPress version and for some plugins.</p> <p>So i want to upgrade everything. then what should be upgraded fir...
[ { "answer_id": 648, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 3, "selected": true, "text": "<p>Change the last line to this:</p>\n\n<pre><code>$output = strtr( wp_list_categories( 'include='.$cat_ids.'&amp;tit...
2010/08/20
[ "https://wordpress.stackexchange.com/questions/651", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/32/" ]
Going to upgrade WordPress 2.7.1 to 3.0.1 along with all plugins, any tips to do without trouble? **Edit: 7 September** Dashboard is showing "New version available" for both, WordPress version and for some plugins. So i want to upgrade everything. then what should be upgraded first, WordPress or plugins? And which ...
Change the last line to this: ``` $output = strtr( wp_list_categories( 'include='.$cat_ids.'&title_li=&style=none&echo=0' ), array( '<br />' => ' // ' ) ); echo preg_replace( '@\s//\s\n$@', '', $output ); ```
665
<p>I need to get the URL of my theme directory to reference an image in the theme's image/headers directory. How is this done in PHP?</p>
[ { "answer_id": 667, "author": "EAMann", "author_id": 46, "author_profile": "https://wordpress.stackexchange.com/users/46", "pm_score": 7, "selected": true, "text": "<p>This function will <em>return</em> the theme directory URL so you can use it in other functions:</p>\n\n<pre><code>get_b...
2010/08/21
[ "https://wordpress.stackexchange.com/questions/665", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/62/" ]
I need to get the URL of my theme directory to reference an image in the theme's image/headers directory. How is this done in PHP?
This function will *return* the theme directory URL so you can use it in other functions: ``` get_bloginfo('template_directory'); ``` Alternatively, this function will *echo* the theme directory URL to the browser: ``` bloginfo('template_directory'); ``` So an example for an image in the themes `images/headers` f...
689
<p>The question is "<strong><em>How do I add one or more fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?</em></strong>" This question was <a href="http://lists.automattic.com/pipermail/wp-hackers/2010-August/033671.html">asked on the wp-hackers list</a> August 1st 2010 and <a href="h...
[ { "answer_id": 7249, "author": "tpoxa", "author_id": 2592, "author_profile": "https://wordpress.stackexchange.com/users/2592", "pm_score": 5, "selected": false, "text": "<p>I added new field 'picture' (input type file) to category with help of these</p>\n\n<pre><code>add_action('category...
2010/08/22
[ "https://wordpress.stackexchange.com/questions/689", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/89/" ]
The question is "***How do I add one or more fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?***" This question was [asked on the wp-hackers list](http://lists.automattic.com/pipermail/wp-hackers/2010-August/033671.html) August 1st 2010 and [I offered a solution](http://lists.automatt...
I added new field 'picture' (input type file) to category with help of these ``` add_action('category_edit_form_fields','category_edit_form_fields'); add_action('category_edit_form', 'category_edit_form'); add_action('category_add_form_fields','category_edit_form_fields'); add_action('category_add_form','category_edit...
712
<p>I'm using the latest build of WP and would like to display the first image attached to the post at the top of the post content. What code do I have to add to single.php to make this happen?</p>
[ { "answer_id": 713, "author": "Travis Northcutt", "author_id": 49, "author_profile": "https://wordpress.stackexchange.com/users/49", "pm_score": 0, "selected": false, "text": "<p>I'm not sure how to limit it to the first attachment (and how to limit it to image attachments), but this sho...
2010/08/23
[ "https://wordpress.stackexchange.com/questions/712", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/366/" ]
I'm using the latest build of WP and would like to display the first image attached to the post at the top of the post content. What code do I have to add to single.php to make this happen?
Attachments are considered children of the post they're attached to, so this should work: ``` $images=get_children( array('post_parent'=>$post->ID, 'post_mime_type'=>'image', 'numberposts'=>1)); echo wp_get_attachment_image($images[0]->ID, 'large'); ``` for a ...
721
<p>I am running WordPress with "WPML Multilingual CMS", so that it has multiple language versions.</p> <p>In a function used with <code>add_action('template_redirect',&lt;functionname&gt;)</code>, I need to find out what the current language is. </p> <p>What should I call?</p>
[ { "answer_id": 722, "author": "Bobby Jack", "author_id": 119, "author_profile": "https://wordpress.stackexchange.com/users/119", "pm_score": 4, "selected": true, "text": "<p>I have no experience with the plugin whatsoever, but from a quick scout of their site, it looks like:</p>\n\n<pre>...
2010/08/23
[ "https://wordpress.stackexchange.com/questions/721", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/255/" ]
I am running WordPress with "WPML Multilingual CMS", so that it has multiple language versions. In a function used with `add_action('template_redirect',<functionname>)`, I need to find out what the current language is. What should I call?
I have no experience with the plugin whatsoever, but from a quick scout of their site, it looks like: ``` ICL_LANGUAGE_CODE ``` will give you the current language. Worth a try, anyway!
733
<p>Hay all, I'm playing around with WordPress 3.0 and two (2) of the new features, <em>Custom Post Types</em> and the <em>Menu Editor</em>.</p> <p>I've started off by creating a new post type called "<code>products</code>", as you've guessed, this list products.</p> <p>I'm using the bog standard template and I'm crea...
[ { "answer_id": 736, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 2, "selected": false, "text": "<p>This is not natively supported by WordPress. However, you could add this to your functions.php file and it would ...
2010/08/23
[ "https://wordpress.stackexchange.com/questions/733", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/376/" ]
Hay all, I'm playing around with WordPress 3.0 and two (2) of the new features, *Custom Post Types* and the *Menu Editor*. I've started off by creating a new post type called "`products`", as you've guessed, this list products. I'm using the bog standard template and I'm creating a new menu to replace the top nav. As...
**@dotty** As you can see by this trac ticket: [***There should be index pages for custom post types***](http://core.trac.wordpress.org/ticket/13818) so obviously the need has not yet been addressed in WordPress core. Both @John P Bloch and @Chris\_O give you good alternatives; I'm going to give you a 3rd. ### A *"P...
737
<p>I'd like to add a new area on a WordPress 3.0 site that <strong>contains a new video from YouTube each day</strong>. This video would be manually picked, and manually added each day. I'm not sure how to properly set this up though.</p> <p>My current thought-process is that I would create a category called "<em>vide...
[ { "answer_id": 736, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 2, "selected": false, "text": "<p>This is not natively supported by WordPress. However, you could add this to your functions.php file and it would ...
2010/08/23
[ "https://wordpress.stackexchange.com/questions/737", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/92/" ]
I'd like to add a new area on a WordPress 3.0 site that **contains a new video from YouTube each day**. This video would be manually picked, and manually added each day. I'm not sure how to properly set this up though. My current thought-process is that I would create a category called "*videos*," and then add a new p...
**@dotty** As you can see by this trac ticket: [***There should be index pages for custom post types***](http://core.trac.wordpress.org/ticket/13818) so obviously the need has not yet been addressed in WordPress core. Both @John P Bloch and @Chris\_O give you good alternatives; I'm going to give you a 3rd. ### A *"P...
741
<p>I have some utility categories that are only used by my theme. To help separate these categories I place them all as children of uncategorized.</p> <p>How can I make sure that any call to wp_list_categories() excludes the child categories under "uncategorized" cat_id = 1?</p> <p>I want this to work even if the cal...
[ { "answer_id": 743, "author": "EAMann", "author_id": 46, "author_profile": "https://wordpress.stackexchange.com/users/46", "pm_score": 0, "selected": false, "text": "<h3>New answer based on OP comments:</h3>\n<p>There isn't a filter or hook you can use with <code>wp_list_categories</code...
2010/08/23
[ "https://wordpress.stackexchange.com/questions/741", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/366/" ]
I have some utility categories that are only used by my theme. To help separate these categories I place them all as children of uncategorized. How can I make sure that any call to wp\_list\_categories() excludes the child categories under "uncategorized" cat\_id = 1? I want this to work even if the call wp\_list\_ca...
Hi **@Scott B**: **UPDATE FROM PRIOR ANSWER**: Due you my evidently poor reading comprehension skills(!) where I missed the requirement to filter out children (Thanks *@Adam BlackStrom* for calling attention to my oversight) I've modified the code provided. --- I think you want to use the `list_terms_exclusions` fil...
759
<p>Is there a way to have the styles on a page appear differently for certain categories, when viewing a page that is only of that category?</p>
[ { "answer_id": 760, "author": "EAMann", "author_id": 46, "author_profile": "https://wordpress.stackexchange.com/users/46", "pm_score": 1, "selected": false, "text": "<p>If you want, you can have a <a href=\"http://codex.wordpress.org/Category_Templates\" rel=\"nofollow\">different templa...
2010/08/23
[ "https://wordpress.stackexchange.com/questions/759", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/293/" ]
Is there a way to have the styles on a page appear differently for certain categories, when viewing a page that is only of that category?
@EAMann has a great answer if you want different layouts for different categories. OTOH **if you only want to change the CSS to, for example, have a different background color for each category** then you'll find that most themes will include the category slug as a CSS class on the `<body>` element and/or possibly othe...
779
<p>In this post: </p> <p><a href="http://humus101.com/?p=1734" rel="nofollow">http://humus101.com/?p=1734</a></p> <p>We've got 4 images set (in the img property) to a width of 246 pixel.</p> <p>In chrome it looks fine. In IE6 it doesn't.</p> <p>Any suggestions on how to solve this?</p>
[ { "answer_id": 781, "author": "Tal Galili", "author_id": 161, "author_profile": "https://wordpress.stackexchange.com/users/161", "pm_score": 3, "selected": true, "text": "<p>I solved the problem.</p>\n\n<p>In the style.css</p>\n\n<p>I needed to make the following change</p>\n\n<pre><code...
2010/08/23
[ "https://wordpress.stackexchange.com/questions/779", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/161/" ]
In this post: <http://humus101.com/?p=1734> We've got 4 images set (in the img property) to a width of 246 pixel. In chrome it looks fine. In IE6 it doesn't. Any suggestions on how to solve this?
I solved the problem. In the style.css I needed to make the following change ``` #content img { margin: 0; height: auto; max-width: 640px; /*width: auto;*/ } ``` I now wonder how to make that stay for all the following theme updates...
798
<p>I am using a WordPress theme which has just header and footer. I would like to continue using it by changing the width and adding side bars.</p> <p>Could anyone help me to change the width (to fit to the screen) of the theme. Does anybody have an idea on how to add sidebars to this theme?</p> <p>==========</p> <p...
[ { "answer_id": 810, "author": "hannit cohen", "author_id": 395, "author_profile": "https://wordpress.stackexchange.com/users/395", "pm_score": 1, "selected": false, "text": "<p>There are several ways to do that:</p>\n\n<ol>\n<li>Include a page (that does not appear in the menu)</li>\n<li...
2010/08/24
[ "https://wordpress.stackexchange.com/questions/798", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/391/" ]
I am using a WordPress theme which has just header and footer. I would like to continue using it by changing the width and adding side bars. Could anyone help me to change the width (to fit to the screen) of the theme. Does anybody have an idea on how to add sidebars to this theme? ========== Sorry for not making cl...
You can but I think it's far more easier for you theme to add a sidebar and then place a text-widget (or any other widget) inside there because that's far more flexible. What you describe I did for some sites longer ago. You can just load the post and display it. I used [`query_posts()`](http://codex.wordpress.org/Fun...
805
<p>Let's say I'm doing a site about cars, and in the main content area of a Page (using a certain template), there are a few paragraphs about a particular car.</p> <p>In the sidebar, are several standard widgets. But I also want a widget with an 'info panel' about the particular car.</p> <p>So what's the sanest way o...
[ { "answer_id": 811, "author": "hannit cohen", "author_id": 395, "author_profile": "https://wordpress.stackexchange.com/users/395", "pm_score": 2, "selected": false, "text": "<p>There are some plugins that enable you to do that. <a href=\"http://wordpress.org/extend/plugins/widget-context...
2010/08/24
[ "https://wordpress.stackexchange.com/questions/805", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/394/" ]
Let's say I'm doing a site about cars, and in the main content area of a Page (using a certain template), there are a few paragraphs about a particular car. In the sidebar, are several standard widgets. But I also want a widget with an 'info panel' about the particular car. So what's the sanest way of putting in a pe...
You want the [**Widget Logic Plugin**](http://wordpress.org/extend/plugins/widget-logic/) if you're going to use widgets to do this. However, as you have guessed, this is not the best way to do this. I think the best way to achieve what you want to do is to create a custom widget that accesses the posts information if ...
813
<p>I am trying to make a "contributors" page where there is a list of authors and the categories they have posted in.</p> <p>I am able to use this code to do this for a single author on a single post page:</p> <pre><code> &lt;?php $cat_array = array(); $args=array( 'author' =&gt; get_the_author_meta('...
[ { "answer_id": 814, "author": "hakre", "author_id": 178, "author_profile": "https://wordpress.stackexchange.com/users/178", "pm_score": 1, "selected": false, "text": "<p>You try to debug your PHP script here via the community. The best thing you can do with PHP issues is to find the root...
2010/08/24
[ "https://wordpress.stackexchange.com/questions/813", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/325/" ]
I am trying to make a "contributors" page where there is a list of authors and the categories they have posted in. I am able to use this code to do this for a single author on a single post page: ``` <?php $cat_array = array(); $args=array( 'author' => get_the_author_meta('id'), 'showposts'=>-1,...
Seemed interesting, so here is my version. Not sure about `get_user_by()`, should be more robust way to get objects for authors. ``` function my_list_authors() { $authors = wp_list_authors( array( 'exclude_admin' => false, 'html' => false, 'echo' => false ) ); $authors = explode( ',', $author...
819
<p>I have some users who are posting to a group blog and are able to cut-and-paste but their pastes include things like:</p> <pre><code>&lt;!– /* Font Definitions */ @font-face {font-family:”Cambria Math”; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-...
[ { "answer_id": 821, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 3, "selected": false, "text": "<p>I'd suggest using Ozh's <a href=\"http://wordpress.org/extend/plugins/tinymce-advanced/\" rel=\"nofollow\">TinyMC...
2010/08/24
[ "https://wordpress.stackexchange.com/questions/819", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/12/" ]
I have some users who are posting to a group blog and are able to cut-and-paste but their pastes include things like: ``` <!– /* Font Definitions */ @font-face {font-family:”Cambria Math”; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; m...
There is a button on the visual text editor built in to WordPress that will strip Microsoft Word formating. It is labeled "Paste From Word" ![alt text](https://i.stack.imgur.com/77SR2.png)
830
<p>How can you have it so that the site's home page will only show the first X (let's say 300) words of the post?</p> <p>But without using "more" tag, or hand filled excerpts? I am looking for a plugin/hack for WP 2.9 and onward.</p> <p>I came across several solutions so far, but am hoping for a recommended solution...
[ { "answer_id": 832, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 3, "selected": true, "text": "<p>Changing the word count on the home page is easy:</p>\n\n<pre><code>if( is_home() )\n add_filter( 'excerpt_length...
2010/08/24
[ "https://wordpress.stackexchange.com/questions/830", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/161/" ]
How can you have it so that the site's home page will only show the first X (let's say 300) words of the post? But without using "more" tag, or hand filled excerpts? I am looking for a plugin/hack for WP 2.9 and onward. I came across several solutions so far, but am hoping for a recommended solution. Challenges I ca...
Changing the word count on the home page is easy: ``` if( is_home() ) add_filter( 'excerpt_length', create_function( '', 'return 300;' ) ); ``` Just replicate that code and change the conditional check to add this to other pages. The other option is to just insert the code on the template page (`home.php`, `tag.ph...
841
<p>If I have a couple of different Page templates, how would I show a different collection of sidebar widgets for each of these templates? I'm using the Starkers theme as a starting point.</p>
[ { "answer_id": 843, "author": "Joshua Lynch", "author_id": 399, "author_profile": "https://wordpress.stackexchange.com/users/399", "pm_score": 4, "selected": true, "text": "<p>You will need to create more sidebars in your functions.php file and then edit the page templates to call the si...
2010/08/24
[ "https://wordpress.stackexchange.com/questions/841", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/394/" ]
If I have a couple of different Page templates, how would I show a different collection of sidebar widgets for each of these templates? I'm using the Starkers theme as a starting point.
You will need to create more sidebars in your functions.php file and then edit the page templates to call the sidebar you want. **Adding sidebars** Go in to your functions.php file. You should see some sidebars already being registered. The code will look something like this: ``` //Adds default sidebar if ( functio...
844
<p>Is there a way to draw the categories listing and highlight the current category being viewed?</p> <p>In addition, it would be great to highlight the current category if a post or page that's assigned to it is being viewed.</p> <p>Any help much appreciated...</p> <p>Here's my current code (I'm excluding the defau...
[ { "answer_id": 847, "author": "Travis Northcutt", "author_id": 49, "author_profile": "https://wordpress.stackexchange.com/users/49", "pm_score": 0, "selected": false, "text": "<p>My first inclination is that you'd need to somehow apply a different class to the \"current\" category and th...
2010/08/24
[ "https://wordpress.stackexchange.com/questions/844", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/366/" ]
Is there a way to draw the categories listing and highlight the current category being viewed? In addition, it would be great to highlight the current category if a post or page that's assigned to it is being viewed. Any help much appreciated... Here's my current code (I'm excluding the default "uncategorized" categ...
The [Wordpress Codex for the wp\_list\_categories tag](http://codex.wordpress.org/Template_Tags/wp_list_categories) is actually pretty helpful here - Wordpress is already assigning a class to the < li > tag of the current category. At that point you just need to add an entry to your theme's .css file to apply whatever...
852
<p>Let's say I have a website about different types of cars. The structure is a little like this:</p> <pre><code>-Home -Cars (shows a submenu with a list of cars, ie Volvo 850, Porsche 911 ) -Volvo 850 overview (the page you get when you click Volvo 850 on the Car page) -Volvo 850 tech spec (the three Volvo pages ar...
[ { "answer_id": 848, "author": "Chris_O", "author_id": 251, "author_profile": "https://wordpress.stackexchange.com/users/251", "pm_score": 2, "selected": true, "text": "<p>Your best option for a form plugin is <a href=\"http://www.gravityforms.com/category/features/\" rel=\"nofollow\">Gra...
2010/08/24
[ "https://wordpress.stackexchange.com/questions/852", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/394/" ]
Let's say I have a website about different types of cars. The structure is a little like this: ``` -Home -Cars (shows a submenu with a list of cars, ie Volvo 850, Porsche 911 ) -Volvo 850 overview (the page you get when you click Volvo 850 on the Car page) -Volvo 850 tech spec (the three Volvo pages are shown as sub...
Your best option for a form plugin is [Gravity Forms](http://www.gravityforms.com/category/features/). It has the ability to create multiple choice options via a drop down or check box and you can use conditional logic that will display fields based on choices in previous fields. I highly recommend it.
858
<p>(note: this question was originally about Custom Fields, but @MikeSchinkel had a better solution involving Custom Post Types)</p> <p>On my site I have several pages which I want to show the same data in the sidebar. For instance, in a structure like this:</p> <pre><code>-Home -Cars -Volvo 850 overview -Volvo 8...
[ { "answer_id": 862, "author": "goldenapples", "author_id": 290, "author_profile": "https://wordpress.stackexchange.com/users/290", "pm_score": 1, "selected": false, "text": "<p>I think someone might have already kind of answered this on the other question you posted (about parent pages /...
2010/08/24
[ "https://wordpress.stackexchange.com/questions/858", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/394/" ]
(note: this question was originally about Custom Fields, but @MikeSchinkel had a better solution involving Custom Post Types) On my site I have several pages which I want to show the same data in the sidebar. For instance, in a structure like this: ``` -Home -Cars -Volvo 850 overview -Volvo 850 tech spec -Volvo...
UPDATE: ------- Based upon the update of the question I think I need to explicitly state that what is asked in the question can be done with the answer below, just used custom fields in the *"Car"* custom post type for each of the items you want displayed on all pages for a given car. If you want to do it simply jus...
891
<p>So today I started work on my first Wordpress theme and so far it's been a lot of fun. However, I have had difficulty in getting wp_nav_menu() to do what I want.</p> <p>Here's what I want:</p> <pre><code>&lt;nav id="topnav" class="menu"&gt; &lt;ul&gt; &lt;li class="current_page_item"&gt;&lt;a href="#" ti...
[ { "answer_id": 893, "author": "EAMann", "author_id": 46, "author_profile": "https://wordpress.stackexchange.com/users/46", "pm_score": 1, "selected": false, "text": "<p>First of all, you won't be able to get WordPress to output any kind of <code>&lt;nav&gt;</code> element using native fu...
2010/08/25
[ "https://wordpress.stackexchange.com/questions/891", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/408/" ]
So today I started work on my first Wordpress theme and so far it's been a lot of fun. However, I have had difficulty in getting wp\_nav\_menu() to do what I want. Here's what I want: ``` <nav id="topnav" class="menu"> <ul> <li class="current_page_item"><a href="#" title="Home">Home</a></li> <li class=...
i had the save problem: it's because if you don't create the menu in the admin wordpress use a fallback method and creates the menu out of all active pages ... and if this happens than the options from wp\_nav\_menu are not used ... so: just create the menu in the admin and u can change the wrapper-tag to "nav"
894
<p>Using Wordpress 3, creating write panels with Magic Fields, how do I add custom fields to my RSS feed?</p> <p>For example, I have an 'image of the day' write panel, with a custom field for the photo credit. How can I include all that as part of my feed?</p> <p>Thanks.</p>
[ { "answer_id": 896, "author": "hakre", "author_id": 178, "author_profile": "https://wordpress.stackexchange.com/users/178", "pm_score": 0, "selected": false, "text": "<p>You can hook into your feed with the according filters and then add your stuff.</p>\n\n<p>Basically <a href=\"http://c...
2010/08/25
[ "https://wordpress.stackexchange.com/questions/894", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/167/" ]
Using Wordpress 3, creating write panels with Magic Fields, how do I add custom fields to my RSS feed? For example, I have an 'image of the day' write panel, with a custom field for the photo credit. How can I include all that as part of my feed? Thanks.
you can use something like this ``` function feed_magic_fields( $content ) { global $post, $id; if ( !is_feed() ) return $content; // is feed $date = get('date_event'); if( $date) $content .= $date return $content; } add_filter( 'the_content', 'feed_magic_fields' ); ```
895
<p>what is option_name on database that store the information of current initiate widget in frontend sidebar ?</p>
[ { "answer_id": 896, "author": "hakre", "author_id": 178, "author_profile": "https://wordpress.stackexchange.com/users/178", "pm_score": 0, "selected": false, "text": "<p>You can hook into your feed with the according filters and then add your stuff.</p>\n\n<p>Basically <a href=\"http://c...
2010/08/25
[ "https://wordpress.stackexchange.com/questions/895", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/365/" ]
what is option\_name on database that store the information of current initiate widget in frontend sidebar ?
you can use something like this ``` function feed_magic_fields( $content ) { global $post, $id; if ( !is_feed() ) return $content; // is feed $date = get('date_event'); if( $date) $content .= $date return $content; } add_filter( 'the_content', 'feed_magic_fields' ); ```
907
<p>I have 3 categories with each 15 posts, I want to do ONE query to the db bringing only 5 first posts for each category, how can I do it?</p> <pre><code>$q = new WP_Query(array( 'post__in' =&gt; array(2,4,8), 'posts_per_page' =&gt; **FIRST_5_OF_EACH_CAT** )); </code></pre> <p>In case its not possible, what is more...
[ { "answer_id": 908, "author": "Bernard Chen", "author_id": 182, "author_profile": "https://wordpress.stackexchange.com/users/182", "pm_score": 0, "selected": false, "text": "<p>I don't know of a way to get the first five posts for each of the categories in a single query. If you're ever ...
2010/08/25
[ "https://wordpress.stackexchange.com/questions/907", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/20/" ]
I have 3 categories with each 15 posts, I want to do ONE query to the db bringing only 5 first posts for each category, how can I do it? ``` $q = new WP_Query(array( 'post__in' => array(2,4,8), 'posts_per_page' => **FIRST_5_OF_EACH_CAT** )); ``` In case its not possible, what is more efficient, getting all the posts...
What you want is possible but will require you to delve into **SQL which I like to avoid whenever possible** (not because I don't know it, I'm an advance SQL developer, but because **in WordPress you want to use the API whenever possible** to minimize future compatibility problems related to future potential database s...
951
<p>I'm at a loss with this. Do you see anything wrong with the code below specific to the noindex, nofollow checkboxes? The meta box gets drawn to the screen fine, but the values do not stick.</p> <p>The code for the custom page title and custom excerpt works fine.</p> <pre><code>// =================== // = POST OPTI...
[ { "answer_id": 945, "author": "Annika Backstrom", "author_id": 66, "author_profile": "https://wordpress.stackexchange.com/users/66", "pm_score": 4, "selected": true, "text": "<p>To slightly sidestep your actual question, the <a href=\"http://codex.wordpress.org/Template_Hierarchy#Visual_...
2010/08/26
[ "https://wordpress.stackexchange.com/questions/951", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/366/" ]
I'm at a loss with this. Do you see anything wrong with the code below specific to the noindex, nofollow checkboxes? The meta box gets drawn to the screen fine, but the values do not stick. The code for the custom page title and custom excerpt works fine. ``` // =================== // = POST OPTION BOX = // =========...
To slightly sidestep your actual question, the [template hierarchy](http://codex.wordpress.org/Template_Hierarchy#Visual_Overview) allows you to have a custom handler for any post ID, category, taxonomy term, etc. That may be the quickest way to solve your problem: just create a template file that stands on its own and...
958
<p>The following snippet is from a sidebar widget that lists "recent posts". Since its on the home page and I feature my lastest sticky post prominently on that page, I want to skip over the sticky in this loop. However, the <code>post_not_in=sticky_posts</code> has no effect.</p> <pre><code>&lt;?php $the_query = ...
[ { "answer_id": 961, "author": "Travis Northcutt", "author_id": 49, "author_profile": "https://wordpress.stackexchange.com/users/49", "pm_score": 1, "selected": false, "text": "<p>If you want to exclude all sticky posts from a query, use</p>\n\n<p><code>query_posts(array(\"post__not_in\" ...
2010/08/27
[ "https://wordpress.stackexchange.com/questions/958", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/366/" ]
The following snippet is from a sidebar widget that lists "recent posts". Since its on the home page and I feature my lastest sticky post prominently on that page, I want to skip over the sticky in this loop. However, the `post_not_in=sticky_posts` has no effect. ``` <?php $the_query = new WP_Query("showposts=$num...
I took *@tnorthcutt's* answer from [**WordPress' Codex on `query_posts()` about Sticky Parameters**](http://codex.wordpress.org/Function_Reference/query_posts#Sticky_Post_Parameters) and created a tandalone example you can drop as `test.php` into your website's root and see it run by navigating to a URL like this, with...
960
<p>Some WordPress themes have their links encrypted in the footer and I am not able to edit them if I want to edit the links. This is the example code I found:</p> <blockquote> <p><code>&lt;?php</code> <code>eval(base64_decode('Pz4gCQkNCg0KCQk8ZGl2IGNsYXNzPSJjbGVhciI+PC9kaXY+DQoNCgkNCg0KCTwvZGl2Pg0KDQoJPCEtLSAvTWF...
[ { "answer_id": 964, "author": "John P Bloch", "author_id": 11, "author_profile": "https://wordpress.stackexchange.com/users/11", "pm_score": 4, "selected": true, "text": "<p>Well, this is the output from that function:</p>\n\n<pre><code>?&gt; \n\n &lt;div class=\"clear\"&gt;&...
2010/08/27
[ "https://wordpress.stackexchange.com/questions/960", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/391/" ]
Some WordPress themes have their links encrypted in the footer and I am not able to edit them if I want to edit the links. This is the example code I found: > > `<?php` > `eval(base64_decode('Pz4gCQkNCg0KCQk8ZGl2IGNsYXNzPSJjbGVhciI+PC9kaXY+DQoNCgkNCg0KCTwvZGl2Pg0KDQoJPCEtLSAvTWFpbiAtLT4NCg0KCQ0KDQoJPCEtLSBGb290ZXIgLS...
Well, this is the output from that function: ``` ?> <div class="clear"></div> </div> <!-- /Main --> <!-- Footer --> <div id="footer"> <?php the_time('Y'); ?> <?php bloginfo('name'); ?> . WordPress . <?php if(is_home()) : ?><a href="http://wordpressthemesforfree.com/" title="Wor...
972
<p>Is it possible to create multiple "custom background" administration pages? A site I'm doing now needs 2 different background in 2 different areas, I would really love giving my client the same experience for both backgrounds in terms of colour/image/select-repeat etc. Any Ideas?</p>
[ { "answer_id": 973, "author": "hakre", "author_id": 178, "author_profile": "https://wordpress.stackexchange.com/users/178", "pm_score": 0, "selected": false, "text": "<p>Technically <strong>it's possible</strong> (so to extend the wordpress source), but not by default. So I would give th...
2010/08/27
[ "https://wordpress.stackexchange.com/questions/972", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/20/" ]
Is it possible to create multiple "custom background" administration pages? A site I'm doing now needs 2 different background in 2 different areas, I would really love giving my client the same experience for both backgrounds in terms of colour/image/select-repeat etc. Any Ideas?
Hi **@Amit:** The answer is *"Yes, it is possible."* The follow up question is *"Do you really want to?"* I thought it would be fun to see if I could build a plugin to do what you are asking for so I decided to see if it was possible. Of course I was able to make it work but I fear that the plugin code I wrote needs ...
994
<p>I have a client that strongly prefers to disable .htaccess files because they like to set the Apache configurations themselves. However, they still want SEO-friendly URLs.</p> <p>Is there a way to have custom permalinks with no .htaccess file? My research thus far seems to indicate this is not possible, but perhaps...
[ { "answer_id": 996, "author": "Chris_O", "author_id": 251, "author_profile": "https://wordpress.stackexchange.com/users/251", "pm_score": 2, "selected": false, "text": "<p><strong>Permalinks without mod_rewrite</strong></p>\n\n<p>Without an .htaccess file or modifying your httpd.conf fil...
2010/08/28
[ "https://wordpress.stackexchange.com/questions/994", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/128/" ]
I have a client that strongly prefers to disable .htaccess files because they like to set the Apache configurations themselves. However, they still want SEO-friendly URLs. Is there a way to have custom permalinks with no .htaccess file? My research thus far seems to indicate this is not possible, but perhaps one of br...
Hi **@Mike Lee**: To answer your question it is helpful to understand how everything works. ### Apache Serves URLs that Match Files and Directories Apache is designed to serve files explicitly matched by URL, or to serve the `index.php` found in a directory when the directory is explicitly matched. ### But Apache...
995
<p>I have different menu items. When the user clicks on a menu item, I want them to go to a particular destination. Each menu's destination has a different background color.</p> <p>I'm thinking that I can pass a variable around and based on the value, I can set the bgcolor.<br> This is just one example of why I want t...
[ { "answer_id": 997, "author": "EAMann", "author_id": 46, "author_profile": "https://wordpress.stackexchange.com/users/46", "pm_score": 1, "selected": false, "text": "<p>WordPress doesn't use session variables ... so you might run into problems if you try that approach. From your descrip...
2010/08/28
[ "https://wordpress.stackexchange.com/questions/995", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/448/" ]
I have different menu items. When the user clicks on a menu item, I want them to go to a particular destination. Each menu's destination has a different background color. I'm thinking that I can pass a variable around and based on the value, I can set the bgcolor. This is just one example of why I want to pass data...
> I have different menu items. When the user clicks on a menu item, I want them to go to a particular destination. Each menu's destination has a different background color. > When you say destination I assume you mean page or post. If you use WordPress's built in body class and post class you can target the page or p...
1,011
<p>I fear this may be too much to ask here, so if so, please feel free to tell me of another place to learn.</p> <h3>Help with Redirections</h3> <p>I'm cleaning up a badly developed site and migrating wordpress from a subdirectory. I've spent hours trying to wrap my head around the logistics of redirections and regex. ...
[ { "answer_id": 1016, "author": "2ndkauboy", "author_id": 462, "author_profile": "https://wordpress.stackexchange.com/users/462", "pm_score": 1, "selected": false, "text": "<p>There is a plugin for changing from one permalink struture to another, but I am quite sure that this will not be ...
2010/08/29
[ "https://wordpress.stackexchange.com/questions/1011", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/-1/" ]
I fear this may be too much to ask here, so if so, please feel free to tell me of another place to learn. ### Help with Redirections I'm cleaning up a badly developed site and migrating wordpress from a subdirectory. I've spent hours trying to wrap my head around the logistics of redirections and regex. I think I'm g...
Hi **@CJN:**, Your first question, moving the WordPress directory is handled differently from the rest. Moving WordPress from Subdirectory to Root: ------------------------------------------- Go into `/wp-config.php` and add the following to defines (using your client's domain instead of `example.com` of course): ...