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 |
|---|---|---|---|---|---|---|
5,811 | <p>The search form at the top of the users listing in the Admin area (wp-admin/users.php) is limited and does not search all of the user meta fields, such as bio, instant messenger handles, etc. I've not been able to find a plugin that can add this. </p>
<p>Is anyone aware of a plugin or a function I could create that... | [
{
"answer_id": 5816,
"author": "MikeSchinkel",
"author_id": 89,
"author_profile": "https://wordpress.stackexchange.com/users/89",
"pm_score": 6,
"selected": true,
"text": "<p>Hi <strong>@user2041:</strong></p>\n\n<p>Clearly as you know you need to modify the search that's performed which... | 2010/12/22 | [
"https://wordpress.stackexchange.com/questions/5811",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2041/"
] | The search form at the top of the users listing in the Admin area (wp-admin/users.php) is limited and does not search all of the user meta fields, such as bio, instant messenger handles, etc. I've not been able to find a plugin that can add this.
Is anyone aware of a plugin or a function I could create that could exp... | Hi **@user2041:**
Clearly as you know you need to modify the search that's performed which you can do by modifying the values in the instance of the `WP_User_Search` class used for the search *(you can find the source code at `/wp-admin/includes/user.php` if you'd like to study it.)*
The `WP_User_Search` Object
----... |
5,831 | <p>I would like to know if there's a way of giving an option (in the admin panel) to the user to change the text of the site title for an uploaded logo image.</p>
<p>So basically it would go like this:</p>
<p>If there's an uploaded image for the site title, don't show the text otherwise just display the site title te... | [
{
"answer_id": 5834,
"author": "hannit cohen",
"author_id": 395,
"author_profile": "https://wordpress.stackexchange.com/users/395",
"pm_score": 1,
"selected": false,
"text": "<p>You can do that using a theme options page - <a href=\"http://wpshout.com/create-an-advanced-options-page-in-w... | 2010/12/23 | [
"https://wordpress.stackexchange.com/questions/5831",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/781/"
] | I would like to know if there's a way of giving an option (in the admin panel) to the user to change the text of the site title for an uploaded logo image.
So basically it would go like this:
If there's an uploaded image for the site title, don't show the text otherwise just display the site title text.
Does anyone ... | I figured out how:
```
<?php
// Theme Options
require_once(TEMPLATEPATH . '/functions/admin-menu.php');
add_action( 'wp_head', 'theme_options');
function theme_options() {
// Initiate Theme Options
$options = get_option('plugin_options');
// If logo image was uploaded then r... |
5,837 | <p>I am writing the backend for my theme and have 4 custom post types. I have registered them all and now I am writing the metaboxes and handlers. </p>
<p>My question is: in WordPress admin, is there a way of determining which custom post type you're editing? i.e. lets say I have a custom post type of <code>Testimonia... | [
{
"answer_id": 5840,
"author": "onetrickpony",
"author_id": 1986,
"author_profile": "https://wordpress.stackexchange.com/users/1986",
"pm_score": 2,
"selected": false,
"text": "<p>that's because the post hasn't been saved yet.</p>\n\n<p>try with <code>$_GET['post_type']</code></p>\n"
}... | 2010/12/23 | [
"https://wordpress.stackexchange.com/questions/5837",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/-1/"
] | I am writing the backend for my theme and have 4 custom post types. I have registered them all and now I am writing the metaboxes and handlers.
My question is: in WordPress admin, is there a way of determining which custom post type you're editing? i.e. lets say I have a custom post type of `Testimonials`, I click `A... | There are hooks and variables set that will allow you determine post type pretty easily, so you can hook onto actions specific to a given type, i'm going to provide some examples below.
Examples
========
If wanted to add a metabox to the post creation screen for the `book` post type, then i'd probably use a hook alon... |
5,858 | <p>My Wordpress blog suddenly seems to have started giving me 404 errors when accessing category pages. For example, <a href="http://blog.rtwilson.com/category/tok-related/" rel="nofollow">http://blog.rtwilson.com/category/tok-related/</a>. Interestingly, this doesn't happen for child categories (such as GIS and Remote... | [
{
"answer_id": 5859,
"author": "markratledge",
"author_id": 268,
"author_profile": "https://wordpress.stackexchange.com/users/268",
"pm_score": 2,
"selected": false,
"text": "<p>First thing to try is resave your permalinks from WordPress admin.</p>\n\n<p>And be sure your changes are save... | 2010/12/23 | [
"https://wordpress.stackexchange.com/questions/5858",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2145/"
] | My Wordpress blog suddenly seems to have started giving me 404 errors when accessing category pages. For example, <http://blog.rtwilson.com/category/tok-related/>. Interestingly, this doesn't happen for child categories (such as GIS and Remote Sensing, shown in the sidebar on the above link) but does happen for parent ... | First thing to try is resave your permalinks from WordPress admin.
And be sure your changes are saved to `.htaccess`. if WP warns you that `.htaccess` isn't writable, manually use FTP to change the permissions of the `.htaccess` file to 644 and try again.
The "." in front of the file name means it's a normally invisi... |
5,869 | <p>I have a few function. For both of them need javascript code. I need to add javascript code in header only when function is active. At this time I have all my javascript code in header for all my function and newermind which one of them is active. I tried to make this code but nothing is changed:
All I have in
<str... | [
{
"answer_id": 5872,
"author": "onetrickpony",
"author_id": 1986,
"author_profile": "https://wordpress.stackexchange.com/users/1986",
"pm_score": 0,
"selected": false,
"text": "<p>Check your logic...</p>\n\n<p>You say that you have 3 functions defined in a file. </p>\n\n<pre><code>if(con... | 2010/12/23 | [
"https://wordpress.stackexchange.com/questions/5869",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1752/"
] | I have a few function. For both of them need javascript code. I need to add javascript code in header only when function is active. At this time I have all my javascript code in header for all my function and newermind which one of them is active. I tried to make this code but nothing is changed:
All I have in
**scrip... | Hi **@Denis Belousov:**
Okay, based on your responses I'm going to ask why tie it to the function existing, why not just test the return value of `get_option('src_switcher')` like this?
```
function my_scripts() {
if (!is_admin()) {
wp_enqueue_script('jquery');
wp_enqueue_script( 'custom',
get_blogin... |
5,871 | <p>I have this coding challenge that's beating my head</p>
<p>I built a site for an academic magazine, where some of the articles are written by two or more authors. This was easily acheived using either Co-Author or Co-Author Plus plugin, as shown in the following image.
<img src="https://i.stack.imgur.com/8GtFo.png... | [
{
"answer_id": 5876,
"author": "hakre",
"author_id": 178,
"author_profile": "https://wordpress.stackexchange.com/users/178",
"pm_score": 0,
"selected": false,
"text": "<p>Wordpress by design knows only one author per post and displays it like so in listings like the archives.</p>\n\n<p>S... | 2010/12/24 | [
"https://wordpress.stackexchange.com/questions/5871",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1576/"
] | I have this coding challenge that's beating my head
I built a site for an academic magazine, where some of the articles are written by two or more authors. This was easily acheived using either Co-Author or Co-Author Plus plugin, as shown in the following image.
 plugin but you can't always depend on plugin developers to anticipate all our needs. Sometimes we just have to build for ourselves! :-)
[ plugin but you can't always depend on plugin developers to anticipate all our needs. Sometimes we just have to build for ourselves! :-)
[.</p>\n\n<p>If yo... | 2010/12/24 | [
"https://wordpress.stackexchange.com/questions/5902",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2153/"
] | how can i use multiple meta\_key and meta\_value in query\_posts?
For example, I want to find multiple content with two different meta\_key and meta\_value. How do I do this?
i using this code but not effective:
```
query_posts('meta_key=test2&meta_value=hello&meta_key=test2&meta_value=bye');
```
please help me... | This is not currently possible with query arguments alone (realm of filtering raw SQL query and such).
If your task is not time-critical then I suggest to wait for upcoming WP 3.1 release. It will feature much more flexible querying capabilities for custom fields.
See [Advanced Metadata Queries](http://scribu.net/wor... |
5,907 | <p>I want to add different class (css) in widgets in site sidebar .</p>
<p>For example:</p>
<p>First widget in Sidebar -> class=sidebar-top1</p>
<p>Second widget in Sidebar -> class=sidebar-top2</p>
<p>third widget in Sidebar -> class=sidebar-top3</p>
<pre><code>i want to add class in <div> tag.
</code></pre... | [
{
"answer_id": 5908,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 0,
"selected": false,
"text": "<p>What a coincidence, I just spent several hours messing with widget classes. I won't post my resulting code because it... | 2010/12/24 | [
"https://wordpress.stackexchange.com/questions/5907",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2153/"
] | I want to add different class (css) in widgets in site sidebar .
For example:
First widget in Sidebar -> class=sidebar-top1
Second widget in Sidebar -> class=sidebar-top2
third widget in Sidebar -> class=sidebar-top3
```
i want to add class in <div> tag.
```
how i can to do? | Check out this post I wrote on the wordpress.org board... it has some functioning code you can work from: <http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets> |
5,915 | <p>I have a WordPress blog for which the domain name has expired. I can still nearly access the blog via a new domain name at the same host, but it seems like the original domain name is quite solidly baked into WordPress. Every time I get WordPress to serve just one page, all links on that page still point to the old ... | [
{
"answer_id": 5916,
"author": "Community",
"author_id": -1,
"author_profile": "https://wordpress.stackexchange.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<p>You mean after changing the Site and WordPress addresses in <code>Settings</code> > <code>General</code> you still ... | 2010/12/12 | [
"https://wordpress.stackexchange.com/questions/5915",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/-1/"
] | I have a WordPress blog for which the domain name has expired. I can still nearly access the blog via a new domain name at the same host, but it seems like the original domain name is quite solidly baked into WordPress. Every time I get WordPress to serve just one page, all links on that page still point to the old dom... | You can fix this by changing the site URL directly in the database. You can either use the mysql client or phpMyAdmin to issue the necessary query:
```
UPDATE wp_options SET option_value = 'http://www.newdomain.com' WHERE option_value = 'http://www.olddomain.com'
```
If you had the blog running at a subfolder, make ... |
5,927 | <p>I'm following <a href="http://codex.wordpress.org/Creating_Tables_with_Plugins"><strong>this</strong></a> to make my plugin auto-create a table when the plugin is activated, but what happens is that while all the tables (the whole db) are utf8_general_ci, the newly created table is latin1_swedish_ci... Why isn't it ... | [
{
"answer_id": 5937,
"author": "hakre",
"author_id": 178,
"author_profile": "https://wordpress.stackexchange.com/users/178",
"pm_score": 4,
"selected": true,
"text": "<p>You're missing the point that there is collation not only for the DB but as well for tables and even fields.</p>\n\n<p... | 2010/12/25 | [
"https://wordpress.stackexchange.com/questions/5927",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1535/"
] | I'm following [**this**](http://codex.wordpress.org/Creating_Tables_with_Plugins) to make my plugin auto-create a table when the plugin is activated, but what happens is that while all the tables (the whole db) are utf8\_general\_ci, the newly created table is latin1\_swedish\_ci... Why isn't it also utf8? I thought it... | You're missing the point that there is collation not only for the DB but as well for tables and even fields.
Therefore from your point of view, I assume that your CREATE TABLE statement is "not complete". Before using SQL statements, please learn the language first.
See [`CREATE TABLE` Syntax (MySQL Manual)](http://d... |
5,929 | <p>For example, I want to use add_menu_page() function to add a menu item to the dashboard. To control which users will be able to access it, I'm supposed to use capabilities... </p>
<pre><code><?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>
</code><... | [
{
"answer_id": 5930,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 1,
"selected": false,
"text": "<p>Not sure is that a rule or just something that happens to work that way, but most of function that take capability as... | 2010/12/25 | [
"https://wordpress.stackexchange.com/questions/5929",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1535/"
] | For example, I want to use add\_menu\_page() function to add a menu item to the dashboard. To control which users will be able to access it, I'm supposed to use capabilities...
```
<?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>
```
So, if I want to gra... | In case someone needs a sollution - I just put `'publish_posts'` as $capability parameter and it works as I thought it would - it gives you all the capabilitis that are below the one used (below publish\_posts in my case)... |
5,933 | <p>I'm planing to create a plugin called Goodbye Dolly. Once installed, it will take care for the installation to remove the auto-installing <a href="http://core.trac.wordpress.org/browser/trunk/wp-content/plugins/hello.php">Hello Dolly (Wordpress Plugin)</a> shipping with wordpress.</p>
<p>This is due to popular requ... | [
{
"answer_id": 5936,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 1,
"selected": false,
"text": "<p>Mike had covered <a href=\"https://wordpress.stackexchange.com/questions/1714/initialization-script-for-standard-aspe... | 2010/12/25 | [
"https://wordpress.stackexchange.com/questions/5933",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/178/"
] | I'm planing to create a plugin called Goodbye Dolly. Once installed, it will take care for the installation to remove the auto-installing [Hello Dolly (Wordpress Plugin)](http://core.trac.wordpress.org/browser/trunk/wp-content/plugins/hello.php) shipping with wordpress.
This is due to popular request. Some folks have ... | While I appreciate the idea, isn't this just replacing one plugin with another? Rarst's link already has the answer -- it just needs to be reworked a bit to check for the plugin periodically, like so:
```
function goodbye_dolly() {
if (file_exists(WP_PLUGIN_DIR.'/hello.php')) {
require_once(ABSPATH.'wp-adm... |
5,955 | <p>I really need a comprehensive solution to this, so I'm offering up almost a quarter of my rep in bounty :)</p>
<p>I would like to have a plugin that creates a custom category listing on my home page. To do this, I'd like the "Category Edit" screen to be augmented with some additional functions as described below...... | [
{
"answer_id": 5957,
"author": "Wyck",
"author_id": 1509,
"author_profile": "https://wordpress.stackexchange.com/users/1509",
"pm_score": 0,
"selected": false,
"text": "<p>The easy way would be with something like this <a href=\"http://wordpress.org/extend/plugins/category-images/\" rel=... | 2010/12/26 | [
"https://wordpress.stackexchange.com/questions/5955",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/366/"
] | I really need a comprehensive solution to this, so I'm offering up almost a quarter of my rep in bounty :)
I would like to have a plugin that creates a custom category listing on my home page. To do this, I'd like the "Category Edit" screen to be augmented with some additional functions as described below...
* Adds "... | Note: This is for older versions of WP < 3.9 prior to the new media upload being introduced
===========================================================================================
Here's how to add fields and save the values on the category edit screen as well as a method of adding an image upload field.
Adding f... |
5,967 | <p>wp_list_pages seems to print out menus ok, but is there a way to alter the functionality so that i can display the menu in two colors..?</p>
<p>So, if the titles of 3 actual pages are:</p>
<pre><code>Big Cinema * Monaco
Theatre * San Franciso
Sport * Berlin
</code></pre>
<p>(each page really has two titles, the a... | [
{
"answer_id": 5968,
"author": "hakre",
"author_id": 178,
"author_profile": "https://wordpress.stackexchange.com/users/178",
"pm_score": 1,
"selected": false,
"text": "<p>Sure, this is. Just locate the code of the function <code>wp_list_pages()</code> (good to know that wordpress is free... | 2010/12/27 | [
"https://wordpress.stackexchange.com/questions/5967",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/394/"
] | wp\_list\_pages seems to print out menus ok, but is there a way to alter the functionality so that i can display the menu in two colors..?
So, if the titles of 3 actual pages are:
```
Big Cinema * Monaco
Theatre * San Franciso
Sport * Berlin
```
(each page really has two titles, the asterisk used to separate them. ... | Hi **@cannyboy:**
Unless I misunderstand, I think what you need is to use `'the_title'` filter.
If you simplly enter *"Title 1 \* Title2"* into your title field, this code I've written for this hook should wrap your Title2 in a `<span class="title2">` which will allow you to style it with CSS. You can put the follow... |
5,973 | <p>I would like to find out the number of comments in total I have and display the number on my website.</p>
| [
{
"answer_id": 5975,
"author": "andrewk",
"author_id": 1043,
"author_profile": "https://wordpress.stackexchange.com/users/1043",
"pm_score": 0,
"selected": false,
"text": "<pre><code><?php\n$numcomms = $wpdb->get_var(\"SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved ... | 2010/12/27 | [
"https://wordpress.stackexchange.com/questions/5973",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/-1/"
] | I would like to find out the number of comments in total I have and display the number on my website. | Hi **@stubudz:**
You are trying to make things easy on me today, right? :)
Here's what you need:
```
$comment_counts = get_comment_count();
echo $comment_counts['approved'];
//print_r($comment_counts); // Uncomment to see all from get_comment_count()
``` |
5,978 | <p>I am building a mobile friendly plugin and put the theme directory inside the plugin directory.</p>
<p>If it's a mobile browser, how can I redirect to the theme in the plugin directory?</p>
<pre><code> /wp-content/plugins/mobview/theme/
</code></pre>
<p>I've managed to use the following redirection:</p>
<pre><c... | [
{
"answer_id": 5980,
"author": "Niraj Chauhan",
"author_id": 1743,
"author_profile": "https://wordpress.stackexchange.com/users/1743",
"pm_score": 2,
"selected": false,
"text": "<p>if i am not wrong then\ntry this code</p>\n\n<p><code>$includes_path = TEMPLATEPATH . '/your folder name/';... | 2010/12/27 | [
"https://wordpress.stackexchange.com/questions/5978",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2168/"
] | I am building a mobile friendly plugin and put the theme directory inside the plugin directory.
If it's a mobile browser, how can I redirect to the theme in the plugin directory?
```
/wp-content/plugins/mobview/theme/
```
I've managed to use the following redirection:
```
wp_redirect( plugins_url('/mobview/theme... | Hi **@Hamza:**
I think what you are looking to do is for your plugin to hook `'template_include'` to tell it to load a file from your plugin directory. Here's starter code for your plugin:
```
<?php
/*
Plugin Name: Mobile View Plugin
*/
if (is_mobile_user()) // YOU NEED TO DEFINE THIS FUNCTION
class MobileViewPlu... |
5,979 | <p>I am trying to add a form where users can submit post from front-end.</p>
<p>I am Following this tutorial:
http:// wpshout.com/wordpress-submit-posts-from-frontend/</p>
<p>What I am doing is adding <a href="http://new2wp.com/labs/downloads/New_Post_Forn_by-Jared_New2WP.txt" rel="noreferrer">this code</a> to one of... | [
{
"answer_id": 6043,
"author": "Philip",
"author_id": 2048,
"author_profile": "https://wordpress.stackexchange.com/users/2048",
"pm_score": 5,
"selected": true,
"text": "<pre><code><?php $postTitle = $_POST['post_title'];\n$post = $_POST['post'];\n$submit = $_POST['submit'];\n\nif(iss... | 2010/12/27 | [
"https://wordpress.stackexchange.com/questions/5979",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1905/"
] | I am trying to add a form where users can submit post from front-end.
I am Following this tutorial:
http:// wpshout.com/wordpress-submit-posts-from-frontend/
What I am doing is adding [this code](http://new2wp.com/labs/downloads/New_Post_Forn_by-Jared_New2WP.txt) to one of my page-template. The form shows up alright ... | ```
<?php $postTitle = $_POST['post_title'];
$post = $_POST['post'];
$submit = $_POST['submit'];
if(isset($submit)){
global $user_ID;
$new_post = array(
'post_title' => $postTitle,
'post_content' => $post,
'post_status' => 'publish',
'post_date' => date('Y-m-d H:i:s'),
... |
6,004 | <p>Say I have top-level(parentless) pages called <strong>Fruit</strong>, <strong>Animals</strong>, <strong>Cars</strong>. </p>
<p>When, say, <strong>Fruit</strong> is selected I would like to show links to the individual <strong>fruit</strong> pages below. I would like to be able to dislpay these <strong>fruits</stron... | [
{
"answer_id": 30084,
"author": "Mat_",
"author_id": 9122,
"author_profile": "https://wordpress.stackexchange.com/users/9122",
"pm_score": 1,
"selected": false,
"text": "<p>You could maybe choose to use a tree like that:</p>\n\n<ul>\n<li>Fruits </li>\n<li><ul>\n<li>Color1</li>\n</ul><... | 2010/12/28 | [
"https://wordpress.stackexchange.com/questions/6004",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/394/"
] | Say I have top-level(parentless) pages called **Fruit**, **Animals**, **Cars**.
When, say, **Fruit** is selected I would like to show links to the individual **fruit** pages below. I would like to be able to dislpay these **fruits** (or **animals**, or **cars**) in several groups with a space between each group of fr... | You could maybe choose to use a tree like that:
* Fruits
* + Color1
* + - Apple
* + - Watermelon
* + Color2
* + - Banana
* + - Lemon
* Level1
* + Level2
* + - Level3
This way, you can, in your theme, hide the second level.
Hope that helps. |
6,008 | <p>I only want a post to be viewable by the administrator and one user. (So I would have a post for each user)</p>
<p>I am thinking of using the Members plugin and meta-data/custom fields to restrict the content. This would effectively make the post private to only those with access and any one else would not even see... | [
{
"answer_id": 6011,
"author": "Community",
"author_id": -1,
"author_profile": "https://wordpress.stackexchange.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<p>Why don't you use plugin such as Role Manager? You can do that easily. =)</p>\n"
},
{
"answer_id": 7882,
... | 2010/12/28 | [
"https://wordpress.stackexchange.com/questions/6008",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1878/"
] | I only want a post to be viewable by the administrator and one user. (So I would have a post for each user)
I am thinking of using the Members plugin and meta-data/custom fields to restrict the content. This would effectively make the post private to only those with access and any one else would not even see the post ... | I am not expert on users, simplest way as for me would be to store ID (or IDs) of user in [custom field](http://codex.wordpress.org/Custom_Fields) and check for it if user is not admin.
Some example code (not tested):
```
if(current_user_can('administrator') || in_array(get_current_user_id(), get_post_meta(get_the_id... |
6,023 | <p>Say I link to <a href="http://www.glumbo.com" rel="nofollow">http://www.glumbo.com</a> on one of my posts. I want wordpress to automatically change the anchor text of the link to glumbo.com's title. How can I do this?</p>
| [
{
"answer_id": 6031,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 4,
"selected": true,
"text": "<p>Decided to entertain the idea. Adapted from my snippet that <a href=\"http://themehybrid.com/support/topic/reformattin... | 2010/12/28 | [
"https://wordpress.stackexchange.com/questions/6023",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2178/"
] | Say I link to <http://www.glumbo.com> on one of my posts. I want wordpress to automatically change the anchor text of the link to glumbo.com's title. How can I do this? | Decided to entertain the idea. Adapted from my snippet that [changes anchors to collapsed domain names](http://themehybrid.com/support/topic/reformatting-commenters-urls). Little too verbose, but seems to work.
```
add_filter( 'the_content', 'anchors_to_page_titles' );
function anchors_to_page_titles( $content ) {
... |
6,042 | <p>The code below creates a plugin that appends the contents of $content to "the_content" on the hompage. It works fine when I set $content to a static value. However, I'm trying to set it to draw out the site's active categories as a list. However, nothing happens when I set $content to wp_list_categories()</p>
<p>Ul... | [
{
"answer_id": 6058,
"author": "MikeSchinkel",
"author_id": 89,
"author_profile": "https://wordpress.stackexchange.com/users/89",
"pm_score": 1,
"selected": true,
"text": "<p>Hi <strong>@Scott B:</strong> </p>\n\n<p>Your example doesn't work for me when I use <code>if (is_home())</code> ... | 2010/12/28 | [
"https://wordpress.stackexchange.com/questions/6042",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/366/"
] | The code below creates a plugin that appends the contents of $content to "the\_content" on the hompage. It works fine when I set $content to a static value. However, I'm trying to set it to draw out the site's active categories as a list. However, nothing happens when I set $content to wp\_list\_categories()
Ultimatel... | Hi **@Scott B:**
Your example doesn't work for me when I use `if (is_home())` but does when I use `if (is_front_page())`. Is there any chance that is the problem?
Other than that it seems to work fine on my WordPress v3.0.3 install. Do you have other plugins that might be disabling the output of `wp_list_categories... |
6,045 | <p>In the sidebar of this page: <a href="http://lifebridgecypress.org/our-people">http://lifebridgecypress.org/our-people</a>, I have a list of upcoming events using this code...</p>
<pre><code><ul id="upcoming-events">
<?php
$latestPosts = new WP_Query();
$latestPosts->query('cat=3&showposts=1... | [
{
"answer_id": 6046,
"author": "Anders",
"author_id": 2188,
"author_profile": "https://wordpress.stackexchange.com/users/2188",
"pm_score": 0,
"selected": false,
"text": "<p>This code will only show your latest posts. One solution is to unpublish the posts regarding events that have alre... | 2010/12/28 | [
"https://wordpress.stackexchange.com/questions/6045",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2059/"
] | In the sidebar of this page: <http://lifebridgecypress.org/our-people>, I have a list of upcoming events using this code...
```
<ul id="upcoming-events">
<?php
$latestPosts = new WP_Query();
$latestPosts->query('cat=3&showposts=10');
?>
<?php while ($latestPosts->have_posts()) : $latestPosts->the_post(); ?>
... | Hi **@Spencer B.**:
Funny, my client submitted a bug ticket for the events modules I wrote for this very issue the other day, and I just fixed it a few hours ago.
Note that **my example uses a Custom Post Type of `'event'`** which is very useful to be able to differentiate logic for Events distinct from Posts. **If ... |
6,049 | <p>I'm trying to set up a wordpress site using active directory authentication.
One question that has come up is the ability to limit category/post/blog reading to specific AD groups.</p>
<p>I've never seen this done and I haven't been able to find any plugins that seem to promise this functionality. It would seem th... | [
{
"answer_id": 6060,
"author": "hakre",
"author_id": 178,
"author_profile": "https://wordpress.stackexchange.com/users/178",
"pm_score": 0,
"selected": false,
"text": "<p>The Role System in Wordpress is somehow limited, so don't expect it to do the job. Especially not while you're combin... | 2010/12/28 | [
"https://wordpress.stackexchange.com/questions/6049",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2252/"
] | I'm trying to set up a wordpress site using active directory authentication.
One question that has come up is the ability to limit category/post/blog reading to specific AD groups.
I've never seen this done and I haven't been able to find any plugins that seem to promise this functionality. It would seem that the bes... | I think this should definitely be doable. I think I would first try to get one of the LDAP authentication plugins -- like [Simple LDAP Login](http://wordpress.org/extend/plugins/simple-ldap-login/) or [LDAP Login Password and Role Manager](http://wordpress.org/extend/plugins/ldap-login-password-and-role-manager/) -- wo... |
6,050 | <p>I've already looked at <a href="https://wordpress.stackexchange.com/questions/2100/database-synchronization-between-dev-staging-and-production">this question</a> and didn't find it too helpful.</p>
<p>We're using Wordpress as a CMS that also includes a blog/news section. The blog/news uses WP "posts" and those are... | [
{
"answer_id": 6060,
"author": "hakre",
"author_id": 178,
"author_profile": "https://wordpress.stackexchange.com/users/178",
"pm_score": 0,
"selected": false,
"text": "<p>The Role System in Wordpress is somehow limited, so don't expect it to do the job. Especially not while you're combin... | 2010/12/28 | [
"https://wordpress.stackexchange.com/questions/6050",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1803/"
] | I've already looked at [this question](https://wordpress.stackexchange.com/questions/2100/database-synchronization-between-dev-staging-and-production) and didn't find it too helpful.
We're using Wordpress as a CMS that also includes a blog/news section. The blog/news uses WP "posts" and those are made whenever and are... | I think this should definitely be doable. I think I would first try to get one of the LDAP authentication plugins -- like [Simple LDAP Login](http://wordpress.org/extend/plugins/simple-ldap-login/) or [LDAP Login Password and Role Manager](http://wordpress.org/extend/plugins/ldap-login-password-and-role-manager/) -- wo... |
6,066 | <p>I made a custom post type and a custom taxonomy, but I have a problem.</p>
<p>When I access the url <code>http://www.ithemes.co.kr/?shopcat=galaxy-s</code>, it works well. But when I access the url <code>http://www.ithemes.co.kr/?shopcat=5</code>, it returns a 404 page. <code>galaxy-s</code> is the taxonomy term sl... | [
{
"answer_id": 6069,
"author": "Jan Fabry",
"author_id": 8,
"author_profile": "https://wordpress.stackexchange.com/users/8",
"pm_score": 3,
"selected": true,
"text": "<p>This is not supported by default, but you can convert the numeric terms back to slugs with the <code>pre_get_posts</co... | 2010/12/29 | [
"https://wordpress.stackexchange.com/questions/6066",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2192/"
] | I made a custom post type and a custom taxonomy, but I have a problem.
When I access the url `http://www.ithemes.co.kr/?shopcat=galaxy-s`, it works well. But when I access the url `http://www.ithemes.co.kr/?shopcat=5`, it returns a 404 page. `galaxy-s` is the taxonomy term slug, but I want to access it by `term_id`, l... | This is not supported by default, but you can convert the numeric terms back to slugs with the `pre_get_posts` hook. I tested this with WP 3.0.1, but in 3.1 the taxonomy query handling changed, so I don't know whether this will work by default or if there is a better way to do it.
```
add_action( 'pre_get_posts', 'wps... |
6,071 | <blockquote>
<p>is it possible to bring custom
taxonomies to permalink?</p>
<p>currently my permalink is looking
something like this
<code>/%postname%/%category%</code></p>
<p>but i also want to add custom
taxonomies to my permalink so it
should look something like this</p>
<p><code>/%postna... | [
{
"answer_id": 6069,
"author": "Jan Fabry",
"author_id": 8,
"author_profile": "https://wordpress.stackexchange.com/users/8",
"pm_score": 3,
"selected": true,
"text": "<p>This is not supported by default, but you can convert the numeric terms back to slugs with the <code>pre_get_posts</co... | 2010/12/29 | [
"https://wordpress.stackexchange.com/questions/6071",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1743/"
] | >
> is it possible to bring custom
> taxonomies to permalink?
>
>
> currently my permalink is looking
> something like this
> `/%postname%/%category%`
>
>
> but i also want to add custom
> taxonomies to my permalink so it
> should look something like this
>
>
> `/%postname%/%category%/%location%/%mba_cours... | This is not supported by default, but you can convert the numeric terms back to slugs with the `pre_get_posts` hook. I tested this with WP 3.0.1, but in 3.1 the taxonomy query handling changed, so I don't know whether this will work by default or if there is a better way to do it.
```
add_action( 'pre_get_posts', 'wps... |
6,079 | <p>I am new to WordPress, and I need to make some quick changes.</p>
<p>How can I find the Page that is referenced by a permalink: e.g. for www.example.com/mypermalink how can I locate the actual WP Page so I can find it either in the file system or in the WP Pages list?</p>
| [
{
"answer_id": 6082,
"author": "EAMann",
"author_id": 46,
"author_profile": "https://wordpress.stackexchange.com/users/46",
"pm_score": 4,
"selected": true,
"text": "<p>Addressing both your original question and the question implied by your comment ...</p>\n<h1>Finding the page ID</h1>\n... | 2010/12/29 | [
"https://wordpress.stackexchange.com/questions/6079",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/397/"
] | I am new to WordPress, and I need to make some quick changes.
How can I find the Page that is referenced by a permalink: e.g. for www.example.com/mypermalink how can I locate the actual WP Page so I can find it either in the file system or in the WP Pages list? | Addressing both your original question and the question implied by your comment ...
Finding the page ID
===================
Every post and page within WordPress is given an ID. By default, WordPress uses the ID in the link structure: <http://www.example.com/?page=ID> or <http://www.example.com/?p=ID> (for posts). You... |
6,083 | <p>I am having problems with <code>pagination</code> on <code>category</code> page that lists posts only within a certain category. Here is my code:</p>
<p>What happens is the <code>Next</code> link takes to <code>/page/2</code> but the content stays the same.</p>
<pre><code><?php
$id = get_cat_id($current_cat... | [
{
"answer_id": 6092,
"author": "MikeSchinkel",
"author_id": 89,
"author_profile": "https://wordpress.stackexchange.com/users/89",
"pm_score": 1,
"selected": false,
"text": "<p>Hi <strong>@eeyore:</strong> </p>\n\n<p>Without being able to see the full context of your theme page I think yo... | 2010/12/29 | [
"https://wordpress.stackexchange.com/questions/6083",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/-1/"
] | I am having problems with `pagination` on `category` page that lists posts only within a certain category. Here is my code:
What happens is the `Next` link takes to `/page/2` but the content stays the same.
```
<?php
$id = get_cat_id($current_category);
$my_query = new WP_Query('cat='. $id .'&showposts=2');
... | Hi **@eeyore:**
Without being able to see the full context of your theme page I think you have at least two issues.
1. You need to use `$wp_query` instead of `$my_query` if you want `previous_posts_link()` and `next_posts_link()` to work since they assume `$wp_query`.
2. What *@Jan Fabry* mentioned; you need to cap... |
6,084 | <p>I'm currently working on a website that has a static frontpage and couple of pages that is going to contain portfolio and things alike on the other pages. </p>
<p>The thing I want to do is to hardcode content on the frontpage in css and xhtml.</p>
<p>Is this possible and where do I do this?</p>
<p>I thought it sh... | [
{
"answer_id": 6085,
"author": "gabrielk",
"author_id": 839,
"author_profile": "https://wordpress.stackexchange.com/users/839",
"pm_score": 2,
"selected": true,
"text": "<p>I would set up a new page template (see <a href=\"http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates... | 2010/12/29 | [
"https://wordpress.stackexchange.com/questions/6084",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/-1/"
] | I'm currently working on a website that has a static frontpage and couple of pages that is going to contain portfolio and things alike on the other pages.
The thing I want to do is to hardcode content on the frontpage in css and xhtml.
Is this possible and where do I do this?
I thought it should be done in **index.... | I would set up a new page template (see <http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates>), create a new page (Pages > New) and set it to use that template, and then set WordPress to use that page as the homepage (Settings > Reading). Then you can fill the custom page template with whatever content yo... |
6,095 | <pre><code><?php $recent = new WP_Query(); ?>
<?php $recent->query('cat=1&showposts=2'); ?>
</code></pre>
<p>With what can i replace cat=1 to show posts from all the categories?</p>
| [
{
"answer_id": 6121,
"author": "hakre",
"author_id": 178,
"author_profile": "https://wordpress.stackexchange.com/users/178",
"pm_score": 0,
"selected": false,
"text": "<p>even though the evolution from blog to CMS is somehow naturally (<a href=\"http://i1t2b3.com/2010/09/01/interview-wit... | 2010/12/29 | [
"https://wordpress.stackexchange.com/questions/6095",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/-1/"
] | ```
<?php $recent = new WP_Query(); ?>
<?php $recent->query('cat=1&showposts=2'); ?>
```
With what can i replace cat=1 to show posts from all the categories? | You could simply use the **["pods"-plugin](http://podscms.org)** (for WordPress) from Matt Gibs and Scott Kingsley Clark. It's exactly what you searching for. Take a look at the doku and look specificaly at "pick columns". Aside from that it has a nice and ajax driven interface and builds it's database tables next to w... |
6,096 | <p>For a project I'm working on, I want to change the labels of the 'Nickname' and 'Biographical Info' fields on edit profile (user-edit.php) page in the dashboard. I still want to use those fields as they are, I only want to change the labels. Anyone know of a function that can do this?</p>
| [
{
"answer_id": 6099,
"author": "Jan Fabry",
"author_id": 8,
"author_profile": "https://wordpress.stackexchange.com/users/8",
"pm_score": 4,
"selected": true,
"text": "<p>Every string goes through <code>translate()</code>, which uses the <code>gettext</code> filter. This mean you can try ... | 2010/12/29 | [
"https://wordpress.stackexchange.com/questions/6096",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2041/"
] | For a project I'm working on, I want to change the labels of the 'Nickname' and 'Biographical Info' fields on edit profile (user-edit.php) page in the dashboard. I still want to use those fields as they are, I only want to change the labels. Anyone know of a function that can do this? | Every string goes through `translate()`, which uses the `gettext` filter. This mean you can try something like this:
```
add_filter( 'gettext', 'wpse6096_gettext', 10, 2 );
function wpse6096_gettext( $translation, $original )
{
if ( 'Nickname' == $original ) {
return 'Funny name';
}
if ( 'Biographi... |
6,103 | <p>I have a few custom thumbnail sizes and obviously one of them is used in the set_post_thumbnail_size, what directly affects the interface in the admin area. </p>
<p>What I'm looking to do is to intercept which admin page (for post-type) I'm in and set a different size in the above function, so basically I'd like to... | [
{
"answer_id": 6105,
"author": "Jan Fabry",
"author_id": 8,
"author_profile": "https://wordpress.stackexchange.com/users/8",
"pm_score": 0,
"selected": false,
"text": "<p>I'll repeat <a href=\"https://wordpress.stackexchange.com/questions/4563/add-image-size-for-specific-post-types/4565#... | 2010/12/29 | [
"https://wordpress.stackexchange.com/questions/6103",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/20/"
] | I have a few custom thumbnail sizes and obviously one of them is used in the set\_post\_thumbnail\_size, what directly affects the interface in the admin area.
What I'm looking to do is to intercept which admin page (for post-type) I'm in and set a different size in the above function, so basically I'd like to have t... | Simpler way to figure out the post type of the item (which you are editing) and uploading media to:
```
$type = get_post_type($_REQUEST['post_id']);
```
As has been noted, the media upload iframe that is shown in the lightbox overlay when you try to upload something doesn't indicate the parent post that new upload w... |
6,126 | <p>I'm getting this error repeatedly in my error.log:</p>
<pre><code>[Wed Dec 29 13:46:37 2010] [error] [mod_pagespeed 0.9.11.5-293] http://marcandkatie.co.za/index.php:1: Reached end of document without finding <body>
</code></pre>
<p>And I believe it's caused my site todo this when I go to the admin:</p>
<pr... | [
{
"answer_id": 6127,
"author": "Niraj Chauhan",
"author_id": 1743,
"author_profile": "https://wordpress.stackexchange.com/users/1743",
"pm_score": 0,
"selected": false,
"text": "<p>this error is caused because of wp-cache plugin, not sure but clear your cache from, the error might go</p>... | 2010/12/30 | [
"https://wordpress.stackexchange.com/questions/6126",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2050/"
] | I'm getting this error repeatedly in my error.log:
```
[Wed Dec 29 13:46:37 2010] [error] [mod_pagespeed 0.9.11.5-293] http://marcandkatie.co.za/index.php:1: Reached end of document without finding <body>
```
And I believe it's caused my site todo this when I go to the admin:
```
Fatal error: Allowed memory size of... | So I started going thru plugins and my Mailchimp plugin seemed to be the issue as I can tell so far. I'm no longer getting any errors. |
6,135 | <p>I'm looking for a way to remove the <em>title</em> attribute from images, preferably through using a hook or a filter.</p>
<p>Most clients don't bother giving images a proper title, thus eliminating the purpose of this attribute. I prefer no tooltips to random, non-descriptive ones.</p>
| [
{
"answer_id": 6137,
"author": "EAMann",
"author_id": 46,
"author_profile": "https://wordpress.stackexchange.com/users/46",
"pm_score": 3,
"selected": false,
"text": "<p>I would <em>strongly</em> discourage this. A better, more sustainable practice would be to educate your clients on th... | 2010/12/30 | [
"https://wordpress.stackexchange.com/questions/6135",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1557/"
] | I'm looking for a way to remove the *title* attribute from images, preferably through using a hook or a filter.
Most clients don't bother giving images a proper title, thus eliminating the purpose of this attribute. I prefer no tooltips to random, non-descriptive ones. | I would *strongly* discourage this. A better, more sustainable practice would be to educate your clients on the value of the `title` attribute and teach them how to use it properly.
Simply removing it is putting a bandage on the symptom, *not* combating the disease.
However, if you do want to remove the attribute any... |
6,153 | <p>On a multi author WordPress blog I need to show a list with more posts from the current author. The list is inside the Loop, so I can use <code><?php the_author_meta('first_name'); ?> <?php the_author_meta('last_name'); ?></code> and <code><?php the_author_meta('description'); ?></code>, but how to... | [
{
"answer_id": 6161,
"author": "benstraw",
"author_id": 2092,
"author_profile": "https://wordpress.stackexchange.com/users/2092",
"pm_score": 0,
"selected": false,
"text": "<p>I think you can use the wordpress query_posts function for this. Take a look at <a href=\"http://codex.wordpres... | 2010/12/31 | [
"https://wordpress.stackexchange.com/questions/6153",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2228/"
] | On a multi author WordPress blog I need to show a list with more posts from the current author. The list is inside the Loop, so I can use `<?php the_author_meta('first_name'); ?> <?php the_author_meta('last_name'); ?>` and `<?php the_author_meta('description'); ?>`, but how to retrieve the user's posts? | This will retrieve the posts of current author when used in the loop.
Put the following in your theme functions.php:
```
function my_get_display_author_posts() {
global $authordata, $post;
$authors_posts = get_posts( array( 'author' => $authordata->ID, 'post__not_in' => array( $post->ID ) ) );
$output =... |
6,154 | <p>Hello friends I am trying to get my wordpress posts to display in a non- wordpress application. Currently I am getting them by using the following method.</p>
<p>My wordPress page is something like this:</p>
<pre><code><div id="header">
<!-- header content goes here -->
</div>
<div id="ma... | [
{
"answer_id": 6160,
"author": "Anh Tran",
"author_id": 2051,
"author_profile": "https://wordpress.stackexchange.com/users/2051",
"pm_score": 0,
"selected": false,
"text": "<p>If you're using jQuery, you can request part of a page. <a href=\"https://stackoverflow.com/questions/2137811/ex... | 2010/12/31 | [
"https://wordpress.stackexchange.com/questions/6154",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2122/"
] | Hello friends I am trying to get my wordpress posts to display in a non- wordpress application. Currently I am getting them by using the following method.
My wordPress page is something like this:
```
<div id="header">
<!-- header content goes here -->
</div>
<div id="main-body">
<div id="content">
... | If it is all on same server it is rather easy to load WP engine and parts you need, see [Integrating WordPress with Your Website](http://codex.wordpress.org/Integrating_WordPress_with_Your_Website).
Otherwise there is probably better to get specific data (rather than whole page) from WordPress remotely, but there are ... |
6,163 | <p>I am trying to build custom user profile with the guidance of this tutorial: <a href="http://blogmum.com/2009/06/how-to-make-a-wordpress-profile-page/">How to make a WordPress profile page</a></p>
<p>I have successfully implemented it to my theme, everything is working well.
Now what I want to achieve is to get the... | [
{
"answer_id": 6165,
"author": "MikeSchinkel",
"author_id": 89,
"author_profile": "https://wordpress.stackexchange.com/users/89",
"pm_score": 5,
"selected": true,
"text": "<p>Hi <strong>@Towfiq</strong>:</p>\n\n<p>Comments are related in the database to Posts. You'll have to do a lot of ... | 2010/12/31 | [
"https://wordpress.stackexchange.com/questions/6163",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1905/"
] | I am trying to build custom user profile with the guidance of this tutorial: [How to make a WordPress profile page](http://blogmum.com/2009/06/how-to-make-a-wordpress-profile-page/)
I have successfully implemented it to my theme, everything is working well.
Now what I want to achieve is to get the comment template in ... | Hi **@Towfiq**:
Comments are related in the database to Posts. You'll have to do a lot of work to get Comments to relate to Users.
Have you considered creating a [Custom Post Type](http://files.meetup.com/1280797/custom-post-types-for-wordpress-atlwp-2010-10-24.html) for Users and then use either a `user_meta` field ... |
6,178 | <p>Is it possible to make some sort of change or add a plugin that allows me to make every 'external' link open in a new window?</p>
<p>Just an example: if my blog was called http//timmy.com/ and I wanted to link to http//tom.com/, it would open a new window instead of the same window,
but I wanted to link from http//... | [
{
"answer_id": 6179,
"author": "curtismchale",
"author_id": 141,
"author_profile": "https://wordpress.stackexchange.com/users/141",
"pm_score": 2,
"selected": false,
"text": "<p>Yup can be done with javascript. </p>\n\n<pre><code>var $j = jQuery.noConflict();\n\n$j(document).ready(functi... | 2010/12/31 | [
"https://wordpress.stackexchange.com/questions/6178",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2236/"
] | Is it possible to make some sort of change or add a plugin that allows me to make every 'external' link open in a new window?
Just an example: if my blog was called http//timmy.com/ and I wanted to link to http//tom.com/, it would open a new window instead of the same window,
but I wanted to link from http//timmy.com/... | Yup can be done with javascript.
```
var $j = jQuery.noConflict();
$j(document).ready(function() { //external attribute
$j("a:not([@href*=http://YOURSITE.com/])").not("[href^=#]")
.addClass("external")
.attr({ target: "_blank" });
});
``` |
6,185 | <p>What are plugins that are added to a post or page using comments...for instance I am aware of the <br/> <code><!--nextpage--></code> tag, (it's part of Wordpress not a plugin...) but I'm assuming that there may be plugins out there with functionality that is placed in a post in a similar manner.</p>
<p>What i... | [
{
"answer_id": 6186,
"author": "andrewk",
"author_id": 1043,
"author_profile": "https://wordpress.stackexchange.com/users/1043",
"pm_score": 1,
"selected": false,
"text": "<p>there is also the <code><!--more--></code>tag.\nthere are many.\nYou can actually use shortcodes <code>[som... | 2010/12/31 | [
"https://wordpress.stackexchange.com/questions/6185",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/304/"
] | What are plugins that are added to a post or page using comments...for instance I am aware of the
`<!--nextpage-->` tag, (it's part of Wordpress not a plugin...) but I'm assuming that there may be plugins out there with functionality that is placed in a post in a similar manner.
What is the name of plugins that op... | There's a similar concept for plugins called shortcodes (as andrewk said). The syntax for these is slightly different than the more tag (which does look a lot like an html comment). Shortcodes are wrapped in square braces like so:
```
[myshortcode arg1="something" arg2="something else"]
```
Shortocde is the term for... |
6,187 | <p>Hi to the community,<br>
i try to build a shortcode that prints the Creative Commons logo and some text,
everything is working fine except that i put the shortcode at the end of the post but the shortcode goes to the top of the post content,</p>
<p>i use the code bellow:</p>
<pre><code><?php // Creative Commons... | [
{
"answer_id": 6188,
"author": "MathSmath",
"author_id": 1537,
"author_profile": "https://wordpress.stackexchange.com/users/1537",
"pm_score": 3,
"selected": true,
"text": "<p>Couple things: I think your shortcode function should return the value rather than print it, and you shouldn't h... | 2010/12/31 | [
"https://wordpress.stackexchange.com/questions/6187",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2048/"
] | Hi to the community,
i try to build a shortcode that prints the Creative Commons logo and some text,
everything is working fine except that i put the shortcode at the end of the post but the shortcode goes to the top of the post content,
i use the code bellow:
```
<?php // Creative Commons License Shortcode
funct... | Couple things: I think your shortcode function should return the value rather than print it, and you shouldn't have the output wrapped in braces like that (the one just before the first div, and the one just before the return). Unless that's some obscure php syntax I've never seen (which is entirely possible)?
As far ... |
6,190 | <p>I have two WordPress installations, one at <a href="http://inversekarma.in" rel="nofollow">http://inversekarma.in</a> and the other at <a href="http://inversekarma.in/photos" rel="nofollow">http://inversekarma.in/photos</a>. The latter is a photoblog, and its theme uses the standard WP post thumbnails (<strong>EDIT:... | [
{
"answer_id": 6208,
"author": "MikeSchinkel",
"author_id": 89,
"author_profile": "https://wordpress.stackexchange.com/users/89",
"pm_score": 4,
"selected": true,
"text": "<p>There are (at least) <strong>two (2) ways</strong> to approach this:</p>\n<ol>\n<li><p>You can <strong>query the ... | 2011/01/01 | [
"https://wordpress.stackexchange.com/questions/6190",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1606/"
] | I have two WordPress installations, one at <http://inversekarma.in> and the other at <http://inversekarma.in/photos>. The latter is a photoblog, and its theme uses the standard WP post thumbnails (**EDIT:** featured images, to be precise!). Is there a way to show the most recent thumbnails from the second site on my fi... | There are (at least) **two (2) ways** to approach this:
1. You can **query the second database** which will require you to maintain the database credentials in two places, or at least in an include file, or
2. You could **create a simple JSON feed** for your photo blog and consume the feed on your main blog and cache ... |
6,201 | <p>Is there any way to use <code>str_replace()</code> in Wordpress outside the loop?
I want to change my html markup which starts before the loop.
I need something like this:</p>
<pre><code>function content_magic($content) {
str_replace('<div id="content">','<div id="new_content">',$content);
... | [
{
"answer_id": 6203,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 3,
"selected": true,
"text": "<p>Filters don't really affect resulting markup. More precisely they affect anything that is passed through them, in this... | 2011/01/01 | [
"https://wordpress.stackexchange.com/questions/6201",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1752/"
] | Is there any way to use `str_replace()` in Wordpress outside the loop?
I want to change my html markup which starts before the loop.
I need something like this:
```
function content_magic($content) {
str_replace('<div id="content">','<div id="new_content">',$content);
return $content;
}
add_filter(... | Filters don't really affect resulting markup. More precisely they affect anything that is passed through them, in this specific case output of `the_content()` function is passed through `the_content` filter and you are able to modify it.
If markup you want to change is not generated by function and not passed through ... |
6,213 | <p>WP 3.0.2 </p>
<p>I've tried adding </p>
<pre>
<?php query_posts($query_string . "&order=ASC") ?>
</pre>
<p>above</p>
<pre>
<?php if(have_posts()) : ?>
</pre>
<p>in the page.php file, with no result</p>
| [
{
"answer_id": 6214,
"author": "Community",
"author_id": -1,
"author_profile": "https://wordpress.stackexchange.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<p>Try combine </p>\n\n<pre><code>orderby=date&order=ASC\n</code></pre>\n"
},
{
"answer_id": 6215,
"au... | 2011/01/02 | [
"https://wordpress.stackexchange.com/questions/6213",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/-1/"
] | WP 3.0.2
I've tried adding
```
<?php query_posts($query_string . "ℴ=ASC") ?>
```
above
```
<?php if(have_posts()) : ?>
```
in the page.php file, with no result | Maybe page.php is not your friend for this one.
It depends where is the list of posts you want to modify.
Try index.php for homepage or archive.php for category based views.
Check <http://codex.wordpress.org/Theme_Development#Template_Files_List>
page.php is used when an individual Page is queried - that means ... |
6,239 | <p>Ever tried this?</p>
<pre><code>// template file
do_action( 'my_hook' );
// ex. functions.php
function my_hooked_template_part() {
get_template_part( 'my_loop_part_file', 'default' );
}
add_action( 'my_hook', 'my_hooked_template_part' );
// my_loop_part_file-default.php
get_template_part( 'query', 'default' );
... | [
{
"answer_id": 6240,
"author": "Michal Mau",
"author_id": 2110,
"author_profile": "https://wordpress.stackexchange.com/users/2110",
"pm_score": 2,
"selected": true,
"text": "<p>If your comments in the code above reflect the file names then it's a dash vs. underscore mistake.<br>\nName of... | 2011/01/03 | [
"https://wordpress.stackexchange.com/questions/6239",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/385/"
] | Ever tried this?
```
// template file
do_action( 'my_hook' );
// ex. functions.php
function my_hooked_template_part() {
get_template_part( 'my_loop_part_file', 'default' );
}
add_action( 'my_hook', 'my_hooked_template_part' );
// my_loop_part_file-default.php
get_template_part( 'query', 'default' );
if ( have_post... | If your comments in the code above reflect the file names then it's a dash vs. underscore mistake.
Name of the second included file should be query-default.php |
6,248 | <p>I would like to write a function to email me the URL of the website when my theme is activated.</p>
<p>What is the hook initiated when the theme is activated?</p>
| [
{
"answer_id": 6253,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 3,
"selected": false,
"text": "<p>There is no specialized hook for this. I have seen couple of approaches:</p>\n\n<ul>\n<li><code>switch_theme</code> h... | 2011/01/03 | [
"https://wordpress.stackexchange.com/questions/6248",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1555/"
] | I would like to write a function to email me the URL of the website when my theme is activated.
What is the hook initiated when the theme is activated? | I have that code here just name the file theme\_activation\_hook.php like on the website and copy this.
```
<?php
/**
* Provides activation/deactivation hook for wordpress theme.
*
* @author Krishna Kant Sharma (http://www.krishnakantsharma.com)
*
* Usage:
* ----------------------------------------------
* Incl... |
6,267 | <p>I am working with a magazine client who sells adversiting offline in their magazine and now has a WordPress online magazine. Each of their stories is broken into different posts, and they are using the Wootheme Spectrum.</p>
<p>They want the ads in the magazine to correspond to the ads online. So if Story B has A... | [
{
"answer_id": 6270,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 1,
"selected": false,
"text": "<p>I'd say best way depends on:</p>\n\n<ol>\n<li>How many different ads</li>\n<li>How many different posts</li>\n<li>How... | 2011/01/03 | [
"https://wordpress.stackexchange.com/questions/6267",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2265/"
] | I am working with a magazine client who sells adversiting offline in their magazine and now has a WordPress online magazine. Each of their stories is broken into different posts, and they are using the Wootheme Spectrum.
They want the ads in the magazine to correspond to the ads online. So if Story B has Ad Z, then on... | Hi **@ewakened:**
The simplest solution would be to have them upload the ads as photos using the media features in WordPress and then to have them add custom field called *"Advertisement"* with the URL to the ad copied from the media module, and a custom field called and *"Ad URL"* to link to the advertiser's site. Th... |
6,268 | <p>I'd like to be able to filter out a commenters ability to add hyperlinks in their comment text. </p>
<p>I removed the "websites" field from the mix to reduce the amount of spammage already (see: <a href="https://wordpress.stackexchange.com/questions/3200/removing-the-website-field-from-comments-and-replies">Removi... | [
{
"answer_id": 6272,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 4,
"selected": true,
"text": "<p>WP runs so many prettifying filters on this stuff that it's easy to get lost.</p>\n\n<p>Here is what I ended up with:<... | 2011/01/03 | [
"https://wordpress.stackexchange.com/questions/6268",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/506/"
] | I'd like to be able to filter out a commenters ability to add hyperlinks in their comment text.
I removed the "websites" field from the mix to reduce the amount of spammage already (see: [Removing the "Website" Field from Comments and Replies?](https://wordpress.stackexchange.com/questions/3200/removing-the-website-f... | WP runs so many prettifying filters on this stuff that it's easy to get lost.
Here is what I ended up with:
```
remove_filter('comment_text', 'make_clickable', 9);
add_filter('pre_comment_content', 'strip_comment_links');
function strip_comment_links($content) {
global $allowedtags;
$tags = $allowedtags;
... |
6,271 | <p>Out of the box the <a href="http://p2theme.com" rel="nofollow">P2 Theme</a> does not have search. Is there a quick and easy way to add it?</p>
| [
{
"answer_id": 6272,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 4,
"selected": true,
"text": "<p>WP runs so many prettifying filters on this stuff that it's easy to get lost.</p>\n\n<p>Here is what I ended up with:<... | 2011/01/03 | [
"https://wordpress.stackexchange.com/questions/6271",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/89/"
] | Out of the box the [P2 Theme](http://p2theme.com) does not have search. Is there a quick and easy way to add it? | WP runs so many prettifying filters on this stuff that it's easy to get lost.
Here is what I ended up with:
```
remove_filter('comment_text', 'make_clickable', 9);
add_filter('pre_comment_content', 'strip_comment_links');
function strip_comment_links($content) {
global $allowedtags;
$tags = $allowedtags;
... |
6,292 | <p>This was really driving me crazy. I was debugging some code with code-generated transient names and they were failing like crazy for no apparent reason.</p>
<p>After much much pain and experimentation I figured out that it fails when over certain key length:</p>
<pre><code>$key = '1234567890';
var_dump( get_transi... | [
{
"answer_id": 6294,
"author": "scribu",
"author_id": 205,
"author_profile": "https://wordpress.stackexchange.com/users/205",
"pm_score": 3,
"selected": false,
"text": "<p>I ran into this exact issue and proposed extending the column length:</p>\n\n<p><a href=\"http://core.trac.wordpress... | 2011/01/03 | [
"https://wordpress.stackexchange.com/questions/6292",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/847/"
] | This was really driving me crazy. I was debugging some code with code-generated transient names and they were failing like crazy for no apparent reason.
After much much pain and experimentation I figured out that it fails when over certain key length:
```
$key = '1234567890';
var_dump( get_transient($key) ); // works... | You don't get an error because [WordPress does not check for the length](http://core.trac.wordpress.org/ticket/15058), and MySQL silently truncates it (giving a warning, not an error), unless you enable [the `STRICT_ALL_TABLES` option](http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html#sqlmode_strict_all_table... |
6,310 | <p>I have a website in which I need to control the displayed excerpt length.
Some of the posts might have manual excerpt so I can't use the <code>excerpt_length</code> filter.</p>
<p>I can, of course, use some kind of <code>substr()</code>, but was looking for a more elegant solution (if such exists).</p>
| [
{
"answer_id": 6313,
"author": "John P Bloch",
"author_id": 11,
"author_profile": "https://wordpress.stackexchange.com/users/11",
"pm_score": 1,
"selected": false,
"text": "<p>I'd say just look at how core does it: <a href=\"http://phpxref.ftwr.co.uk/wordpress/wp-includes/formatting.php.... | 2011/01/04 | [
"https://wordpress.stackexchange.com/questions/6310",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/395/"
] | I have a website in which I need to control the displayed excerpt length.
Some of the posts might have manual excerpt so I can't use the `excerpt_length` filter.
I can, of course, use some kind of `substr()`, but was looking for a more elegant solution (if such exists). | Take a look on my answer here: [Best Collection of Code for your functions.php file](https://wordpress.stackexchange.com/questions/1567/best-collection-of-code-for-your-functions-php-file/6225#6225)
If I understood your question correctly, it does what you are looking for.
Place this in `functions.php`:
```
functi... |
6,311 | <p>The title says it all. I'm using WP 3.0.4</p>
| [
{
"answer_id": 6312,
"author": "John P Bloch",
"author_id": 11,
"author_profile": "https://wordpress.stackexchange.com/users/11",
"pm_score": 4,
"selected": true,
"text": "<p>Something like this should work. <code>$handle</code> should be the menu's slug; set <code>$sub</code> to true to... | 2011/01/04 | [
"https://wordpress.stackexchange.com/questions/6311",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2072/"
] | The title says it all. I'm using WP 3.0.4 | Something like this should work. `$handle` should be the menu's slug; set `$sub` to true to search submenus (defaults to top level menus):
```
function find_my_menu_item( $handle, $sub = false; ){
if( !is_admin() || (defined('DOING_AJAX') && DOING_AJAX) )
return false;
global $menu, $submenu;
$check_menu = $... |
6,315 | <p>** UPDATED BELOW **</p>
<p>Original Question:
Anyone know how to create a function that changes the url of the_tags so that when one is clicked on, the function searches another domain? </p>
<p>** UPDATE **</p>
<p>IT WORKS! Thanks a million. What a star. :-)</p>
<p>ONE MORE Q:
I have discovered that the search t... | [
{
"answer_id": 6323,
"author": "t31os",
"author_id": 31073,
"author_profile": "https://wordpress.stackexchange.com/users/31073",
"pm_score": 1,
"selected": false,
"text": "<p>There's a filter in place specifically for tag links, can be found in source here.<br>\n<a href=\"http://core.tra... | 2011/01/04 | [
"https://wordpress.stackexchange.com/questions/6315",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/-1/"
] | \*\* UPDATED BELOW \*\*
Original Question:
Anyone know how to create a function that changes the url of the\_tags so that when one is clicked on, the function searches another domain?
\*\* UPDATE \*\*
IT WORKS! Thanks a million. What a star. :-)
ONE MORE Q:
I have discovered that the search the link is being sent ... | There's a filter in place specifically for tag links, can be found in source here.
<http://core.trac.wordpress.org/browser/tags/3.0.4/wp-includes/category-template.php#L780>
It's the first function you see on the above link, and it's this line that provides a hookable filter.
```
return apply_filters( 'tag_link', ... |
6,333 | <p>I am using the following to help display a list of posts created in a custom post type. </p>
<pre><code>$args = array(
'post_type'=>'portfolio',
'title_li'=> __('Portfolio')
);
wp_list_pages( $args );
</code></pre>
<p>However a class is not being added to the list item of the current page (<code>current... | [
{
"answer_id": 6338,
"author": "Red",
"author_id": 2289,
"author_profile": "https://wordpress.stackexchange.com/users/2289",
"pm_score": 2,
"selected": true,
"text": "<p>Found this and it works perfectly!</p>\n\n<p><a href=\"https://wordpress.stackexchange.com/questions/3247/dynamic-navi... | 2011/01/04 | [
"https://wordpress.stackexchange.com/questions/6333",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2289/"
] | I am using the following to help display a list of posts created in a custom post type.
```
$args = array(
'post_type'=>'portfolio',
'title_li'=> __('Portfolio')
);
wp_list_pages( $args );
```
However a class is not being added to the list item of the current page (`current_page_item`). Any ideas of how I coul... | Found this and it works perfectly!
[Dynamic navigation for custom post type (pages)](https://wordpress.stackexchange.com/questions/3247/dynamic-navigation-for-custom-post-type-pages/3270#3270) |
6,343 | <p>I have searched all over the web to find some solution, but none of them are working for me, can someone help me with this and explain what is wrong? I've spent 3 hours debugging and didn't find the issue. </p>
<p>Here is my code:</p>
<pre><code>global $paged;
global $wp_query;
wp_reset_query();
$per_page = get_o... | [
{
"answer_id": 6364,
"author": "kevin",
"author_id": 1997,
"author_profile": "https://wordpress.stackexchange.com/users/1997",
"pm_score": 0,
"selected": false,
"text": "<p>I have this code (cleaned) on a site, calling posts from a custom post type, and at the bottom the pagination, if t... | 2011/01/05 | [
"https://wordpress.stackexchange.com/questions/6343",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1147/"
] | I have searched all over the web to find some solution, but none of them are working for me, can someone help me with this and explain what is wrong? I've spent 3 hours debugging and didn't find the issue.
Here is my code:
```
global $paged;
global $wp_query;
wp_reset_query();
$per_page = get_option('posts_per_page... | I had a similar problem recently and determined the cause to be that when WordPress queries for posts in a category, it looks for posts with post\_type equal to 'post' before it reaches the point where you query for post\_type 'any' or some custom post type. This doesn't cause a problem on page 1 because even if there ... |
6,346 | <pre><code>the image is worth a thousand words. take a look at it.
</code></pre>
<p>you know how craigslist has posts organized by date ..ex</p>
<p><code>Tue 3</code></p>
<p>post links for tuesday</p>
<p><code>Wed 4</code></p>
<p>post links for wed</p>
<p><code>Thurs 5</code></p>
<p>post links for thur</p>
<p>I... | [
{
"answer_id": 6359,
"author": "Christopher",
"author_id": 1340,
"author_profile": "https://wordpress.stackexchange.com/users/1340",
"pm_score": 1,
"selected": false,
"text": "<p>As @goldenapples noted, if your template uses the the_date(); template tag, it'll do this all on its own, as ... | 2011/01/05 | [
"https://wordpress.stackexchange.com/questions/6346",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1043/"
] | ```
the image is worth a thousand words. take a look at it.
```
you know how craigslist has posts organized by date ..ex
`Tue 3`
post links for tuesday
`Wed 4`
post links for wed
`Thurs 5`
post links for thur
I know wordpress posts are organized by date by default.
take a look at this
 ) : while ( have_posts() ) :... |
6,348 | <p>I made a new custom type, it's working fine. My question is: If i want to add in a single post that custom-type with different informations for about x times...how should I do this?</p>
<p><strong>Example:</strong><br>
Let's say I have "Reduced Price Laptops," with: </p>
<ul>
<li>Name </li>
<li>Price</li>
<li>Imag... | [
{
"answer_id": 6359,
"author": "Christopher",
"author_id": 1340,
"author_profile": "https://wordpress.stackexchange.com/users/1340",
"pm_score": 1,
"selected": false,
"text": "<p>As @goldenapples noted, if your template uses the the_date(); template tag, it'll do this all on its own, as ... | 2011/01/05 | [
"https://wordpress.stackexchange.com/questions/6348",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2292/"
] | I made a new custom type, it's working fine. My question is: If i want to add in a single post that custom-type with different informations for about x times...how should I do this?
**Example:**
Let's say I have "Reduced Price Laptops," with:
* Name
* Price
* Image
* Description
I want to make a post where I wil... | You may notice that I did more or less exactly this for Matt's site: <http://ma.tt>. Every set of posts is grouped by the day. The basic principle is to keep track of your day in the loop, then print the date and related stuff only when it changes.
Take a basic Loop:
```
if ( have_posts() ) : while ( have_posts() ) :... |
6,350 | <p>I am new to theming with wordpress. I have a theme layout with one sidebar at the right side of the website.</p>
<p>Now on my homepage and one other page i dont want to have the sidebar. On all other pages it needs to stay. How can i do this.</p>
<p>Any help would be appreciated.</p>
<p>Thanks.</p>
| [
{
"answer_id": 6355,
"author": "user1147",
"author_id": 1147,
"author_profile": "https://wordpress.stackexchange.com/users/1147",
"pm_score": 1,
"selected": false,
"text": "<p>You will need to register another sidebar.Look at twenty theme,in function.php file for example how to do that.<... | 2011/01/05 | [
"https://wordpress.stackexchange.com/questions/6350",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2293/"
] | I am new to theming with wordpress. I have a theme layout with one sidebar at the right side of the website.
Now on my homepage and one other page i dont want to have the sidebar. On all other pages it needs to stay. How can i do this.
Any help would be appreciated.
Thanks. | >
> ... on my homepage **and one other page**
> i dont want to have the sidebar.
>
>
>
You can tell WordPress to **do not generate** sidebar on specific page(s) with simple condition in your **page.php** file (or other relevant [template file](http://codex.wordpress.org/Theme_Development#Template_Files_List)).
... |
6,372 | <p>I am trying to <code>automate</code> editors work by automating <code>excerpts</code>.</p>
<p>My solution works but there are few problems with it: </p>
<ol>
<li><p>If a post has images/broken html at the beginning it breaks the layout.</p></li>
<li><p>Substring cuts words.</p></li>
</ol>
<p>Is there a better sol... | [
{
"answer_id": 6378,
"author": "goldenapples",
"author_id": 290,
"author_profile": "https://wordpress.stackexchange.com/users/290",
"pm_score": 4,
"selected": true,
"text": "<p>The excerpt filter by default cuts your post by a word count, which I think is probably preferable to a charact... | 2011/01/05 | [
"https://wordpress.stackexchange.com/questions/6372",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2313/"
] | I am trying to `automate` editors work by automating `excerpts`.
My solution works but there are few problems with it:
1. If a post has images/broken html at the beginning it breaks the layout.
2. Substring cuts words.
Is there a better solution to automate excerpts or improve my existing code?
```
<?php if(!empty... | The excerpt filter by default cuts your post by a word count, which I think is probably preferable to a character-based substr function like you're doing, and it strings out tags and images as well while doing it.
You can set the number of words to excerpt with the filter **[excerpt\_length](http://codex.wordpress.org... |
6,373 | <p>I have a subdirectory within my WP installation called <code>labs</code>. I created a WP page called <code>labs</code> as well. When a user hits <code>mydomain.com/labs/</code> I want them to load up the WP page. But instead it's loading up the <code>labs</code> directory listing.</p>
<p>I've read a few ways to d... | [
{
"answer_id": 6414,
"author": "Community",
"author_id": -1,
"author_profile": "https://wordpress.stackexchange.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<p>Your question seems to be a few in one :)</p>\n\n<ol>\n<li><p>you should not have to create a page <code>labs</code... | 2011/01/05 | [
"https://wordpress.stackexchange.com/questions/6373",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1979/"
] | I have a subdirectory within my WP installation called `labs`. I created a WP page called `labs` as well. When a user hits `mydomain.com/labs/` I want them to load up the WP page. But instead it's loading up the `labs` directory listing.
I've read a few ways to do this if I want my WP page to have a different name tha... | You'll need to do some .htaccess-fu to get what you're proposing to work.
```
RewriteCond $1 ^/labs/(.+)
RewriteRule ^/labs/(.*)$ /labs-folder/$1 [L]
```
This isn't tested yet but it if you put it *before* the wordpress rules in your htaccess file it will remap urls that begin with /labs/ to /labs-folder/ but not if... |
6,381 | <p>This question relates to a solution found <a href="https://wordpress.stackexchange.com/questions/578/adding-a-taxonomy-filter-to-admin-list-for-a-custom-post-type">here</a> from user somatic and mikeSchinkel</p>
<p>I am testing somatic's solution, and it loads and populates the dropdown with no issues, but When you... | [
{
"answer_id": 6391,
"author": "Manny Fleurmond",
"author_id": 2234,
"author_profile": "https://wordpress.stackexchange.com/users/2234",
"pm_score": 0,
"selected": false,
"text": "<p>I think that in the example you gave, the term that you put in the $filters array has to be lower case si... | 2011/01/05 | [
"https://wordpress.stackexchange.com/questions/6381",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2320/"
] | This question relates to a solution found [here](https://wordpress.stackexchange.com/questions/578/adding-a-taxonomy-filter-to-admin-list-for-a-custom-post-type) from user somatic and mikeSchinkel
I am testing somatic's solution, and it loads and populates the dropdown with no issues, but When you click filter, it doe... | I had the exact same problem like you. Don't know why mikeSchinkels code doesn't work anymore. But there are a new (WordPress 3.1) code for this, that works.
I found it here: <https://gist.github.com/541505#gistcomment-28441> (in mikes comments)
I replaced mikes code from line 65 to 95, with this code. (check Mikes c... |
6,389 | <p>I've got some pages with a custom taxonomy for each page and i'm trying to retrieve this taxonomy on the page. I'd basically need something like <code>the_current_taxonomy()</code> like <code>the_title()</code>. This has to run outside the loop cos i'll use it in a custom <code>WP_Query</code> right after.</p>
<p>E... | [
{
"answer_id": 6393,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 2,
"selected": false,
"text": "<p>I assume <code>taxonomy</code> is the same and what you need are <code>terms</code> in that taxonomy, assigned to the... | 2011/01/05 | [
"https://wordpress.stackexchange.com/questions/6389",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1997/"
] | I've got some pages with a custom taxonomy for each page and i'm trying to retrieve this taxonomy on the page. I'd basically need something like `the_current_taxonomy()` like `the_title()`. This has to run outside the loop cos i'll use it in a custom `WP_Query` right after.
Edit: Found a solution using a different way... | So, i needed to extract the **term** of a know **taxonomy** given to a page (like this:
```
function register_prod_categoria() {
register_taxonomy(
'prod-categoria',
array( 'produtos', 'page' ),
```
(**produtos** being a custom post type, just for info.)).
I tried various things, among them, this: `ge... |
6,399 | <p>Curious to know if there is a handy solution for showing cool email stats like Ma.tt's contact page <a href="http://ma.tt/contact/" rel="nofollow">http://ma.tt/contact/</a></p>
<blockquote>
<p>Inbox: 157. Low priority: 1,461.
Unknown: 155. I’ve sent out 920 emails
to 357 people in the past month.</p>
</blockq... | [
{
"answer_id": 6393,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 2,
"selected": false,
"text": "<p>I assume <code>taxonomy</code> is the same and what you need are <code>terms</code> in that taxonomy, assigned to the... | 2011/01/05 | [
"https://wordpress.stackexchange.com/questions/6399",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1521/"
] | Curious to know if there is a handy solution for showing cool email stats like Ma.tt's contact page <http://ma.tt/contact/>
>
> Inbox: 157. Low priority: 1,461.
> Unknown: 155. I’ve sent out 920 emails
> to 357 people in the past month.
>
>
> | So, i needed to extract the **term** of a know **taxonomy** given to a page (like this:
```
function register_prod_categoria() {
register_taxonomy(
'prod-categoria',
array( 'produtos', 'page' ),
```
(**produtos** being a custom post type, just for info.)).
I tried various things, among them, this: `ge... |
6,404 | <p>I am developing a website for a record label and the basically it uses quite a few custom post types for various pieces of information. My problem is that I feel the same bits of information are being repeated, rather than shared.</p>
<p>I have an artists custom post type, however on the homepage there is a carouse... | [
{
"answer_id": 6416,
"author": "MikeSchinkel",
"author_id": 89,
"author_profile": "https://wordpress.stackexchange.com/users/89",
"pm_score": 1,
"selected": false,
"text": "<p>Hi <strong>@Dewayne:</strong> </p>\n\n<p>You can't really <em>\"share\"</em> a post type; each post has one type... | 2011/01/06 | [
"https://wordpress.stackexchange.com/questions/6404",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1687/"
] | I am developing a website for a record label and the basically it uses quite a few custom post types for various pieces of information. My problem is that I feel the same bits of information are being repeated, rather than shared.
I have an artists custom post type, however on the homepage there is a carousel with art... | I have partly solved my own question so-to-speak. I've been trying to get post type relationships working for ages and the plugin relation post types as mentioned in my comment to Christopher's answer. It is far from perfect, but I worked out how to get this plugin: <http://wordpress.org/extend/plugins/relation-post-ty... |
6,417 | <p>I have installed the <a href="http://wordpress.org/extend/plugins/custom-post-type-ui/">Custom Post Type UI plugin</a>. After activation of this plugin I have created a custom post type called <code>portfolio</code>. Now I want to use this on the portfolio page in the front-end. How do I fetch <em>all post that are ... | [
{
"answer_id": 6418,
"author": "Martin-Al",
"author_id": 1463,
"author_profile": "https://wordpress.stackexchange.com/users/1463",
"pm_score": 6,
"selected": true,
"text": "<pre><code>query_posts( array( 'post_type' => array('post', 'portfolio') ) );\n</code></pre>\n\n<p>which shows b... | 2011/01/06 | [
"https://wordpress.stackexchange.com/questions/6417",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1850/"
] | I have installed the [Custom Post Type UI plugin](http://wordpress.org/extend/plugins/custom-post-type-ui/). After activation of this plugin I have created a custom post type called `portfolio`. Now I want to use this on the portfolio page in the front-end. How do I fetch *all post that are of custom post type `portfol... | ```
query_posts( array( 'post_type' => array('post', 'portfolio') ) );
```
which shows both normal posts and posts inside `portfolio` type
or
```
query_posts('post_type=portfolio');
```
for only `portfolio`.
Use as normal WP Query - read the Codex: <http://codex.wordpress.org/Function_Reference/query_posts#Usag... |
6,442 | <p>There are ways to convert color image to <code>black and white</code> on the client side with javascript. However, it won't work in all browsers and it's slow.</p>
<p>Is there a way to convert Wordpress post-thumbnails to <code>black and white</code> on the <code>server side</code> automatically? </p>
<p>This is w... | [
{
"answer_id": 6444,
"author": "Amit",
"author_id": 20,
"author_profile": "https://wordpress.stackexchange.com/users/20",
"pm_score": 1,
"selected": false,
"text": "<p>check that <a href=\"http://phpthumb.sourceforge.net/\" rel=\"nofollow\">http://phpthumb.sourceforge.net/</a> it has som... | 2011/01/06 | [
"https://wordpress.stackexchange.com/questions/6442",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2313/"
] | There are ways to convert color image to `black and white` on the client side with javascript. However, it won't work in all browsers and it's slow.
Is there a way to convert Wordpress post-thumbnails to `black and white` on the `server side` automatically?
This is what I would like to achieve:
1. Upload a color im... | You can use the php GD library which you most likely already have on your server since wordpresses uses it.
You can filter the image using [imagefilter](http://us2.php.net/manual/en/function.imagefilter.php) specifically IMG\_FILTER\_GRAYSCALE and/or IMG\_FILTER\_CONTRAST.
For example
```
imagefilter($im, IMG_FILTE... |
6,462 | <p>I've developed a custom post type for WordPress that has quite a few entries that require pagination. I used the *paginate_links* function and it creates the pagination appropriately, rendering links that look like this:</p>
<p><a href="http://mysite.com/people/page/5/" rel="nofollow">http://mysite.com/people/page/... | [
{
"answer_id": 6464,
"author": "EAMann",
"author_id": 46,
"author_profile": "https://wordpress.stackexchange.com/users/46",
"pm_score": 1,
"selected": false,
"text": "<p>As a starter, I recommend you review the discussion on a similar question regarding custom taxonomies and custom post ... | 2011/01/06 | [
"https://wordpress.stackexchange.com/questions/6462",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2355/"
] | I've developed a custom post type for WordPress that has quite a few entries that require pagination. I used the \*paginate\_links\* function and it creates the pagination appropriately, rendering links that look like this:
<http://mysite.com/people/page/5/>
But whenever one of the links is clicked on it returns a 40... | As a starter, I recommend you review the discussion on a similar question regarding custom taxonomies and custom post types: [Fixing Pagination with Custom Taxonomy Archive](https://wordpress.stackexchange.com/questions/1635/fixing-pagination-with-custom-taxonomy-archive).
You'll probably need to work with the global ... |
6,466 | <p>0 down vote favorite</p>
<p>Hi, I am working with wordpress where i have a event listing system. There is a custom field in my post called starting_time which is unix timestamp. Now i want to short all posts by starting_time by this query_post command:</p>
<pre><code>query_posts(array(
'post_type' =... | [
{
"answer_id": 6471,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 2,
"selected": false,
"text": "<p>If this table is in same database as your WordPress installation you can use <a href=\"http://codex.wordpress.org/Fun... | 2011/01/06 | [
"https://wordpress.stackexchange.com/questions/6466",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/3094/"
] | 0 down vote favorite
Hi, I am working with wordpress where i have a event listing system. There is a custom field in my post called starting\_time which is unix timestamp. Now i want to short all posts by starting\_time by this query\_post command:
```
query_posts(array(
'post_type' => 'event',
... | This is precisely what [custom post types](http://codex.wordpress.org/Post_Types) are for.
If it were my project, I'd scrap the custom table you have, set up a custom post type for your "widgets", add all your existing widgets as regular WP content, and use standard WordPress functions and templates to query and displ... |
6,493 | <p>I've got a custom query on my homepage showing all posts in a certain category. I need this query to respect sticky posts, but it seems from my research that category queries ignore stickyness. My question is two (and a half) fold:</p>
<ol>
<li>Can anyone tell me where/how in the database stickyness is applied to a... | [
{
"answer_id": 6494,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 2,
"selected": false,
"text": "<p>Sticky is not saved per post, there is <code>sticky_posts</code> option that holds array of such. So you can fetch th... | 2011/01/06 | [
"https://wordpress.stackexchange.com/questions/6493",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2044/"
] | I've got a custom query on my homepage showing all posts in a certain category. I need this query to respect sticky posts, but it seems from my research that category queries ignore stickyness. My question is two (and a half) fold:
1. Can anyone tell me where/how in the database stickyness is applied to a post? I don'... | Just add `'post__in' => get_option('sticky_posts')` to your query, to confine your query to only sticky posts. So,
```
$getHighlights = array(
'numberposts' => 7,
'post_type' => array('post','Event'),
'post__in' => get_option('sticky_posts'),
'category_name' => 'Highlights'
);
```
should work for you... |
6,499 | <p>I'm trying to create a conditional statement for the content width in the functions.php of my theme. So some categories will have a content_width of 580, some will have 900. This will make the oEmbed work correctly wherever it's used.</p>
<p>Usually, you would have this in your functions.php:</p>
<pre><code>if ( !... | [
{
"answer_id": 6500,
"author": "goldenapples",
"author_id": 290,
"author_profile": "https://wordpress.stackexchange.com/users/290",
"pm_score": 4,
"selected": true,
"text": "<p>No, its not possible. <strong>$content_width</strong> is a theme-wide constant, and its set in functions.php be... | 2011/01/07 | [
"https://wordpress.stackexchange.com/questions/6499",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2357/"
] | I'm trying to create a conditional statement for the content width in the functions.php of my theme. So some categories will have a content\_width of 580, some will have 900. This will make the oEmbed work correctly wherever it's used.
Usually, you would have this in your functions.php:
```
if ( ! isset( $content_wid... | No, its not possible. **$content\_width** is a theme-wide constant, and its set in functions.php before any of the query conditionals are set.
**$content\_width** is used to determine the intermediate image sizes in `image_send_to_editor`. The "large" image size will be set to the value of $content\_width.
If you nee... |
6,508 | <p>I'm messing with wp_rewrite and have spent the past few hours trying to figure regular expressions out again (i seem to have forgotten.) This is probably extremely easy for someone. Basically I'd like to match an alpha expression and stop at teh first occurance of a forward slash. Here's what i'm doing:</p>
<p>I h... | [
{
"answer_id": 6509,
"author": "scribu",
"author_id": 205,
"author_profile": "https://wordpress.stackexchange.com/users/205",
"pm_score": 3,
"selected": true,
"text": "<p>Replace <code>(.*)</code> with <code>(.*?)</code>. The question mark makes it 'lazy'.</p>\n\n<p>Also, replace <code>(... | 2011/01/07 | [
"https://wordpress.stackexchange.com/questions/6508",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2271/"
] | I'm messing with wp\_rewrite and have spent the past few hours trying to figure regular expressions out again (i seem to have forgotten.) This is probably extremely easy for someone. Basically I'd like to match an alpha expression and stop at teh first occurance of a forward slash. Here's what i'm doing:
I have a url
... | Replace `(.*)` with `(.*?)`. The question mark makes it 'lazy'.
Also, replace `([0-9]{4})` with `(\d+)`.
See <http://www.regular-expressions.info/reference.html> |
6,511 | <p>A website I work on recently posted a file at the root of their website named "2011.html." Now, any 2011 blog posts with the permalink structure of year/month/day/post-name do not work, and instead load the 2011.html file. Trying to bring up the archive at domain.com/2011/ also incorrectly brings up the file. 201... | [
{
"answer_id": 6517,
"author": "jmort253",
"author_id": 2368,
"author_profile": "https://wordpress.stackexchange.com/users/2368",
"pm_score": 1,
"selected": false,
"text": "<p>Yes, this is exactly the type of thing mod_rewrite was designed to do. However, you will need to move the blog ... | 2011/01/07 | [
"https://wordpress.stackexchange.com/questions/6511",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/5/"
] | A website I work on recently posted a file at the root of their website named "2011.html." Now, any 2011 blog posts with the permalink structure of year/month/day/post-name do not work, and instead load the 2011.html file. Trying to bring up the archive at domain.com/2011/ also incorrectly brings up the file. 2010 and ... | The reason that's happening at all is because of [content negotiation](http://httpd.apache.org/docs/2.2/content-negotiation.html). `/2011.html` wouldn't normally be accessible through `/2011/`, but content negotiation is making Apache automatically look for files named `2011` (whatever the extension) when it can't find... |
6,538 | <p>Is it possible using WP_Query to return a filtered list of items based on the following criteria set? I seem to be struggling as there are numerous queries against custom fields.</p>
<pre><code>Select all posts that are of type business_club (post_type)
Where the post has a zone of 'Asia' (meta_value)
Order by coun... | [
{
"answer_id": 6545,
"author": "kevin",
"author_id": 1997,
"author_profile": "https://wordpress.stackexchange.com/users/1997",
"pm_score": 2,
"selected": false,
"text": "<p>Did you try something like this: </p>\n\n<pre><code>$loop = new WP_Query( array( \n 'post_type' => 'business_... | 2011/01/07 | [
"https://wordpress.stackexchange.com/questions/6538",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2371/"
] | Is it possible using WP\_Query to return a filtered list of items based on the following criteria set? I seem to be struggling as there are numerous queries against custom fields.
```
Select all posts that are of type business_club (post_type)
Where the post has a zone of 'Asia' (meta_value)
Order by country ASC (meta... | The way around it was to build a custom query. More information on this can be viewed on the Wordpress codex at <http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query>.
My final code looked as follows
```
<?php
$row = 0;
$zone = $_GET['zone'];
if (!$zone) $zone = "United Kingdom";
?>
... |
6,553 | <p>I recently switched a WP site from shared hosting to a VPS and would like to document the process here.</p>
| [
{
"answer_id": 6556,
"author": "scribu",
"author_id": 205,
"author_profile": "https://wordpress.stackexchange.com/users/205",
"pm_score": 3,
"selected": false,
"text": "<h2>Put old host in read-only mode</h2>\n\n<ol>\n<li>Go to WP Admin -> Settings -> Discussion and check \"Users must be... | 2011/01/07 | [
"https://wordpress.stackexchange.com/questions/6553",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/205/"
] | I recently switched a WP site from shared hosting to a VPS and would like to document the process here. | Put old host in read-only mode
------------------------------
1. Go to WP Admin -> Settings -> Discussion and check "Users must be registered and logged in to comment"
2. Disable authentication:
Create a PHP file inside the wp-content/mu-plugins folder, with the following content:
```
<?php
function wp_get_current_u... |
6,557 | <p>I've been browsing all over google for a solution to this. I'm writing a custom post types plugin for work to log-in visitors that we get. I initially wrote a mock-up <em>without</em> custom post types, then I came around here from a google search and saw a screenshot that showed an example of custom post types to s... | [
{
"answer_id": 6575,
"author": "Chris_O",
"author_id": 251,
"author_profile": "https://wordpress.stackexchange.com/users/251",
"pm_score": 5,
"selected": true,
"text": "<h3>The question / answer you are referring to was <a href=\"https://wordpress.stackexchange.com/questions/128/tips-for... | 2011/01/07 | [
"https://wordpress.stackexchange.com/questions/6557",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2322/"
] | I've been browsing all over google for a solution to this. I'm writing a custom post types plugin for work to log-in visitors that we get. I initially wrote a mock-up *without* custom post types, then I came around here from a google search and saw a screenshot that showed an example of custom post types to store infor... | ### The question / answer you are referring to was [Tips for using WordPress as a CMS](https://wordpress.stackexchange.com/questions/128/tips-for-using-wordpress-as-a-cms).
The screenshots posted in that answer were created using the `register_meta_box_cb` argument that is available to for custom post types.
register... |
6,561 | <p>I am in the process of moving a site made up of asp pages to a completely redesigned Wordpress site. It has come time to create the 301 redirects for those old pages, so I don't break any links that are out there. </p>
<p>I do have the redirection plugin installed as well. </p>
<p>I've tried using it to do thes... | [
{
"answer_id": 6575,
"author": "Chris_O",
"author_id": 251,
"author_profile": "https://wordpress.stackexchange.com/users/251",
"pm_score": 5,
"selected": true,
"text": "<h3>The question / answer you are referring to was <a href=\"https://wordpress.stackexchange.com/questions/128/tips-for... | 2011/01/07 | [
"https://wordpress.stackexchange.com/questions/6561",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2378/"
] | I am in the process of moving a site made up of asp pages to a completely redesigned Wordpress site. It has come time to create the 301 redirects for those old pages, so I don't break any links that are out there.
I do have the redirection plugin installed as well.
I've tried using it to do these types of redirects... | ### The question / answer you are referring to was [Tips for using WordPress as a CMS](https://wordpress.stackexchange.com/questions/128/tips-for-using-wordpress-as-a-cms).
The screenshots posted in that answer were created using the `register_meta_box_cb` argument that is available to for custom post types.
register... |
6,569 | <p>I'd like to decrease the default RSS cache time for a widget plugin i've made that outputs RSS feeds. I'm no php expert, I just copy and paste and understand little bits. I'm using this code to output the RSS</p>
<pre><code> function widget($args, $instance) {
// outputs the content of the widget
extract( ... | [
{
"answer_id": 6573,
"author": "Chris_O",
"author_id": 251,
"author_profile": "https://wordpress.stackexchange.com/users/251",
"pm_score": 2,
"selected": false,
"text": "<h3>The default lifetime of a transient cached feed is 12 hours. It can be changed by hooking in to the wp_feed_cache... | 2011/01/08 | [
"https://wordpress.stackexchange.com/questions/6569",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1925/"
] | I'd like to decrease the default RSS cache time for a widget plugin i've made that outputs RSS feeds. I'm no php expert, I just copy and paste and understand little bits. I'm using this code to output the RSS
```
function widget($args, $instance) {
// outputs the content of the widget
extract( $args );
... | Why not just use native RSS widget?
Also while Chris\_O is absolutely right on filter to use, it is better practice to change cache time for specific feed URL rather than globally:
```
add_filter( 'wp_feed_cache_transient_lifetime', 'speed_up_feed', 10, 2 );
function speed_up_feed( $interval, $url ) {
if( 'http... |
6,571 | <p>I am completely noob with WordPress so I apologize in advance if my questions sounds completely stupid.</p>
<p><strong>Background</strong></p>
<p>I have a small <a href="http://venhawk.com" rel="nofollow">business catalog site</a> that I wrote long ago in plain HTML. Now I want to add some SEO and improve the desi... | [
{
"answer_id": 6573,
"author": "Chris_O",
"author_id": 251,
"author_profile": "https://wordpress.stackexchange.com/users/251",
"pm_score": 2,
"selected": false,
"text": "<h3>The default lifetime of a transient cached feed is 12 hours. It can be changed by hooking in to the wp_feed_cache... | 2011/01/08 | [
"https://wordpress.stackexchange.com/questions/6571",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2382/"
] | I am completely noob with WordPress so I apologize in advance if my questions sounds completely stupid.
**Background**
I have a small [business catalog site](http://venhawk.com) that I wrote long ago in plain HTML. Now I want to add some SEO and improve the design therefore I am looking to use a CMS for easy content ... | Why not just use native RSS widget?
Also while Chris\_O is absolutely right on filter to use, it is better practice to change cache time for specific feed URL rather than globally:
```
add_filter( 'wp_feed_cache_transient_lifetime', 'speed_up_feed', 10, 2 );
function speed_up_feed( $interval, $url ) {
if( 'http... |
6,579 | <p>Ok, I'm going to try to explain this as simple as possible.</p>
<p>I'm trying to modify a plugin called <a href="https://code.google.com/p/smart-lencioni-image-resizer/downloads/detail?name=slir-2.0b3.7z" rel="nofollow">smart-lencioni-image-resizer</a> v2.0. to be used in WP-Multisite.</p>
<p>I'm trying to display... | [
{
"answer_id": 6580,
"author": "Denis de Bernardy",
"author_id": 1208,
"author_profile": "https://wordpress.stackexchange.com/users/1208",
"pm_score": 1,
"selected": false,
"text": "<p>autoload gets fired whenever class_exists() gets called. In your autoloader, add a check to verify that... | 2011/01/08 | [
"https://wordpress.stackexchange.com/questions/6579",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1447/"
] | Ok, I'm going to try to explain this as simple as possible.
I'm trying to modify a plugin called [smart-lencioni-image-resizer](https://code.google.com/p/smart-lencioni-image-resizer/downloads/detail?name=slir-2.0b3.7z) v2.0. to be used in WP-Multisite.
I'm trying to display an image through SLIR using the following ... | Denis was pointing to the right direction, but just looking for if the file exists is not the whole job.
I do this by example, but you need to do this for every file that is unable to load:
* The class that is unable to get auto-loaded, locate it. Class is `Translation_Entry` and it is located in `/wp-includes/pomo/e... |
6,581 | <p>I couldn't seem to find a plugin with both functionality so I created mine(not a plugin) thru the help of my old friend google. My code works but there's a small glitch, the title of the posts are the same for all recent comments.</p>
<pre><code>$comments = get_comments('status=approve&number=5'); ?>
<ul&... | [
{
"answer_id": 6596,
"author": "onetrickpony",
"author_id": 1986,
"author_profile": "https://wordpress.stackexchange.com/users/1986",
"pm_score": 3,
"selected": true,
"text": "<p>Use <code>$comment->comment_post_ID</code> instead of <code>$comment->post_id</code>.</p>\n\n<p>Also yo... | 2011/01/08 | [
"https://wordpress.stackexchange.com/questions/6581",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1649/"
] | I couldn't seem to find a plugin with both functionality so I created mine(not a plugin) thru the help of my old friend google. My code works but there's a small glitch, the title of the posts are the same for all recent comments.
```
$comments = get_comments('status=approve&number=5'); ?>
<ul> <?php
foreach ($commen... | Use `$comment->comment_post_ID` instead of `$comment->post_id`.
Also you don't need get\_post(...). Just use [get\_the\_title](http://codex.wordpress.org/Function_Reference/get_the_title) instead of your `$post_obj` and related code... |
6,582 | <p>I want to use dd belatedpng so the PNG's on my website appear properly on IE. The script I've always used on non-wordpress websites was</p>
<pre><code><!--[if lt IE 7 ]>
<script src="js/dd_belatedpng.js"></script>
<script> DD_belatedPNG.fix('img, .ir'); </script>
<![endif]--... | [
{
"answer_id": 6586,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 2,
"selected": false,
"text": "<p>Enqueue doesn't support output of more complex blocks, only script files.</p>\n\n<p>Best approach for this would be s... | 2011/01/08 | [
"https://wordpress.stackexchange.com/questions/6582",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2169/"
] | I want to use dd belatedpng so the PNG's on my website appear properly on IE. The script I've always used on non-wordpress websites was
```
<!--[if lt IE 7 ]>
<script src="js/dd_belatedpng.js"></script>
<script> DD_belatedPNG.fix('img, .ir'); </script>
<![endif]-->
```
Now that I need to use it on a Wordpres... | WordPress has a `$is_IE` global variable:
```
global $is_IE;
if($is_IE) enqueue_script(...);
```
Personally I prefer the IE conditional comments. Other browsers ignore them anyway, so there's no reason to use PHP for browser detection.
You might also want to consider using [8 bit alpha PNG images](http://www.ethana... |
6,600 | <p>First time posting in the Wordpress area of Stack Exchange. Hopefully someone will be able to help me with an issue.</p>
<p>I have successfully integrated Gallerific with the NextGen plugin.The one issue that I am having is that I simply cannot figure out how to rotate the image description with the image. I can on... | [
{
"answer_id": 11295,
"author": "aendra",
"author_id": 1682,
"author_profile": "https://wordpress.stackexchange.com/users/1682",
"pm_score": 0,
"selected": false,
"text": "<p>Please provide a link to an example page in the future, makes everyone's job easier. :D</p>\n\n<p>Try changing:</... | 2011/01/08 | [
"https://wordpress.stackexchange.com/questions/6600",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2388/"
] | First time posting in the Wordpress area of Stack Exchange. Hopefully someone will be able to help me with an issue.
I have successfully integrated Gallerific with the NextGen plugin.The one issue that I am having is that I simply cannot figure out how to rotate the image description with the image. I can only get the... | I struggled with the same issue but instead of using Nextgen (which goes way overboard in my opinion), I integrated Gallerific as a WordPress gallery shortcode replacement. It works really well and is very easy for the end user because they just have to add the images to the post and click insert gallery.
I'll provide... |
6,602 | <p>This question got me thinking <a href="https://wordpress.stackexchange.com/questions/5704/transient-rss-feeds-in-wp-options-not-removed-automatically">Transient RSS feeds in wp_options not removed automatically?</a></p>
<p>Transients are supposed to expire and be deleted. However the only way I see this handled is ... | [
{
"answer_id": 6652,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 7,
"selected": true,
"text": "<h2>They now are</h2>\n\n<p>Starting with WordPress 3.7 expired transients are deleted on database upgrades, see <a href=... | 2011/01/09 | [
"https://wordpress.stackexchange.com/questions/6602",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/847/"
] | This question got me thinking [Transient RSS feeds in wp\_options not removed automatically?](https://wordpress.stackexchange.com/questions/5704/transient-rss-feeds-in-wp-options-not-removed-automatically)
Transients are supposed to expire and be deleted. However the only way I see this handled is when transient is ex... | They now are
------------
Starting with WordPress 3.7 expired transients are deleted on database upgrades, see [#20316](http://core.trac.wordpress.org/ticket/20316)
---
Old answer
----------
If someone can't show me otherwise it seems that transients are not garbage collected after all. What makes it worse is that ... |
6,605 | <p>Is it possible to fetch videos and images of a particular website and put it into post?
i mean i am thinking of writing a function, where i will just write the website name, and then with the help of website url, all or latest images and videos are posted to my post.
Is this possible?</p>
| [
{
"answer_id": 6652,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 7,
"selected": true,
"text": "<h2>They now are</h2>\n\n<p>Starting with WordPress 3.7 expired transients are deleted on database upgrades, see <a href=... | 2011/01/09 | [
"https://wordpress.stackexchange.com/questions/6605",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1743/"
] | Is it possible to fetch videos and images of a particular website and put it into post?
i mean i am thinking of writing a function, where i will just write the website name, and then with the help of website url, all or latest images and videos are posted to my post.
Is this possible? | They now are
------------
Starting with WordPress 3.7 expired transients are deleted on database upgrades, see [#20316](http://core.trac.wordpress.org/ticket/20316)
---
Old answer
----------
If someone can't show me otherwise it seems that transients are not garbage collected after all. What makes it worse is that ... |
6,622 | <p>I want to add a custom button to the tinyMCE toolbar in the 'Add New Post' screen which when clicked, will insert text into the new post.</p>
<p>I have tried using this code (from <a href="http://tinymce.moxiecode.com/tryit/custom_toolbar_button.php" rel="nofollow">http://tinymce.moxiecode.com/tryit/custom_toolbar_... | [
{
"answer_id": 6624,
"author": "t31os",
"author_id": 31073,
"author_profile": "https://wordpress.stackexchange.com/users/31073",
"pm_score": 4,
"selected": true,
"text": "<p>Your problem i believe are the lines that follow the enqueues and print scripts, you're mixing Javascript with PHP... | 2011/01/09 | [
"https://wordpress.stackexchange.com/questions/6622",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/739/"
] | I want to add a custom button to the tinyMCE toolbar in the 'Add New Post' screen which when clicked, will insert text into the new post.
I have tried using this code (from <http://tinymce.moxiecode.com/tryit/custom_toolbar_button.php>):
```
wp_admin_css('thickbox');
wp_print_scripts('jquery-ui-core');
wp_print_scrip... | Your problem i believe are the lines that follow the enqueues and print scripts, you're mixing Javascript with PHP..
Javascript goes inside the HTML section of a PHP file or inside an echo statement.
[This page of the codex](http://codex.wordpress.org/TinyMCE_Custom_Buttons) gives an example for adding a button to T... |
6,645 | <p>Is there any way I can take a URL of an image and find the attachment or post id of that image in the database?</p>
<p>Here is the situation:</p>
<p>I'm in a loop going over all the 'img' tags that are surrounded by 'a' tags in my post content. if the src attribute of the 'img' tag does not match the href attribut... | [
{
"answer_id": 7094,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 6,
"selected": true,
"text": "<p>Massively improved function developed for plugin heavy on images:</p>\n\n<pre><code>if ( ! function_exists( 'get_attac... | 2011/01/10 | [
"https://wordpress.stackexchange.com/questions/6645",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2404/"
] | Is there any way I can take a URL of an image and find the attachment or post id of that image in the database?
Here is the situation:
I'm in a loop going over all the 'img' tags that are surrounded by 'a' tags in my post content. if the src attribute of the 'img' tag does not match the href attribute of the outer 'a... | Massively improved function developed for plugin heavy on images:
```
if ( ! function_exists( 'get_attachment_id' ) ) {
/**
* Get the Attachment ID for a given image URL.
*
* @link http://wordpress.stackexchange.com/a/7094
*
* @param string $url
*
* @return boolean|integer
... |
6,679 | <p>Seems like a trivial problem but I can't get it to work. I need to add <code>class="last"</code> to every third post. </p>
<p>Here is my code:</p>
<pre><code> <?php
$count = 0;
$my_query = new WP_Query('cat=-18,-7&showposts=9');
while ($my_query->have_posts()) : $my_query->the_post();
... | [
{
"answer_id": 6682,
"author": "sanchothefat",
"author_id": 1733,
"author_profile": "https://wordpress.stackexchange.com/users/1733",
"pm_score": 2,
"selected": true,
"text": "<p>I think you just need to start the <code>$count</code> variable from 1 and not zero. You'll get the opposite ... | 2011/01/10 | [
"https://wordpress.stackexchange.com/questions/6679",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2313/"
] | Seems like a trivial problem but I can't get it to work. I need to add `class="last"` to every third post.
Here is my code:
```
<?php
$count = 0;
$my_query = new WP_Query('cat=-18,-7&showposts=9');
while ($my_query->have_posts()) : $my_query->the_post();
?>
<article class="<?php if ($count ... | I think you just need to start the `$count` variable from 1 and not zero. You'll get the opposite effect otherwise because 0 modulo 3 is 0. The first item of every 3 will be getting the class name. |
6,680 | <p>I recently asked a <a href="https://wordpress.stackexchange.com/questions/6557/redesigning-custom-post-type-add-new-page">question</a> the other day and got what I was looking for. Today I put that knowledge to practice, but I can't seem to figure how to remove the title and editor fields from the "edit" page.</p>
... | [
{
"answer_id": 6684,
"author": "Noel Tock",
"author_id": 2393,
"author_profile": "https://wordpress.stackexchange.com/users/2393",
"pm_score": 0,
"selected": false,
"text": "<p>I think you need something in there. Title & Editor are the <strong>defaults when nothing is present</stron... | 2011/01/10 | [
"https://wordpress.stackexchange.com/questions/6680",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2322/"
] | I recently asked a [question](https://wordpress.stackexchange.com/questions/6557/redesigning-custom-post-type-add-new-page) the other day and got what I was looking for. Today I put that knowledge to practice, but I can't seem to figure how to remove the title and editor fields from the "edit" page.
Below shows the ar... | You were close .) This works:
```
'supports' => array( '' ),
``` |
6,699 | <p><strong>The problem</strong>: to change a widget's options with a custom function in functions.php, when there are no useful hooks, and where there are multiple occurrences of the same widget (multiwidget). </p>
<p>This would involve:</p>
<ol>
<li><p>Retrieving the options from "widget_some-widget" in the "wp_opti... | [
{
"answer_id": 6732,
"author": "MikeSchinkel",
"author_id": 89,
"author_profile": "https://wordpress.stackexchange.com/users/89",
"pm_score": 0,
"selected": false,
"text": "<p>Hi <strong>@maduroblanco:</strong></p>\n\n<p>This would very much be a hack, but have you tried to hook <code>'o... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6699",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2039/"
] | **The problem**: to change a widget's options with a custom function in functions.php, when there are no useful hooks, and where there are multiple occurrences of the same widget (multiwidget).
This would involve:
1. Retrieving the options from "widget\_some-widget" in the "wp\_options" table. (The returned option c... | After some digging, I've arrived at a solution (explained in the comments) -
```
function change_widget_configuration() {
$options = get_option('widget_some-widget'); // retrieve the options for all occurrences of the named widget*
$widget_number = 3; // the id number of the specific occurrence of the widget who... |
6,712 | <p>Is it possible to set configuration options such as DEBUG mode only for specific sub blogs in a wordpress multisite installation? If so, how?</p>
| [
{
"answer_id": 6714,
"author": "andrea_r",
"author_id": 1391,
"author_profile": "https://wordpress.stackexchange.com/users/1391",
"pm_score": -1,
"selected": false,
"text": "<p>If you're asking about putting that define in wp-config and making it apply to one site, then no.</p>\n"
},
... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6712",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/353/"
] | Is it possible to set configuration options such as DEBUG mode only for specific sub blogs in a wordpress multisite installation? If so, how? | Hi **@Raj Sekharan:**
If I understand your question lets say you have three (3) subdomains on your multisite and you only want to debug the first?
1. <http://foo.example.com>
2. <http://bar.example.com>
3. <http://baz.example.com>
If yes then it's a simply matter of adding the following to your `/wp-config.php` file... |
6,719 | <p>I'm trying to add a new tab to my groups on BuddyPress. All the groups will have different content preferrably from the database.</p>
<p>How can I accomplish this?</p>
| [
{
"answer_id": 6739,
"author": "sanchothefat",
"author_id": 1733,
"author_profile": "https://wordpress.stackexchange.com/users/1733",
"pm_score": 4,
"selected": true,
"text": "<p>There's an example of this on the buddypress forums which is a good place to start looking for answers.</p>\n... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6719",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2188/"
] | I'm trying to add a new tab to my groups on BuddyPress. All the groups will have different content preferrably from the database.
How can I accomplish this? | There's an example of this on the buddypress forums which is a good place to start looking for answers.
<http://buddypress.org/community/groups/creating-extending/forum/topic/can-someone-explain-how-to-add-tabs-to-the-profile-page/>
For the sake of answering here though here goes:
```
bp_core_new_subnav_item( array(... |
6,722 | <p>When a site gets to a certain scale, storing categories on a per-blog basis starts to get a little messy. Assuming someone would want all WPMU blogs to share a single set of categories, how might one go about that? My gut it so store a set of "cannonical" categories in the root blog. Is there a more elegant or stand... | [
{
"answer_id": 6724,
"author": "EAMann",
"author_id": 46,
"author_profile": "https://wordpress.stackexchange.com/users/46",
"pm_score": 2,
"selected": true,
"text": "<p>A more elegant solution would be to create a <a href=\"http://codex.wordpress.org/Create_A_Network#WordPress_Plugins\" ... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6722",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1860/"
] | When a site gets to a certain scale, storing categories on a per-blog basis starts to get a little messy. Assuming someone would want all WPMU blogs to share a single set of categories, how might one go about that? My gut it so store a set of "cannonical" categories in the root blog. Is there a more elegant or standard... | A more elegant solution would be to create a [MU (must use) plug-in](http://codex.wordpress.org/Create_A_Network#WordPress_Plugins) and drop it on the network. This plug-in would check (per-site) if the categories exist and, if not, add them as appropriate.
Here's some ***untested*** example code:
```
<?php
$default_... |
6,723 | <p>Is there any plugin that can do that?</p>
| [
{
"answer_id": 6726,
"author": "Noel Tock",
"author_id": 2393,
"author_profile": "https://wordpress.stackexchange.com/users/2393",
"pm_score": 2,
"selected": false,
"text": "<p>Just add it in before the comment function (unless I misunderstood something?):</p>\n\n<pre><code><div class... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6723",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1542/"
] | Is there any plugin that can do that? | Hi **@Emerson:**
Do you want before the list of comments or before the comment form *(I assume the latter?)*
If yes, and I'm assuming you are either using the TwentyTen theme or a theme that uses the new `comment_form()` function from WordPress 3.0.0? If so it's as simple as using the `'comment_form_before'` hook. He... |
6,728 | <p>my self-made admin panel works just fine, but it doesn't save values of form inputs.</p>
<p>When I type something into textbox and click "save" it is still there after refreshing, thanks to PHP:</p>
<pre><code><input type="text" name="header" value="<?php echo get_option('header'); ?>" />
</code></pre... | [
{
"answer_id": 6729,
"author": "goldenapples",
"author_id": 290,
"author_profile": "https://wordpress.stackexchange.com/users/290",
"pm_score": 2,
"selected": true,
"text": "<p>This is really just an html question, not specific to WordPress. Look into <code>checked=\"checked\"</code> (fo... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6728",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1869/"
] | my self-made admin panel works just fine, but it doesn't save values of form inputs.
When I type something into textbox and click "save" it is still there after refreshing, thanks to PHP:
```
<input type="text" name="header" value="<?php echo get_option('header'); ?>" />
```
So the PHP echoes its own value to a in... | This is really just an html question, not specific to WordPress. Look into `checked="checked"` (for check boxes) or `selected="selected"` (for selects, radio buttons, etc.) In your case,
```
<input type="checkbox" name="showS" value="true"
<?php if (get_option('showS')==true) echo 'checked="checked" '; ?>>
```
... |
6,731 | <p>I am looking for a way to test if a post is a custom post type. For example, in, say, the sidebar I can put in code like this:</p>
<pre><code> if ( is_single() ) {
// Code here
}
</code></pre>
<p>I want code testing for only a custom post type.</p>
| [
{
"answer_id": 6733,
"author": "Szymon Skulimowski",
"author_id": 2430,
"author_profile": "https://wordpress.stackexchange.com/users/2430",
"pm_score": 8,
"selected": true,
"text": "<p>Here you are: <a href=\"http://codex.wordpress.org/Function_Reference/get_post_type\"><code>get_post_ty... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6731",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1333/"
] | I am looking for a way to test if a post is a custom post type. For example, in, say, the sidebar I can put in code like this:
```
if ( is_single() ) {
// Code here
}
```
I want code testing for only a custom post type. | Here you are: [`get_post_type()`](http://codex.wordpress.org/Function_Reference/get_post_type) and then `if ( 'book' == get_post_type() ) ...` as per [Conditional Tags > A Post Type](http://codex.wordpress.org/Conditional_Tags#A_Post_Type) in Codex. |
6,742 | <p>I'm trying to determine how to retrieve custom values from wp_options when the values are stored in a single options array.</p>
<p>For example, I've got the following data in wp_options for option_value where option_name = "my_category_fields_option". The i:n value represents the category id of the category that ho... | [
{
"answer_id": 6744,
"author": "onetrickpony",
"author_id": 1986,
"author_profile": "https://wordpress.stackexchange.com/users/1986",
"pm_score": 4,
"selected": true,
"text": "<pre><code>$term_id = get_query_var('cat'); // the current category ID\n\n$my_fields = get_option('my_category_f... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6742",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/366/"
] | I'm trying to determine how to retrieve custom values from wp\_options when the values are stored in a single options array.
For example, I've got the following data in wp\_options for option\_value where option\_name = "my\_category\_fields\_option". The i:n value represents the category id of the category that holds... | ```
$term_id = get_query_var('cat'); // the current category ID
$my_fields = get_option('my_category_fields_option');
echo $my_fields[$term_id]['my_title']; // the title corresponding to the current category
```
(assuming you're talking about [Any examples of adding custom fields to the category editor?](https://wor... |
6,746 | <p>I'd like this function to only return on certain pages. How might i do that?</p>
<pre><code>// Retreats Accordion
function retreats_accordion() {
?>
<!-- accordion root -->
<div id="accordion">
<?php
global $post;
$c = 0;
$class = '';
$args = array( 'posts_... | [
{
"answer_id": 6747,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 3,
"selected": true,
"text": "<p>Your code:</p>\n\n<pre><code>if( is_page(107) )\n return;\n</code></pre>\n\n<p>checks for page and returns nothing ... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6746",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1925/"
] | I'd like this function to only return on certain pages. How might i do that?
```
// Retreats Accordion
function retreats_accordion() {
?>
<!-- accordion root -->
<div id="accordion">
<?php
global $post;
$c = 0;
$class = '';
$args = array( 'posts_per_page' => 6, 'post_type'=> 's... | Your code:
```
if( is_page(107) )
return;
```
checks for page and returns nothing on match, effectively it's exactly opposite of what you want. So if you reverse it and put this at start of function:
```
if( !is_page(107) )
return;
```
It will do nothing everywhere, but page 107 where it will proceed to r... |
6,754 | <p>I think this must be a simple question, despite the seemingly broad title. My wordpress theme by default displays several social icons. (You can <a href="http://www.topblogformula.com/demo/" rel="nofollow">see them here</a>, in the upper right corner.) I'm trying to add a new icon to the existing ones. I've already ... | [
{
"answer_id": 6755,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 2,
"selected": false,
"text": "<p>HTML markup can be generated in several ways:</p>\n\n<ul>\n<li>directly included in theme's <a href=\"http://codex.wo... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6754",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2400/"
] | I think this must be a simple question, despite the seemingly broad title. My wordpress theme by default displays several social icons. (You can [see them here](http://www.topblogformula.com/demo/), in the upper right corner.) I'm trying to add a new icon to the existing ones. I've already generated and uploaded a new ... | As @Ambitious Amoeba indicated above, what I was looking for was hardcoded in the footer template. |
6,765 | <p>I have been working around with adding stuff in user profile edit area. I am done with that but there is one thing I am unable to sort out. </p>
<p>What I am planning to do is to redirect a user to a custom page (custom member page) after they successfully edited their profile (wp-admin/profile.php) .
In case of e... | [
{
"answer_id": 6932,
"author": "onetrickpony",
"author_id": 1986,
"author_profile": "https://wordpress.stackexchange.com/users/1986",
"pm_score": 0,
"selected": false,
"text": "<pre><code>add_action('personal_options_update', 'redirect_me');\nfunction redirect_me(){\n wp_redirect(home_u... | 2011/01/11 | [
"https://wordpress.stackexchange.com/questions/6765",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2419/"
] | I have been working around with adding stuff in user profile edit area. I am done with that but there is one thing I am unable to sort out.
What I am planning to do is to redirect a user to a custom page (custom member page) after they successfully edited their profile (wp-admin/profile.php) .
In case of error they ... | This is the function that you need:
```
add_action( 'profile_update', 'custom_profile_redirect', 12 );
function custom_profile_redirect() {
if(is_admin()):
wp_redirect( trailingslashit( home_url() ) );
exit;
endif;
}
```
Just change the target of wp\_redirect to whatever URL you want your use... |
6,788 | <p>Can i use <b> dynamic_sidebar('first-footer-widget-area');</b> directly in <i>footer.php</i>?Any change to made in <i>functions.php</i> page? I am using twenty ten theme.</p>
| [
{
"answer_id": 6790,
"author": "Rarst",
"author_id": 847,
"author_profile": "https://wordpress.stackexchange.com/users/847",
"pm_score": 1,
"selected": false,
"text": "<p>Here is complete code that runs this sidebar from <code>sidebar-footer.php</code> template:</p>\n\n<pre><code><?ph... | 2011/01/12 | [
"https://wordpress.stackexchange.com/questions/6788",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/-1/"
] | Can i use **dynamic\_sidebar('first-footer-widget-area');** directly in *footer.php*?Any change to made in *functions.php* page? I am using twenty ten theme. | Here is complete code that runs this sidebar from `sidebar-footer.php` template:
```
<?php if ( is_active_sidebar( 'first-footer-widget-area' ) ) : ?>
<div id="first" class="widget-area">
<ul class="xoxo">
<?php dynamic_sidebar( 'first-footer-widget-area' ); ... |