title: How to list all images in uploads directory except those that are attached to any post

text: I've got code in my functions.php which parses the WP uploads folder and lists all images it finds there. Is it possible to place a filter here that would exclude any image that is already "attached" to a post? eg: "List all images in folder "uploads" where image is not found in (attached images)"


title: Child Theme activates, but nothing from parent theme displays (MAMP, Multisite)

text: I searched for a solution for this problem, but cannot find an answer (or exact replica of the problem) Basically, I set up Multisite on MAMP Pro (Apache port 80, MySQL Port 3306). The set up was smooth, and I created a new site via a subdirectory. The parent theme loads fine. I created a child theme, and it activates (it doesn't show a broken message). On the Appearance page it shows the message "This theme requires the parent theme", but underneath the Theme Description. However when I view the front page of the site, the page is blank, and there is no html at all. Would could possibly be the error? I spent a few hours on this already and it's not going really well. Code of child theme, only CSS, no functions.php or other php files in the child theme folder.               /*     Theme Name: Confit Child Theme     Author: Automattic     Template: confit     Description: Confit Child Theme 1     Version: 1.0     */          @import url('../confit/style.css');        * Should also mention that the parent functions are not loading either.  Thanks!


title: How to detect mobile devices and present them a specific theme?

text: I would like to create a new modified version of my theme (check my profile if needed) to present to visitors if I detect that they are visiting the site from a hand-held device, like iPhone, Android, etc.   1. How to detect if the request is coming from a mobile device/browser?   2. How can I load and present them a dedicated theme? **More Info** : My theme is not fluid. It has a fixed width of about 976px (676px content + rest is left sidebar). I do not want to revolutionize the theme but I feel it is to large for 320x480 and 800x480 phones. Probably I will remove the sidebar or at least move it to right and do other small adjustments.


title: Advanced templating / Wordpress as a CMS questions

text: I have a Web site that consists of several pages, with different layouts, and also a blog. I would like all these page to be editable through Wordpress, rather than having them as custom pages through wordpress which I then have to manually edit the html for in a html editor. Is it possible to have multiple editable areas in a wordpress template? What I'm trying to achieve is a multi-column layout which is fully manageable in wordpress, is it possible? Thanks in advance!


title: Get the type of an advanced custom field (ACF) in a WP_Query loop

text: When reading posts with `WP_Query` how would I get the data type of an advanced custom field (textbox, date, number, repeater, …) ? My code:               $loop = new WP_Query( $args );       $posts = $loop->get_posts();      foreach ( $posts as $post ) {         $custom_fields = get_post_custom($post->ID);          foreach ( $custom_fields as $field_key => $field_values ) {             // Get type of field? How?         }     }


title: User registration approval based on role selected

text: On my site I've got two types of users, Subscribers and Partners. I've used Cimy User Extra Fields to add additional fields to the registration form. I've also used a plugin called WP Roles at Registration. This plugin adds a drop down box on the registration form so when a user registers they can pick their own role. What I want to be able to do is, if a user selects Subscriber as their role they become registered and can use their account as normal. However if a user selects Partner, the account needs to be reviewed and approved by an editor before they can use it, to ensure they are actually a Partner. The reason I say it needs to be approved by an editor is because the people who will be using it won't have access to an admin account. It also needs to send an email to an editor to tell them the account needs to be approved and possibly send an email to the user once their account has been approved. Is there anyway I can do this? Thanks


title: How to connect imported metabox content with media library id

text: i created metabox with media gallery id with it. i don't see any reverence on codex or anything that can point me how to connect my metabox content with media library id during import process. i try to find reference about `import_post_meta` action. but get nothing from codex. any one can point me how to link imported metabox content (width media gallery id with it) with meda gallery?


title: Extracting the post_id via the wp_insert_post action (external db query)

text: i'm writing a little action plugin. everytime a new post is created, a new table should be created in an external db. The name of the table sholud reflect the post_id of the newly created post, but i can0t figure how to pass it. Here's my code so far (for php purists, forgive me for using old mysql_connect (but adding the flag TRUE to the new_link parameter, i don't have to bother with wpdb globals etc)               function insert_new_table($post_id){         $usernamel = "secret";         $passwordl    = "secret";         $hostl    = "localhost";         $databasel    ="secret";         $connect = mysql_connect($hostl, $usernamel, $passwordl, TRUE) or die("Error");         mysql_select_db($databasel) or die("Error, Cannot locate the database!");         $table_name = 'tablename4';  //with this variable works         $postidl = get_the_ID();     // i'm outside the loop .. so what?         $sql = "CREATE TABLE $postidl (           id int(11) NOT NULL AUTO_INCREMENT,           name varchar(255) DEFAULT NULL,           UNIQUE KEY id (id)           );";         $query = mysql_query($sql);         return $post_id;         }     add_action( 'wp_insert_post', 'insert_new_table' );      everything is going smooth using the var $table_name in my $sql query; but i can't pass the post_id of the post that is currently being saved (don't know how to get it!) Any hint?


title: How To Display Pages Based On Subscriber Signup Date

text: I want to get a course rolling where I show a new link for a weekly lesson to a subscriber, based on how many weeks the subscriber has been registered. Say, the subscriber goes to the course page and gets shown something like the schematic below. http://imageshack.us/photo/my-images/845/coursedesignwordpress.png/ > Visitor Signups To My Blog = Week 0 I was thinking of using slugs to do this. So I would create a page with 'week-3' slug and then I would use some custom PHP code checking for the slug and return the right ones, on the course page. Example:   1. _Check for how long the user has signed-up (in weeks)_   2. _Show the title of page that has 'slug-'$weeks_ But there is a problem with this. **I wouldn't be able to easily change the order of the lesson. Say for example, change lesson from week-3 to week-2.** What is an easy way to do this and be able to easily change the lesson week?


title: Is It Possible to Restore Accidentally Deleted Widgets?

text: I accidentally deleted the widgets without dragging it to the inactive widgets section. I have a backup of all the files and the database but i have changed many things on the site other than the widgets. Can I only restore the widgets?


title: Taxonomy Drop Down with hierarchical view using $terms

text:
I asked this on the Wordpress forum but dint get any replies now I hope I can ask it here. I found the code here My Code is:               function exc_custom_taxonomy_dropdown( $taxonomy, $orderby, $order, $hierarchical, $show_count,  $name) {         $args = array(             'orderby' => 'name',             'order' => 'ASC',             'hierarchical' => true,             'show_count' => true,         );         $terms = get_terms( $taxonomy, $args );         $name = ( $name ) ? $name : $taxonomy;         if ( $terms ) {             printf( '<select name="%s" class="postform">', $name );             foreach ( $terms as $term ) {                 printf( '<option value="%s">%s (%s)</option>', $term->slug, $term->name, $term->count );             }             print( '</select>' );         }     }     ?>     <form role="search" method="get" id="equipfilter" action="<?php bloginfo('url'); ?>">             <fieldset>                <?php exc_custom_taxonomy_dropdown( 'exc_equipment_cat', 'name', 'ASC', true, true, 'exc_equipment_cat'); ?>     -       </fieldset>             <fieldset>                 <legend>Kw Range:</legend>                 <input type="text" name="kw_min" placeholder="from" value>
                 <input type="text" name="kw_max" placeholder="to" value>             </fieldset>             <fieldset>                 <legend>Price Range:</legend>                 <input type="text" name="pr_min" placeholder="from" value>
                 <input type="text" name="pr_max" placeholder="to" value>             </fieldset>             <input type="submit" id="filtersubmit" value="Search" />         </form>      It creates a drop down for my custom taxonomy. It works 100% I just cant get it to show my categories with hierarchy like it would with wp_dropdown_categories. I have tried to use wp_dropdown_categories with a walker but it outputs a slug website.com?equipment_cat instead of website.com/equipment_cat. Here is my code for the wp_dropdown_categories with walker.               <?php     // Equipment Category Dropdown, thanks https://gist.github.com/2902509     class Walker_SlugValueCategoryDropdown extends Walker_CategoryDropdown {                  function start_el(&$output, $category, $depth, $args) {             $pad = str_repeat(' ', $depth * 3);                  $cat_name = apply_filters('list_cats', $category->name, $category);             $output .= "\t<option class=\"level-$depth\" value=\"".$category->slug."\"";             if ( $category->term_id == $args['selected'] )                 $output .= ' selected="selected"';             $output .= '>';             $output .= $pad.$cat_name;             if ( $args['show_count'] )                 $output .= '  ('. $category->count .')';             if (isset ( $args['show_last_update'] ) ) {                 $format = 'Y-m-d';                 $output .= '  ' . gmdate($format, $category->last_update_timestamp);             }             $output .= "</option>\n";         }     }     ?>     <form role="search" method="get" id="equipfilter" action="<?php bloginfo('url'); ?>">             <fieldset>                 <?php                 $dropdown_args = array(                     'taxonomy'      => 'exc_equipment_cat',                     'name'          => 'equipment_cat',                     'show_option_none'  => 'Select category',                     'show_count'        => 1,                     'orderby'       => 'name',                     'hierarchical'      => true,                     'echo'          => 1,                     'walker'            => new Walker_SlugValueCategoryDropdown);                      wp_dropdown_categories( $dropdown_args );                 ?>             </fieldset>             <fieldset>                 <legend>Kw Range:</legend>                 <input type="text" name="kw_min" placeholder="from" value>
                 <input type="text" name="kw_max" placeholder="to" value>             </fieldset>             <fieldset>                 <legend>Price Range:</legend>                 <input type="text" name="pr_min" placeholder="from" value>
                 <input type="text" name="pr_max" placeholder="to" value>             </fieldset>             <input type="submit" id="filtersubmit" value="Search" />         </form>      Help would really be appreciated.


title: Accessing two databases

text: I have two databases on my server, and wanted to know is there a way to access both databases from wordpress? My thought is adding the second set of credentials to the `wp-config.php`.


title: How to separate a specific page's comments from other comments

text: I am using WordPress comments on a page as a Contact form. Comments from my Contact form page are set to auto approve and only visible to the logged admin. Now in the dashboard I would like to separate my Contact form comments from the other comments. I would like to do it either by placing them in a theme option page or by using a filter on the comments page. Why I wanna do this new way? Because I believe it will be more user friendly.


title: How to Structure Wordpress for an Organization and its Departments?

text: I want to make a wordpress site for an organization (main) that has many departments. The requirements are   1. There is only one website ( or maybe same theme for the main site and its department site)   2. There are some categories such as news, events or other articles.    3. If writer from department post a news, it has to appear on main site in news section.    4. If writer from department post an event, it has to appear as well on main site but in event section.    5. User can visit department site that only contains news and events about that department   6. A Writer can post a news and event for main site that is not related to any departments. I have considered to use Multisite but the challenge is I can't find any plugins to retrieve post from another site for specific category (news or event). If I use a single wordpress, I have to think about how to display single page (I assume department is category or tag) with specific news and event widget that related to the department. **What is the best way in wordpress to achieve those requirements?**


title: Use lots of pages, or categories/posts?

text: Currently I am designing a website that will have alot of content. The site will be build like this: site.com/country/region/city/accommodationtype/accommodation Should I do this in pages and have A LOT of pages. Or... create alot of categories and have the accommodation as a post? Keep in mind that also the country, region, city and accommodation type should be able to rank in the search engines.


title: Problem with Custom Post Type Categories

text: Before I proceed on writing anything just have a look the following images. (snapshots) ![enter image description here](http://i.stack.imgur.com/LWlr3.jpg) ![enter image description here](http://i.stack.imgur.com/sLl3k.jpg) ![enter image description here](http://i.stack.imgur.com/HbOIv.jpg) I have one custom post type by name 'questions' just like we have 'posts/pages'. If you look at the image one, you can find that. And I found categories in that too. When I click on one of the categories in that (like Apostasy which has 1 article), I found that in categories of the questions (have a look at the image-2 for seeing that posts). Now, when I begin to edit that article (as you asked me in the question), I find 'categories on the right side as it supposed to be and it is no doubt have tick marks on the respected categories which my client needed. When I click on update. The questions are moving to the url `fatwaa.com/questions/post-title`. Whereas, when you look at the categories, you found zero posts. I then soon back posted a test article in the 'Post' Section by ticking mark the respected category then without any difficulty I'm getting that in the category. I have edited one archive and tick mark one category into that and it is working without any difficulty. So, I think the whole problem is causing due to this 'Questions Template'. Also on the home page whenever I go to any category it is displaying same posts again and again.. (here is the code of the home page) http://pastebin.com/5LqnwAzY


How do I skip wordpress's 404 handling and redirect all 404 errors for static files to 404.html? I read and it seems its not possible when using permalinks? The objective is to reduce the server load for 404 errors by not loading php.


title: How can I get only parent terms?

text: Is there any way to get only parent terms from custom taxonomy or category?


title: Conditional wp_enqueue_script on a page

text: For efficiency we are trying to hook some JS scripts only a certain page template of a theme that is to hold a form: page-with-form.php On the theme functions.php we've defined a init_method as such:               function my_init_method(){              $dir = get_bloginfo('stylesheet_directory')."/js/jquery.js";         wp_deregister_script('jquery');             wp_register_script('jquery',$dir);         wp_enqueue_script('jquery');              $dir = get_bloginfo('stylesheet_directory')."/js/jquery.validate.min.js";         wp_deregister_script('jquery.validate.min');             wp_register_script('jquery.validate',$dir);         wp_enqueue_script('jquery.validate.min');              $dir = get_bloginfo('stylesheet_directory')."/js/funcion.js";         wp_deregister_script('funcion');             wp_register_script('funcion',$dir);         wp_enqueue_script('funcion');     }          We then expected we could just add at the firts line of page-with-form.php page template (before get_header()) :               add_action('init', 'my_init_method');        * Is this not possible?   * Are we forced to add an if rule to the functions.php function to detect that we are on that page? _**Code modifications based on answers:_** On the page template load the function directly, no need to add_action("init"...               my_init_method();     ...     get_header();


title: How to automate featured posts number?

text: > **Possible Duplicate:**   >  featuring old articles without messing up with the archive Let's say you have a category called "featured". and you use that to feature posts. And the theme you have has a zone to show those featured posts and has room to show the last 5 featured posts in there. And you want to make the admin work as easy as possible to the degree that you only want to find yourself checking the posts into that "featured" category and you do NOT want to uncheck them later. You are basically only checking, and never unchecking. The problem is WP uses post_data to find out the most recent posts. But then, what do you do when you want to feature a very old post? how do you deal with that? Change the post_date? If you were to select that post into the "featured" category, that post is not going to make it into the top 5 because the other posts that happened to be "featured" and more recent may easily be pushing it down. In this case, I got no choice but change the the post_date of the article and this seems totally wrong to me. Because this definitely messes the ARCHIVE data integrity. Your 5 year old post will appear as brand new. What solutions are out there to address this problem? I almost think that the wp_posts table should have a special field called "post_feature_date". If we were to use the "sticky posts" feature, that's not gonna cut it neither because remember, I'm only interested in checking things, NOT UNCHECKING THINGS. If you got a simple blog, I do understand that this issue is not a matter but if you are using the WP to the rim in managing a huge portal, then you want to save every maintenance step as possible.


title: include wp-blog-header not working on MAMP

text: To clarify my question... My plugin is/was using AJAX to call the file `pluginname/submit/pick.php` My `pluginname/pluginname.php` contains the usual plugin header and wordpress automatically finds it. Original Question... I'm trying to use the global `$wpdb` in a plugin to insert data into one of my tables. From the docs it sounds like I just need to include `wp-blog-header.php` However when I try to do so I'm getting an error. > **PHP Fatal error:** [`require()`](function.require) : Failed opening > required 'http://localhost:8888/blog/wp-blog-header.php' > (include_path='.:/Applications/MAMP/bin/php/php5.3.6/lib/php') in > /Applications/MAMP/htdocs/blog/wp-content/plugins/pluginname/submit/pick.php > on line 4 My `pluginname/submit/pick.php` (which is called by AJAX) has the following code               <?php         $p = 'http://localhost:8888/blog/wp-blog-header.php';         echo $p;         require($p);         echo 'hi';     ?>       If I load the `pick.php`, I see `http://localhost:8888/blog/wp-blog- header.php` and that is it. So it must be failing on the require, as the error log confirms. The path is correct as I inserted a quick echo into `wp-blog-header.php`, and copy pasted the output from `pick.php` into the address bar and it worked. Any help would be appreciated.


title: Using Query Posts With Multiple Post Types And A Taxonomy

text: I am developing a site that has two different custom post types; one of them is called Articles and one is called Sketchpad. Sketchpad is user submitted content that is assigned a custom taxonomy term value of either; public or private. Public posts are shown on the site and private posts aren't. The article post type caleld Articles is added in by administrators in the Wordpress admin area, articles do not have a custom taxonomy. On the homepage I need to pull out both "article" and "sketchpad" post type posts and then sort them by date with newer posts as the top and older ones at the bottom. My current code is as follows:                   <?php             $args = array(                 'post_type' => array('sketchpad', 'article'),                 'taxonomy'  => 'type',                 'term'      => 'public'             );             // Only show content from the sketchpad post type where the taxonomy of type is public             query_posts($args);         ?>      The code above works, to an extent. You see only the post type "sketcphad" has the taxonomy of type and a term value of "public" so the issue is the above query is also checking if posts of the type "articles" have the particular taxonomy and term value as well. Is it possible to only make the taxonomy and term part of my query apply to the "sketchpad" post type and the post type of "article" doesn't have any filtering criteria applied to it? Basically what I am wanting to do is merge two different queries into the one and output the results.


title: Is my host the problem?

text: I've been working on my WordPress Site for quite some time now, and it's about ready to be deployed. One major issue, though - it's VERY SLOW! At first I thought that the 20 second load time could be attributed to the 100+ images on each page; however, after some analysis, I've come to find that it's taking nearly 10 seconds for the server to get through its initial queries (before any content can even think about being downloaded). I am very new to the hosting game, and I know nothing about it. I've done my fair share of reading and I've come across the idea of moving away from my cheap shared hosting plan to a dedicated host over at VPS.net. Furthermore, I plan on integrating a CDN to increase the speed of all of the images loading up. Two questions:   1. Would switching hosts make the page load time go down to around 5 seconds (or less!)   2. What are your thoughts on vps.net and their hosting options? Do you recommend any other hosts for a optimized wordpress site? Thank you! Evan


title: get excerpt without images

text:
Is there any way to not get the images with get_the_excerpt()? I am using a my_recent_post() function to pull posts onto the home page and I don't need to have it pull the images within the posts, just some of the text. Here's the function that I am using:               function my_recent_post()      {       global $post;       $html = "";       $my_query = new WP_Query( array(            'post_type' => 'post',            'posts_per_page' => 3       ));            if( $my_query->have_posts() ) : while( $my_query->have_posts() ) : $my_query->the_post();                 $html .= "
" . get_the_date() . "" . get_the_post_thumbnail() . "            " . get_the_excerpt() . "

";            endwhile; endif;            return $html;     }     add_shortcode( 'news', 'my_recent_post' );


title: maintaing consistent layout wordpress dashboard

text: I am developing a functionality in WordPress so that once user updated any information admin can approve/reject the information only after which it should get published in the front users,in specific terms functionality is much similar to e,g Comment approval. i am new to PHP as well Word press, though i have developed the functionality and its working fine. but i have created simple table in the dashboard where admin can see the things he/she needs to approve/reject. i want to give it a consistent look like other functionality in word-press e.g Comment   1. Admin can do bulk operations delete/approve with the build in panel.   2. Admin can quick edit/delete any individual comment what i observe that there seems to be a single design pattern on which this is implemented as i can see same type of features for post/pages or any other place in dashboard where items are being displayed in list. is there a way to achieve this.i will appreciate if some one help me to understand this. attaching a screen shot for better clarification. ![common navigation area](http://i.stack.imgur.com/ldBeX.png)


title: Rewrite rule for custom parameter

text: I'm stuck with rewrite rules regex. I have this kind of link:               http://www.xyz.com/page-1_b/page-3_d/page-0_a/box-page-3_d      I need to add rewrite rule for this link so that it extracts what's after 'box-' and treats rest of the link as a standard WP link. I have this expression from another SO question:               (.+?)/box-([^/]+)      It returns what's after the `'box-'($matches[2])` and also the whole WP link($matches[1]) but I need something that will fit into:               index.php?pagename=$matches[1]&box=$matches[2]       Do you have any ideas?


title: no posts or pages showing on mirror domain

text: alright this is a tricky one bear with me a while back i developed a site for someone and he just pointed his DNS nameservers to my host which is dreamhost. later he decided to change the DNS back, and i was effectively stuck without being able to view the site or modify it. what dreamhost suggested, which made sense, is to make a mirror domain and new SQL user so that i could access the database, this worked fine and ive backed up the database - its huge btw about 300Mb. i have been able to get the site back up on the mirror and can administer wordpress but there are no posts or pages showing in the admin panel. the theme works fine, all images are broken of course...due to the old URL being hard coded all over the database. i figured i could sort this out using a script to find and replace all of the old URLs in the database, which did work. but posts and pages are still absent. ive done the usual regeneration of permalinks and all that, no joy. i am treating the mirror address as if it was the primary URL, like when i re deploy a site when i move them which i do all the time, this has never happened... as a last resort i was wondering about changing the A records to point another domain to this one for the time being. that might show what the score is. could it be a plugin.. i didnt get that far. the other solution is to re deploy the site on another clean install of wordpress, but with a database this large it is difficult. can someone tell me a simple step by step way to get this done... i use putty so can use command lines, although never have with dreamhost. i was thinking to upload the SQL file first via ftp then run a command, can someone explain exactly how i would do that? is it via php myadmin? thanks J


title: Pre-install widgets in WP-Admin

text: When a user activates the TwentyEleven theme in the admin widgets area, the user already has the Main Sidebar populated with a few standard widgets. Could someone explain or point me in the right direction about how I could implement the same behavior for my widgets on another theme?


title: Using php to overwrite or replace title tag, while using yoast

text: I use yoast for my seo, indexing, title, sitemap etc. But I have one issue, for my product pages I want to use costum taxonomy data and yoast doesnt support that. Now I got the code to echo the exact title I want in the product pages but how do I let it overwrite the title set by yoast, or how do I replace the title set by yoast for this specific post type?


title: Let visitors post comments on category page

text: I'm looking for a way to let users comment categories on category.php, but I haven't been able to find one. Simple pasting didn't do the trick (didn't really expect it to.) For clarification, I'm not looking for users to comment posts in category.php, but rather to comment the category itself. Is it possible?


title: Overflow and Comments

text: Go to this link and click where it says "2 comments" in the sub-title: http://themeforward.com/demo2/2011/01/17/lobortis-tellus-diam/ **When the link that brings the user to the comments is clicked it doesn't just scroll users down the page, it brings them to what APPEARS TO BE a separate page (even though it isn't a separate page). This is caused by the extreme margin/padding I am using in #sidebar and #post_content which I am using for equal height columns...http://www.positioniseverything.net/articles/onetruelayout/equalheight Any fixes for this (while still using the equal height columns css)?** THE CSS:                   #container {             overflow:hidden;             margin:35px auto         }         #sidebar {             width: 410px;                display:block;             padding-bottom: 32767px;             margin-bottom: -32767px;             float:right         }         #post_content {             display:block;             padding-right:25px;             padding-bottom: 32767px;             margin-bottom: -32767px;             margin-right:25px;             border-right:1px solid #EEE;             float:left;             width: 660px         }     #commentlist {         list-style:none;         width:100%     }      THE LINK:               <?php comments_number( 'No comments', 'One comment', '% comments' ); ?>


title: How can i manually relate pages?

text: I've got a custom post type called Products, which underneath i've got a related products section using a plugin called http://wordpress.org/extend/plugins/related-posts-thumbnails/. I need to be able to create some more post types for example called Accessories and Supplies. I need to be able to relate some accessories to products. How can i make it so when i add an accessory or supply i can say this relates to a certain product and shows in the related products section.


title: Best way to programmatically link to multiple categories (union/intersection)

text: This question assumes that you know about the various complex taxonomy queries available from the WP_Query API. I know about `tax_query` as well as about things like `category__and`, which allow you to run multi-term queries inside a template. It also takes for granted the knowledge that you can manually create links, both pretty (`/category/mac+mobile/`) and ugly (`/?cat=2+3`) that will generate the results similar to many of the `tax_query` (or at least `category__and`) options. The question is: What is the best way to generate such links within code, so that a theme can automatically link to screens showing complex mixes of categories.   * The solution should be forward compatible and use standard WP if possible.   * It should ideally work with any possible permalinks and category-permalink configuration.    * Ideally it would work with any order of categories, as well as with categories nested inside a hierarchical taxonomy.   * It should accomodate both intersections (a+b only posts in both categories are returned) and unions (a,b any post in one or the other category works). As far as I can tell there is no built-in function that can achieve this. The similar function is `get_term_link()` but it only accepts a single term. Ideally core would have something like `get_tax_query_link()` that accepted a tax_query and rendered a link that would show the desired results.


title: dynamic_sidebar not rendering sidebar

text:
I have the following code               // in functions.php     register_sidebar(array(         'before_widget' => '
',         'after_widget' => '
',         'before_title' => '
',         'after_title' => '
',     ));          // in sidebar.php     if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?>         // static sidebar here ..      I find that the static sidebar is what renders even if I add widgets in the dashboard. I'm not sure if WP3.2 caused it as I never tried using dynamic sidebar before updating


title: Tinymce/Wordpress is removing all line-breaks?

text: In my wordpress theme, I have a custom options panel with textareas that utilize the tinymce script included with wordpress. This was working fine until I upgraded to the latest version of wordpress (3.2). Now the editor still works, however it is removing all paragraph and line-break tags once I save my code. While putting my text into the editor, it looks great and shows all line breaks in the preview, but once I save it those are all gone. Other tags (b, img, a) seem to be working fine. Now this may be an issue with wordpress, but on the same hand the wordpress upgrade also included the newest and latest version of Tinymce, so that may be causing the issue. When I disable the Tinymce editor and use standard textareas, all the tags and line breaks get saved no problem. > EDIT: Got it working. Needed to wrap my output values in wpautop() before > saving. So now my value is wpautop($output[$option_array['id']]); Here is the code I am using to initiate the Tinymce editor:                   <?php     wp_tiny_mce( false , // true makes the editor "teeny"         array(             'theme' => 'advanced',             'skin' => 'default',             'theme_advanced_resizing' => 'false',             'theme_advanced_path' => 'false',             'theme_advanced_buttons2' => '',             'theme_advanced_buttons1' => 'code,bold,italic,underline,|,justifyleft,justifycenter,justifyright,forecolor,fontsizeselect,link,unlink,image',              'width' => '650px',              'media_strict' => 'false',     'valid_elements' => '*',     'extended_valid_elements' => '*',     )     );               ?>


title: How to remove/hide Yoast's "SEO" tab in admin panel?

text: I don't want this shown to members who register for my website as it's confusing and irrelevant for them. I assume some code added to `functions.php` will do the trick but what code?


title: Get current page number of splitted article

text: I am trying to find a way to get the current page number of an article that has been splitted into several pages with the use of:               <!-- nextpage -->      There is an example that can be found here: http://codex.wordpress.org/Conditional_Tags#Testing_for_paginated_Pages But this doesn't work for me – it always returns 0:               $paged = $wp_query->get( 'paged' );     echo $paged;      Any idea? Thank you!


title: Can I use wordpress for a non-blog site?

text: I'm starting a website (more complicated than a blog) and would appreciate advice on which framework to use. A person on my team uses wordpress and is enthusiastic about its possibilities, but a friend who works on rails is lobbying against it ("But it's for blogs!"). Both can help me get started so I'll probably chose either wordpress or rails because of that. The question is : which? What I want to do : The site is centered around comparing and commenting constitution articles. Users will browse articles by country and by topic, comment and vote on the articles, suggest topics for the articles (=tag them), post their suggestions of articles. Users will create polls (like Facebook questions more or less) that other users can answer. I'd also like a forum section where they can start discussions about a given article or a topic. Users will also post links/documents relevant to an article or topic. I want my users to be registered, give me certain info (gender, age, country…) and then get statistics about who voted/commented on what articles (It will be helpful for research). Wordpress looks cool because of how easy it looks to get something together and integrate plugins, even for a non-technical person, and there's a huge number of plugins. But it's designed for blogs so I'll probably run into trouble and do dirty hacks because what I want to do is not a blog. Rails looks cool because it's designed to do things like that so I can get precisely what I want, but there aren't as many plugins, and it will require longer to code. I'll be spending the next 2 months on this, and when I leave the the person who has to take care of the site has little technical background (except wordpress), and I don't want to have to do heavy maintenance after I leave. I'm not scared of learning, but I do have limited time and I'm the only developer (though I might get help from volunteers.). I might not get all the functionality I want before I leave, but I do need to get something together. What is your opinion here? Thanks for your help!


title: Is it possible to include an HTML flat-file website inside a WordPress theme?

text: Is it possible to include an entire flat-file HTML site (.html, folders/ and CSS) inside WordPress? Essentially, I want to host an HTML site, but have access to WP functions and plugins. Not to interested in a iframe solution as that would break the look of the URLs on the browser address bar. Can I include the html site in WP? Or perhaps include WP in the HTML (with some PHP .htaccess extension magic)?


title: How to change tag Title to its name?

text: i have previously asked it in stackoverflow, but there was no answer!   I wish to change the title of Tags pages of my wordpress blog. What I want to do is to keep the Tag name as it's title only. For example: If a tag name is "Wordpress Tag Pages Tutorial" then that tag should have the same title "Wordpress Tag Pages Tutorial" instead of "Blog Name - Wordpress Tag Pages Tutorial" so what to change in this code? I have tried but showing errors like only variables name in wordpress title.               <title>     <?php if (is_home () ) { bloginfo('name'); }elseif ( is_category() ) {     single_cat_title(); echo ' - ' ; bloginfo('name'); }     elseif (is_single() ) { single_post_title();}     elseif (is_page() ) { bloginfo('name'); echo ': '; single_post_title();}     else { wp_title('',true); } ?>      please see this screen-cast i.stack.imgur.com/Ai9JU.png


title: How to reorder billing fields in WooCommerce Checkout template?

text: I'm creating a madlib style checkout form using WooTheme's _Customizing checkout fields using actions and filters_. Billing fields in the checkout template `form-billing.php`are displayed with this call:               <?php foreach ($checkout->checkout_fields['billing'] as $key => $field) : ?>     <?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>     <?php endforeach; ?>      How can change the order the fields appear? The current (default) field order is:   first name   last name   company (hidden for me)   town/city   zipcode   country   state   email   phone _Default order:_   ![screenshot](http://i.stack.imgur.com/imhxW.png) I want the fields to be in a more natural order for Americans (where I live), so:   first name   last name   company (hidden for me)   town/city   state   zipcode   country   email   phone How can I best do this?


title: Display Categories in Search Results

text: I couldn't find anything pertaining to my question. How difficult would it be to display the category of search results, without a plugin - if possible. So it would be something like this: > Category One > > Search results from category one > > Category Two > > Search results from category two > > and so on. Any help would be greatly appreciated. I don't necessarily need anyone to do the work for me, I'm a PHP/Wordpress beginner, but I'd like to think I'm fairly competent in understanding code. Unfortunately, I haven't been able to find something that points me in the right direction when searching google and stackexchange.


title: Displaying tags associated with posts in Custom Post Type

text: I have a custom post type called 'camps', which has tags associated with it, registered as 'camps_tag' I have managed to list all of the posts from a certain category within the 'camps' cpt, but how can I list the tags associated with the post? Any help would be greatly appreciated.


title: Register Custom Post Type from Plugin

text: I'm trying to register a CPT from a plugin upon activation but seem to have hit a wall... Anyone see anything im missing? I don't get any errors but the CPT doesn't show up in the dashboard links....                   function ctg_cpt_init() {         register_post_type( 'ctg_questions',             array(                 'labels' => array(                     'name' => __( 'Questions' ),                     'singular_name' => __( 'Question' )                     ),             'public' => true,             'has_archive' => true,             'rewrite' => array( 'slug' => 'questions' )             )         );     }     add_action( 'init', 'ctg_cpt_init' );          function ctg_rewrite_flush() {         ctg_cpt_init();         flush_rewrite_rules();     }     register_activation_hook( __FILE__, 'ctg_rewrite_flush' );      Thanks,


title: How to create Page templates for showing Blog posts in different layouts?

text:
I'm creating a Wordpress Theme, and I want to create few Page Templates for creating Blog pages with different layouts. So for example, I want to have blog-4-column.php, blog-3column.php and blog-list.php, for giving the user 3 different layout options for having a Blog Page. Now I'm able to list blog posts in my index.php file using this code:               if (have_posts()) : while(have_posts()) : the_post(); ?>       <?php get_template_part('content', get_post_format()); ?>     <?php endwhile; else : ?>       <div id="post-<?php the_ID(); ?>" <?php post_class('no-posts'); ?>>
No Posts found

     <?php endif;      Where I have content.php, content-link.php, content-gallery.php to display posts of different Post Formats. Now the only way I know how to do this in a page template is by using WP_Query, as the post type in the page template would be 'pages' and using the above code will list the registered Pages and not Posts. I just want to know if there is anyway I can use the same 'content- _post- format_ ' files for this, as I don't want to create 3 or 4 'content- _post- format_ ' files for each individual Blog Page Template that I would create. I've searched around for this and one I found most useful was on Tutsplus, but still it doesn't cover having different 'content- _post-format_ ' files and also having few different Page Templates for listing Blog posts in different ways. Please let me know about this and thank you.


title: WP query by custom post type slug/name

text: I am running a simple wp query to retrieve just one post. But the post is a custom post-type post, not a normal post               $ajaxBike = $_GET['varbike'];           $bikeProfile = new WP_Query(array(              'name'          => $ajaxBike,         'meta_query'    => array(             array(                 'key' => 'app_visibility',                 'value' => 1,                 'compare' => '='             )         )          ));      or...               $ajaxBike = $_GET['varbike'];           $bikeProfile = new WP_Query('name='.$ajaxBike);      But I think the **name** parameter only works for posts. But I'm struggling to find anything to work with a custom post type slug. Can you anyone help work out how to query a custom post type using the slug?    Thanks in advance!


title: How to Create a Custom Plugin Permalink

text: I wrote a simple plugin that will redirect the users to a page on a certain date. (in this case it's for the Blackout against SOPA here in the US) Right now I'm using the line `wp_redirect(plugins_url( 'simple-sopa- blackout/blackout.php'),302 );` to redirect the users on the given date. The problem is it makes a nasty URL like `http://example.net/wp- content/plugins/simple-blackout/blackout.php` It would be great to just make this `http://example.net/blackout` I Following what I thought was the proper codex I tried this:               add_filter( 'rewrite_rules_array','my_insert_rewrite_rules' );     add_action( 'wp_loaded','my_flush_rules' );          // flush_rules() if our rules are not yet included     function my_flush_rules(){         $rules = get_option( 'rewrite_rules' );              if ( ! isset( $rules['blackout/?$'] ) ) {             global $wp_rewrite;             $wp_rewrite->flush_rules();         }     }          // Adding a new rule     function my_insert_rewrite_rules( $rules )     {         $newrules = array();         $newrules['blackout/? $'] = plugins_url( 'simple-sopa-blackout/blackout.php');         return $newrules + $rules;     }      Any help would be awesome, the full source is here EDIT: Here's what I have now, it works if access the page with the query vars `index.php?blackout=stop-sopa` but not if i go to `blackout/stop-sopa` it also seems to be creating a loop and timing out if the date is true                   //create your rewrite rule     add_action( 'init', 'wpse38978_init' );          function wpse38978_init() {          add_rewrite_rule('blackout/(\d*)$', 'index.php?blackout=$matches[1]', 'top');     }          // add blackout to the whitelist of variables it wordpress knows and allows     function my_plugin_query_vars($query_vars) {         $query_vars[] = 'blackout';         return $query_vars;     }     add_filter('query_vars', 'my_plugin_query_vars');               function my_plugin_parse_request($wp) {         if (array_key_exists('blackout', $wp->query_vars)                  && $wp->query_vars['blackout'] == 'stop-sopa') {             include( dirname( __FILE__ ) . '/blackout.php' );     exit();         }          }     add_action('parse_request', 'my_plugin_parse_request');          if(!function_exists('wp_redirect')) {          require(ABSPATH . WPINC . '/pluggable.php');     }          $current_time =  current_time('mysql', '0'); //get current blog time     $ts =strtotime($current_time); //parse the sql blog time to a php useable format     $check_date = date('m/d/Y', $ts);  // put the date in a format we can check     $check_hour = date('H', $ts);  // put the date in a format we can check     $blackout_day = "01/15/2012"; // should we black out the site?     $blackout_day_time_start = "08"; // when should we start (hour in 24 hour format)     $blackout_day_time_end = "20"; // should we black out the site?          if((!is_admin()) && ($check_date == $blackout_day && ($check_hour >= $blackout_day_time_start || $check_hour < $blackout_day_time_end))){         wp_redirect(get_bloginfo('url').'/blackout/stop-sopa',302 );           exit();          }


title: wp_schedule_event / cron_schedules - custom recurrence time not working in Plugin

text: I am trying to add custom intervals for the WP cron in a plugin. It run with "hourly", "daily" default recurrence time. It dont' run when I add my own custom recurrence time for the function wp_schedule_event. I want to execute a function every X hours (defined by users). Thanks. Here is the code:               <?php     /*     Plugin Name: Test Cron     Description: Plugin to Test Cron Jobs.     Version: 1.00     */     class WP_TestCron {         function __construct()         {             register_activation_hook(__FILE__, array($this, 'TestCron_cron_activate'));             register_deactivation_hook(__FILE__, array($this, 'TestCron_cron_deactivate'));             add_filter('cron_schedules', array($this, 'TestCron_cron_update_schedules'));             add_action('TestCron_cron_eventOne', array($this, 'TestCron_cron_fct'));             add_action('TestCron_cron_eventTwo', array($this, 'TestCron_cron_fct'));         }              function TestCron_cron_activate()          {             // Run => In Schedule Cronjobs              if (!wp_next_scheduled('TestCron_cron_eventOne')) { wp_schedule_event(time(), 'hourly', 'TestCron_cron_eventOne'); }                  // Dont't Run => Not in Schedule Cronjobs              if (!wp_next_scheduled('TestCron_cron_eventTwo')) { wp_schedule_event(time(), 'in_per_minute', 'TestCron_cron_eventTwo'); }         }              function TestCron_cron_deactivate()          {             wp_clear_scheduled_hook('TestCron_cron_eventOne');             wp_clear_scheduled_hook('TestCron_cron_eventTwo');         }              function TestCron_cron_update_schedules()          {             return array(                 'fively' => array('interval' => 300, 'display' => 'Once in Five minutes'),                 'in_per_minute' => array('interval' => 60, 'display' => 'In every minute'),                 'in_per_ten_minute' => array('interval' => 60 * 10, 'display' => 'Once in Ten minutes'),                 'three_hourly' => array('interval' => 60 * 60 * 3,  'display' => 'Once in three hours')             );           }              function TestCron_cron_fct()          {             $testCcron_post = array();             $testCcron_post['post_title'] = 'Cron Update - '.date('d/m/y \a\t h:i A');             $testCcron_post['post_content'] = 'WP-Cron job is working!';             $testCcron_post['post_status'] = 'publish';             $testCcron_post['post_author'] = 1;             $testCcron_post['post_category'] = array(1);                  wp_insert_post( $testCcron_post );           }        }          if (is_admin()) $wpTC = new WP_TestCron();          ?>


title: Engadget Like most commented plugins

text: i am looking for a most commented plugin like that of in engadget website and propakistani. I would be very thankful if someone could help me out with it. Thanks ![enter image description here](http://i.stack.imgur.com/HzQTW.png)


title: wp_postmeta store multiple values in one key

text: I am currently storing some data in a custom field like this:               $get_ref = $_SERVER['HTTP_REFERER'];     $ref = get_post_meta($post->ID, 'page_ref', true );     $ref[] = $get_ref;     update_post_meta($post->ID,'page_ref', $ref);      The above updates the post_meta but doesnt overide it. I would like to save additional data to the same value that is saved above. The above produces this:               Array ( [0] => http://test.com [1] => http://website.com )      I would like something like this:               Array ( [0] => array(http://test.com, 14/04/2014) [1] => array(http://website.com, 10/01/2014));      Any ideas how i can achieve this?


title: How to create media library for each user?

text: In my project there are three types of users, teacher, student, and admin. Each user has the provision to add posts. But my problem is that each user need each media library for add images into post. When I create a post adding space outside admin which done but the editor shows all the images inside my site. How can I create media library for each user? I am newbie in wordpress coding.


title: Overriding Gallery Margin

text: Continuing the build on a free theme. Working on the gallery CSS. Wordpress automatically adds a left margin to the gallery. Example: http://themeforward.com/demo2/features/gallery-2/ So, how do I get rid of that nasty margin?               /* Gallery */     .gallery {     margin:30px auto auto;     text-align:center     }     .gallery-item {     float:left;     margin-top:10px;     text-align:center;     width:33%     }     .gallery img {     border:1px solid #E6E6E6!important;     margin-bottom:27px;     padding:5px     }     .gallery img:active {     margin:1px 0 0     }     .gallery-caption {     display:none;     font-size:.8em;     margin-left:0     }     .gal_img {     margin:20px auto 0!important;     text-align:center     }     .gal_caption p {     font-size:1.3em!important;     font-weight:700;     text-align:center;     font-family:Arial, Helvetica, sans-serif!important     }     .gal_description p {     font-size:1.1em!important;     text-align:center     }


title: Pagination on Custom Tax Pages Removes Spaces from Query Vars

text: I've got a weird problem that's very similar to this one: Why does Wordpress Pagination Remove the Spaces from my GET Variable?. Except that mine isn't withn search results pages--it's with custom taxonomy pages. Here's the problem: clean WP install with no plugins. I add a custom taxonomy like so in my functions file:               register_taxonomy(         'my-categories',         array(             'post',         ),         array(             'hierarchical' => true,             'label' => 'My Categories',             'query_var' => true,             'rewrite' => array( 'slug' => 'my-categories' ),         )     );      I've created a term in this taxonomy called "test one". If I go to the taxonomy page and add a custom var to the query string, everything seems fine (like so: /my-categories/test-one/?something=one+two). Here's where it gets weird: if I add in some pagination vars (manually changing the URL to /my-categories/test-one/page/2/?something=one+two), the resulting page actually rewrites my URL, stripping out spaces from the custom var (the resulting URL is /my-categories/test-one/page/2/?something=onetwo). Adding my custom var to the vars list using the query_vars filter has no effect. There is obviously a bad rewrite happening somewhere in the WordPress core (I assume in the register_taxonomy() function?), but I don't know enough about WP's rewriting API to figure out what it is. Anybody have any ideas? I'll file an issue in Trac if it is indeed a bug, but I need to know how to patch it short-term.


title: Custom post type media upload error with custom user role

text: I have created a custom post type named `product` and assigned a new role `manager` for it. Everythign works fine, except the media uploader for `product`. I can even upload images without any error directly in the `add media` section. So, I started to test with default `author`, and still same error! Amazingly `author` can upload images successfully, when they are in a default `post`, not in `product`! The error message says: **An Error occurred in the upload. Please Try again later.** Below is the code for custom post type:               function cpt_product() {         $slug = 'product';         $labels = array( //all the custom labels );              $args = array(             'labels' => $labels,             'public' => true,             'menu_position' => '5.1',             'public' => true,             'has_archive' => true,             'supports' => array( 'title', 'editor', 'author', 'excerpt', 'custom-fields', 'revisions' ),             'exclude_from_search' => false,             'publicly_queryable' => true,             'show_ui' => true,             'capability_type' => $slug,             'capabilities' => array(                 'edit_post' => 'edit_' . $slug,                 'read_post' => 'read_' . $slug,                 'delete_post' => 'delete_' . $slug,                 'edit_posts' => 'edit_' . $slug . 's',                 'edit_others_posts' => 'edit_others_' . $slug . 's',                 'publish_posts' => 'publish_' . $slug . 's',                 'read_private_posts' => 'read_private_' . $slug . 's',                 'delete_posts' => 'delete_' . $slug . 's',                 'delete_private_posts' => 'delete_private_' . $slug . 's',                 'delete_published_posts' => 'delete_published_' . $slug . 's',                 'delete_others_posts' => 'delete_others_' . $slug . 's',                 'edit_private_posts' => 'edit_private_' . $slug . 's',                 'edit_published_posts' => 'edit_published_' . $slug . 's'             ),             'map_meta_cap' => true         );              register_post_type( $slug, $args );          }      Below is the code for custom role `manager`               function add_manager () {     $role_manager = 'manager' ;     $displayname_manager = 'Manager';     $capabilities_manager = array (         'read' => true,         'edit_product' => true,         'read_product' => true,         'delete_product' => false,         'edit_products' => true,         'edit_others_products' => true,         'publish_products' => true,         'read_private_products' => true,         'delete_products' => false,         'delete_private_products' => false,         'delete_published_products' => false,         'delete_others_products' => false,         'edit_private_products' => true,         'edit_published_products' => true,         'edit_posts' => true,         'upload_files' => true         );                   create_custom_role ( $role_manager, $displayname_manager, $capabilities_manager );     }     add_action('admin_init', 'add_manager');               function create_custom_role ( $rolename, $roledisplayname, $capabilities ) {         if ( get_role ( $rolename ) ) {             return 0;         }         else {             add_role ( $rolename, $roledisplayname, $capabilities );         }     }      Now I am completely lost here, and can't find a solution! Can anyone please help me and tell me what I missed, or did wrong? :(


title: Conditional Shortcode image display

text:
Got a problem with a shortcode.. i probebly dont know where & how to set the condition so it will display the right image according to the topic / category of the toturial.. Help Plz :)               function postInfoBoxSc( $atts ) {         extract( shortcode_atts( array(             'subject' => 'Category type',             'difficulty' => 'User Types',             'completiontime' => 'completion Time'         ), $atts ) );                  // Set image acorring to guide type             if ($subject == 'wordpress') {                 $subjectImg = '';             } elseif ($subject == 'web design') {                 $subjectImg = '';             } elseif ($subject == 'facebook') {                 $subjectImg = '';             } elseif ($subject == 'RSS') {                 $subjectImg = '';             }              return '

             '. $subjectImg .'
Guide information:

Category: '. $subject .'

User Lever: '. $difficulty .'

completion Time: '. $completiontime .'

         ';     }     add_shortcode( 'postInfoBox', 'postInfoBoxSc' );      **The Problem** For some reason the value of $subject doesent get updated like the othere values and isnt being passed trough the shortcode and the image isn't changing because of that **What Am I Doing Wrong ??** (just added per request) this is the shortcode i am entreing in wordpress editor when writing a post:               [postInfoBox subject="somthing" difficulty="hard" completiontime="2-5 minuts"]


title: Delete post revisions on post publish

text: _Is it possible to delete post/page revisions from the database when a post/page is published?_ **11/05/12 Answer: See the plugin below by _bueltge_** I want to do this on a site with 5,000 posts and 125,000 comments; it's on a VPS and can handle the wp_posts table size - before I deleted all revisions, the table was 1.5 gigs - but I still want to keep the overall database size to a minimum by preventing revisions. But, the client tells me he lost a big post due to a browser freeze, so: is it possible to delete post/page revisions from the database for each post/page when it is published? What hook would be used? Is `save_post` the correct one? http://codex.wordpress.org/Plugin_API/Action_Reference/save_post I have the autosave parameter set in wp-config.php, but according to the docs, that autosaves the post/page as it is being worked on, and overwrites each autosave. What I want to do is have revisions accumulate for drafts - however many, depending on how many times "Save" and "Update" are used by the author - but once the draft is published, delete all revisions. There will only be revisions for the one post, but rather than try and parse the post_ID, the SQL query can run through all posts. This is what I'm trying in functions.php, but I get a `Call to a member function query() on a non-object` error.               function delete_revisions_on_publish( $post_id ) {              if ( !wp_is_post_revision( $post_id ) ) {          remove_action('save_post', 'delete_revisions_on_publish');              $wpdb->query(          $wpdb->prepare(          "DELETE a,b,c         FROM wp_posts a         LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)         LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)         WHERE a.post_type = 'revision' "             )     );             }     }     add_action( 'save_post', 'delete_revisions_on_publish' );


title: Non Wordpress Folder in a Wordpress Site

text: On localhost (WAMP server) I have installed wordpress in the root directory (examplesite.com). I have an application that needs to run outside of Wordpress, so I would like it in the folder /application (examplesite.com/application). I created the folder “application” in the root, but when I go to the url examplesite.com/application, I get the message “Forbidden you don't have permission to access examplesite/application/< on this server”. I found a solution suggesting to add the following to my htaccess, but it didn’t work for me.                   <IfModule mod_rewrite.c>         RewriteEngine On         RewriteBase /         RewriteCond %{REQUEST_URI} ^/application/(.*)$ [OR]         RewriteRule ^.*$ - [L]         </IfModule>         # BEGIN WordPress         <IfModule mod_rewrite.c>         RewriteEngine On         RewriteBase /         RewriteRule ^index\.php$ - [L]         RewriteCond %{REQUEST_FILENAME} !-f         RewriteCond %{REQUEST_FILENAME} !-d         RewriteRule . /index.php [L]         </IfModule>              # END WordPress`      Any advice? Thank you in advance!


title: How can I UN-attach media from a post?

text: I'm having a trouble un-attaching media from a post without deleting it entirely from my site. Is there a simple way to unattach an image from a post for instance?


title: woocommerce: How can I show all the subcategories from a specific category?

text:
I need to show all subcategories using               $product_category = wp_get_post_terms( $post->ID, 'product_cat' );      actually I use:               <?php                          global $post;                              $terms = get_the_terms( $post->ID, 'product_cat', 'hide_empty=0'  );                                        foreach ( $terms as $term ){                         $category_id = $term->term_id;                         $category_name = $term->name;                         $category_slug = $term->slug;                              echo '
slug, 'product_cat') .'">'.$category_name.'
';                                   }                                       ?>      it's ok but it shows only the parent category and only one subcategory... how to fix that?


title: Output Sanitation

text: I've read the WP codex and several tutorials about data validation and sanitation in WordPress. Now I've got this simple example code: `$title = "<script>alert('Test')</script>"; echo esc_html($title);` According to the tutorials and the codex this should be the output: `<script>alert('test')</script>` But on my website I get this: `<script>alert('Test')</script>`. Am I doing something wrong? Because the XSS isn't being executed, so the esc_html filter is working correctly. Thanks in advance!


title: Getting Custom Post Type content from main-site of a Multisite

text: I have a multi-site network with 3 sub-sites: ![enter image description here](http://i.stack.imgur.com/qJ1pt.png) Is it possible to "link" or include custom post to all 3 sites from the main site? By include or link I don't mean to make other sites to edit them, I'm asking for the visual solution. If possible, could I do that without using a plugin?


title: Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)

text: I've spent a few days researching working with WP static pages - as separate from posts. Although I've found useful guidance, I can't seem to find any good tutorials or worked examples that show me how to work with pages using a modified WordPress Loop that will enable me to filter on specific page criteria and extract relevant content. I am creating a site that will be used annually for events. I want to have a page type (or custom post type) for Calls to Action. My expectation is that there will only ever be a limited number of call to action pages: typically only a few, and likely to be no more than 10 for the site. I'd like the home page to list a summary of the content on these pages, and build that using a loop: but I want to filter this loop by both the specific page content type (e.g. CallToAction), as well as a status indicator, such as "sticky" or active. I'd like to either interrogate the page by its template, or use some other indicator such as a custom field that I check. Being able to set the desired order of the content pages, and sorting their appearance by that order is also a requirement, and I'd like these pages to be shown in the site menu: probably under a parent menu of Calls To Action. Due to the limited number of pages and the relatively static nature of them, static pages feel like a good approach, however my reading so far indicates that what I want to do with the loop control could be challenging, maybe impossible. My main question is can I interrogate a page to find out about template type or custom meta data within a loop? A custom post type seems like a solution that will work, but having a separate post type seems overkill. Suggestions? [Edited 14 May 2013 to simplify/ clarify]


title: Some images suddenly not appearing

text: I'm having trouble with some images not showing up. These were fine and then suddenly stopped working for no apparent reason. A couple of examples: http://coachmi.com.au/blog/2012/11/how-to-build-a-strong-organisational- culture/ http://coachmi.com.au/blog/2012/11/the-path-creating-your-mission-statement- for-work-and-life-book-review/ I've tried deleting and reinserting the images but it doesn't seem to make any difference. The images appear in the dashboard when I am editing the post but not when it's previewed or published Any suggestions/help would be appreciated!


title: How do I check if a post is private?

text: What I am looking to do is check if a page is private, give the users the option to register and see the page. Here is what I have now:               <?php     if (have_posts()) :         /* Print the most as normal */     else :        if ($post->post_status = 'private')         {          /* Print login/register box */         }       else         {          /* Print page not found message */         }     endif; ?>      My problem is that it is always falling through and displaying the login box even when the page does not exists. How do I fix this?


title: WooCommerce : Direct Checkout Page

text: I would like to redirect to the checkout page directly upon clicking the "add to cart" button. Or a Direct Buy Now Feature. How can this be done? Thanks


title: How to query custom db table?

text: I am creating my first ever plugin for a membership site. I have a custom table named `subscription` with a `subscr_user_id` column whose values are taken from `$current_user->ID`. So when a current user subscribes, a new record is inserted into the table where `subscr_user_id` gets the value of the current user's ID. How do I query(INSERT AND SELECT) the table from a template(I don't know of any other means to test queries)? I have this SELECT query: Note that I have preinserted one record into table subscription with subscr_user_id = 1 which means the user is an administrator. I did that thru sql console.               //Somewhere in between the body of the template.     //This query will be used for a code that checks if a user ID is already subscribed to avoid duplicate records.     global $current_user;     global $wpdb;          $user_id = $wpdb->get_row("SELECT * FROM $wpdb->subscription WHERE subscr_user_id = $current_user->ID");          echo '<p> Current user ID is:'.$user_id->subscr_user_id. '</p>';      Before I viewed the page that uses that template, I logged in as an administrator to make sure the ID is `1`. Unfortunately I didn't get any result? Could anyone also please show me a sample of INSERT statement?


title: Managing and Playing Large videos

text: I am implementing a blog to share courses, lectures, tutorials or talks. The video sizes might be bit a bit big - so i was wondering what is a good quality plugin for wordpress that would allow to play videos smoothly , with different dpi settings and such. I want to host the files on my hosting - and play them. Is that a bad option, should i go to youtube ? 3rd party ? what are the + and - of each. Are there any copyright issues, limits, "fair usages", forced ads ? Any tips on the video thing is extremely welcomed. I live in one of the top 5 countries with slowest internet, so optimizing this can be crucial. Thanks for any advice you guys can share Regards


title: How can I create an alternative home page?

text: I'm working on a site which has a fully customized front page. Now I'm asked to add a more classic looking blog type page which will be reacheable at `http://domain/blog`. I tried creating a custom (empty) page called `blog` and put some code into `page-blog.php`, but the problem is that I can't get The Loop to work in there: the page render aborts right where the display of The Loop should start. Is a custom page the wrong way to do it?


title: Making a custom upload form and page in the admin section

text: so I've built this standalone php script which allows my users to upload a CSV which updates JSON data for a feature on our site, but I want to put the script inside of the wordpress admin section for obvious reasons. So as a standalone script it works just fine, I can upload a CSV which the script converts to JSON and then it updates the file in the appropriate directory inside the wordpress theme. Once moving this into WP however, Im getting errors because WP has already sent out headers (so I cant have my upload script redirect the use to the previous page) and probably related, I cant seem to open/create the JSON files any more.               failed to open stream: No such file or directory in blah blah blah.      Here is the code Im using to open/create the new JSON files:               $root_dir = dirname( dirname(__FILE__) );          if( $format == 'map'){              $new_file = 'grading-data-'.$year.'.js';         $target = $root_dir.'/js/reportcard/data/'.$new_file;      }else{              $new_file = 'states-data-'.$year.'.js';         $target = $root_dir.'/js/reportcard/data/states/'.$new_file;         }                    $handle = fopen($target, "w+");     fwrite($handle, $output);     fclose($handle);      The script by the way, is located inside the theme folder. ie: theme> lib > upload_data > script.php Now, because this is wordpress Im sure theres a very wordpressy way to do this but Im not sure where to look.


title: WordPress picks parent theme's home page template instead of the child theme one

text: I have a child theme with its own home custom page template called "template- home.php" (Template Name: Home Template). I have a "Home" page which uses this template. Everything works fine as long as my Settings > Reading > Front Page Displays is set as "Your latest posts". But if I set Front page as a static page and I set this page as the "Home" page (which uses the home page template), then WordPress picks the Home page template of the parent theme. Why is that? Extra info: the parent theme has the same "template-home.php" attached to the same "Home" page, and has not any home.php or front-page.php file.


title: Is wp-app.php or wp-apps.php needed for Wordpress?

text: A few Wordpress blogs I overlook have suddenly generated 3 PHP files in their top folder: wp-app.php, wp-apps.php, and wp-register.php, not of which existed before. Checking their contents against a few Google searches suggests I have been infiltrated by a common Wordpress exploit. Since they keep regenerating, I thought about blanking them and setting file permissions to readonly or less. But if they're needed by WP I don't want to compromise site functions.


title: Only show content before more tag

text: I am using the Siren Template. In homepage.php this code is used to display the portfolio content               print_excerpt(200);      But I to need show the content only before `<!--more-->` I have used this:               the_content( $more_link_text, FALSE);      but it is not working. It shows all the content


title: jQuery "on" handler does not fire on newly inserted widgets

text: I have a jQuery script attached to the widget.php page via an add_action('admin_footer') call. The jQuery executes fine on widget items that were in place when the page loaded. However, on newly installed widgets (widgets that are added to the sidebar after the page has loaded), the handler does not fire. Any ideas how to work around this issue?               if ($pagenow == 'widgets.php'){         add_action('admin_footer', 'my_load_widgets_script');         function my_load_widgets_script()         {         wp_enqueue_script('jquery');         ?>                  <?php         }     }      HTML               Show Advanced Options


title: Programmatically schedule post with wp_update_post function

text:
I schedule posts in a wp plugin (WP 3.8) with the following function. My posts seem to be in the correct status after scheduling them (when editing them, date time and status are good), and also after a database check with phpmyadmin, where the record in the post table seems coherent with another record corresponding to a post scheduled with wp classic edit interface. But the post is never published, and stays in the scheduled status. Second problem, the date retrieve by strtotime('now') is one hour late (here is why i do 'strtotime('+1 hour')') repecting to the local time (displayed on my server with 'date' command) Can you help please ?               function updatePostDate($blog_id, $post_id, $post_date) {         $status = strtotime($post_date) > strtotime('+1 hour') ? 'future' : 'publish';         switch_to_blog( $blog_id );         $operation = 'edit';         $newpostdata = array();         if ( $status == 'publish' ) {             echo ' ' .strtotime($post_date) .'('.$post_date. ') < '. strtotime( "now" ) ,"\n" ;             echo 'cannot publish artilces from here, only schedule, dates in future';             return;         } elseif ( $status == 'future' ) {             echo '
SCHEDULING: ' .strtotime($post_date) . '>'. strtotime( "today" ) .'\r\n';             $newpostdata['post_status'] = $status;             $newpostdata['post_date'] = date( 'Y-m-d H:i:s', strtotime($post_date) );             $newpostdata->edit_date = true;              // Also pass 'post_date_gmt' so that WP plays nice with dates             $newpostdata['post_date_gmt'] = gmdate( 'Y-m-d H:i:s', strtotime($post_date) );             echo '
SCHEDULING: ' . $newpostdata['post_date'] . ' / GMDate : ' . $newpostdata['post_date_gmt'];         }              if ('insert' == $operation) {             $err = wp_insert_post($newpostdata, true);         } elseif ('edit' == $operation) {             $newpostdata['ID'] = $post_id;             $err = wp_update_post($newpostdata);       //echo "wp_update_post::Error return: ".$err ."\r\n";         }     }      Thank you very much!


title: How to install a wordpress website template on an existing website?

text: I just downloaded a template called Senna for my website. It's a responsive wordpress template, and I don't have knowledge of how to use wordpress templates. My currently website is html based on 117.boxhost.me ... The website has auto install feature of installing wordpress to folder(s)... I installed wordpress to a subdirectory: /wordpress. Currently I've kept the main site in html, and I post blog posts on the wordpress. I need to combine the main site with the wordpress and don't want to disturb the directory /wordpress. That's because I've already posted the blog links elsewhere on the internet and so anyone trying to read the articles won't be able to find the pages if I move the blogs from subfolder to main folder. I'm trying to keep the index.html of root website as a redirect page with `"meta=refresh"` tag. So the main site would then be at : `117.boxhost.me/wordpress/` But I don't know how to change the current set of pages to a webpage form. What I know about wordpress templates is: Install wordpress > Upload the images and content of the pages > And then upload the zip file as a theme for the wordpress. After that I don't know if it's easy to create the pages in the new theme/template or would that disturb or damage the blogs posts or their permanent-url... Also, the downloaded file doesn't contain any zip files, only a 5 folders including a folder Senna, with subfolders (templates, etc) That's mostly all I need to ask. Thanks for any help.


title: How to add modified php in child theme?

text: I have lot of modification in my php parent theme. How to save it to the child theme that I have? So, if ever the theme have some new version the php files that I modified would not affect. Thank you


title: new page redirect to old page which had the same permalink

text: I had a page on /features/   and a newer page on /features-2/   I wanted the newer page to get the more pretty slug /features/   So i did the following:   /features/ => /features-old/   /features-2/ => /features/   But when I go into /features/ now I'm sent to /features-old/


title: How to create a custom image gallery in the footer?

text: I need to add sponsor images, thumbnails, in the footer of a Wordpress website. I'd like the possibility to just upload images through the native Wordpress media gallery and then having a way to select those pictures. Is there a way to do this? A way to mark some uploaded pictures so that I can select them for the footer? Right now I'm using the image widget. It works, but I'm not totally satisfied. I would prefer to get images from the php code and customize them as I want and possibly not having to use a plugin.


title: change add to cart button link

text: I'm new to WordPress and the WooCommerce plugin. I'm creating a plugin to change the add to cart button link if it hits a desired stock quantity. For example if stock qty is above 50, I would like to change the link for special payment. I've searched for hours in the internet and found no solution or idea on how to do it.   Is it possible? Can you give me ideas on how to start and implement it.


Add Media Button Stops Working After Publishing The Post. It works fine for the first time when I try to create a post or page. Once I publish the post, it stops working. It is not just Add Media, all types of JavaScript and jQuery popups gets automatically disabled. See there is one more thing that I noticed: If I do not add any image, and publish it. It works. Once I add an image in the post, it stops working. I have tried default theme. I had uninstalled all the plugins. Nothing worked. I hope somebody would give me a clue to solve this problem. This is happening to all my sites on the same shared server.


title: Is the front-page.php template reserved in wordpress twenty twelve theme?

text:
I'm writing my first twenty twelve child theme and came across (what I think) is a strange quirk. I modified front-page.php to have a slider using sliderjs, afterwards I decided I did not want to use this as a front page template, so I'd much prefer to call it something else for a different page. To my surprise, the moment I renamed front-page.php to text-carousel.php and changed the Template Name in the docblock to something else the page changes from displaying my content in full width and the widgets below to a 2 column version similar to my blog, but with the widgets assigned to front-page. So, is front-page.php a reserved template in twenty twelve? is it possible to duplicate its look and feel into a different template? For reference here's my code:               <?php     /**      * Template Name: Text Carousel Page Template      *      * Description: A page template that provides a key component of WordPress as a CMS      * by meeting the need for a carefully crafted introductory page. The front page template      * in Twenty Twelve consists of a page content area for adding text, images, video --      * anything you'd like -- followed by front-page-only widgets in one or two columns.      *      * @package WordPress      * @subpackage Twenty_Twelve      * @since Twenty Twelve 1.0      */          get_header('nonav'); ?>

             <?php              $args = array(                             'posts_per_page'  => 5,                             'orderby'         => 'post_date',                             'order'           => 'DESC',                             'post_type'       => 'post',                             'post_status'     => 'publish',                             'suppress_filters' => true );                              $myposts = get_posts( $args );                         foreach( $myposts as $post ) :  setup_postdata($post); ?>

<?php the_title(); ?>

<?php echo get_the_excerpt(); ?>

<a href="<?php the_permalink(); ?>" class="link">Leer articulo

                         <?php endforeach; ?>

     <?php get_sidebar( 'front' ); ?>     <?php get_footer(); ?>      It works fine if the file is called twentytwelve/page-templates/front-page.php with **Template Name: Template Name: Front Page Template** , but it goes 2 column as twentytwelve/page-templates/text-carousel.php with **Template Name: Text Carousel Page Template** I had posted this question in stackoverflow, but it didn't seem to be getting too much success so I decided to open an account here and move it across.


title: watermarking gallery items

text: How can I add an image watermark to only those images which are to be published in gallery using a function in `functions.php`? Images can be in `.jpg`, `.png`, `.gif` format. I also found this snippet which serves the same but it watermarks all the uploaded images.


title: How to display only some widgets of a sidebar?

text: I would like to break up a sidebar over three containers. Each container should hold up to three widgets of the sidebar. Therefore, I need to find the HTML for only the widgets 0 to 2, 3 to 5 and 6 to 8 separately. Normally, I would use `dynamic_sidebar()` to display the sidebar, but this function doesn't accept parameters to specify that I only want a range of the widgets of the sidebar. Moreover, I found `wp_get_sidebars_widgets()`, but it is not intended to use for themes. How can I get only the widgets in a given range of a dynamic sidebar? For example, this is what I think of.               // functions.php     // display range of widgets of a sidebar     function dynamic_sidebar_range($name, $from, $to)     {         $widgets = get_dynamic_sidebar($name); // this function doesn't exist!         for ($i = $from; $i < count($widgets) && $i < $to; ++$i ) {             $widget = $widgets[$i];             echo $widget['before_widget']                . $widget['before_title']                . $widget['title']                . $widget['after_title']                . $widget['content']                . $widget['after_widget'];         }     }      ****               // frontpage.php     // consists of blocks of three posts or widgets alternatingly     for ($sections = 0; $sections < 3; ++$sections) {         // display three posts         for ($i = 0; $i < 3 && have_posts(); ++$i) {             the_post();             // ...         }         // display three widgets         $from = $sections * 3;         $to = $from + 3;         dynamic_sidebar_range('name', $from, $to);     }


title: Properly customizing login/register form

text:
I'm working on a customized login form for WordPress. I noticed that it's pretty difficult to achieve what I wanted. Here's the HTML of the form:               <form method="post" action="<?php bloginfo('url') ?>/wp-login.php">

<input type="text" name="log" id="user_login"  value="" placeholder="<?php _e('Username'); ?>"/>

<input type="password" name="pwd" id="user_pass" value="" placeholder="<?php _e('Password'); ?>"/>

                 <input name="rememberme" type="checkbox" id="rememberme" value="forever"  <?php checked( $rememberme ); ?> />                 <?php esc_attr_e('Remember Me'); ?>
             <a href="/nojs.html" class="loginbox_button form_submit" title="<?php esc_attr_e('Log In'); ?>"><?php esc_attr_e('Log In'); ?>

                     Not registered?	                     	                     Forgot password?

                     <a href="<?php echo get_permalink(); ?>?action=register" class="loginbox_stdbutton" title="Register">Register	                     	                     <a href="<?php echo get_permalink(); ?>?action=lostpassword" class="loginbox_stdbutton" title="Reset Password">Reset Password

     </form>      Due to style requirement, I put `div` wraps around `input` boxes and the submit button is an anchor tag. According to the document, `wp_login_form` and its hooks will not be able to implement this design. So I followed the suggestions on this question (I asked) Custom user profile, registration, login page with theme , and got something close to http://digwp.com/2010/12/login-register-password-code/ . Basically, it allows you to put the login form anywhere you want, but still points back to `wp- login.php` when submitted. But it has one major flaw. When login is incorrect, it points you back to `wp- login.php`. Like this demo, if you click "Login" without entering anything, it leads you back to the default `wp-login.php` form. I'm currently putting the above form in one of the custom pages. I had a filter hooked to `template_include` and used this HTML code as the login form. I only wanted to change the style, I'm not planning on adding functions. What does it take to implement this login form design? Shall I start from wp- login.php and change it? If so, how do I start (in terms of putting in the theme and form)?


title: single.php fires more than once after clicking on any post to view with different post id each time

text: I am now experiencing a wired problem with my wordpress installation. I was surprised when I saw post view counter of another post also increased including the the post on which I clicked to try and check the result. I also observed that it increments the post view of another post from the same user. For more information: I am calling a function from single.php while passing post id to it to display post counter at the bottom of post. In order to trace the issue I used netbeans IDE and found that single.php runs more than once and it passes different post id at first run and subsequently it passes correct post id at the end. In order to get post id on single.php I used: `<?php $newpostid = get_the_ID(); ?> Total Views <?php echo_views($newpostid); ?` echo_views() is a function which directly used to output the updated number using echo statement within it. Hope someone can help me out of this issue. Thanks.


title: Unable to get wp_redirect() working after adding a CPT via the front end

text: I am attempting to learn PHP by creating a relatively simple application built on wordpress, it is a basic CRM and I've made decent progress but have been stuck on some of the finer points. I've been having some serious 'headers already sent' problems with getting wp_redirect() working after a user creates a new customer. Here is an example of what I want to do:   * /new-customer.php : Create a new Custom Post Type via the front end and then redirect to that particular customer's single post page. Here is the code:                  <?php             $address_line_1      = $_POST['address_line_1'];             $address_line_2      = $_POST['address_line_2'];             $suburb              = $_POST['suburb'];             $state               = $_POST['state'];             $post_code           = $_POST['post_code'];             $country             = $_POST['country'];             $email               = $_POST['email'];             $first_name          = $_POST['first_name'];             $last_name           = $_POST['last_name'];             $phone_number        = $_POST['phone_number'];             $progress_identifier = '1';                      // PROCESS THE FORM                 if ('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action']) && $_POST['action'] == "new_customer")                 {                          $new_customer = array(                         'post_title'  => wp_rand(100,999).'-'.wp_rand(),                         'post_author' => $user_ID,                         'post_status' => 'publish',                         'post_type'   => 'customer'                     );                          $pid = wp_insert_post($new_customer);                          add_post_meta($pid, 'address_line_1',      $address_line_1,      true);                     add_post_meta($pid, 'address_line_2',      $address_line_2,      true);                     add_post_meta($pid, 'suburb',              $suburb,              true);                     add_post_meta($pid, 'state',               $state,               true);                     add_post_meta($pid, 'post_code',           $post_code,           true);                     add_post_meta($pid, 'country',             $country,             true);                     add_post_meta($pid, 'email',               $email,               true);                     add_post_meta($pid, 'first_name',          $first_name,          true);                     add_post_meta($pid, 'last_name',           $last_name,           true);                     add_post_meta($pid, 'phone_number',        $phone_number,        true);                     add_post_meta($pid, 'address',             $address,             true);                     add_post_meta($pid, 'progress_identifier', $progress_identifier, true);                          $survey_post = array(                         'post_title' => $pid . '-' . wp_rand(),                         'post_author' => $user_ID,                         'post_status' => 'publish',                         'post_type' => 'survey'                     );                          $survey_id = wp_insert_post($survey_post);                          global $wpdb;                     $wpdb->insert(                         $wpdb->p2p,                         array(                             'p2p_from' => $survey_id,                             'p2p_to' => $pid,                             'p2p_type' => 'survey_to_customer'                         )                     );                     wp_redirect(home_url());                     exit();                 }         ?>      This code is placed after the HTML form. I know wp_redirect() has to be called before the page starts outputting anything but I am unsure how to make that happen because I have tried putting it further up in the page but it doesn't get me anywhere. Feel free to abuse me for the terrible code and ambiguous question but if you could possibly point me in the right direction to accomplish what I am trying to achieve that would be great! I have tried to break things up into functions to get called via the 'save_post' hook but no luck with that either. Thanks for reading!


title: Create a Network of Different websites with wordpress

text: I followed wordpress instructions of creating network of websites.   I created two subdirectories; `/site1` and `/site2`.   Why doesn't WordPress create different folders for both the subdirectories in `/theme` folder?   I want to build a network of websites with different theme but some Functionality will be same and some might not, that is why I need folders to change it.


title: How To Add WordPress Style Toggle Boxes

text: How to add a WordPress style toggle box with custom text in a plugin. Here's a example of it from All in one SEO plugin: ![enter image description here](http://i.stack.imgur.com/SWkkN.png)


title: Use mapped URL on images

text: I have wordpress installed on my own webspace and have the blog on some native URL like https://user.foo.bar/wordpress/, but I don't want this URL to be public. Instead I want to use a mapped URL for all public content. **What I've tried so far:** On the server I have mapped my own (sub)domain like `blog.foobar.com` to this URL, which works fine. The blog is reachable at `blog.foobar.com` and all post show this URL. In the WP settings I have then set "WordPress Address (URL)" to the original URL and "Site Address (URL)" to my domain, which I want to use for public access. However, when I put an image in a post with no link URL, and I tell my browser for example to copy the image URL or to open the image in a new tab, the URL is something like `user.foo.bar/wordpress/wp-upload/content/bla/image.jpg`. But I want it to show only the mapped domain, e.g. `blog.foobar.com/image.jpg` or similar, so that my native server/user URL is not exposed. Is that possible? I have also tried to use a link on the file, which also gives me the original URL. I checked the advanced settings of the image, where the Source address also is the original URL (with seems to be the core of the problem). When I then manually replace the source URL `user.foo.bar/wordpress/wp-upload/content/bla/image.jpg` by the mapped url `blog.foobar.com/bla/image.jpg`, it works. Then, the browser shows the image to reside at the mapped URL. Is there a way to make this the default? To use the mapped URL for all public content? As I figured, setting both "WordPress Address (URL)" and "Site Address (URL)" to the mapped URL would probably do this. However, I need to keep "WordPress Address (URL)" at the original server URL because that has HTTPS access which I want to use for administrating WP and the mapped domain does not. Any ideas if this is somehow possible? Otherwise I have to replace the source URL for every image manually.


title: How to add menu to Dashboard that can be viewed by all users

text:
I am able to add Menu to the Dashboard using the below code, it can be viewed by an administrator. That menu doesn't appear when logged in as an Author or a Subscriber. How to make sure every user can view the custom added menus.               //Add Menu Page               add_action( 'admin_menu', 'register_my_custom_menu_page' );          function register_my_custom_menu_page(){     add_dashboard_page( 'custom menu title', 'Test', 'manage_options', 'custompage', 'my_custom_menu_page', plugins_url( 'test/images/icon.png' ), 6 );      }               function my_custom_menu_page(){     echo '

';         echo '
Test
';         echo 'Test';          echo '
';     }


title: Website Preview Graphic for Wordpress Site

text: No idea how to ask this... so I'll give it my best. I have a Wordpress site, self hosted. When I post a link to a post on Facebook, Facebook tries to detect a preview graphic to show along with the post (see screenshot) ![Example](http://i.stack.imgur.com/ez1ZX.png) For whatever reason, Facebook always picks up the Stumbleupon share button for the graphic. It's not the first graphic on the page, and it's not the last either, so I'm not sure why. But more importantly, my question is... when I am not using a Featured Image for the post (sometimes I do, sometimes I do not), how can I make sure that previews such as this pick a different image? The site uses a favicon, but that doesn't seem to work in this instance. Is there an image, or something I can set in code, that would allow me to specify what image gets picked up when a site tried to create a preview like this?


title: Displaying Page as Custom Post type landing Page

text: Custom Post-Types are awesome and a PAIN at the same time. Basically, I need to have a landing page, with the list of the direct child elements of the post type (think product categories), but also some information copy at the top as well. I initially created a top-level post called "Products" and have the hierarchy tree underneath that, but that was making the link http://example.com/products/products which is obviously not what I want. I know I can create an archive page and a custom template to display JUST the child elements, but I'm not sure how add the extra content (I.E. the informational content) at the top of the page without hard-coding it into the template. Any way to do this?


title: Adding a list of social media links

text: I want to add a list of my social media pages. What ways are there to do this? Are there widgets designed for this?