title: Is there a capability/User role plugin that lets you specify edit 'posts' not 'custom posts'?

text: > **Possible Duplicate:**   >  When you create a custom post type, does that also create capabilities for > editing/deleting that post type automatically? I have many custom posts in my wordpress site. I want to add multiple members but I only want them to be able to do two things in the back end, edit their profile and add posts. However, giving them the ability to edit posts and create new ones also allows the option to add and view all custom posts as well. I only want them to be able to add basic wordpress posts.


title: How can I find the first post in a category that has a featured image and then return the get_the_post_thumbnail()?

text: I have a function that I thought should find the first article with a featured image in it, and then return that image. Not sure if this is the best way to go about it, as it's giving me a 502 Bad Gateway...               function get_category_post($cat_id){             $finished = false;             $postcount = 0;             $post_args = array(                 'numberposts' => 1,                 'category' => $cat_id,                 'fields' => 'ids'             );             $posts = get_posts($post_args);             while ( $finished != true ) {                 if ( has_post_thumbnail($posts[$postcount]) ) {                     $postthumb = get_the_post_thumbnail($posts[$postcount], $size = 'thumbnail');                     $finished = true;                 }                 $postcount++;             }             return $postthumb;         }


title: Using plugin functionality in external php script not working

text: I am encountering a strange problem which I couldn't solve so far. I'm calling a .php script via cronjob (Debian/GNU Linux). To use wordpress functionailty I added:               define('WP_USE_THEMES', false);     require( '/full/path/to/wp-blog-header.php' );      Now database queries and default wordpress functionality all works fine, but I also call some functions provided by a plugin (namely advanced custom fields, the problem however affects other plugins as well as I tested) the following php error is returned:               PHP Fatal error:  Call to undefined function update_field() in executed.php on line 24      Which tells me that the function of that plugin has not been included. So it seems to me that require wp-blog-header.php dies not include plugin functionality (which it did when I started to develop the mentioned script, but now when I tested it, it produced an php error that). Could it be, that the 3.5 upgrade of wordpress changed something here? Or does anyone of you has some piece of advice for me as to why this problem occures? Thank you! **edit** I made further tests. The problem seems to be, that I am executing the php in the shell using following command:               /usr/bin/php5 -q -d memory_limit=256M /path/to/executed.php      Thus certain variables are not set like `$_SERVER['REQUEST_METHOD']` Wordpress would therefore give me warnings in debug-mode. So what I did is, I definied the `DOCUMENT_ROOT` variable, and included my function.php (which was alos not loaded) manualy:               $_SERVER['DOCUMENT_ROOT'] = '/full/path/to/my/document/root/';     define('WP_USE_THEMES', false);     require( '/full/path/to/wp-blog-header.php' );     require_once( '/full/path/to/themes/mytheme/functions.php' );      Now it is working. Yet it seems to me as a mere unhealthy walkaround ...


title: Is Wordpress Suitable for my site?

text: I will be starting the development of a site that will allow my users to upload pictures and giving the ability to other people to view them. I just want to know if wordpress is suitable for all these things (payment system, editing the user profiles) because i hear all the time that wordpress is mostly for blogs, but my site has nothing to do with a blog. Thanks in Advance!


title: Error 310 too many redirects after switching domains

text: I'm at a loss here. My site is http://www.kgstiles.com and about 70% of my pages now result in a 310 error. There doesn't seem to be any pattern to the error, but one thing I thought was interesting: if I change the slug of a page, it works, but obviously I can't do that for all of them. I tried rebuilding the .htaccess file, saving the permalink structure again, I have restored all files from a few days ago before switching the domain, then I restored the database - none of it worked. I have tried installing "Permalink Fix & Disable Canonical Redirects Pack" which solved the problem for some people and tried one more plugin that solved the issue for others(can't think of the name at the moment). What could be the problem? Nothing has changed in Wordpress. Any help is appreciated!               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+     RewriteRule .* - [E=no-gzip:1]     </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          <IfModule mod_rewrite.c>      RewriteEngine On     RewriteRule ^wp-content(/.*|)$ - [L] # don't take any action     RewriteRule ^wp-admin(/.*|)$ - [L] # don't take any action     RewriteRule ^wp-includes(/.*|)$ - [L] # don't take any action          RewriteRule ^moreinfo/(.*)$ http://www.kgstiles.com/moreinfo$1 [R=301]     RewriteRule ^healthsolutions/(.*)$ http://www.kgstiles.com/healthsolutions$1 [R=301]     RewriteRule ^(.*)\.html$ $1/ [R=301]     RewriteRule ^(.*)\.htm$ $1/ [R=301]     </IfModule>


title: Remove Spaces From WP_LINK_PAGES

text: By default, wp_link_pages (the code which allows you to breakup posts into multiple pages) creates spaces between each number. Is there a way to remove these spaces via functions.php?


title: How to change post status in hook?

text: I have similar problem as described in How to trap "Publish" button to check for meta box validation? Answer there is to hook into `save_post` and change post type. How can I do it? I try to use `wp_transition_post_status` but it doesn't work for me...               function myHook( $post_ID, $post )     {              wp_transition_post_status('pending', $post->post_status, $post );          }          add_action( 'save_post', 'myHook', 10, 2 );      Edit: I have clear wordpress installation without any plugins, additional code and similar


title: Where do wordpress posts go?

text: We have wordpress installed in our data center and it manages all the content in our corporate website. So I have a list of pages that are accessible and available in tree view. We are interested in also posting to a regular blog as a part of our corporate website. I'm not clear how to do this but I noticed a New Posts option in the very top nav. I so I created a couple draft posts. However, now I can't find them. I foudn a video that discussed saving draft posts, but my left hand nav does not show any link to posts... just pages. So I can create new posts but have no idea how to manage them. Any advice is much appreciated.


title: wordpress theme: on site seo

text: I have a site that is not getting the traffic I have been hoping for (not as much traffic as other sites I own) and I am wondering if it might be something with the theme. The site is _idolx_ (not pornographic but site has pictures of cute girls, just a heads up) Should I change the theme?   or, Try to optimize it?   or, Is it simply the content? Any ideas, opinions or advice would be appreciated. PS: I am not familiar with PHP/coding, etc.


title: advanced custom fields update_field for field type: Taxonomy

text: I need to insert a post via wp_insert_post and then add relevant post_meta - however, the WP admin has been customized with the excellent ACF. I know I can add_post_meta in this way:               add_post_meta( $post_id, 'q_key_type', $q_key_type );      However, to make ACF happy, it's required to also use the "update_field" function - like so:               update_field( "field_52c737a413e07", $q_key_type, $post_id );      This method works fine, but I can't get a Taxonomy object to register correctly - I can get the value to save using add_post_meta - when I view the new post it does not recognise the Taxonomy - the value is empty, but in the postmeta table the value is stored correctly - what is missing is the correct field recognition. I can save fields of the type "Text" and "User" correctly using these two methods. Here is an image of two rows in the post_meta table - the first two are created by acf - the last two manually - they appear to be formatted identically: ![enter image description here](http://i.stack.imgur.com/hCNZF.png) I can only find one other reference to the same field name in the post_meta table - it contains an array with the following data - which seems to be the field set-up for acf:               Array (         [key] => field_52c737a413e07         [label] => Type         [name] => q_key_type         [type] => taxonomy         [instructions] =>          [required] => 0         [taxonomy] => q_key_type         [field_type] => select         [allow_null] => 0         [load_save_terms] => 1         [return_format] => object         [conditional_logic] => Array (             [status] => 0             [rules] => Array (                 [0] => Array (                     [field] => null                     [operator] => ==                     [value] =>                  )             )             [allorany] => all         )     [order_no] => 3     )      So, the question is - where else is ACF saving the taxonomy data - I can't find anything in the terms tables?


title: Warning when using <?php include 'thefile.php'; ?>

text: Would need some more help with the Did ask a question how to import some code with php, in this case it's a sidebar that will be used on some of the pages on a website, It's wordpress and it can execute php from post / page's and have also tested directly in the main code When i did ask the question the best and most easy thing would be to create a file and use include Did create thefile.php and did put it in the theme dir where all other .php file's used is, In the file i did just put some basic html like               <div id=the-id">            <p> a test text </p>     </div>       Then i did put the include code writen as below in my template               <?php include 'thefile.php'; ?>      Doing this i see my text "a test text" but also get several warning's                Warning: include(/wp-content/themes/thetheme/thefile.php) [function.include]:       failed to open stream: No such file or directory in /home/cplac/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 22      And also this               Warning: include() [function.include]: Failed opening ‘/wp-content/themes/thetheme/thefile.php’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php:/home/cplac/public_html/wp-content/plugins/wpsyndicator:/home/cplac/public_html/wp-content/plugins/wp-external-links/includes/phpQuery/:/home/cplac/public_html/wp-content/plugins/wp-external-links/includes/phpQuery/plugins/’) in /home/cplac/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 22      Someone that can help me out whit this ? Have tested both in pages but also in the theme files and so on !


title: How to increase the thumnail size of nggallery carousel template

text:
I want to increase the thumbnail image size of nggallery carousel template. Check this link http://arkamediaworks.com/rel_test/uncatagorize/hello-2/?pid=6 is there any better code to do it. Here, is the code:                    <?php foreach ( $images as $image ) : ?>     <?php if ( $image->hidden ) continue; ?>     <?php $subnavi[] = $image->pidlink ;?>     <li id="ngg-image-<?php echo $image->pid ?>" class="ngg-thumbnail-list <?php if ($image->pid == $current->pid) echo 'selected' ?>" >         <a href="<?php echo $image->pidlink ?>">             <img src="<?php echo $image->thumbnailURL ?>" alt="<?php echo $image->alttext ?>"   />
     <?php endforeach; ?>


title: remove support for 'Categories' for a custom post type

text: How would I go about removing support for Wordpress 'Categories' for a custom post type? I've created a custom taxonomy for the post type, so there is no need for the standard categories. Oddly, I thought this would be easy to find out how to do via Google but I can't find anything on it. Any help appreciated!


title: Multiple loops are not reset

text:
My lovely colleagues have once again designed something that gives me a hard time getting it in Wordpress. Surprisingly it's something that I have done multiple times before; having recent posts and page content on one page. The homepage is a page. Just above the page's content there are three recent posts. For the posts I need to display the first part of the content before the `<!--more-->` tag. That loop seems to work fine. Later in the template I loop through the actual page content. No matter what I do, it always gives me dodgy results. Here's a trimmed version of my index.php/page.php template (they happen to be identical):
         <?php get_template_part('news'); ?>              <?php         $args = array(             'hierarchical'  => false,             'sort_column'   => 'menu_order'         );              $pages = get_pages($args);         ?>              <?php while(have_posts()): the_post(); ?>             <?php $id = get_the_ID(); ?>

                     <?php foreach($pages as $page): ?>                         <li<?php echo (($page->ID !== $id) ? '': ' class="active"'); ?>>                             <a href="<?php echo get_page_link($page->ID); ?>"><?php echo $page->post_title; ?>
                     <?php endforeach; ?>

jaarrekeningen

administraties

salarisverwerking

fiscaal advies

overig advies

<?php the_content(); ?>

         <?php endwhile; ?>              <?php get_template_part('social'); ?>
      As you can see, I'm including the `news` template. Here it is:               <?php     $args = array('numberposts' => 3);          $posts = get_posts($args);          global $more;     ?>
         <?php foreach($posts as $key => $post): setup_postdata($post); ?>             <?php if($key > 0): ?>

<?php endif; ?>             <?php $more = 0; ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                      <?php the_content('Lees meer'); ?>
         <?php endforeach; wp_reset_postdata(); ?>

      What am I doing wrong? Thanks in advance.


title: Membership subscription, change user role when subscription runs out

text: There are heaps and heaps of membership plugins out there, all of them focusing on restricting site content based on the users chosen subscription. I would however only want the user role to change from "have paid" to "haven't paid" when the subscription time runs out, still allowing them to view all the site content but only limited to the role capabilities I've set previously. **EDIT** (for clarification): My users have a public profile page on which they present themselves and their services. They pay annually to stay public, but if they haven't payed they should be hidden from the site, i.e change role to "invisible" instead of "public". Today I do this manually by keeping dates on each user and change their role when needed to, which is quite tedious.


title: Layer post title on top of image Wordpress featured thumbnail image

text:
I'm currently trying to layer a post title on top of the posts featured image but all I see at the moment is " **);">** " instead of the image. The code I'm using is as follows:               <div style="width:609px;height:364px;background-image:url(<?php the_post_thumbnail(); ?>);">
<a href="<?php the_permalink() ?>"><?php the_title(); ?>

      And here is the CSS for the H2 style               article h2 a{     background-color:#bf0c08;     color:#fff;     width:auto;     font-size:30px;     text-decoration:none;     padding:8px;     max-width:479px;     line-height:60px;}      Any idea where I'm going wrong? Also a solution would be awesome :) You can see this on www.ridermagazine.co.uk


title: Custom field not showing

text:
I am trying to get 3 images and their links which I have defined as custom fields. The custom field aren't displayed and when I `var_dump()` my `get_post_meta()` it returns `string(0)""`, what am i doing wrong?
     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
 <?php echo "
".the_meta()."
"; ?>     <a href="<?php $show = get_post_meta(get_the_ID(), 'promotional_link', true); ?>">     <?php //var_dump($show); ?>     <img src="<?php echo get_post_meta(get_the_ID(), 'promotional_image', true); ?>" height="200" width="260">

     <?php endwhile; endif; ?>


title: Get post ID in post/page edit area

text: How can i get "post id" in post edit area for add_filter in functions.php? I want to change file name automatically during upload. so i need to obtain post id. the code is as follows:               add_filter( 'wp_handle_upload_prefilter', 'custom_upload_name' );        function custom_upload_name($file)     {              list($name, $ext) = explode('.', $file['name']);       $file['name'] = $post_ID.'.'.$ext;         return $file;     }      Edited: the final and working code:               add_filter( 'wp_handle_upload_prefilter', 'custom_upload_name' );        function custom_upload_name($file)     {              $post_ID = $_POST['post_id'];          list($name, $ext) = explode('.', $file['name']);       $file['name'] = $post_ID.'.'.$ext;         return $file;     }


title: Problem with update_user_meta() meta_value

text: I am trying to insert a large number of user in to the wordpress db using wp_insert_user(). After inserting each user, I am trying to add an user meta for each user. I am doing like this:               $meta_value = //data from an API (e.g.: 19, 34, 1290 etc)     $user_id = wp_insert_user( $new_user_data );// it works fine     update_user_meta( $user_id, 'my_meta_key', $meta_value ); //does not work      When I run it, user get inserted, but not the meta. When I try like below, it works:               $user_id = wp_insert_user( $new_user_data );// it works fine     update_user_meta( $user_id, 'my_meta_key', '1290' ); //it works      I have over 1000 users, I need to insert, so I need to insert the meta dynamically as well. Any idea how can I overcome this? Thanks.


title: Content between shortcodes

text: I am wondering if there is a way to take content between shortcodes and input it into a string, for example, I want to be able to have [shortcode]Hello World![/shortcode] input to a string called $ShortCodeText, how do I do this?


title: Having a series of pages created based on records in a table with fields populating the pages

text: I just did a redesign of my site, AlpineZone.com. I worked with a WP developer on the completion of the site. One thing that was done that I'm not entirely happy with is the way the Resorts section is handled. Here is an example resort: http://www.alpinezone.com/resorts/sugarbush/ I'm 100% happy with the way it _looks_. The site used to be in standard PHP and all the data was stored in a tab delimeted file that was read by a PHP script. The tab file was updated in Filemarker Pro and updated. This means that it was in a tabular format so I could easily search for records; find resorts that had X number of lifts or between X and Y vertical feet, etc. basically I had a lot more flexibility in parsing the information. However, the "data" in the new format comes from the Postmeta table. I believe the fields are done using a plugin called Advanced Custom Fields. As far as I can tell, it's not easily queryable or searchable. I have other areas of the site, like the Map (http://www.alpinezone.com/skiing/ski-resort-map/), that I would like to pull information from the same source, so I don't need to maintain two sets of records for each resort. Right now the Map is still pulling from the same Tab file it did before. But this means I have the risk of resorts in the Resorts section falling out of sync with the resorts on the Map since the data sources are disparate. basically: is there a way to create a series of pages based on a table of data with each record becoming a new page and the fields being populated into a page structure? Then, I could update the records by just updating the table and it gives me the other benefits of having a table structure (querying, sorting, advanced searching, and ultimately easier expansion (e.g. if I want to add a new field I don't have to add to 140+ resorts manually I can add a field, update the page template to include that field, and then just populate the fields in the table.). Edit: i found this; http://www.myreviewplugin.com/importman.html, which kind of sounds like what i want except it is part of this larger package I don't need. Thanks! -Nick


title: issues with wp_enqueue_script in my plugin

text: So I am working on a plugin and am trying to trigger a js file whenever a post is saved. I have been reading up on this all morning and cannot seem to find why this is not working. Any advice? If I were to paste the js code directly into the plugin it seems to work... I have double checked the path to the js and still no response.               add_action( 'admin_init', 'plugin_admin_init' );     function plugin_admin_init() {           wp_register_script( 'qtool-insert-v2', plugins_url() . '/buildStatus2/' . 'qtool-insert-v2.js' );     }          add_action( 'save_post', 'add_my_script' );     function add_my_script() {         wp_enqueue_script( 'qtool-insert-v2' );     }      Here is the qtool-insert-v2.js - very simple redirect.               <script type="text/javascript">     <!--     window.location = "http://www.google.com/"     //-->     alert("HELLO");     </script>


title: Redirect members to custom page upon logging in through WP admin

text: When a members logs in through WP admin, I would like to redirect them instantly to a custom URL. What will I need to change to make this possible? Respond with step-by-step details would be ideal.


title: Custom fields attached to a page template only show on edit screen when page is saved

text: When I create a custom field and associate it to a custom page template, it doesn't show in the post editor screen until I click save (draft / publish). Ideally, the custom field should show when I select the page template from the dropdown, without having to save anything. Can anyone suggest how I would achieve this desired behavior? Regards Bob


title: Making audio playlist with external audio files?

text: In WordPress 3.9 there is a new feature that can make a playlist with uploaded audio files. I'd like to use external audio files. I use two web hosts. One for my website and one for my audio files.


title: A-Z Plugin takes the root of the page and not my site?

text: Already tried the maker of the plugin but dont get any respons meby some smart men know the answer also. I use a A-Z plugin on this page: http://www.spreuken-wijsheden.nl/wijsheden- a-z/ The plugin links to my categories but doesnt take the root of my site but the page wijsheden-a-z. tried everything quitte desperate. The plugin can be found here. http://www.tipsandtricks-hq.com/wp-alphabet- listing-plugin-list-all-wordpress-posts-or-pages-alphabetically-4873 Many thanx already if someone knows the answer


title: Where to set individual blog quotas?

text: I am administering a self-hosted, multi-site Wordpress 3.1.x site with a few hundred sites. 10 users have requested to have their quotas increased to 1GB. I can't do it for everyone, but I would like to do it for these 10 sites. How can I set blog media quota on a site-by-site basis ? Thanks


title: Theme Loading Into Dashboard

text: I'm having this really weird, never seen before, issue ... whenever I visit the Dashboard, after about 3-5 seconds, my theme loads into the Dashboard layout. It's like the theme's stylesheet is being enqueued somehow ... ![enter image description here](http://i.stack.imgur.com/Elyd5.png) Here is my enqueue hook within `functions.php`:               function myyogawebsite_scripts() {              wp_enqueue_style( 'foundation-normalize', get_template_directory_uri() . '/css/normalize.css' );         wp_enqueue_style( 'foundation-min-css', get_template_directory_uri() . '/css/foundation.min.css' );              // WordPress Core         wp_enqueue_style( 'wordpress-core-css', get_template_directory_uri() . '/css/wp-core.css' );              // Load our main stylesheet.         wp_enqueue_style( 'myyogawebsite-style', get_template_directory_uri() . '/style.css' );              wp_enqueue_script( 'foundation-jquery', get_template_directory_uri() . '/js/jquery.js', null, null, false);              wp_enqueue_script( 'foundation-modernizr', get_template_directory_uri() . '/js/modernizr.js', null, null, true);         wp_enqueue_script( 'foundation-min-js', get_template_directory_uri() . '/js/foundation.min.js', array('foundation-jquery'), null, true);          }     add_action( 'wp_enqueue_scripts', 'myyogawebsite_scripts' );


title: Pages throwing 404 error on server load

text: I have a really strange problem. I have to fix a strange bug in a wordpress installation that is related to the server load. When the site receive more than 5 parallel request some pages starts to throw 404 errors. The pages throwing the errors are never the same and seems to be totally random. I can recreate the problem on my local machine using curl in the terminal :               $ curl -I http://site.local.com/path/to/page & curl -I http://site.local.com/path/to/page/ & curl -I http://site.local.com/path/to/page/ & curl -I http://site.local.com/path/to/page/ & curl -I          HTTP/1.1 200 OK     Date: Fri, 13 Jun 2014 14:31:09 GMT     Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.5.11 mod_ssl/2.2.26 OpenSSL/0.9.8y     X-Powered-By: PHP/5.5.11     X-Pingback: http://site.local.com/xmlrpc.php     Content-Type: text/html; charset=UTF-8          HTTP/1.1 404 Not Found     Date: Fri, 13 Jun 2014 14:31:09 GMT     Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.5.11 mod_ssl/2.2.26 OpenSSL/0.9.8y     X-Powered-By: PHP/5.5.11     X-Pingback: http://site.local.com/xmlrpc.php     Expires: Wed, 11 Jan 1984 05:00:00 GMT     Cache-Control: no-cache, must-revalidate, max-age=0     Pragma: no-cache     Content-Type: text/html; charset=UTF-8          HTTP/1.1 200 OK     Date: Fri, 13 Jun 2014 14:31:09 GMT     Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.5.11 mod_ssl/2.2.26 OpenSSL/0.9.8y     X-Powered-By: PHP/5.5.11     X-Pingback: http://site.local.com/xmlrpc.php     Content-Type: text/html; charset=UTF-8          HTTP/1.1 200 OK     Date: Fri, 13 Jun 2014 14:31:09 GMT     Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.5.11 mod_ssl/2.2.26 OpenSSL/0.9.8y     X-Powered-By: PHP/5.5.11     X-Pingback: http://site.local.com/xmlrpc.php     Content-Type: text/html; charset=UTF-8      The second curl call return a 404 errors. I have disabled all the plugins and this behavior is still happening. Anyone have any ideas?


title: Conditional within a public function within a loop

text: I am using a plugin to build widgets that includes images. Unfortunately it doesn't allow me to resize the images. I tried by adding a conditional but since it's in a public function and within a loop it wasn't working. This is the code:               public function get_widget_data() {             $widget_params = $this->get_widget_data_cache();                  if ( $widget_params ) {                 return $widget_params;             }                  $available_custom_widgets = $this->get_widget_posts();             if( !empty($available_custom_widgets) ) {                 foreach($available_custom_widgets as $widget) {                         $widget_params[] = array(                         'ID' => $widget->ID,                         'title' => $widget->post_title,                         'content' => $widget->post_content,                         'size' => $size,                         'image' => (has_post_thumbnail( $widget->ID ) ) ? wp_get_attachment_image_src( get_post_thumbnail_id( $widget->ID ), $size ) : null, //aangepast                         'link_url' => get_post_meta($widget->ID, '_' . Tribe_Widget_Builder::TOKEN . '_link_url', true),                         'link_text' => get_post_meta($widget->ID, '_' . Tribe_Widget_Builder::TOKEN . '_link_text', true),                         'link_target' => get_post_meta($widget->ID, '_' . Tribe_Widget_Builder::TOKEN . '_link_target', true),                         'widget_description' => get_post_meta($widget->ID, '_' . Tribe_Widget_Builder::TOKEN . '_widget_description', true),                         'dashboard' => get_post_meta($widget->ID, '_' . Tribe_Widget_Builder::TOKEN . '_dashboard', true),                         'disable_sidebar' => get_post_meta($widget->ID, '_' . Tribe_Widget_Builder::TOKEN . '_disable_sidebar', true),                         'token' => Tribe_Widget_Builder::TOKEN,                     );                                   }             }             $this->set_widget_data_cache($widget_params);             return $widget_params;         }      I need to assign a conditional thumbnail size to `$size` on the line that starts with `image- =>` depending within which sidebar the widget is located. I tried adding the following to the function, but is_dynamic_sidebar is not working within:               if (is_dynamic_sidebar('buildings-right')) {         $size = 'test';     }else {         $size ="banner";     }      It just takes the 'else'. What are alternatives for `is_dynamic_sidebar` that will work within this function and within a loop?


title: Get First Image Or youtube Thumbnail with link to youtube video

text: Looking for a single function to grab the first image or video thumnail (with link to the video location i.e. youtube) Havent quite found one that will work. My youtube file starts with there new sharing format http://youtu.be. Not the best with functions yet so ive been stumped for awhile on this havent got any help on wordpresses fourm either


title: Check if values exists DB

text:
I am getting nutts with this one. I want to check if the email introduced in the form already exists in the database before creating a new record. But for some reason the email is empty at search time but when gets into the database gets it correct value from the form. The PHP @ 'functions.php':               function qsmp_register($name, $mail, $password, $terms, $newsletter) {         global $wpdb;         $table_name = $wpdb->prefix . 'qsmp_mails';              $query = $wpdb->prepare( 'SELECT COUNT(*) FROM %s WHERE email = %s ', $table_name, $mail );              $cEMAIL = $wpdb->get_var( $query );              if ($cEMAIL < 1)         {      The HTML:               <form class="reg-page" name="register" action="<?php qsmp_register( $_POST['qsmp_name'],                                                                                $_POST['qsmp_email3'],                                                                                $_POST['qsmp_password3'],                                                                                $_POST['qsmp_terms'],                                                                                $_POST['qsmp_newsletter']) ?>" method="post">

Register a new account


title: Track skip button on built-in WP audio playlist?

text: I feel like I'm missing something here. How do I add a skip track button to the WordPress built-in audio playlist player? Do I lose the ability to move around the playlist if I hide that gigantic track list? I'm looking to embed a slim playlist player on a page.


title: Ajax Call in page theme not working?

text: Ok, i am VERY new to wordpress (2 Hours new). I am creating a page template, which works fine, but this is the issue i am having: In the template.php file, i have this code:               <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>     <script type="text/javascript">         function loadTweets() {$.getJSON("http://mysite.com/wp-content/themes/truemag/page-templates/includes/twitter.php", function (json) {alert(json);});} setInterval(loadTweets(), 60000);     </script>      For some reason when i go to the URL in my browser, I get an Error 500. Same with my ajax call? How would i fix this? I was told maybe a .htaccess file, but i dont think that would be an issue. For some reason this page is blocked.


title: child_of not working in wp_dropdown_categories

text: I have `wp_dropdown_categories` working without setting `child_of`. Once I set `child_of`, all categories disappear. Here's my code, what should I do to enable `child_of`?               function dropdown(){         $book_term=term_exists('book','category');         $book_term_id = $book_term['term_id'];          $dropdown = array(         'child_of'   => $book_term_id,         'hide_empty' => 0         )     ?>         wp_dropdown_categories( $dropdown );     <?php     }


title: Edit default action for profile_personal_options

text: Is there a way to edit the pre-existing action attached to the `profile_personal_options` hook that is built-in to WordPress?


title: How to access global variable $menu inside a class function

text: am puzzling why can't i access the global variable `$menu` inside a php class function               class adminMenus {        public function getWPdefaultmenus(){           global $menu;           return $menu;        }     }      using this code in a plugin file and this function still return `NULL`. **Edited** what i am doing after @Will the Web Mechanic's answer               class adminMenus {          private $getWPdefaultmenus;          public function __construct(){             add_action( 'admin_menu', array( $this, 'getWPdefaultmenus' ) );           }           public function getWPdefaultmenus(){               global $menu;               $this->getWPdefaultmenus = $menu;           }         }      but this returns error:Fatal error: Cannot access empty property


title: WPDB - How to search a column in a table

text: I have a custom table called wpgrating I have a column there called "ip" Now what I want to do is search for "ip" column and see if there is an entry already there? How can I achieve this?


title: Terms not appearing in wp_dropdown_categories

text: I am trying to use wp_dropdown_categories at front end. I got the dropdown box with default "uncategorized", the rest of the category is not there.               function cats_dropdown(){         require_once(ABSPATH . '/wp-admin/includes/template.php');         $args = array('taxonomy' => 'category');     ?>       <div>          <?php wp_dropdown_categories($args); ?>       </div>     <?php     }      In the same function, if I try to output wp_terms_checklist, it works. This is confusing. Anything I missed in the dropdown?


title: Custom metabox value not saving

text:
I have a custom meta box on a custom post-type. I've followed this tutorial but can't get the value I enter to save, I'm guessing I've referenced to something incorrectly. I've looked at the other answers here but no one seems to be using the same save method as I am, and I'm unsure of how to use those answers. This is how I'm creating the fields in the meta box:               // Album Information Metabox Content     function meta_album_info() {         global $post;         // Noncename needed to verify where the data originated         echo '<input type="hidden" name="albummeta_noncename" id="albummeta_noncename" value="' .         wp_create_nonce( plugin_basename(__FILE__) ) . '" />';         $year_released = get_post_meta($post->ID, '_year_released', true);         $record_label = get_post_meta($post->ID, '_record_label', true);         echo '
Year Released
<input type="text" name="_year_released" value="' . $year_released  . '" class="widefat" placeholder="1980" />

Label
<input type="text" name="_record_label" value="' . $record_label  . '" class="widefat" placeholder="2Tone" />
';     }      And here's how I'm attempting to save the data (well for now just the year_released field):               // save album info     function wpt_save_album_meta($post_id, $post) {         if ( !wp_verify_nonce( $_POST['albummeta_noncename'], plugin_basename(__FILE__) )) {         return $post->ID;         }         if ( !current_user_can( 'edit_post', $post->ID ))             return $post->ID;         $album_meta['_year_released'] = $_POST['_year_released'];         foreach ($album_meta as $key => $value) {             if( $post->post_type == 'revision' ) return;             $value = implode(',', (array)$value);             if(get_post_meta($post->ID, $key, FALSE)) {                 update_post_meta($post->ID, $key, $value);             } else {                 add_post_meta($post->ID, $key, $value);             }             if(!$value) delete_post_meta($post->ID, $key);         }     }     add_action('save_post', 'wpt_save_album_meta', 1, 1);      much appreciated!


title: Adding line breaks to nav menu items

text: I need to add line breaks to the nav menu item titles. I didn't realize this was a problem as when I am logged in as a Super Admin, I can add `<br/>` just fine, but apparently regular-level admins cannot. I've read over this post Custom Menus Description Stripping HTML Tags but I'm fairly convinced the tags are being stripped on on save/update, so I am not immediately seeing how a Custom Walker is the solution, but my brain is pretty well shot today, so it might be obvious. There also doesn't seem to be any sanitation happening in `wp_save_nav_menu_items()` or `wp_update_nav_menu_item()`.


title: Filter post query to only show direct children of category

text: Google seems all purple on this subject, if you know what I mean. I've searched for this topic forever to find a solution. I want to build a finder/explorer feel to my categories, so when browsing to a category, I only want to display the direct children of the category - not posts in sub categories of this category. I would like to alter the current query if possible, and not do any SQL quries. **I tried:**               $posts = query_posts('cat='.$cat.'&child_of='.$cat.'&parent='.$cat);      And a whole bunch of other stuff.. But I'm running out of ideas...


title: ajax, right way to do it and make it works?

text: I'm new to wordpress but have knowledge in php and javascript. I read a lot of blogs about ajax call in wordpress. I also read some posts on this forum. However, I still have some difficulties making an ajax call with wordpress. It's a little confusing in my mind where `add_action` and hook must be written (inside my custom php function file or inside function.php file? or in an other way). When my jquery script is called, `wp_ajax` is not defined... I don't understand how my jquery script can get `wp_ajax` url or other variable from php before it is ran. Here my different scripts: In my function.php (I really don't know if I need to put this here or in my custom php file):               wp_enqueue_script('load_post', get_template_directory_uri().'/js/load_post.js', array('jquery'), '1.0', 1 );     wp_localize_script( 'load_post', 'wp_ajax',             array( 'url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce('ajax_nonce') ));       In load_post.php               <?php          add_action('wp_ajax_load_post', 'load_post_callback');     add_action('wp_ajax_nopriv_load_post', 'load_post_callback');          function load_post_callback() {          if (isset($_POST['post_ids'])) {              $nonce = $_POST['nonce'];          if ( ! wp_verify_nonce( $nonce, 'ajax-nonce' ) ) {             die ( 'Interdit !');         }              $ids = array();          $ids[] = $_POST['post_ids'];              $posts_per_page = 8;         global $wp_query;         query_posts(array('post_type' => array('post', 'portfolio'), 'post__not_in' => $ids, 'posts_per_page' => $posts_per_page));         while (have_posts()) : the_post();              $post_type = get_post_type( $post->ID );         if ($post_type == 'post') {             $post_type = 'blog';         }     ?>          //I do some stuff echo...          <?php         endwhile;         wp_reset_query();         }     }     ?>      And load_post.js               jQuery(document).ready(function($) {               jQuery('#next-container').click(function() {                   var IDs = [];             $(".element").each(function(){ IDs.push(this.id); });                  $('#next-container').html('loading');                  $.ajax({                 type: 'POST',                 url: wp_ajax.url,                 data: {  action: 'load_post',                            ajax_nonce: wp_ajax.nonce,                         'post_ids': IDs,                         },  //{'post_ids[]': IDs },//'post_ids='+IDs,                 success: function(data) {                         $('#next-container').html('');                           $container.isotope( 'insert', $(data));                              }                     })             })     })


title: How can I create an RSS feed that includes "Private" posts?

text: I'm currently publishing articles to wordpress as "Private", as I don't want them to be viewable on the website. However I do need an RSS feed of these posts. Any suggestions on how to go about creating an RSS feed of posts that aren't viewable on my site?


title: How can I list custom post by custom category?

text:
From some references I wrote a code for create custom post type ( **journal** ) and taxonomy using following code. It works fine. Next I am add a new category from admin side for my custom post type ( **journal** ) called **featured**. I can sort this post type by category on admin side ![Admin part](http://i.stack.imgur.com/nwOAO.png). But on user side I can't list them when I am list my category which shows only **post categories** Like below image. Below image show list of my custom post type( **journal** ) . How can I show this journal list by category name on user side?![enter image description here](http://i.stack.imgur.com/vb9kH.png)               function post_type_journal()         {                  $labels = array(             'name' => _x('Journals', 'post type general name'),             'singular_name' => _x('Journal', 'post type singular name'),             'add_new' => _x('Add New', 'journal'),             'add_new_item' => __('Add New Journal'),             'edit_item' => __('Edit Journal'),             'new_item' => __('New Journal'),             'view_item' => __('View Journal'),             'search_items' => __('Search Journal'),             'not_found' =>  __('Nothing found'),             'not_found_in_trash' => __('Nothing found in Trash'),             'parent_item_colon' => ''         );              $args = array(             'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,             'query_var' => true,             'menu_icon' => null,             'rewrite' => true,             'capability_type' => 'post',             'hierarchical' => false,             'menu_position' => null,             'supports' => array('title','editor','thumbnail'),                );              register_post_type('journal', $args);         }         add_action('init','post_type_journal');     function themes_taxonomy() {                  register_taxonomy('article', 'journal', array(             // Hierarchical taxonomy (like categories)             'hierarchical' => true,             'query_var' => true,                     // This array of options controls the labels displayed in the WordPress Admin UI             'labels' => array(                 'name' => _x( 'Journal Category', 'taxonomy general name' ),                 'singular_name' => _x( 'Journal-Category', 'taxonomy singular name' ),                 'search_items' =>  __( 'Search Journal-Categories' ),                 'all_items' => __( 'All Journal-Categories' ),                 'parent_item' => __( 'Parent Journal-Category' ),                 'parent_item_colon' => __( 'Parent Journal-Category:' ),                 'edit_item' => __( 'Edit Journal-Category' ),                 'update_item' => __( 'Update Journal-Category' ),                 'add_new_item' => __( 'Add New Journal-Category' ),                 'new_item_name' => __( 'New Journal-Category Name' ),                 'menu_name' => __( 'Journal Categories' ),             ),                  'rewrite' => array(                 'slug' => 'article', // This controls the base slug that will display before each term                 'with_front' => false, // Don't display the category base before "/locations/"                             'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"             ),         ));     }     add_action( 'init', 'themes_taxonomy',0);        The following is code of user side that outputs is shown in second image               $categories = get_categories($args);       foreach($categories as $category) {          echo '
Category: term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'
 ';         echo '
 Description:'. $category->description . '
';         echo '
 Post Count: '. $category->count . '
';  }                        $type = 'journal';                     echo  $cat_id=get_cat_ID('featured');             $args=array(                      'cat'=>$cat_id,              'post_type' => $type,              'post_status' => 'publish',              'posts_per_page' => -1,              'caller_get_posts'=> 1);                  $my_query = null;             $my_query = new WP_Query($args);             if( $my_query->have_posts() ) {              while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
             <?php               endwhile;             }             wp_reset_query();  // Restore global post data stomped by the_post().             ?>


title: Where to put a migration script to switch post information?

text: I just changed a crucial aspect of my theme, and posts tagged with a particular taxonomy called `position` are now handled by a custom meta field called `cmb_position_name`.   * Posts that have the taxonomy `position` with the term `event_highlights` should now have a `cmb_position_event_highlights` meta value of `on`.   * Posts that have the taxonomy `position` with the term `featured_news` should now have a `cmb_position_featured_news` meta value of `on`.   * Posts that have the taxonomy `position` with the term `slider` should now have a `cmb_position_slider` meta value of `on`. I need to make a script that migrates existing posts, adding these meta values accordingly. What is a good place to put this script so that it is executed once, and ensures all the posts are migrated properly?


title: What does that mean: cannot use a scalar value as an array

text:
I've got a theme and when I host it locally on my MAMP server I have no issues, after moving it to a web server get the following issue: > Warning: Cannot use a scalar value as an array in /home/XXX/public_html/wp- > content/themes/XXX/lib/inc/shortcodes.php on line 752 Firstly, I have no idea what a scalar value is, but here is the code in question. When commenting out the code, the site works fine again, but, it obviously does something, so any help would be appreciated. Lines 752 - 756               $param = WPBMap::getParam('vc_row', 'el_class');          $param ['description'] = 'If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.
Predefined Classes:
          no-margin-sides  no-margin-top  no-margin-bottom  margin-top-75  margin-bottom-75
          padding-top-50  padding-bottom-50
';          WPBMap::mutateParam('vc_row', $param);


title: Pretty Permalinks

text: I've created my own search functionality which basically finds the nearest store closest to the entered postal code. My URL for the search currently looks like this `http://www.example.com/stores?searchTerm=London`, which is not really that SEO friendly. I would like my URL to be in the following format - `http://www.example.com/stores/London`, however due to my lack of knowledge in how the WordPress URL Rewrites work I'm struggling with this and would like some help in resolving this issue. Stores is a page that loops through the results. If anybody has any ideas on how to do this or can point me in the right direction then it would be greatly appreciated.


title: rewriting for custom taxonomy rewrite

text: I want to rewrite my custom taxonomy in form of http://mywebsite.com/cars/my-tax All examples i found makes use rewrites and use a new function to get the new permalink... problem is normally to get a term url, get_term_link is used but I cannot use this as I have rewritten the permalink.. so i need to replace this function everywhere it is called? does not seem to be a good solution for me.


title: Thumbnail for categories / taxonomies plugin?

text: I'm looking for a nice way to attach an image as a thumbnail to a category. No plugin that I found does this. I have a category loop and it would nice to display a category thumbnail, not just the name and description.


title: Wordpress localization - gettext and git

text: We're about to start working on localization of a highly customized wordpress theme with over 200 php files. We're using git for version control. Are there any particular hints or warnings we should know about? Do we just stick the po/mo files in there with the theme? We're probably going to try to use a tool like WPML or Codestyling Localization. Do they store everything in files or to they mess about with wpdb?


title: Trigger Customizer saving process with Javascript only

text: I'm working on a custom theme that uses WordPress Customization API to let the user play with parts of the content of his website, basically the front-page which he can modify by adding/removing custom blocks such as latest posts, page children, etc. Blacks structure is collected and filled in an custom input. Everything works fine except for saving, the Customizer seems to have some safety that blocks me from saving the input value: in order to save it, I need to manually trigger a Javascript 'keypress' event by selecting the input and pressing a key. If I don't, the submit button stays disabled. By browsing through /wp-admin/js/customize-controls.js I manage to activate the submit button:               wp.customize.trigger('change')      But even though the saving thing is unlocked, it doesn't have any effect: the input value is not sent to admin_ajax.php and my data is not saved. Any idea of how I could force the trigger on the Javascript API to save my data? I couldn't find detailed doc on the WP JS API, that could helped too if I missed it somewhere.


title: 3 different ways to check the number of pages on site gives 3 different answers

text: I entered this command into Google:               site:g33ktalk.com      And it returned 659 pages. But when I created a sitemap with this service: http://www.xml-sitemaps.com/ it showed me 498 pages crawled. And when I made the sitemap with the Wordpress default sitemap generator, it showed under 400 pages. Would anyone know why this happens and what is the correct count? Is it a crawling problem? If so, how would I begin debugging it so that all 600+ pages can be crawled? Thank you!


title: localization of theme and plugins to English (originally in another language)

text: We're about to start localizing a wordpress installation with a highly customized theme and several custom plugins. Unfortunately it is not gettext- ready, and also the original theme is not in English. How would you do this? I'm thinking the best way to do it would be to go through the theme and plugin files, change all static text (currently in Swedish) to gettext-wrapped English, and then do a translation back to Swedish. It sound pretty tedious. Can we just wrap the Swedish in gettext calls and provide an en_US translation? Also, any thoughts on tools? WPML, Codestyling Localization, raw poedit, something else?


title: My website is slow on the initial load

text: I am creating my first website in wordpress, and I have noticed some strange behavior. The website is really slow on the initial load. When I open the website after some time of inactivity, let's say an hour, the site loads extremely slow, over 5 sec. After that the website is just fast. Even when I close the browser and open again the website stays fast. When I switch to another browser, I have the same problem. Initial load is slow, after that the page works as usual. Anyone know something I could do. I have disabled all plugins and still the same problem, any know what I can do. Profiling with firebug and Yslow is not really an option, because I can not get good results. I can only test this once every hour.


title: How do I filter a custom post type loop by a field?

text:
OK, very simple task, I'm just not good at PHP. I have a page where I want to list some staff using a styled list. Here is the page all working fine, I just need to divide the results - http://www.themontessoripeople.co.uk/montesori/?post_type=people I downloaded a "custom content type" plugin and added the content type of "people" and added the appropriate fields. Now I want to filter the posts I have added by the custom field called "hierarchy". Here is how I want the page to display - http://i47.tinypic.com/oqymwh.jpg Notice in the image I have headings for each group of posts filtered by the room. The custom field "hierarchy" contains the room variables of either "management", "babies_room" and "toddlers_room". How do I amend the code below to filter the posts by the value held within `<?php print_custom_field('hierarchy'); ?>` ?               <?php $col = 1; ?>               <?php if (have_posts()) : ?>                     <?php while (have_posts()) : the_post(); ?>                          <?php if ($col == 1) echo "
"; ?>                          <div class="post col<?php echo $col;?>" id="post-<?php the_ID(); ?>">

<?php the_title(); ?>
                                      <?php print_custom_field('job'); ?>

                                     <img src="<?php print_custom_field('staff_image:to_image_src'); ?>" width="160" height="160" alt="<?php the_title(); ?>-image" />

<?php edit_post_link('Edit Post', ''); ?>

                      <?php if ($col == 1) echo "
"; (($col==1) ? $col=2 : $col=2); ?>                <?php endwhile; ?>      Thanks, Ben.


title: Redirect Domain to a Specific Category

text: My current blog site hosts the Category-- http://www.soulintentarts.com/the- weekly-rune/ I would like the domain theweeklyrune.com to redirect to the above URL, which is the WP Category The Weekly Rune. Is that possible? Thank you!


title: Upload iPhone video clips to blog via native WP app

text: I'm using the WordPress iPhone app, and when I upload video clips to a blog they show up in some browsers and in others not. I'm using a HTML5 video markup as a container for the clips. While mpeg-4 doesn't work in Firefox and Opera I would really expect the clips to work in Apple's own browser Safari, which they don't. The only browser I can currently view these clips in is Chrome. Here's my markup for the uploaded clips:               <video width="960" height="540" src="http://path/to/clip/1.mov" type="video/quicktime" controls>Your browser can't play this video.</video>      It seems that .mov files are harder to interpret for Safari than it's mp4 counterpart. Could it be that Safari needs the clips to be in the latter format? If it does, what approach would you recommend converting these files when uploading a video clip?      Any directions regarding this issue are much appreciated.


title: How to randomise my menu items?

text: So I thought I could do it like this (also I want to only get 3) -               $menu_items = wp_get_nav_menu_items(26);     $menu_items = array_rand($menu_items, 3);          foreach ( (array) $menu_items as $key => $menu_item ) {         $title = $menu_item->title;         echo $title;     }


title: Hide H1 Title using the_title filter

text: I am trying to hide the pages H1 header IF a custom field specifies this. On a page back end I have added a custom field: Name = hide_title Value = true I then want to hide only the H1 using a filter. The following code does not work but is the result of my noodling around. Can anyone suggest a fix for this code or an alternate way of approaching this. I do not want to amend the core template files. Thanks                   // Hide H1 Title              add_filter('the_title', 'hide_title', 10, 2);              function hide_title($title, $id) {                  global $post;             $key = 'hide_title';             $meta = get_post_meta($post->ID, $key, true);                  if ($meta = 'true') $title['post_title'] = '';             return $title;              }


title: automatically adding submenu items

text: Here's the solution that @bainternet has posted here: Add child pages automatically to nav menu               /**     * auto_child_page_menu     *      * class to add top level page menu items all child pages on the fly     * @author Ohad Raz <admin@bainternet.info>     */     class auto_child_page_menu     {         /**          * class constructor          * @author Ohad Raz <admin@bainternet.info>          * @param   array $args           * @return  void          */         function __construct($args = array()){             add_filter('wp_nav_menu_objects',array($this,'on_the_fly'));         }         /**          * the magic function that adds the child pages          * @author Ohad Raz <admin@bainternet.info>          * @param  array $items           * @return array           */         function on_the_fly($items) {             global $post;             $tmp = array();             foreach ($items as $key => $i) {                 $tmp[] = $i;                 //if not page move on                 if ($i->object != 'page'){                     continue;                 }                 $page = get_post($i->object_id);                 //if not parent page move on                 if (!isset($page->post_parent) || $page->post_parent != 0) {                     continue;                 }                 $children = get_pages( array('child_of' => $i->object_id) );                 foreach ((array)$children as $c) {                     //set parent menu                     $c->menu_item_parent      = $i->ID;                     $c->object_id             = $c->ID;                     $c->object                = 'page';                     $c->type                  = 'post_type';                     $c->type_label            = 'Page';                     $c->url                   = get_permalink( $c->ID);                     $c->title                 = $c->post_title;                     $c->target                = '';                     $c->attr_title            = '';                     $c->description           = '';                     $c->classes               = array('','menu-item','menu-item-type-post_type','menu-item-object-page');                     $c->xfn                   = '';                     $c->current               = ($post->ID == $c->ID)? true: false;                     $c->current_item_ancestor = ($post->ID == $c->post_parent)? true: false; //probbably not right                     $c->current_item_parent   = ($post->ID == $c->post_parent)? true: false;                     $tmp[] = $c;                 }             }             return $tmp;         }     }     new auto_child_page_menu();      How to use it? I have to implement it on a published website so I'm not in a position to experiment much... c/p code to functions.php? call the function from inside the header?


title: List all posts in custom post type by taxonomy

text: Is there a way I can list all posts in a specific custom post type and arrange them by the custom taxonomy term attached to them? For example; **Taxonmy Term #1**   Post Type   Post Type   Post Type   **Taxonomy Term #2**   Post Type   Posty Type Any help would be most appreciated. Thanks.


title: How to extend WP_Query to include custom table in query?

text: I have been days over this issue now. Initially it was, how to store a user's follower data in database, for which I got couple of nice recommendations here at WordPress Answers. After, following the recommendations I have added a new table like this:               id  leader_id   follower_id     1   2           4     2   3           10     3   2           10      In the table above, the first row has a user with an ID of 2 who is being followed by a user with an ID of 4. In the second row, a user with an ID of 3 is being followed by an user with an ID of 10. The same logic applies for the third row. Now, essentially I want to extend WP_Query so that I can limit posts fetched to that of, only by the leader(s) of a user. So, taking the above table into consideration, if I were to pass the user ID 10 to WP_Query the results should only contain posts by user ID 2 and user ID 3. I have searched a lot trying to find an answer. Nor, I have seen any tutorial to help me understand how to extend the WP_Query class. I have seen Mike Schinkel's answers (extending WP_Query) to similar questions, but I have really not understood how to apply it to my needs. It would be great if someone could help me out with this. Links to Mike's answer's as requested: Link 1, Link 2


title: Change post category via MySQL

text: I'm currently building a management program that works separately from Wordpress but interacts directly with the Wordpress MySQL database. I have it working updating, adding and deleting posts and postmeta but I am now stumped on adding categories to posts and changing categories. I have posts setup with custom taxonomies "what" and "from" and I would like to change these using a select box in a form via MySQL. Is this possible? I know it involves a lot of LEFT JOINS to display the taxonomies for each post but I'm not sure how to update them. Heres what I have for displaying the custom taxonomies on the site:               SELECT t.*, tt.* FROM wp_terms AS t      INNER JOIN wp_term_taxonomy AS tt ON (tt.term_id = t.term_id)      INNER JOIN wp_term_relationships AS tr ON (tr.term_taxonomy_id = tt.term_taxonomy_id)      WHERE tt.taxonomy IN ('what') AND tr.object_id IN (79088)      ORDER BY t.name ASC;      Where 'what' is the custom taxonomy and 79088 is the post ID how would I go about changing this what from term_ID 1500 to 1501 for example?


title: Loading Custom Post Type Events into jQuery-based FullCalendar?

text: Here is a question I have spent over 3 hours attempting to solve but each approach I take ends up not working out for me. All I am attempting to do is utilize this opensource ajax calendar script:   * **FullCalendar** and have the entries display all posts within a specific post type. For each of the posts within this event post type I have a custom metabox with the following custom fields:   * event category   * event start date   * event start time   * event end date   * event end time At the most basic level I just need each post to show up within the applicable calendar box based on the "event start date" and "event start time" and link to the applicable event post details page. In an ideal situation I was looking to have each event category with its own color and have each event span multiple days if the applicable event has an `"event_end_date"` that is different than the start date. Has anyone done this before and can past the applicable code to get either of these in place. I feel this would be highly valuable to the WordPress community as well.


title: How do I add CSS options to my plugin without using inline styles?

text: I recently released a plugin, WP Coda Slider, that uses shortcodes to add a jQuery slider to any post or page. I am adding an options page in the next version and I would like to include some CSS options but I don't want the plugin to add the style choices as inline CSS. I want the choices to be dynamically added to the CSS file when it's called. I would also like to avoid using fopen or writing to a file for security issues. Is something like this easy to accomplish or would I be better off just adding the style choices directly to the page?


title: What Is The Difference Between suppress_errors() And hide_errors() in $wpdb?

text: What is the difference between the suppress_errors() function and the hide_errors() functionin wpdb class? What is the use of each function?


title: Order by multiple meta keys on wordpress

text: After multiple research I didn't find the correct answer to my question. I just need to order my custom post type by date and then by time (format: 18:00). Here's what I tried: http://pastebin.com/BRR6h08j It orders well by the date but not by the time. And I don't need to hide events that occured. If someone can help me getting my correct meta_keys I know the problem is here:               'meta_query' => array(          'relation' => 'AND',           array(             'key' => 'heure_de_lartiste',             'value' => $todaysDate,             'compare' => '>='            )       ),      I don't know what to put in "value" and "compare" Thanks a lot, Jhon


title: Having Trouble With get_category_by_slug In a Custom Function

text:
Here's my custom function to list child categories by the parent slug.               function ribbon_list_cats($parent_cat_slug)     {         $parent_category = get_category_by_slug($parent_cat_slug);         if ($parent_category->count != 0) {             echo "
";             echo wp_list_categories('title_li=&child_of='.$parent_category->term_id.'&hide_empty=0&show_option_none=&echo=0');             echo "
";         }     }      I'm having trouble getting it to return and output. It doesn't throw an error. I'm using it multiple times so I created this but when I do it like so:               $parent_category = get_category_by_slug('lifestyle');     if ($parent_category->count != 0) {         echo "
";         echo wp_list_categories('title_li=&child_of='.$parent_category->term_id.'&hide_empty=0&show_option_none=&echo=0');         echo "
";     }      right in the template it works fine. But that's a lot of code to repeat over and over again. Hope that makes sense. Thanks!


title: Disable the link on certain pages

text: I currently have a site with two levels of navigation. I am styling the wp_list_pages() list to act as my navigation. I would like to disable the link on some pages which have children (not exclude) so that I can hover over them to display the drop down navigation but I can't click on them. Does anyone know of such a method or parameter I could add?


title: How do I view registered syles and scripts for enqueue

text: I know that `wp_register_style()`, `wp_deregister_style()` and `wp_enqueue_style()` are used for css style registration and enqueue management. However, I am interested in viewing ALL registered styles (whether custom or by default). Does `wp_register_style()` add the script names/locations to a table in the WordPress database? If so, which? And how can I view them? Is there a function for that or do I have to create my own? Thanks.


title: remove "edit your profile" from admin menu bar

text: How can I remove "edit your profile" submenu under "my-account-with-avatar" admin menu bar, while still keeping the avatar and logout?


title: Custom taxonomy from custom post type

text:
Trying to have a set of categories for every custom post type. > Book (custom post type) -> category (custom taxonomy) -> Adult / Teenage / > Kids > > Movie (custom post type) -> category2 (custom taxonomy) -> Thriller / Comedy > / Action So far I manage to display the custom taxonomy as a list:               $terms = get_terms( 'category' );     echo '
';     foreach ( $terms as $term ) {         $term_link = get_term_link( $term );         if ( is_wp_error( $term_link ) ) {             continue;         }         echo '
' . $term->name . '
';     }     echo '
';       and in functions.php               add_filter('pre_get_posts', 'query_post_type');     function query_post_type($query) {         if (is_category() || is_tag()) {             $post_type = get_query_var('post_type');             $post_type = array('Book');             $query->set('post_type',$post_type);             return $query;         }     }      When I click on Adult/Teenage/Kids it works as I want it, it calls category.php, but when I click on any of Thriller/Comedy/Action it doesn't work. Any suggestions?


title: How can I make a website with dynamic features with wordpress?

text: As I am a novice in web development field, I wanted to clarify some questions running in my head.   1. I want to make a multilingual website with dynamic features. Dynamic features can be like anything under the sun. Is it possible that I can make a website using WordPress (which is mostly considered as blogging platform). Well I know that there are some limitations while making a customized website with wordpress.   2. Should I learn any of the frameworks like Django or rails, if yes why (its obvious I would have to learn CSS, Ajax, Javascript, PHP)?   3. Suppose I want to add dynamic features in my wordpress site real time features like that of twitter (should I learn ruby on rails then?), or building API's, support digg like features ,people submitting blogs and reblogging again, aggregaton features, editing features, some facebook features like notification features on the top of your profile page, colloborative blogging, submitting links, photos, videos, social platform for people to know each other and follow them, microblogging (realtime) like tumblr. Will it be fully customizable after I get my hands perfectly on learning some languages and/or frameworks like rails or django.   4. I don't want to learn drupal as it learning curve is very high and meant for technically good programmers, while I don't have much knowledge of Joomla (and am ready for it to learn if wordpress fails).   5. I also want to make a rich platform for advertisement which will be commercial. Is it possible that I make a model of advertisement which is in my mind which can link to any other websites, blogs, people (users). The most interesting,challenging and important question is:   1. If I am not able to make a website with such dynamic features with Wordpress, will I have to make pluggins, widgets,themes on my own which can be fully customized for my website. Is it possible to make such pluggins and themes which can be fulfill above said points.


title: Custom Metabox with Taxonomy Dropdown - Saving Issue

text: My goal was simple --- to create a custom post type with a custom metabox with a simple drop down list of taxonomy terms instead of utilizing the tags or checkboxes. The reason was to ensure that the editor can only select a single term from the taxonomy list. After trial and error I finally managed to figure out a way to utilize the excellent metabox creation tools I am using from WP-Alchemy (http://farinspace.com/wpalchemy-metabox/) to create my metabox and have it display the applicable terms in a dropdown list. The problem I am having is that I can't seem to get a new selection from the dropdown menu to save the selected value. To be clear... its important that only a single term be associated with each post in this custom post type meaning that whenever a different value is select from the dropdown menu and the post is saved it needs to ensure the previous selection is unregistered. As mentioned I currently have it displaying the list of terms in a dropdown and I also have it correctly displaying whatever term might be associated. Just the saving of the new values is where i am having issues. From extensive research it "seems" like the solution involves using the wordpress "wp_set_post_terms" functions which is further explained here: http://codex.wordpress.org/Function_Reference/wp_set_post_terms However I am unsure how to utilize it correctly to achieve my desired result. Below I have include the code I am utilizing. It's very possible there is a better way of doing this and I would appreciate whatever suggestions you guys might have might also ensure that the applicable "checks" are being done to ensure data can't be inserted by users that are not authorized. FUNCTIONS.PHP FILE (SHOWS THE CREATION OF THE CUSTOM POST TYPE AND TAXONOMY BELOW.               //////////////////////////////////////////////////////////////////////////////     // CUSTOM POSTTYPE FOR -- SERVICES       //////////////////////////////////////////////////////////////////////////////          add_action('init', 'services');     function services() {      register_post_type('services', array(       'labels' => array(        'name'   => __('Services'),        'singular_label'  => __('Service'),        'new_item'   => __('Add a Service'),        'add_new'   => __('Add a Service'),        'add_new_item'  => __('Add a Service'),        'edit'   => __('Edit Service'),        'edit_item'   => __('Edit Service'),        'view'   => __('View Service'),        'view_item'   => __('View Service'),        'search_items'  => __('Search Services'),        'not_found'   => __('No Services Found'),        'not_found_in_trash' => __('No Services Found in Trash'),            'parent_item'  => __('Parent Service'),        'parent_item_colon' => __('Parent Service:')        ),       'can_export'    => true,       'menu_position'   => 7,       'public'    => false,       'show_ui'    => true,       'publicly_queryable'  => true,       'hierarchical'   => true,       'query_var'    => true,       'capability_type'   => 'post',       'exclude_from_search'  => false,       'supports' => array(        'title',        'editor',        'revisions',        'page-attributes'        ),       'rewrite' => array(         'slug'   => 'disability-services',         'with_front'   => false        )      ));     }      HERE IS WHERE I AM REGISTERING THE TAXONOMY I AM TRYING TO WORK WITH               // CUSTOM TAXONOMY METABOX POSTTYPE - AGE GROUPS        register_taxonomy('theme', array('services'), array(         'hierarchical'          => false,          'singular_label'            => 'Age Group',          'query_var'                 => 'theme',         'public'                => true,         'show_ui'               => true,         'show_tagcloud'             => false,         'show_in_nav_menus'             => true,             'rewrite'               => array( 'slug' => 'age-groups', 'with_front' => false ),         'labels' => array(             'name'          => __( 'Age Groups' ),             'singular_name'         => __( 'Age Groups' ),             'search_items'      => __( 'Search Age Groups' ),             'all_items'             => __( 'All Age Groups' ),             'parent_item'       => __( 'Parent Age Group' ),             'parent_item_colon'         => __( 'Parent Age Group:' ),             'edit_item'             => __( 'Edit Age Group' ),              'update_item'       => __( 'Update Age Group' ),             'add_new_item'      => __( 'Add Age Group' ),             'new_item_name'         => __( 'New Name of Age Group' ),             'popular_items'         => __( 'Popular Age Groups' ),             'separate_items_with_commas'=> __( 'Separate Age Groups with commas' ),             'add_or_remove_items'   => __( 'Add or remove Age Groups' ),             'choose_from_most_used' => __( 'Select Popular Age Groups' ),              ),        ));        wp_insert_term('Kids', 'theme');        wp_insert_term('Teens', 'theme');        wp_insert_term('Adults', 'theme');      THIS IS THE REMAINDER OF THE CODE I AM USING IN THE FUNCTIONS FILE AND THE CODE TO CREATE THE METABOX BASED OFF WPALECHEMY. In this attempt I tried to include 'save_filter' => "wp_set_post_terms( $post->ID, 'theme' )", with the hope this would save the applicable data but it did not.               // CUSTOM METABOX POSTTYPE - SERVICE DETAILS        $custom_metabox_service_details = new WPAlchemy_MetaBox(array (         'id'        => '_service_details-metaboxes',        // underscore prefix hides fields from the custom fields area         'title'     => 'Age Groups',            // title added automatically to the custom metabox         'types'     => array('services'),           // added only for custom post type "name-of-post-type" can also be "page" or "post"         'context'   => 'normal',                    // same as above, defaults to "normal" but can use "advanced" or "side"         'priority'  => 'high',                  // same as above, defaults to "high" but can use "low" as well         'mode'  => WPALCHEMY_MODE_EXTRACT,         'save_filter' => "wp_set_post_terms( $post->ID, 'theme' )",         'template'  => TEMPLATEPATH . '/admin-metabox/service_details-metaboxes.php'  // contents for the meta box         ));      I SHOULD ALSO NOTE THAT DIMAS OVER AT WPALECHMEY JUST ADDED SOME NEW CODE INTO HIS 1.3.2 VERSION OF GITHUB WHICH ALLOWS THE ABOVE CODE TO INCLUDE A               'save_filter' => "custom-function",       This code allows you to create a custom function or I guess call a custom function which gets executed upon hitting the publish button so maybe that is the best way to save the data? In any case, I am utilizing the following code for the custom metabox to display the actual dropdown list displaying the taxonomy terms.               <?php      // This function gets called in edit-form-advanced.php     echo '<input type="hidden" name="taxonomy_noncename" id="taxonomy_noncename" value="' . wp_create_nonce( 'taxonomy_theme' ) . '" />';          // Get all theme taxonomy terms     $themes = get_terms('theme', 'hide_empty=0');      ?>          <select name='post_theme' id='post_theme'>     // DISPLAY TERMS AS DROP DOWN OPTIONS     <?php $names = wp_get_object_terms($post->ID, 'theme'); ?>     <option class='theme-option' value='' <?php if (!count($names)) echo "selected";?>>None</option>     <?php foreach ($themes as $theme) {      if (!is_wp_error($names) && !empty($names) && !strcmp($theme->slug, $names[0]->slug))       echo "<option class='theme-option' value='" . $theme->slug . "' selected>" . $theme->name . "</option>\n";       else      echo "<option class='theme-option' value='" . $theme->slug . "'>" . $theme->name . "</option>\n";      }     ?>     </select>      I am assuming saving the data should be simple as pie but I guess I am confusing myself on how to accomplish this. As mentioned I would appreciate if you could also provide suggestions on the code to ensure any necessary checks are done to ensure data is saved correctly and only be the correctly authorized people. Must thanks in advance!


title: Post & edit a post from front end along with upload, dropdown, and other inputs

text: I am following this tutorial to post from front end. I am able to post the title, content, category, tags, I would like to know is it possible to add more fields like in the image below. How to increment field-set? and how to add edit the post from the front end itself? basically this what I want to do. ![front end post with advanced fields](http://i.stack.imgur.com/vqY6E.jpg)


title: I can't set meta_key in my custom post type query

text: I've created a custom post, `events`, and saved the meta data `event_year` to each event. I'm trying to get a year's event archive. When I go the the following URL, the `meta_key` and `meta_value` are not set for some reason, and thus the event archive is unfiltered.               /?post_type=events&meta_key=event_year&meta_value=2011      Debugging the values:               echo $wp_query->query_vars['post_type']; // 'events'     echo $wp_query->query_vars['meta_key']; // -blank-     echo $wp_query->query_vars['meta_value']; // -blank-      **Why can't I set the meta_key and meta_value?** The meta_values are saved to the events. I've successfully displayed them:               get_post_meta($post->ID, 'event_year', true); // '2011'


title: using get_the_category to get all post categories except one

text:
foreach((get_the_category()) as $cat) {     if (!($cat->cat_name=='Featured')) echo $cat->cat_name . ' ';     }      this is what has been recommended in the forums but its not working for me. I need to split off the echo piece like the following to show an image.
<img src="<?php bloginfo('template_url'); ?>/images/cats/<?php echo $category->slug ?>-icon.png"/>  <?php  echo $category->cat_name ?>
      any ideas?


title: Multiple Comment Moderators and Notifications

text: I am looking for a way to make it so multiple authors/moderators within wordpress get notified when there is a new comment waiting approval. I'm thinking of switching over to Disqus for this type of thing, but was wondering if it's possible without swapping out the commenting interface.


title: Template files missing after moving site

text: I just moved a site (by exporting & importing all posts & pages, and copying theme files over), and on the new site the various page and post templates are unavailable for selection on post and page edit screens. The files did have Windows line endings, which I fixed, but that did not eliminate the problem. Any other things to try?


title: How do I fix the url when clicking on portfolio item?

text: Right now I'm working on the portfolio section of this website, and I noticed that whenever I click on a work, it adds a # followed by the whole URL of what I want. For example, it goes from               http://ligature23.ufdesigners.com/work/      to               http://ligature23.ufdesigners.com/work/#http://ligature23.ufdesigners.com/work/soft-money/      The only plug-ins I have activated are the ones that came with the theme, and I have my permalinks set to Post Name. Any guesses as to what it could be that's causing this?


title: Geting error in post and category

text: Hallo, I have in my blog now add a Plugin [Custom Post Type UI] and have great a Post type movies and taxonomies like genre,actors,directer..... like this all ok now i have great a test post min add Movie and add info now come my big problem it show noting in post just a error > Catchable fatal error: Object of class WP_Error could not be converted to > string in /home/user* **/public_html/ _*_ ** _*_** / _*_ */wp- > content/themes/telegraph/functions/wpzoom-functions.php on line 783 Lines 780-786               } elseif ( is_single() ) {       $cat = get_the_category();        $cat = $cat[0];       echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');       echo $currentBefore;     //      the_title();       echo $currentAfter;      can some on help me by this problem. PS: do i have to add any code to my theme wen i great a Post type or Taxonomies in [Custom Post Type UI]


title: passing markup thought a shortcode attribute

text:
Happy holidays everyone. Hope someone can help me in thinking about a problem I've run into. I have a plugin Im building that allows the user to pull address data from the maps API - ie it validates an address and if it is a business, pulls the marker icon, address details, web link etc. and builds a shortcode to render the map on the front end. At the moment the shortcode is being built and result previewed via a tinyMCE modal window. Creating the map marker content (marker info bubble) is what is causing me greif. I wanted the user to be able to add or manipulate the content of this block, but the net result is a fair amount of markup. So far I've tried to pass the generated markup though one of the shortcode attributes like so:               [my_gmaps id="map" z="11" w="100%" h="300" scrollwheel="false" maptype="ROADMAP" address="Southampton, United Kingdom" marker="true" markerimage="http://anachronistic.local:9102/wp-content/plugins/_TomRush/inc/js/TinyMCE_additions/modal/../img/icons/music_folk_map.png" infowindow="
Southampton
Southampton, UK
Some User Note
external map" ]      What I've found (probably no surprise to you all) is that the visual editor wreaks havoc on the shortcode, especially the infowindow atribute, adding line breaks and stripping the `<br>` tags for starters. I want the user to be able manipulate the marker content but this isn't a tenable solution. How can I pass this information without the editor mangling it? Is this where I need to learn the transients API or should I consider another approach? Many thanks in advance for your experience.


title: Ways of dealing with nested arrays within option

text: I stumbled upon one problem regarding too complicated(at least in my point of view) data structures stored in option field. Right now I have an array of collections and within each other there is another sub-collection (as depicted below). In my opinion it looks too complicated, especially when one wants to store some value inside. More or less it would look like:               $collection = get_option('collection_setting');     $collection[1][elements][0][name] = "ChangedExample";      And this can get much worse when we would like to introduce another array inside of collection. Plus I think it can get quite sloppy if one uses like 100 entries per array. My question is how could this be improved? Storing it into two different option fields - one for collection, second for sub-collections and then somehow trying to connect this within code? Or maybe this is perfectly OK? Of course I assume that creating another table in DB is not the most elegant way.               Array     (       [0] => Array           (             [name] => collection_name             [speed] => 200             [id] => collection_name_1             [max_elements_per_page] => 13             [elements] => Array                 (                     [0] => Array                         (                             [id] => 1                             [url] => http://www.example1.org                             [name] => Example1                         )                          [1] => Array                         (                             [id] => 2                             [url] => http://www.example2.org                             [name] => Example2                         )                          [2] => Array                         (                             [id] => 3                             [url] => http://www.example3.org                             [name] => Example4                         )                      )              )          [1] => Array         (             [name] => collection_name_2             [speed] => 200             [id] => collection_name_2             [max_elements_per_page] => 13             [elements] => Array                 (                     [0] => Array                         (                             [id] => 1                             [url] => http://www.example1.org                             [name] => Example1                         )                          [1] => Array                         (                             [id] => 2                             [url] => http://www.example2.org                             [name] => Example2                         )                          [2] => Array                         (                             [id] => 3                             [url] => http://www.example3.org                             [name] => Example4                         )                      )              )          )      For example when I have setting page on which I want to edit only the first element of collection then with the moment I'm saving it, Wordpress overwrites whole option with only values submitted with form, erasing second element from collection (here $collection[1] is erased). What is the way out? I'm thinking of using validate_options function( which is receiving data from setting page). I could retrieve collection_setting, modify it accordingly and returning modified collection_setting.               register_setting('collection-settings-group', 'collection_setting', 'validate_options');      But I think it's too much work and I'm sure there is some better solution for this.


title: A-Z Index Taxonomy

text:
Hi to all I just got working the code below to display an alphabetical pagination on index.               //Register the AZ Index shortcode [azindex]     $azindex = '';          add_shortcode('azindex','azindex_get_filter');     function azindex_get_filter($attr){              echo '
';         azindex_get_alphabetical_index();          echo '
';     }          /********************************************************************/     /* ACTIONS                                                          */     /********************************************************************/     add_action('init', 'set_index_var');     function set_index_var()     {         global $azindex;         $tmp = get_query_var('azindex');              if($tmp != "")             $azindex = $tmp;     }          //Add WHERE addition to query      add_filter( 'posts_where' , 'azindex_posts_where',10,2 );          function azindex_posts_where( $where, &$wp_query) {         global $wpdb;         global $azindex;         //global $azindextype;              //var_dump($wpdb);              if(isset($azindex)  )             $where .= " AND {$wpdb->posts}.post_title LIKE '{$azindex}%' ";              return $where;     }     /********************************************************************/     /* FILTERS                                                          */     /********************************************************************/     // Add the query var azindex so WP won't drop it     add_filter( 'query_vars', 'azindex_add_query_vars');          function azindex_add_query_vars($vars){         $vars[] = "azindex";         return $vars;     }     /********************************************************************/     /* MAIN CODE                                                        */     /********************************************************************/     function azindex_get_alphabetical_index(  )     {         $azindex = get_query_var('azindex');              if($azindex == '')             $azindex = -1;              $base_url = get_site_url();              for($i=0;$i<26;$i++)         {             $letter[$i] = chr($i + 65);                  $href = $base_url.'/index.php?azindex='.$letter[$i];             $base_add = '';                  if($azindex == "")  //Not selected -> link                 echo '
'.$letter[$i].'
';             else if($azindex == $letter[$i])                 echo '
'.$letter[$i].'
';             else                 echo '
'.$letter[$i].'
';         }              if($azindex == -1)             echo '
All
';         else             echo '
All
';     }      Than added in my index template:
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">ALL
     <?php echo '
';         azindex_get_alphabetical_index();          echo '
'; ?>      For now its working good but I need to add the numeric pagination too something as 0-9 or a button # wich will display all posts with numeric titles. Anyone wich has more experience please a small help will finish this small job. I tried this function here but didnt work.


title: Show list of custom posts with respective attachments?

text:
I would like to construct a query to show a list of custom posts ("podcasts") with the urls to their respective attachments. Each custom post_type ("podcast") has 1 attachment (the mp3 file belonging to it's post_parent). I would like an unordered list showing podcast's title, and it's attachment url (guid of the attachment) like this:

Podcast Title - http://..../podcast.mp3
      I achieved this with wp queries:               <?php query_posts('showposts=1&post_type=podcasts'); ?>
     <?php while (have_posts()): the_post(); ?>
<?php the_title(); ?>
     <?php     $args = array( 'post_type' => 'attachment', 'post_parent' => $post->ID );     $attachments = get_posts($args);     if ($attachments) {       foreach ( $attachments as $attachment ) {       echo $attachment->guid;       }     } ?>
     <?php endwhile; ?>
      But I would like to know how I solve with raw SQL query. I've tried so many queries it's made me dizzy - any help would be amazing! _*_ EDIT: Decided to go with John's suggestion of WordPress' queries. Thank you and I trust someone else will also find this useful in future.


title: Add delete/edit button to each row in an SQL table (Wordpress Backend)

text:
I have a form that is submitting entries to a table in the backend of my Wordpress installation. I would like to add edit/delete buttons to each row so that an administrator can delete submissions or edit them directly through the backend tool. So far I have the submissions submitting and displaying correctly in the backend but I am not sure how to achieve the edit/delete functionality. Here is what I have so far:               add_action( 'admin_menu', 'form_menu' );          function form_menu() {       add_menu_page( 'Form Submits', 'Form Submits', 'manage_options', 'form-submissions', 'form_options', 'dashicons-list-view', '24' );     }          function form_options() {       if ( !current_user_can( 'manage_options' ) )  {         wp_die( __( 'You do not have sufficient permissions to access this page.' ) );       }            global $wpdb;             $submission = $wpdb->get_results( "SELECT * FROM form_submissions");            echo "
";       echo "
               First Name	               Last Name	                E-mail	               Address
";       foreach($submission as $row) {         echo "
";         echo "".$row->first_name."	";         echo "".$row->last_name."	";         echo "email.">".$row->email."	";         echo "".$row->address."	";         echo "
";       }       echo "
";     }      Can someone point me in the right direction? Thanks!


title: Hard Code Pages into a Theme for a Network (multisite) Installation

text: I'm creating a multisite network and I am looking for a way to have it so new blogs that are created have a couple of standard pages set up automatically. The purpose of these pages will be to display universal membership options and other info that I want each site to display. So, for example, I want each new site to have a "Join" page and an "About this Network" page, and I don't want to have to manually set up the pages and their custom templates. I'm using Twentyeleven as my child theme base and customizing a specific theme to be used by each of the newly created sub blogs users. I guess a part of this question is: is it possible to hardcode pages into a Wordpress theme? Thanks very much. JW


title: Insert content into <title> head tag with function

text: Is there a hook available that lets you append or prepend text to the `<title>` tag in the head? I've seen lots of posts about customizing the `<title>` tag, but they all involve manually adding a function inside the `<title>` tag. I'm looking to modify it with a hook if possible so it can be easily turned on/off in a functions.php file.


title: xmlrpc how to check for errors

text: I am trying to post to wordpress with XMLRPC using this tutorial:http://wp.tutsplus.com/tutorials/creative-coding/xml-rpc-in- wordpress/ the problem is that tutorial does not have any kind of check for errors while post and I am wondering how to check if the post was posted without any problem based on that tutorial. Maybe someone could help. Thank you.


title: Restrict query to last day with posts

text: I am using the Delicacy theme. I want to show n my homepage the posts of the current day.   But if there are no post for that day it shows _"No found"_. I want to show posts from the last day with posts instead. How can I do that? I am using this query:               $current_year = date('Y');     $current_month = date('m');     $current_day=date('d');          query_posts(          "cat=5&year=$current_year&monthnum=$current_month&day=$current_day&order=ASC"      );


title: Upload video in custom folder

text: I am trying to find a system to upload some kind of media in a custom folder. I want to keep all uploads in default wordpress folder and create a custom folder just for videos. So i would have the following folder structure:               - wp-content       - uploads         - year         - month       - videos         - category-one         - category two      In addition i would like that the files stored in this new folder should be listed in media library.


title: The work of Wordpress Function update_post

text: I use wp_update_post() in a Frontend Page. The first part of the function works as expected. post_content and/or post_title will be changed in wp_posts. But the function does not create a revision copy from the old table item as described in the WP Function Reference. Here is my code               $upd_post = array();     $upd_post['ID'] = $post->ID;     $upd_post['post_title'] = $wp_query->query_vars['4tn_title'];     $upd_post['post_content'] = $wp_query->query_vars['4tn_content'];     $update_result = wp_update_post( $upd_post );      Perhaps it doesn't work because the post_type is a cutom-type 'portfolio' instead 'post'. If this is the reason what is to do for getting a 'revisioncopy' for portfolio-items


title: Create a live demo gallery for themes

text: I want to create a live demo site like http://www.elegantthemes.com/gallery/ that show themes so when I click on the theme screenshot it takes me to the live theme preview. I tried two plugins themebrowser and wordpress-theme-showcase they are showing the themes in a list and I can click the theme to view, but when I'm trying to go to any page inside the preview theme it takes me to the original theme that already installed, so also I want to be able to browse the demo theme pages and posts like if it is activated. Thanks Edit: From the source code of wordpress-theme-showcase plugin the Theme Preview URI: php?preview_theme=WordPress%20Default and that's ok for he home page of the new theme, but if I want to go to some page it redirects me to the home page of the installed theme. So I tried to add &p=1 (post url) to the end of the Theme Preview URI above and it works. The question now is how I can append this url to all the links in the preview page


title: javaScript in <head> section of WP API

text: How do I place the following javaScript in the `<head>` section of the Wordpress _Widgets_ API menu screen?               <script type="text/javascript">         jQuery(window).load(function() {             jQuery("#logocheckbox").change(function() {                 jQuery("#logocheckboxdiv").fadeToggle("slow");             });         });     </script>