title: Adding Pagination on a Custom Author Page

text:
i have created a custom author's page that list the title of their posts. but the problem is i can't get the pagination to work if it's beyond the set post per page value. i have used get_posts() to it's custom loop.               <?php                          $ppp = 5; //set my custom number of post to appear                         $uid = $curauth->ID;                         $args = array(                                         'numberposts' => $ppp,                                         'author' => $uid                                          );                         $authorposts = get_posts($args);                         //print_r($authorposts);                         if ( count( $authorposts ) > 0 ) {                                                 foreach ( $authorposts as $post ):  setup_postdata($post)            ?>
                                               <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>" class="authorpostlink"><?php the_title(); ?>                                     <?php the_excerpt(); ?>
                         <?php endforeach;  ?>

<?php previous_posts_link('‹ Previous Page') ?>

<?php next_posts_link('Next Page ›') ?>

                         <?php                         } else {                             echo '
No articles by this user
';                         }                                ?>      This should display 5 post with it's title and it's excerpt by the author,....but the rest of the author's posts isn't paginated what it paginates is the whole number of post on the blog.


title: Rewrite rule for a page to support pagination

text: I have a created a page and I want to use pagination in this page. I have added below rewrite rule but still I am getting 404 error, please help me to fix this issue,               function my_generate_rewrite_rules(){         $new_rules = array(                "tags/page/?([0-9]{1,})/?$" =>           "index.php?pagename=tags&paged=".$wp_rewrite->preg_index(1)         );              return $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;     }


title: What causes a theme to be inefficient?

text: Someone has asked me to analyze if his theme is 'good'. I've decided to analyze it in terms of   1. number of assets that the theme needs   2. compressing those assets   3. ensuring wp_enqueue_x is being used    4. ensure that loops are properly coded Am I missing anything important and obvious? I'd love to know what else you may think of, thanks!


title: get_posts from post x(offset=>x) to end

text: How can i get the posts using get_posts from let's say post 10 and beyond?So if i have 200 posts i will get from post 10 to post 200(190 posts)? Because as i see if i use               <?php $args = array(         'numberposts'     => -1,         'offset'          => 10         ); ?>      i just get all the posts Cheers


title: Failed to open stream: HTTP request failed! in \wamp\www\wordpress\wp-includes\class-http.php on line 929

text: I'm writing a theme and almost everytime I reload a page, Wordpress is giving the following error `Warning: fopen(http://localhost/wordpress/wp- cron.php?doing_wp_cron=1373799734.2041289806365966796875): failed to open stream: HTTP request failed! in D:\wamp\www\wordpress\wp-includes\class- http.php on line 92` As can be seen I have enabled `WP_DEBUG`. Here is a screenshot of the warning window: http://oi44.tinypic.com/2qnrrd5.jpg I'd provide further information but I have to know what exactly as I have no idea where the problem may lay :\


title: How to call function that create table in database (plugin functionality)

text:
I am trying to create a small plugin but it not creating table in database when i activate the plugin. please have a look the code given below there is function `function jal_install ()` it not called.                     <?php             /*             Plugin Name: My-Ads             Plugin URI: http://wordpress.org/#             Description: This is the most basic wordpress plugin, gets input from the user and displays it on every page.             Author: shalu                      */                 /*when plugin is activated*/                 register_activation_hook(_FILE_,'my_first_install');                /*when plugin is deactivated*/           register_deactivation_hook( __FILE__, 'my_first_remove' );                function my_first_install()            {              add_option("my_first_data", 'Testing !! My Plugin is Working Fine.', 'This is my first plugin panel data.', 'yes');                 }            function my_first_remove()                {             /* Deletes the database field */             delete_option('my_first_data');                     }                     /*Code-Add Admin Panel Menu Item*/                if(is_admin())             {                    add_action('admin_menu','my_first_admin_menu');                     function my_first_admin_menu()                 {                  add_options_page('My First', 'Ads', 'administrator','my-first',        'my_first_plugin_page');                  }                 }                             function my_first_plugin_page() {            ?>

Add your ads from here
               <form method="post" action="options.php" enctype="multipart/form-data">                  <?php wp_nonce_field('update-options'); ?>

             Name:	                               <input name="my_first_data" type="text" id="my_first_data" value="<?php echo get_option('my_first_data'); ?>" />

              Target Url:	                             <input name="Target_Url" type="text" id="Target_Url" value="<?php echo get_option('Target_Url'); ?>" />

              Ad image:	                            <input name="file" type="file" id="file"/>

           <input type="hidden" name="action" value="update" />           <input type="hidden" name="page_options" value="my_first_data" />
            <input type="submit" value="<?php _e('Save Changes') ?>" />
             </form>
                <?php                         }                    /* This calls my_first() function when wordpress initializes.*/             function my_first()            {                    echo get_option('my_first_data');                }                 function jal_install () {                global $wpdb;                   global $jal_db_version;                     $table_name = $wpdb->prefix . "liveshoutbox";                echo $table_name;                 if($wpdb->get_var("show tables like '$table_name'") != $table_name) {                     $sql = "CREATE TABLE " . $table_name . " (           id mediumint(9) NOT NULL AUTO_INCREMENT,       time bigint(11) DEFAULT '0' NOT NULL,       name tinytext NOT NULL,       text text NOT NULL,       url VARCHAR(55) NOT NULL,       UNIQUE KEY id (id)     );";            require_once(ABSPATH . 'wp-admin/includes/upgrade.php');       dbDelta($sql);            $rows_affected = $wpdb->insert( $table_name, array( 'time' => current_time('mysql'), 'name' => $welcome_name, 'text' => $welcome_text ) );            add_option("jal_db_version", $jal_db_version);                      }               }                  //calling the function             register_activation_hook(__FILE__,'jal_install');                   ?>       please help me where is the issue. I shall be very thankful you


title: javascript conflict

text:
I am having a JavaScript which is used for marquee, I want to use this in my wordpress site. But this java script is conflicting with my wordpress, I am using this in footer, but just the `div` area is getting loaded, the marquee in it is not working. Here is my code:

      How can I integrate this with my wordpress site?


title: How to resolve "Failed to send your message" problem for Contact Form 7?

text: I am using `contact form 7` but when i m trying to send msg through contact form it gives error given below `Failed to send your message. Please try later or contact administrator by other way.` please help me


title: Prevent Editors from Editing/Deleting Admin Accounts

text: I need editors to be able to add/edit/delete other users. Giving them those capabilities is easy with code similar to this:               $editor = get_role('editor');     $editor->add_cap('edit_users');      The problem is that when they have the privileges they need to add/edit/delete other users, they can also do all of those things to admin users and/or promote themselves to the admin role. Is there a way to allow them to add/edit/delete only specified user roles (best case scenario)? Or as an alternative, prevent editors from doing anything at all to admin accounts, and possibly even hide those accounts from their list view altogether?


title: Archive by months with pretty url?

text: I wanted to able to get the archive months working, I tried this               http://codex.wordpress.org/Function_Reference/wp_get_archives#Last_Twelve_Months      but it only gets the last 12 months, what I wanted is to get the 12 months listed from Jan - Dec whenever the year is. Then is seem its not working without the year in url for example               with year                      |  somesite.com/01/13     without a year monthts //01-12 |  somesite.com/01/       My Query to get all posts of month January for example, the problem is I don't able to get the value of $month base from url               $args = array(         'orderby' => 'date',              'order' => 'DESC'         'date_query' => array(             array(                 'month' => $month,             ),         ),     );     $query = new WP_Query( $args );


title: How to callback custom field text

text:
I have a plugin where the user can click a button to feature a post. I added a text field but i want the text field to call back whatever is posted in it Here is how it looks now http://ratedrnb.com/wp-content/uploads/2013/05/ffm2.jpg now the plugin grabs the thumbnail of the post but i also want it to grab whatever is in the "Artist/Song" field. Here is the code where the "Featured Music Options" is               <?php     /*     Plugin Name: Featured Music     Plugin URI: LittleLadyEnterprises.com     Description: This Plugin is used to show your featured Posts/Pages with thumbnails in a nice slider.     Version: 2.6     Author: Little Lady Enterprises     */            $m_slider_options_page = get_option('siteurl') . '/wp-admin/admin.php?page=rated-featured-music/options.php';           function m_slider_options_page() {          add_options_page('Featured Music Options', 'Featured Music', 10, 'rated-featured-music/options.php');           }           add_action('admin_menu', 'm_slider_options_page');           function m_slider_add_scripts() {              if ( !is_admin() ) {                      wp_register_script('jquery.cycle', get_bloginfo('url') . '/wp-content/plugins/rated-featured-music/scripts/jquery.cycle.all.2.72.js', array('jquery'), '1.3' );                 wp_enqueue_script('jquery.cycle');               }           }           add_action('wp_enqueue_scripts', 'm_slider_add_scripts');                function m_slider_cut_text($text, $chars, $points = "...") {          $content = $text;          $content = preg_replace('/\[.+\]/','', $content);     $content = apply_filters('the_content', $content);      $content = str_replace(']]>', ']]>', $content);     $content = strip_tags($content);          $length = strlen($content);          if($length <= $chars) {              return $content;           } else {              return mb_substr($content, 0, $chars)." ".$points;          }     }          add_action("admin_init", "m_slider_init");     add_action('save_post', 'm_slider_save');          function m_slider_init() {              add_meta_box("feat_music", "Featured Music Options", "m_slider_meta", "post", "normal", "high");         add_meta_box("feat_music", "Featured Music Options", "m_slider_meta", "page", "normal", "high");          }          function m_slider_meta() {              global $post;         $custom = get_post_custom($post->ID);         $feat_music = $custom["feat_music"][0];          ?>

                 Feature in Featured Music?    	                 <input type="checkbox" name="feat_music" value="1" <?php if($feat_music == 1) { echo "checked='checked'";} ?>	          Artist/Song	                     <input type="text" name="artist_title" value="Artist - Song">

          <?php          }           function m_slider_save() {              if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )          return $post_id;         global $post;              if($post->post_type == "post" || $post->post_type == "page") {                      update_post_meta($post->ID, "feat_music", $_POST["feat_music"]);              }          }          function m_slider_insert($atts, $content = null) {              include (ABSPATH . '/wp-content/plugins/rated-featured-music/content-slider.php');          }          add_shortcode("featslider", "m_slider_insert");          $m_slider_img_width = get_option('img_width');          if(empty($m_slider_img_width)) {              $m_slider_img_width = 320;          }          $m_slider_img_height = get_option('img_height');          if(empty($m_slider_img_height)) {              $m_slider_img_height = 200;          }          if (function_exists('add_image_size')) {          add_image_size( 'feat_music', $m_slider_img_width, $m_slider_img_height, true );          }          function m_slider_get_thumb($position) {          $thumb = get_the_post_thumbnail($post_id, $position);     $thumb = explode("\"", $thumb);     return $thumb[5];          }          //Check for Post Thumbnail Support          add_theme_support( 'post-thumbnails' );          function m_slider_get_dynamic_class() {              $class = explode("http://", get_bloginfo("url"));     $class = explode(".", $class[1]);         $class = $class[0];         return $class . "_slider";          }          ?>      **What is the callback code that I need to add to the Value Area?** **The code below is the styling of the plugin and callback codes, what is the callback code to call back whatever is placed in the textarea.**               <?php          $m_slider_direct_path =  get_bloginfo('wpurl')."/wp-content/plugins/rated-featured-music";          $m_slider_class = m_slider_get_dynamic_class();          ?>
     <?php              $m_slider_sort = get_option('sort'); if(empty($c_slider_sort))    {$c_slider_sort = "post_date";}         $m_slider_order = get_option('order'); if(empty($c_slider_order)){$c_slider_order = "DESC";}         $m_slider_post_limit = get_option('limit_posts');     if(empty($m_slider_limit_posts)){$m_slider_limit_posts = "-1";}              global $wpdb;              global $post;              $args = array( 'meta_key' => 'feat_music', 'meta_value'=> '1', 'suppress_filters' => 0, 'post_type' => array('post', 'page'), 'orderby' => $m_slider_sort, 'order' => $m_slider_order, 'numberposts'=> $m_slider_post_limit);              $myposts = get_posts( $args );              foreach( $myposts as $post ) :  setup_postdata($post);                  $m_slider_custom = get_post_custom($post->ID);                  $m_slider_thumb = m_slider_get_thumb("featmusic");              ?>
<a href="<?php the_permalink();?>"><?php the_post_thumbnail('featmusic'); ?>

<a href="<?php the_permalink();?>">TEXT AREA TEXT HERE

<a href="<?php the_permalink();?>">

     <?php endforeach; ?>


title: How to show author's avatar in the post meta data with plugin `user-avatar`

text: I'm using `user-avatar`, and I want to show user icon in the post meta data. http://wordpress.org/plugins/wp-user-avatar/ I'm writing like this. ` <?php the_author_posts_link(); ?> <?php echo get_avatar(); ?> ` It shows only default "nobody" avatar. If I write like `<?php echo get_avatar("myemail@example.com"); ?>`, then it shows my avatar through `user-avatar` plugin. So if I can get the author's emails, it works all fine. I tried to get the email by `<?php the_author_meta('user_email'); ?>`. But it doesn't return the email, but it outputs directly. I'm stuck now. How can I set user avatar in post meta area?


title: Wordspress add <p> into my javascripts

text:
I use a slider called _revoslider_ and use it via shortcode. When i use the shortcode **and do not use visual editor for insert** and save, the slider does not work because WordPress adds `<p>` into javascript like this :

      Because of this, the code does not work and I don´t understand why WordPress adds these `<p>` for each line - it´s ridicoulus. I tried `add_filter` for content but it also does not work.


title: How do I get around "Sorry, this file type is not permitted for security reasons"?

text: I was wondering how I could allow .tiff files to be uploaded in my wordpress site. I get the message "Sorry this file type is not permitted for security reasons". This question has been asked in other places, but the solutions suggested aren't working for me. I have tried using the following snippet in my theme's functions.php file, I saw a lot of suggestions to use this or something similar to extend the allowed file types:               function my_wonderful_mime_types($mime_types){         $mime_types['tiff'] = 'image/tiff'; // Adding an extension, I tried 'tif' too         return $mime_types;     }     add_filter('upload_mimes', 'my_wonderful_mime_types', 1, 1);      but it doesn't do anything. I have tried adding this in the functions.php file too:               define('ALLOW_UNFILTERED_UPLOADS', true);      That actually works, (the image will not display, but I'm not worried about that part). However, this seems sub optimal because I only want to extend the allowed mime types to include .tiff files, not just any type of file. I've found a couple other solutions that rely on old/unmaintained plugins. I can't be using a plugin that isn't maintained! Does anyone know how to get around this security feature?


title: Tips for finding SPAM links injected into the_content

text:
I'm working on a client's site and I noticed that posts have a hidden `<div>` filled to SPAM links to dick pills, etc. Hoping to get lucky, I searched for some of the keywords in the database tables, but found no matches. I also searched the code in all the files, and also found no matches. I know that Wordpress hacks can be very tricky to remove, and they go to great lengths to make them hard to find. But perhaps there are some "usual suspects" that I could check, or maybe some tell-tale signs I could look for. **I'm not asking for anyone to solve this specific hack.** I'm just looking for advice on where (in general) to look. In case it's useful, here's the unauthorized `<div>` which is injected right before the close of the first `<\p>`:
 At that requires looking for how you http://www.cialis.com want $745? visit our site. sign any of money. Visit our secure bad creditors that cialis levitra sales viagra viagra australia online payday lenders know otherwise. But the black you stay on discount price levitra what is impotence in men duty to their lives. Citizen at one online or after receiving their research viagra online www.viagra.com to just take just wait until monday. This specifically relates to shop every pay stubs get viagra without prescription cialis overnight delivery and only used or faxing required. We will turn double checked by some small business loans viagra for woman cialis india sites that works the business before approval. Living paycheck went out cash there would generate levitra viagra cialis levitra the scheduled maturity day method. Own a short application on when money also buy cialis online kamagra plenty of personal initial limits. Even those loans quick because lenders realize http://cialis-ca-online.com levitrafroaustraila you notice a payday advance. A loan applications are more common thanks http://www.cialis2au.com/ cialis to only apply online website. Third borrowers will use your paycheck to levitra online pharmacy viagra online purchase utilize these individuals can cover. Often there must also referred to ensure online pharmacy viagra usa viagra effectiveness you with financial expenses. Thanks to checking account also merchant cash loan wwwwviagracom.com levitra viagra cialis comparison to state or from there. At that they pay them in mere viagra cheapest generic viagra seconds and to comprehend. If a repossession or limited to see if approved www.cashadvances.com  | Apply for a cash advance online! cialis dosage the risks associated at your current address. Second borrowers should not start and struggle http://www.cashadvance.com levitra for sale at least a button. Thanks to send the benefits of everyday living cheapest viagra order online tadalafil from being foreclosed on its benefits. Finally you get help rebuild the original loan buy cialis viagra viagra without prescription can really only to surprises. Bank loans out you will take http://wviagracom.com/ erectile dysfunction supplements the conditions are a. Bills might provide an unexpected car cialis uk suppliers kamagra broke a repayment length. Third borrowers repay because payday industry has the results http://www.buy9levitra.com/ viagra recreational use by the middle man and check process. After verifying your question with dignity and credit cards www.levitra.com overnight viagra delivery or drive to secure loan online. Most people for dollars you between bad and free cialis http://viagra7au.com/ instead these applicants is available. Social security against your payday the larger sums buying viagra online direct lenders installment loans no credit check of gossip when working telephone calls. Face it provides hour payday industry levitra online buy viagra now has high credit score? Within minutes during your best score range from http://cashadvance8online.com viagra dosage instructions fees if there for them most. To avoid paperwork you in crisis arise from wwwpaydayloancom.com | Online Payday Loans application form! super active viagra online from paying the bank? Funds will know to throwing your cash advance no credit check viagara online finances there that purse. Companies realize that asks for which can become cialis online sublingual viagra eligible to paycheck some lenders. Medical bills that be much easier than actually need only online cash advance online cash advance your funds via the freedom you out.


title: 404 for some custom taxonomy not ALL taxonomy

text: i created taxonomy and post type & Metabox using Easy Content Types some custom taxonomy work correctly, but i don't know why one of my custom taxonomy , each time i try to access it , i got 404 page not found but i can access single post page. my problem only with taxonomy term. my post type name is services and my taxonomy name is services also i have another taxonomy called location location working correctly, but services no. i tried to remove .htacess to rebuild it and i tried to update my permalink but nothing has been changed


title: Give subscribers the option to post anonymously

text: I'm looking for a way to allow subscribers to post or comment anonymously. Basically it would be a checkbox at the end of the comment form, exactly like beyond the shock. Any ideas?


title: Show Sub pages excerpt+thumbnail

text: I'm trying to show the excerpt+thumbnail of all subpages in a specific parent; I tried a bunch of plugin but no one actually works as I need; andy advice?


title: Pending Post review notification for contributors

text: I've been looking around at this for solutions but strangely I can't seem to find one that appears decent - maybe I haven't looked hard enough. What I want is a notification on my dashboard when posts are pending review. I can't believe this doesn't seem to be core behaviour for WP. I so far can't seem to find any recent plugins for this, maybe it's a setting I haven't noticed on WP. Any help gratefully appreciated. Jonathon


title: Trying to get logged-in user data inside php class

text: I am trying to get the current logged-in user data and use this in the parent class(I need it in several functions). In the example below I can get the userID in the first function but it will give no output inside the next function. This is my first wordpress plugin and the first time that I work with OOP, so who can help me out with this thing.               <?php          class WP_PM{              public $currentId;              public function __construct(){                  $this->addActions();             $this->showId();         }              private function addActions(){             add_action('wp_loaded', array(&$this, 'getId'));         }              public function getId(){             global $current_user;                  $this->currentId = $current_user->ID;                  //$this->currentId = 'hello';//we have an output                  echo $this->currentId;//we have an output                  return $this->currentId;         }              public function showId(){             echo $this->currentId;//no output                 echo $this->getId();//no output         }          }          register_activation_hook(__FILE__, array('WP_PM', 'activate'));     register_deactivation_hook(__FILE__, array('WP_PM', 'deactivate'));          $wp_pm = new WP_PM();     ?>      // new example based on G.M solution(still not working -> triggers wp error and no logged in text)               class WP_PM_Extend extends WP_User {              function getID() {             return $this->ID;         }          }          class WP_PM{              protected $user;              public function __construct(WP_PM_Extend $user = NULL){                  if (!is_null( $user ) && $user->exists()){                 $this->user = $user;             }                  $this->getUser();              }              public function getUser() {             return $this->user;         }          }               function getWPPM() {              if(!did_action('wp_loaded')){          $msg = 'Please call getCurrentUser after wp_loaded is fired.';         return new WP_Error('to_early_for_user', $msg);         }              static $wp_powertour_core = NULL;              if(is_null( $wp_powertour_core)){             $wp_pM = new WP_PM( new WP_PM_Extend( get_current_user_id() ) );         }              return $wp_powertour_core;     }          function getCurrentUser(){            $wppm = getWPPM();              if(is_wp_error($wppm)){             return $wppm;          }              $user = $wppm->getUser();              if($user instanceof WP_PM_Extend){              return $user;         }     }          add_action( 'wp_loaded', 'getCurrentUser');          $current_user = getCurrentUser();     if($current_user instanceof WP_PM_Extend){         echo 'Current user ID: ' . $current_user->getID();     }else{         echo 'No one logged in';     }


title: Unhook the comment form in Buddypress

text:
Im trying unhook the comment form found in the functions.php of the deafault buddypress theme so I can change it a bit. I placed this piece of code into my child theme functions.php but it didn't change anything. What did I do wrong?               remove_filter( 'comment_form_defaults', 'bp_dtheme_comment_form', 10 );     if ( !function_exists( 'my_dtheme_comment_form' ) ) :     function my_dtheme_comment_form( $default_labels ) {     global $user_identity;          $commenter = wp_get_current_commenter();     $req = get_option( 'require_name_email' );     $aria_req = ( $req ? " aria-required='true'" : '' );     $fields =  array(         'author' => '
' . '' . __( 'Name', 'buddypress' ) . ( $req ? ' *' : '' ) . ' ' .                     '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />
',         'email'  => '
' . __( 'Email', 'buddypress' ) . ( $req ? ' *' : '' ) . ' ' .                     '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />
',         'url'    => '
' . __( 'Website', 'buddypress' ) . '' .                     '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />
',     );          $new_labels = array(         'comment_field'  => '
<textarea name="comment" id="comment" cols="60" rows="10" aria-required="true"></textarea>
',         'fields'         => apply_filters( 'comment_form_default_fields', $fields ),         'logged_in_as'   => '',         'must_log_in'    => '
' . sprintf( __( 'You must be logged in to post a comment.', 'buddypress' ), wp_login_url( get_permalink() ) ) . '
',         'title_reply'    => __( '', 'buddypress' )     );          return apply_filters( 'my_dtheme_comment_form', array_merge( $default_labels, $new_labels ) );     }     add_filter( 'comment_form_defaults', 'my_dtheme_comment_form', 10 );     endif;      To test that nothing changed I removed the label text for 'title_reply'


title: Send email to Admin when user/member updates specific user/member data

text: I have previously asked about How to automatically send email to Admin when a user/member changes his/hers profile data. And got some very good answers. Send automatic mail to Admin when user/member changes/adds profile. Now a follow up: I only want to send/email the data (profiledata) that was updated/added.


title: Make thumbnail from uploaded image without plugin

text: When I add image in post, I need to make some thumbnails with several sizes. Maybe someone could tell action or filter to implement this?


title: Invoking Jquery in a Plugin

text: I am using the following code in my plugin :               <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>          <?php echo "<script src=".$plugins_url."/mistral/js/jquery.pajinate.js>  </script>";  ?>     <script>     $(document).ready(function(){     $('#paging_container1').pajinate();     });     </script>      Now it is breaking my other jquery plugins due to the re instantiating of the Jquery from the CDN . Any solution to use the default jquery with WordPress would be great.


title: Wordpress theme & site not loading after moving files

text: I was recently created a custom application for wordpress. So while doing so in my file manager (I use the one provided by godaddy(my webhost)), I moved all the files from the [DOCUMENT_ROOT] ... the webroot /public_html/ page to a seperate folder (that was 3 days ago)... 3 days later. When I moved them back, my wordpress site broke or something, and all my content (blog posts and site template) are gone, it doesn't even load my wp-login properly. This is my website: www.security-shell.com Before the change it looked perfectly fine, and everything was spectacular, but now it doesn't load at all, and looks like that. Can anyone tell me why? Thanks again, anyways, much appreciated Sincerly, D4RK_Phox


title: Menu Disappears on Category Pages

text: I have a site whose navigation disappears on category pages for posts in the ‘post’ post type, but not for posts in any of my custom post types. The ‘post’ post type and post of the custom post types use the same template file for theirs archives and headers – no differences. The menu is using the wp_nav_menu function. Example links below (again, same template files being used): **Menu:** http://politichicks.tv/column/ **No Menu:** http://politichicks.tv/category/videos


title: Select Custom Posts

text: I am developing a wordpress website. It has only posts.... I have define links according to categories and tags.... what I want to do...?   1. Login option in home page... with signup....    2. User signup and enter into admin panel..    3. In admin panel he is able to see only posts and pages... nothing else...    4. **the most important thing >** **In pages he should able to see only those pages which he has published...** **not all users pages...**   5. He add new page... in new page **he add selected posts.**.. and publish...  ---- Now In home page I have define many buttons.. 6. here I want to add one more button of **logged on user.**.. When user click on that... it recognize **which user is logged on**... and **shows pages which are published by current user....** plz help......


title: Only show metabox when date-value in other metabox is over?

text: probably a weird question. I'm using the custom MetaBox and CustomFields Class by jaredatch on Github. I have this "event-date" metabox:               $meta_boxes[] = array(             'id'         => 'event_date',             'title'      => 'Event Date',             'pages'      => array( 'wr_event', ),             'context'    => 'normal',             'priority'   => 'high',             'fields'     => array(                 array(                     'name' => 'Test Date Picker (UNIX timestamp)',                     'desc' => 'field description (optional)',                     'id'   => $prefix . 'event_date',                     'type' => 'text_date_timestamp',                 )             ),         );      I have a second metabox called "event-review"               $meta_boxes[] = array(         'id'         => 'wr_event_review',         'title'      => 'Event Review',         'pages'      => array( 'wr_event', ), // Post type         'context'    => 'normal',         'priority'   => 'high',         'show_names' => true, // Show field names on the left         'fields'     => array(             array(                 'name'    => 'Event Review',                 'id'      => $prefix . 'event_wysiwyg',                 'type'    => 'wysiwyg',                 'options' => array( 'textarea_rows' => 5, ),             )         ),     );      I wonder if it's possible to show the event-review metabox only when the date is over? Something like…               if ( date('U') > date('U', $_POST["_wr_event_date"] ) ) {          $meta_boxes[] = array(             'id'         => 'wr_event_review',             'title'      => 'Event Review',      However I have no idea if this is even possible or even how I can get the current `event_date` that is in the input. Any thoughts on this?


title: Deleting users from front-end with wp_delete_user()

text: I would like admins to be able to delete users from the frontend with the click of a button. How could I use the wp_delete_users() function to create such a button on the frontend if the user ID is provided?


title: How do I highlight the menu for a child page?

text: EDIT: This used to be > How do I force a page to be `is_archive == true`? I was trying to solve the wrong problem. Instead of forcing the post/page to have a particular attribute, I should have looked at the classes applied to the menu item. The 'Blog' menu-item has the `current-page-ancestor` class applied to it. I can style the menu based on this. ORIGINAL QUESTION: I have my own theme where I created an `archives.php` template in order to have a page that tries to list the different ways to view archives and to give a place for users to browse the archives if they want to. I created a page using the WP admin page and I made it's parent the 'Blog' page. The 'Blog' page is the page where all my posts get emitted. I have a menu at the top and right now, every sub-page under the 'Blog' page causes the menu to highlight 'Blog' (this is the correct behavior). Specifically, the menu item has the style `current_page_*` applied to it. This doesn't happen when you load `blog/archives` (the template/page I created in the first paragraph). So when I click on the date of a blog post, it brings me to an archived post page it looks like this (note that the Blog menu item is highlighted): ![Archived Date Posts](http://i.stack.imgur.com/II4St.jpg) When I go to my archives, it looks like this (note that the menu item is NOT highlighted): ![Archives Page](http://i.stack.imgur.com/mA9hx.jpg) I looked at `$wp_query` to see what the difference was. I saw that `is_archive` or `is_home` was true in the cases where the menu-item was correctly styled. How do I force my page to be `is_archive == true`? I tried to insert a `$wp_query->set('is_archive', 1);` before the call to `get_header();` in my template but that didn't work. I also looked in the WP admin dashboard to see if there was something I could click to force the page to be considered an archive. Edit: To be clear, I'm looking for a WP solution. I know that I can hard-code the CSS to get the menu item to appear the way I want it to be, but that doesn't seem to be the right thing to do.


title: Is this correct get_template_part() in WordPress?

text: I just want to show the slider structure if it has posts... is this correct?               <?php     if ( (have_posts() ) {       get_template_part('slider');     }     ?>      I think that works but I'm not sure if is the correct way to do that..


title: Displaying Current Page Number Conditionally

text:
I want to display the current page number in the site. I want it to be conditional though so that it doesn't show up on the home/front page. Using the code below, the page number is being displayed at all.               <?php          $pageNumber = (get_query_var('paged')) ? get_query_var('paged') : 1;         if(!is_front_page()) {             echo "
<?php echo '– $pageNumber –'; ?>
";         }     ?>


title: How to control manual excerpt length?

text: I have a website in which I need to control the displayed excerpt length. Some of the posts might have manual excerpt so I can't use the `excerpt_length` filter. I can, of course, use some kind of `substr()`, but was looking for a more elegant solution (if such exists).


title: How to check if an admin (sub)menu already exists?

text: The title says it all. I'm using WP 3.0.4


title: How do I add a custom sublevel menu specified in one directory to a custom top level menu specified in another directory?

text: I'm working on a plugin that constructs a top level menu and resides within its own directory in /wp-content/plugins. For example, the plugin looks like this:               function main_menu() {       if(function_exists('add_menu_page')) {        add_menu_page('Main Menu Title', 'Main Menu', 'administrator', 'main-menu-handle', 'menu-display');       }      }     add_action('admin_menu', 'main_menu');      I would like to build out additional menu items as plugins in the future so that they may reside in their own directory within /wp-content/plugins but will add themselves to this particular custom menu. Ideally, these new plugins would register themselves like this:               function register_submenu() {       if(function_exists('add_submenu_page')) {         add_submenu_page('main-menu-handle', 'Widget Title', 'Widget', 'administrator', 'widget-handle', 'widget_display');       }     }     add_action('admin_menu', 'register_submenu');      But I can't seem to make this work mainly because of the way WordPress uses the admin.php and the page query string parameter to navigate custom menus. Any insight?


title: Change tags url to search different site

text: ** UPDATED BELOW ** Original Question: Anyone know how to create a function that changes the url of the_tags so that when one is clicked on, the function searches another domain? ** UPDATE ** IT WORKS! Thanks a million. What a star. :-) ONE MORE Q: I have discovered that the search the link is being sent to is complicated. The search term below is "dish": `http://www.myweb.com/search?I_DSC=dish&I_DSC_AND=t&_ACT=search` So the `$replace_with = 'http://www.myweb.com/';` needs to be replaced with: `http://www.myweb.com/search?I_DSC=` then the $link followed by `&I_DSC_AND=t&_ACT=search` the line: `http://www.myweb.com/search?I_DSC=$link&I_DSC_AND=t&_ACT=search` won't work. Is there some alternative? Thanks again - it is really appreciated.


title: How to make the Newsletter plugin visible to users with author privileges?

text: I'm using the Newsletter plugin and would like to make it accessible to author users. Is it possible to do so? If there's no solution for this I'll edit the editor role to make it a new author role.


title: scrape data from a website and post it on the blog (wordpress)

text: This could be in DocType But I'm looking for a software or just a plugin for wordpress. I wanted to fetch those data from a website and automatically post it on my blog (Wordpress powered). It doesn't have rss or api to get those data, so I need to manually copy and paste it one-by-one and post it on wordpress. Do you know an alternative options on my process? or you know a software or a plugin that does the job? Thanks!


title: Admin Pointers on a custom post type

text: Is it possible to leverage the Admin Pointers code (core, non published API) to create pointers on a custom post type? I was trying to use a plugin called Easy Admin Pointers, but it does not support pointers on a custom post type and I can't find any examples on the web that will work with a custom post type. Any ideas or tips? Thanks!


title: posts_per_page is not working

text:
I have a query to display custom post type categories' posts, but I want to limit the `posts_per_page` to 8, so I am using the code below.   Please tell me, if I'm doing something wrong.               <?php      $args = array(         'post_type' => 'cs_album',         'posts_per_page' => 8,         'tax_query' => array(             array(                 'taxonomy' => 'cs_album_categories_tax',                 'field' => 'slug',                 'terms' => 'bollywood-songs'             )         )     );     $query = new WP_Query($args);     if( $query->have_posts() ) {         while ($query->have_posts()) :             $query->the_post();             ?>

<a href="<?php the_permalink();?>"><?php the_post_thumbnail(array(180,180)); ?>
<?php the_title();?>

             <?php         endwhile;     }     wp_reset_query();     ?>


title: Search Function on a plugin Wordpress User

text: I am using the plugin Wordpress User to display all the users in a single page. Now I am planning to create a search form which is not included in the plugin's function... But I'm having hard time to do it, that's why I am asking for a help now.   I pasted the code at pastebin because it's too long to paste here. The search form should work like "%like%" of SQL, meaning if I search "ad" it should display all the users that has "ad" on their username like "admin".


title: User fields that can be edited by administrator?

text: How can I add custom user fields for a user profile that an administrator can edit? I want the user to be able to see the value of the field on their profile, but I don't want them to edit it. How can I achieve this with WordPress?


title: get post attachments of a particular size

text: Is there a good way to know if a post has an image attachment of a particular size? I'm trying to fetch 5 random posts, but I only want results that have image attachments with a (custom) size of "extra_large". I'm trying:               $images = get_posts( array(       'post_type' => 'attachment',       'orderby' => 'rand',       'posts_per_page' => -1,     ) );     foreach ($images as $img) :       $image = wp_get_attachment_image_src( $img->ID, 'extra_large' );       if ( !empty($image) )         $carousel[] = array($img->post_parent, $image);     endforeach;      ...but I don't particularly like this as I have to grab every single image, and then loop through them to see if there's an extra_large version. I'm just using the first 5 items in $carousel[], but as my data set is very large there's a lot of un-needed processing. Also, I then have to do another call to get the parent from the ID. Is there a more elegant way to do this?


title: Dukapress jQuery("form.product_update").livequery is not a function

text: I have a wordpress site running Seduction theme and Dukapress. Once you add a product and reach the checkout page, the payment and discount button is not clickable. Chrome/Firebug throws the error jQuery("form.product_update").livequery is not a function The site is available at : http://sunshinemountainvineyard.com/wine-shoppe/ Can somebody help me out here... I have no clue what is happening. I updates livequery to the latest version 1.1.1 and still no effect


title: call my script only after loading UI library?

text: i want to add small effect (UI-jquery-draggable) to the navigation buttons in one of the WP slider plugins. what i did: 1 I have installed the slider plugin 2 know that UI is allredy registerd in wordpress but i have to call it (am i right?) so in my child theme functions.php,i added this:                  function my_enqueue() {        wp_enqueue_script( 'jquery-ui-draggable' );        }        add_action( 'wp_enqueue_scripts', 'my_enqueue' );             ?>      3 .the script itself is only one line so i included it directly in the my child theme page.php like this                      <?php if ( is_page(291) ) : ?>               <script>         jQuery( ".easingsliderlite-icon" ).draggable({ revert: true });              </script>            <?php endif; ?>      now what happens is that this line of script is loaded before the UI jquery library,when I look at the page in the browser (source code) the UI library is at the buttom of the page meaning its probebly loading after my script so the script doesnt work:( 4 i know you can create dependencies but only with wp-enqueue and only in function.php not for single line of script in page.php (am i correct?) ,


title: Recommendation for server config for Wordpress Staging servers

text: I've won a sweet managed VPS hosting package with Anchor (VPS D), and I'm looking for recommendations on how to set up the server. Anchor will setup apache or nginx for me - but which should I choose?! My considerations are:   * I'm concerned that there'll be a big configuration shift between my staging server and the clients' production servers: generally cheap shared hosting   * I'm hosting my own site here, so I want it fast (anything will be, compared to my old shared hosting!)   * my site, and my clients' are quiet low traffic sites   * I'll certainly be caching with WP-Supercache   * I use rewrites regularly for SEO purposes   * I'm familiar with .htaccess   * I won't have root access, but understand that I could edit non-root try files under nginx I'm leaning towards staying with apache, but want to be sure before passing up the opportunity to implement nginx, which seems superior for higher traffic setups. This question deals with hosting, but I'm interested in the experience of developers using WordPress in particular (and some business logic), so I believe it belongs here rather than on Serverfault. I appreciate any thoughts, Cheers, Tim


title: Custom Post Type Title by Slug

text: Is there a function which will get the title using the slug, For some reason I need to get the title of the custom post type using the slug Here is the PHP               if(isset($_GET["album"])){         $slug = $_GET["album"];         $slug = preg_replace("/[^a-zA-Z0-9-]/","", $slug);         $slug = esc_attr($slug);     }      I thought the function the_title would have worked but it won't because am using url variables to get the slug to another page. Here's what I tried               $page = get_page_by_path($slug);     $title = get_the_title($page->ID);


title: Add post tags to previously created custom post type

text: I am trying to add post tags to the custom post types bbpress creates, so that I can do some "related topics" kind of stuff. Is there a function that adds a post support like `'taxonomies' => array('post_tag')`, but to a post type that was previously created? My thought was I could just re create the custom post type on theme install or soemthing and hope it didnt mess anything up, but I really wanted to avoid doing that.


title: Best WP cache plugin for large site

text: I'm looking for WP cache plugin which is able to handle large number of pages. approx. 1 mil. I'm considering W3 total cache , WP super cache and few more , unfortunately I don't know which one is the best for large site. Can you suggest one ?


title: Translate a theme with a PO file

text: I'm new to WordPress. two weeks ago I downloaded a theme for my Arabic language blog, and the theme is scripted in English but it contains a folder called `languages/` and inside it has two files one is `languages/default.po` and the other is `languages/default.mo`. the developer told me that I can use these for translating the theme to my local language. But I have no idea how to use them. So is there another file I have to make? The `default.po` file have a similar structure like this:                 #: ../author.php:68 ../page-template-archives.php:31       msgid "Recently Added"       msgstr ""      By the way, I googled this but didn't find a specific technique.


title: How can I filter a query by post id?

text: In my wp_postmeta table, I have the following values: ![enter image description here](http://i.stack.imgur.com/Y3zlV.jpg) I'm trying query the posts whose ID lie in the `meta_value` column associated to a given post (the current post being viewed). For example, lets suppose I'm viewing post `94`. As illustrated above I would like to retrieve the posts `108,78,90` associated with `94` and display their titles. In this way the an area (post type) is associated with a post by its ID being one of the meta values for the post's 'area' meta key. I start with this:               $args = array(               'post_type' => 'area',               'posts_per_page' => -1,           );                $areas = new WP_Query($args);      But how I can specify I want the posts associated with the post `94`?


title: Use an id on a button to update_post_meta in post

text: I hope that someone can answer this conundrum for me.. As its doing my head in a bit LOL. I have a button with the code as follows:                   <button class="contact-owner-send" id="rsvp_button">RSVP</button>      This button sends an email from a form within the system to the post owner. What I have is a custom field called "number_attending", this is within the posts in the back end. When the user clicks the send button I want the number_attending field to be incremented up by one point. I currently am using the following code, but it just doesn't seem to do what I want.                   <script type="text/javascript">         $(document).ready(function(){         $('button#rsvp_button').click(function qwe4_tracker(){         global $post;             // get each post by ID             $postID = $post->ID;             // get the post's custom fields             $custom = get_post_custom($postID);             // find the view count field             $views = intval($custom['number_attending'][0]);             // increment the count             if($views > 0) {                 update_post_meta($postID, 'number_attending', ($views + 1));             } else {                 add_post_meta($postID, 'number_attending', 1, true);             }         });         });         </script>      I'm hoping someone can help me figure this one out :)


title: How to recover Wordpress on GoDaddy hosting after reseting database password?

text: I did reset my database password, so I could enter the phpMyAdmin, but now my Wordpress installation can't connect to the database. I tried to access the "wp-config.php" (should be at http://mysite.com/wp-config.php right?) but, again, I get the "can't connect to database" message. Also, now when I try to access the file manager on the GoDaddy hosting, I get "The page isn't redirecting properly". I did e-mail the GoDaddy support, and I'm researching while they do not answer. Not sure if it's a GoDaddy or Wordpress issue. Is there any way to fix Wordpress, or I'll need to re-install it?


title: Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?

text: _Question updated._ ## What I'm trying to do If I want to display posts (or a feed of posts) that belong to a category AND a custom taxonomy, or a category AND a tag, or a custom taxonomy AND a tag, I can do so using query variables as query strings in URL. But I want to prettify the URLs first, like so:   * `example.com/?category_name=main&channel=tech` **to** `example.com/main/channel/tech/`   * `example.com/?category_name=main&channel=tech&feed=rss2` **to** `example.com/main/channel/tech/feed/`   * `example.com/?category_name=main&tag=jsyk` **to** `example.com/main/tag/jsyk/`   * `example.com/?category_name=main&tag=jsyk&feed=rss2` **to** `example.com/main/tag/jsyk/feed/` Where `category_name` defines the category slug, `channel` the custom taxonomy "Channel" term's slug, and `tag` the tag slug. ## How I'm doing it First, I tried reading as many examples as possible, including:   * http://codex.wordpress.org/Class_Reference/WP_Rewrite   * Need help with add_rewrite_rule   * Need help with friendly URL's in Wordpress   * Custom rewrite rules for a $_GET request   * custom post type and custom taxonomy permalink   * Taxonomy based permalinks I place all theme independent functions for my site in a must-use plugin, which looks like this:               <?php     /*      * Plugin Name: Default Functions      * Description: Site-specific functions for example.com      */          /* Add functions below */                    /* THE END */      That's where I added my rewrite function which looks like this:               function wtnerd_edition_specific_categories( $wp_rewrite ) {         $rewrite_rules = array(             '([a-zA-Z0-9-_^/]+)/channel/([a-zA-Z0-9-_^/]+)' => 'index.php?category_name='.$wp_rewrite->preg_index(1).'&channel='.$wp_rewrite->preg_index(2),                  '([a-zA-Z0-9-_^/]+)/channel/([a-zA-Z0-9-_^/]+)/feed' => 'index.php?category_name='.$wp_rewrite->preg_index(1).'&channel='.$wp_rewrite->preg_index(2).'&feed=rss2',                  '([a-zA-Z0-9-_^/]+)/section/([a-zA-Z0-9-_^/]+)' => 'index.php?category_name='.$wp_rewrite->preg_index(1).'&tag='.$wp_rewrite->preg_index(2),                  '([a-zA-Z0-9-_^/]+)/section/([a-zA-Z0-9-_^/]+)/feed' => 'index.php?category_name='.$wp_rewrite->preg_index(1).'&tag='.$wp_rewrite->preg_index(2).'&feed=rss2'         );         $wp_rewrite->rules = $rewrite_rules + $wp_rewrite->rules;     }     add_filter( 'generate_rewrite_rules', 'wtnerd_edition_specific_categories' );      ## Problem The feed URLs don't work. For example:               example.com/main/channel/tech/feed/      loads the `content-none.php` template instead of showing the actual feed of posts that belong to the said terms. I am not sure how to fix this.


title: How is comment spam received without a comments form?

text: The theme one of my sites is using does not have a comments form nor is there any HTML markup for comments anywhere within the code. So, how am I receiving spam comments? All the spam is caught by akismet and I can change the Discussion Settings so only registered and logged-in users can comment (and a few other settings) -- so the question is not "HOW to reduce spam" but how do spammers (bots or humans) submit spam without a form?


title: When adding media, can I filter the HTML generated from "Insert From URL" before it hits the editor?

text: function test_function( $html ) {        return $html . 'TEST!';     }     add_filter( 'post_thumbnail_html', 'test_function', 21 );     add_filter( 'image_send_to_editor', 'test_function', 21 );     add_filter( 'media_send_to_editor', 'test_function', 21 );      I've tried something like the above, but it only edits the HTML of images appended thru the media library, not ones added manually via URL. The goal here is to modify the tag produced so I can add some additional attributes to it. Any ideas?


title: Dynamically display custom posts by custom fields

text: I am an intermediate PHP/jQuery developer and would just need a few pointers in the right direction (a tutorial would be great!) please; I have a custom post type of "Events" - amongst others, each "Event" has a startdate and enddate. I'd like to display the "Events" according to the the current month and dynamically filter this as the user scrolls through a 'calendar' e.g. if the user clicks September the display will update (AJAXian) to show events with a startdate and/or enddate in September. It is possible for Events to span over two months - in this instance the event would show across both months. I have looked at a couple of plugins for this (e.g. WP FullCalendar and The Events Calendar) but these are generally "overkill" for what I wish to achieve and/or they do not retain the custom post type I have already setup (which I must retain). Any help would be greatly appreciated! Thank you


title: Add <span> within the <a> output of <? wp_nav_menu() ?>

text:
Currently i am using:               <?php echo  wp_nav_menu( array( 'menu' => 'main-menu','depth'=> 1,'items_wrap' => '
%3$s
' ) ); ?>       I want to achieve:

                                               About Us

                                               Downloads

                                             For Learning

                                                 Support

        But i am not getting it in this way. Please help me out to find out the solution its very urgent.


title: Where should I insert code to dynamically generate page content?

text: I would like to generate dynamic pages based on a third-party API. However, I'm not sure where in the WP loop to capture the request and generate the content. For example, if a user is requesting a page at               http://mydomain.com/events/june-2      I would like to detect that they are requesting an event page by looking at the URL slug, then using the final piece, "june-2", to make a request to the third-party API and use the data to generate a page. Unfortunately, I can't figure out where to place it before a 404 is generated. I have tried the theme's index.php and page.php files. Would it better to do this with URL rewriting? Any thoughts?


title: is_single(); Question

text: If a page would contain this code: `<?php if( !is_single('') ): ?><div id="navtoggle"></div><?php endif; ?>` But regardless of it would show the div navtoggle, would that mean the code makes WP think the page is a `posts` page? If not, how can I make WP only show navtoggle on the homepage?


title: Search that will look in custom field, post title and post content

text:
I am looking for a way to perform a search, and while performing the search, it checks a custom field named keywords, the post title and the post content. If any of those fields have results like what the user searches, it display the custom post type (programs) in the results page. I do not need help with the end display result (it currently does what I want it to) but I need to make it so when it searches it checks all three fields (post title, post content and custom field keywords) and if any of them have a result like what was searched, it display the results. This is the code I have so far. It is currently only looking in the keywords custom field:               elseif($program_search) {         // search by program search text         query_posts(array(         'post_type' => 'program',         'meta_query' => array(             array(                 'key' => 'keywords',                 'value' => $program_search,                 'compare' => 'LIKE'             ),               )         ));                      if ( have_posts() ) :              while ( have_posts() ) :                  the_post();                 $l.= "
";                     $l.= "
ID)."'>". get_the_post_thumbnail($post->ID, 'thumbnail')."
";                     $l.= "
ID)."'>".get_the_title($post->ID)."
";                     $l.= "
".get_the_excerpt()."
";                     $l.= "

";                 $l.= "
";              endwhile;          else:         endif;     }


title: How to set a link to custom archieve page

text: I am working on my blog where I wish to have a archieve for only specific category post. To make it, I create a custom archive-cat.php. So for example I can get archive link date by wp_get_archives(). So I just want when I clicked on archive date the whole archive data should come from my specific category. For it, I have looked into wp-includes/general-templates.php -> wp_get_archive() and wp_archive_link(). Honestly I could not found the way to understand in actually how the archieve date link open archive template... In other word I want to change the link template for archieve date link So guide me in the right direction to solve my issue what should I do..


title: Customise wp_List_pages to output a UL LI

text: I am trying to get my pagination for posts outputted as a list. ie: UL > LI > A.               <?php wp_link_pages(); ?>      I see that I can add a UL easily enough by editing the $defaults but I cannot seem to wrap the a links in li's. Any help would be appreciated. Thanks


I am stuck in replacing post ID by custom post name in url. link is as shown below: href="'.$url.'/'.$options['applyp'].'/?pos='.$post[$i]->ID.'" i need to replace ?pos='.$post[$i]->ID.' by custom postname.. I tried /%postname% but got an error. The error was something like this. Parse error: syntax error, unexpected '"> I also tried by using http://codex.wordpress.org/Using_Permalinks. I got same error Can somebody help me in resolving this issue? regards


title: custom_post_type with umlaut in name

text: hi and thanks for stopping by. i created a custom_post_type like this:               function custom_post_types() {         register_post_type( 'veroeffentlichungen',             array(                 'labels' => array(                     'name' => __( 'Veröffentlichungen' ),                     'menu_name' => 'Veröffentlichung'                 ),             'public' => true,             'has_archive' => true,             'rewrite' => array('slug' => 'veroeffentlichungen')             )         );     }     add_action( 'init', 'custom_post_types' );      this works fine. now i need the navigation to show the class, when im on a single page in that post type `.current-menu-item` i do that with following function (print_r's included..):               add_filter('nav_menu_css_class', 'current_type_nav_class', 10, 2 );     function current_type_nav_class($classes, $item) {         print_r($item);         $post_type = get_post_type();         print_r($post_type);         if ($item->post_name != '' && $item->post_name == $post_type) {             array_push($classes, 'current-menu-item');         };         return $classes;     }      but the results from the `print_r()`'s are different:               $post_type       = veroeffentlichungen     $item->post_name = veroffentlichungen      the ö should turn into oe, NOT into o, but i dont know, where to edit the `$item->post_name`, i guess that should be done inside the labels array, but i couldnt find a solution in the codex. the output of `print_r($item)` is               WP_Post Object     (         ...         [post_title] => Veröffentlichungen         ...         [post_name] => veroffentlichungen         ...         [title] => Veröffentlichungen         [url] => /veroeffentlichungen/         ...     )


title: A error is being shown at the last stage of WampServer installation

text: A error is being shown at the end (see the screenshot) of WampServer installation. Please advise me how to solve this problem. ![enter image description here](http://i.stack.imgur.com/4ocww.png) Thanks.


title: Why do I need to check if wp_nonce_field() exists before using it

text: i dont really understand why the check if the nonce function exists before running it ...               if ( function_exists('wp_nonce_field') )           wp_nonce_field('gmp_nonce_check');      i understand its for backwards compatibility ... > Also notice how you are verifying that the `wp_nonce_field` function exists > before trying to call it for backward compatibility but wont it break anyway if on post back i check               if ( isset($_POST['submit']) ) {          check_admin_referer('gmp_nonce_check');


title: What's the difference between esc_* functions?

text: I've read _Professional WordPress_ and it says: > `esc_html` function is used for scrubbing data that contains HTML. This > function encodes special characters into their HTML entities > > `esc_attr` function is used for escaping HTML attributes > > `esc_url`. This function should be used to scrub the URL for illegal > characters. Even though the href is technically an HTML attribute What's the difference between these? If I have               <script>alert('hello world!');</script>this is some content      Would all `< >` be converted to `< >`? Will the URL be something like `%xxx`?


title: Plugin uninstall: why run dbDelta after $wpdb->query($drop_sql)

text: i am reading professional wordpress. their code for uninstalling a plugin is               //build our query to delete our custom table     $sql = "DROP TABLE " . $table_name . ";";          //execute the query deleting the table     $wpdb->query($sql);     require_once(ABSPATH .’wp-admin/includes/upgrade.php’);     dbDelta($sql);      my question is why run `dbDelta` after `$wpdb->query($sql);`


title: why shouldn't i save metadata when its a revision

text: reading a book about wordpress ... sorry if i ask the too many questions at 1 go but i am new and confused why does the author always not save data in the metadata box when its a revision. just in case its not clear, what i refer to by metadata box is the one added by `add_meta_box`.               //save meta box data      function pp_save_meta_box($post_id,$post) {         // if post is a revision skip saving our meta box data         if($post->post_type == ‘revision’) { return; }              // process form data if $_POST is set         if(isset($_POST[’pp_sku’]) && $_POST[’pp_sku’] != ‘’) {             // save the meta box data as post meta using the post ID as a unique prefix             update_post_meta($post_id,’pp_sku’, esc_attr($_POST[’pp_sku’]));             update_post_meta($post_id,’pp_price’, esc_attr($_POST[’pp_price’]));             update_post_meta($post_id,’pp_weight’, esc_attr($_POST[’pp_weight’]));             update_post_meta($post_id,’pp_color’, esc_attr($_POST[’pp_color’]));             update_post_meta($post_id,’pp_inventory’,esc_attr($_POST[’pp_inventory’]));         }     }


title: I have an old version of jQuery showing up. How do I figure out where it is coming from?

text: I am fairly new to WP, so I apologize for this very basic question, but I am working on a site that has an older version of jQuery showing up. Here is the jQuery reference I have placed in the header, which appears on line 20 of the source code:               <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>      But on line 39 of the source code I see the following:               <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js?ver=3.8.1'></script>      I have searched the files and I cannot see where this reference is coming from. I need to get rid of it and could therefore use some guidance on tracking it down. Thanks.


title: mySQL queries are executed twice on wordpress website

text: I'm sorry for my english. I'm trying to add some functionalities at my Wordpress website and to do this i have added a function in my function.php theme. The idea is to save in a custom table some datas and create a wp_post for any element added in the custom table. I hooked the function in this way:               add_action ( 'init', 'inserimentoAutoDatabase' );      The problem is that when the function is executed the query that save the datas in the custom table and create a new post is executed twice. I report my code:               function inserimentoAutoDatabase(){              //get datas from an xml file         $result = fetchData("http://dealer.drivek.it/myPortalXML/index?myPortalXMLkey=d660d1e9-8c1d-41ff-8f54-0829777a9960");              //save the xml           $fp = fopen('autodealerk-1.xml', 'w+');         fwrite($fp, $result);         fclose($fp);              //load xml file         $xml=simplexml_load_file("autodealerk-1.xml");              $i=0;              //start parsing xml content         foreach($xml->car as $auto)         {             //this echo is executed only once             echo ("test");                  //not important for the question | checks some content             if($auto->km == null || $auto->km  == ''){                 $kilometri = "nuova";                 $anno_registrazione = "-";             }else{                 $kilometri = $auto->km;                 $anno_registrazione = $auto->registrationDate;             }                  $inevidenza = 0;             if($auto->tractionType){                 $inevidenza = 1;             }                       // create an array for the query             $insData = array(                 'id' => $auto['id'],                 'make' => (string) $auto->make,                 'model' => (string) $auto->model,                 'version' => (string) $auto->version,                 'bodyType' => $auto->bodyType,                 'fuelType' => $auto->fuelType,                 'type' => $auto->type,                 'dealer_name' => (string) $auto->dealer->name,                 'gear_gearType' => (string) $auto->gear->gearType,                 'tractionType' => $auto->tractionType,                 'kw' => $auto->kw,                 'doors' => $auto->doors,                 'seats' => $auto->seats,                 'emissionClass' => $auto->emissionClass,                 'prices_listPrices' => $auto->prices->listPrice,                 'exterior_color_paint' => $auto->exterior->color . " " . $auto->exterior->paint,                 'km' => $kilometri,                 'typewarrantyMonths' =>  $auto->warranty->type . " " . $auto->warranty->warrantyMonths,                 'equipments' => "equipaggiamenti",                 'media' => $auto->image,                 'description' => $auto->description,                 'registrationDate' => $anno_registrazione             );                  $wpdb->insert('auto_importate', $insData);                       // define the post             $my_post = array(               'post_title'    => (string) $auto->make . (string) $auto->model . (string) $auto->version,               'post_content'  => $auto->description,               'post_status'   => 'publish',               'post_author'   => 1,               'post_type'     => "vehicles"             );                  // ***** post is created twice             $post_id = wp_insert_post( $my_post );                       //i break the cycle **** only for test             $i++;             if( $i == 1 ) break;              }     }      As you can see in the images below at the end of the cicle (breaked after the first execution) i expect only one element but there are twice. ![auto_importate table](http://i.stack.imgur.com/FoRaw.png) ![auto_importate table content](http://i.stack.imgur.com/LQ0yr.png) Anyone can help me??? Have you any idea about this issue? Thanks in advance.


title: Redirect to post_id?

text: I am using a Simple 301 Redirects plugin and I understand that this requires the redirect to be a permalink. Is there any way I can redirect to a post_id? That way I can move the post (or page in this case) and then I don't have to worry about rewriting the direct URL. Thanks.


title: Applying a filter to multiple loops for days ago

text: I'm trying to use a filter that limits the days ago loops pull posts from. My problem is that I need different day limits for certain loops on the index page and when I duplicate the filter over a second loop, I get an error saying "Cannot redeclare filter_where() (previously declared in ".) I remove the filter after the first loop that I use it, but that doesn't help. Here are the filters...               <?php       function filter_where($where = '') {         $where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";         return $where;       }     add_filter('posts_where', 'filter_where');     query_posts($query_string);     ?>


title: wp_set_object_terms() -- prevent overwrite?

text: From my understanding (and before trial and error),               wp_set_object_terms( 'post_id', 'add_this_term', 'in_this_taxonomy');      But from the Codex, apparently adding the term will overwrite any other terms that are set for that post and that taxonomy? Is this right? What if the terms are nested?


title: How to control order when displaying child categories

text: I'm working on displaying a series of child categories in the meta of each post. For instance, after the post appears an array, depending on category selection, describing the post content: Color: Red | Shape: Circle | etc. The following code displays the content as desires except not in the correct order. The display currently appears as alpha order of the child categories. I need to either order the categories by parent ID or in the order their presented in the code. Any ideas?                        <?php         foreach((get_the_category('orderby=ID&order=ASC')) as $childcat) {         if (cat_is_ancestor_of(3, $childcat)) {         echo 'Color: '. 'cat_ID).'">';      echo $childcat->cat_name . ' | ';         }         if (cat_is_ancestor_of(10, $childcat)) {         echo 'Shape: '. 'cat_ID).'">';      echo $childcat->cat_name . ' | ';         }         }         ?>


title: shortcode to create dynamic dropdown box form shortcode attributes

text:
I am trying to make a shortcode that will create a dynamic dropdown list of downloadable file links, that once selected, html will show a download link below the dropdown. Here is the end result of how the shortcode will function: http://jsfiddle.net/KKyE9/ I am struggling with how to turn the shortcode array into a multidimensional array or if that is the right approach. For example, via the shortcode I am passing attributes that are not defined in the shortcode function but beed to be created inside the function.               [sc total_options="10" option1="module 1" link1="http://cisco.com" label1="Click Here to download Module 2 audio file"  option2="module 2" link2="http://wordpress.com" label2="Click Here to download Module 2 audio file" option3="module 3" label3="Click Here to download Module 3 audio file" link3="http://cisco.com" option4="module 4" label4="Click Here to download Module 4 audio file" link4="http://wordpress.com"]      So option1, link1, label1, option2, link2, label2...etc. need to be created when the shortcode attributes are extracted. I have a working model that creates the dropdown list and displays the html link below but that only works for a single link. My challenge is passing the keyed attributes (option1, option2from the shortcode into the shortcode function so that I can use them in a loop and dynamically create the dropdown list options. I am sure the code can be better but I was just trying to get it to work first for a single attribute.               function shortcode_dd_list($atts, $content = null) {              extract(shortcode_atts(array(             "total_options" => '',             "option" => '',             "label" => '',             "link" => ''         ), $atts));              $output  = '';         $output .= '<select id="wlmm-select-dropdown">';         $output .= '<option value="option0">Please select a module to download</option>';              $i = 1;          while ( $i <= $total_options ) {           $output .= '<option value="'.$option'">'.$option.'</option>';                  $i++;                }              $output .= '</select>';              $i = 1;          while ( $i <= $total_options ) {                     $output .='
'.''.$label.'
';                        $i++;         }              return $output;     }     add_shortcode("sc", "shortcode_dd_list");      Ideally I would rather setup the dropdown like this from the following series of schortcodes, its easier to read but I keep getting 4 dropdown boxes.               [sc total_options="4"]     [sc option1="Module 1" label1="Module 1 download" link1="http://bitBucket.com"]     [sc option2="Module 2" label2="Module 2 download" link="http://lostInSpace"]     [sc option3="Module 3" label3="Module 3 download" link="http://null"]     [sc option4="Module 4" label4="Module 4 download" link="http://error.com"]


title: what is the difference between timthumb and post thumbnail?

text: I get the image through wordpress built in post_thumbnail, but i see a lot of developers use timthumb for that and i don't know why! is it more flexible or something?


title: Can we create front end user login and registration form other than WordPress default login

text: In my WordPress site I need a "log-in" and "register" section in the sidebar area so that logged in member can only view "memberlist" menu item in the navigation menu. Unregistered members or not logged in users should not be able to see that menu in the navigation menu. I can make this functionality using a plugin, but **the problem** is :- All the log in section plugins available now depends on the WordPress admin credentials. I don't want my members to access the dashboard section using their credentials (means in my site there will be so many members so I don't want them to access the `wp-admin` section with their credentials). That's why I need a completely separate log in section. Is it possible in WordPress ? I've searched Google for a help but I can't find an answer. Even the plugin I mentioned above for hiding menu item also uses `wp-admin` credentials.


title: Custom permalinks not work on Nginx + Apache

text: I have strange situation...my permalinks not work after setup nginx to work with apache. permalinks work if they not finish with ".html", but work if finish with "/" ie.: this work: justflick.com/new-the-dark-knight-rises-set- photo-2012-01-25.html/tom-hardy-as-bane-in-the-dark-knight-rises but this don't: justflick.com/new-the-dark-knight-rises-set- photo-2012-01-25.html here is my confog for nginx for this site.                server {            access_log off;            error_log  /etc/nginx/logs/vhost-error_log warn;       listen    80;       server_name  justflick.com www.justflick.com;            # uncomment location below to make nginx serve static files instead of Apache       # NOTE this will cause issues with bandwidth accounting as files wont be logged       location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css)$ {        root   /home/justflic/public_html;       }            location / {        client_max_body_size    10m;        client_body_buffer_size 128k;             proxy_send_timeout   90;        proxy_read_timeout   90;             proxy_buffer_size    4k;        # you can increase proxy_buffers here to suppress "an upstream response        #  is buffered to a temporary file" warning        proxy_buffers     16 32k;        proxy_busy_buffers_size 64k;        proxy_temp_file_write_size 64k;             proxy_connect_timeout 30s;                  proxy_pass   http://76.76.22.237:88/;             proxy_set_header   Host   $host;        proxy_set_header   X-Real-IP  $remote_addr;        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;       }      }


title: How do i configure my content to show full posts?

text: So my blog is currently http://www.joegilbertphotography.co.uk/blog/ using the “delight” theme. Can anybody tell me how on earth I change it so instead of showing excerpts of posts, it just shows the entire post, one after the other, for about five posts or so, on the main landing page? I've tried changing the_excerpt to the_content, which just makes the whole lot disappear. I've also tried asking the creator of the template with no joy. Please help this is driving me nuts! Many thanks * * * Thanks Sagive, I've tried changing every entry of excerpt to content, all successfully other than one line which makes everything vanish when I amend it in any way. You can (hopefully) see my code at: http://pastebin.com/Fkr3eTrW thanks very much! * * * any ideas anyone? Really stuck on this! Thanks


title: Redirection not working in this front end post submission form?

text:
I found this tutorial to create a front end post submission form: It doesn't matter what I type on `wp_redirect( 'http://www.google.com' );` I don't get redirected to anywhere. Just the same page but without the form (http://localhost/my-wordpress-site/submit/).               <?php      /*      Template Name: Rate Wine Form      */     ?>      <?php      if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) &&  $_POST['action'] == "new_post") {               // Do some minor form validation to make sure there is content          if ($_POST['title'] != '') {              $title =  $_POST['title'];          } else {              echo 'Please enter the wine name';              return false;         }          if (isset ($_POST['description'])) {              $description = $_POST['description'];          } else {              echo 'Please enter some notes';          }               $tags = $_POST['post_tags'];          $winerating = $_POST['winerating'];               // ADD THE FORM INPUT TO $new_post ARRAY          $new_post = array(          'post_title'    =>   $title,          'post_content'  =>   $description,          'post_category' =>   array($_POST['cat']),  // Usable for custom taxonomies too          'tags_input'    =>   array($tags),          'post_status'   =>   'publish',           // Choose: publish, preview, future, draft, etc.          'post_type' =>   'post',  //'post',page' or use a custom post type if you want to          'winerating'    =>   $winerating         );               //SAVE THE POST          $pid = wp_insert_post($new_post);                        //KEEPS OUR COMMA SEPARATED TAGS AS INDIVIDUAL          wp_set_post_tags($pid, $_POST['post_tags']);               wp_redirect( 'http://www.google.com' );               //ADD OUR CUSTOM FIELDS          add_post_meta($pid, 'rating', $winerating, true);                //INSERT OUR MEDIA ATTACHMENTS          if ($_FILES) {              foreach ($_FILES as $file => $array) {              $newupload = insert_attachment($file,$pid);              // $newupload returns the attachment id of the file that              // was just uploaded. Do whatever you want with that now.              }               } // END THE IF STATEMENT FOR FILES           } // END THE IF STATEMENT THAT STARTED THE WHOLE FORM           //POST THE POST YO      do_action('wp_insert_post', 'wp_insert_post');           ?>

              <form id="new_post" name="new_post" method="post" action="" class="wpcf7-form" enctype="multipart/form-data">                                    <fieldset name="name">                      Wine Name:                      <input type="text" id="title" value="" tabindex="5" name="title" />                  </fieldset>                                         <fieldset class="category">                      Type:                      <?php wp_dropdown_categories( 'tab_index=10&taxonomy=category&hide_empty=0' ); ?>                  </fieldset>                                         <fieldset class="content">                      Description and Notes:                      <textarea id="description" tabindex="15" name="description" cols="80" rows="10"></textarea>                  </fieldset>                                         <fieldset class="winerating">                      Your Rating                      <input type="text" value="" id="winerating" tabindex="20" name="winerating" />                  </fieldset>                                         <fieldset class="images">                      Front of the Bottle                      <input type="file" name="bottle_front" id="bottle_front" tabindex="25" />                  </fieldset>                       <fieldset class="images">                      Back of the Bottle                      <input type="file" name="bottle_rear" id="bottle_rear" tabindex="30" />                  </fieldset>                                         <fieldset class="tags">                      Additional Keywords (comma separated):                      <input type="text" value="" tabindex="35" name="post_tags" id="post_tags" />                  </fieldset>                       <fieldset class="submit">                      <input type="submit" value="Post Review" tabindex="40" id="submit" name="submit" />                  </fieldset>                       <input type="hidden" name="action" value="new_post" />                  <?php wp_nonce_field( 'new-post' ); ?>              </form>

       Any suggestions to fix this?


title: Disable category RSS Feeds on Wordpress blog with PHP

text: I have a Wordpress powered site and I would like to know how to disable all category based RSS feeds with PHP or even mod-rewrite if possible. Thanks


title: get_category_parents displays an empty category

text: When I execute               '<?php echo get_category_parents(get_query_var('cat'), false, '\' - \''); ?>'       on the category page `bar`, which is a sub category of `foo`, this is the output: `'foo' - 'bar' - ''`. How do I remove the last, empty category without PHP functions like `explode` or `substr`?


title: Filter Loop by Custom Field Value

text: I'm trying to filter a loop by a custom field value. I've tried all of the suggestions on the site, but it just won't filter. This loop is being used for a custom template of an rss feed. It pulls together the custom post type and only the posts that are "published", but I can't get it to filter by custom field value. ` global $wp_query; $args = array_merge( $wp_query->query, array( 'post_type' => 'custom_type', 'post_status' => 'publish', 'meta_key' => 'my_custom_field', 'meta_value' => 'custom field value', ) ); query_posts( $args ); ?> while( have_posts()) : the_post(); ?>` Any suggestions?


title: Avoiding calls to theme-compat

text: I have developed my own theme as a variant of Twenty Eleven. I am trying to avoid having `aria-required` being printed by the comments template. For ease of maintenance I'd rather override the comment template in my own theme than change the one that is currently being called. How do I go about overriding the comment template in my own theme?


title: get_posts that haven't been assigned a specific custom field

text: I'm trying to use get_posts() to pull articles that have _not_ been assigned a specific custom field. For example (not working):               $articles = get_posts(array(       'post_parent' => 0,       'post_type' => 'custom-type',         'meta_query' => array(         array(           'key' => 'alternate_page',           'value' => array(0, '', null),           'compare' => 'IN'         ),       )              ));      Basically, I want all 'custom-type' articles that don't have a parent and don't have the 'alternate_page' custom field assigned. I've read elsewhere about doing two queries, one for all articles that have the custom field, getting and array of their IDs, and using the '__post_not_in' parameter, but this seems tedious. Is it possible to do in one query like above? Thanks.


title: Query the post which have a thumbnail

text: I've got a highlight section on the header of my website which shows the title and the thumbnail of the last X posts having a thumbnail. Is there any custom query which allows me to retrieve only the last X post having a thumbnail? At the moment I'm retrieving the last X * 10 posts (because not all the posts have a thumbnail) hoping that in this result I'll have X posts having a thumbnail. After doing my query I add a condition: `if (has_post_thumbnail())`. This solution is really uncertain and ugly, a custom query with a thumbnail parameter would be great but I couldn't find any hint about it.


title: How to replace blog page url with subdomain at all places, even in xml sitemap?

text: I've a blog page in wordpress site at http://website.com/blog I want this should be accessed with http://blog.website.com and even the any blog article's link should be http://blog.website.com/article-of-the-week. and search-engine should also take the link as http://blog.website.com/article-of- the-week not http://website.com/blog/article-of-the-week I'm also using google XML sitemap plugin. and for the blog page url I want to submit the url as http://blog.website.com not http://website.com/blog As a example site you can take this http://www.ndesign-studio.com/blog it's a site which has blog page. Is it possible?


title: Manually Moving Posts/Pages/Comments/Tags from WPMU to WP3.0

text: Seems when I import the WPMU's XML file into the WP 3.0 install, I lose a ton of Pages/Posts/Categories. I am now leaning towards just manually moving over the tables from WPMU to WP3.0. Yet, when I do a dump of just wp_posts I get a sql error - making me think moving the db tables from WPMU to WP3.0 will be more complex. Any help would be appreciated in figuring out how to correctly move over these tables so I don't have to do the XML export/import all day with no results.


title: Is there a way to relate custom post types?

text: I'd like to be able to choose an object from another custom post type I've created when adding a second type. Similar to the way you can choose an author for a post. So when creating a post of type B there would be a dropdown of all the post As that the current author has created. Is there a way to do this? Thanks for any suggestions or direction.


title: remove archive from url :: marketpress

text: http://valeriegeffner.com/valstore/products is the site i'm working on // if you hover over the product the url is /archives/valstore/products/%the_product_name% // the problem i'm having is that the archives is being put in there for some reason && if you go to the product all links (( including nav bar )) have archives inject'd into them. any ideas ? only solution i can think of is doing some sort of url rewriting w/ .htaccess (( tho i'm not entirely sure how to pull that off ))


title: Autogenerate wordpress shortcodes using array?

text:
I was create a shortcode which automatically generate shortcodes with given array key and value. Function names does not generate dynamically. Note: Array KEY = ShortcodeName and Value = Wordpress Option field.               add_shortcode("auto_gen", "auto_gen");     function auto_gen() {         $a = array(             "get_address"       =>  "mg_admin_address",             "get_phone"         =>  "mg_admin_phone",             "get_fax"           =>  "mg_admin_fax",             "get_email"         =>  "mg_admin_email",             "get_hrs_mon"       =>  "mg_work_hrs_mon_frd",             "get_hrs_sat"       =>  "mg_work_hrs_sat"         );         foreach ($a as $k => $v) {             if(has_shortcode($k)) {                 echo "
Found: ". $k;             } else {                 add_shortcode($k,  $k. "_init");                 function $k. "_init"() {                     return get_option[$v, ''];                 }             }             add_shortcode();             echo $k ." -> ". $v. "
";         }     }      There is any possible way to do this. **NOTE:** > Here, get_address array key is a shortcode. And it is dynamically generate > when It pass though loop. get_address is changable. If I change get_address > with get_user_address then get_user_address generate generated. > "get_address", "get_phone" are CHANGABLE at END LEVEL. Developer also generate shortcodes to access created wp_options useing get_options, simply pushing elements in array. e.g. "shortcode_name" => "option_name"


title: Custom Post Formats

text: Here's my use case: a client will be making numerous blog posts, some of which are portfolio pieces of his recent work. This sounds like a perfect use case for a Post Format, but no "portfolio" post format exists. Post Formats are meant to be standardized, common formats, such as gallery, quote, status etc. Unfortunately "portfolio" isn't in that list and doesn't seem to fit with any of the sanctioned post formats. Creating a custom post type for this seems like bringing a bomb to a bonfire and frankly doesn't sit right with me since the portfolio blog post fits right in with the chronological main blog. So should I consider extending post-formats (if that's even possible)? Or is that strictly taboo? What's another alternative?


title: Create Advanced search with taxonomies (not filter list)

text: as always after struggling my mind for 3 days with a problem i decide to ask for help here. Im trying to create an advance search page with taxonomies and keyword field. You can see what i actually got in http://alianzasuperior.com/empleo/busqueda- avanzada/ ( dont panic, its spanish but just think as taxonomies and you will be ok) The keyword part is working fine. I can also create taxonomies pages for example taxonomy-job_type.php to handle an individual taxonomy and it works aswell. The problem is when i try to search in multiple taxonomies , and multiple terms for those taxomies. I tried to figure it out with scribu plugin "query multiple taxonomies" but im not able. Someone did something similiar for what im trying to do? Any help or clue will me much appreciate


title: Invoke a function before the action hook

text: I want to invoke a function before a special action. I want to validate the input of a custom metabox (or custom field) before the changes are saved. If the input value is invalid, then a stop save action with a message should be invoked. If the input fiels is valid, input value should be saved to DB.               add_action('save_change','my_function');     function my_function(){         if(validate($input){             //do core action          }else{             //show message and stop action, don't save other field         }     }      Please advise for me how to implement this problem.


title: Purpose of Adding Capability to Role But Not Grant?

text: I am attempting to create a custom role upon activation of my plugin. Along with that role, I wanted to add new capability to that role to access later. Now, after reading the Codex, I am totally confused. What is the purpose of the grant parameter? What good would it do to add a capability to a user/role and not grant access to it when WordPress doesn't offer access to check if the capability is granted? The `has_cap` method only returns true or false. At this point, it looks like the direction I should go is just create new Roles and either assign those roles to my users or not. The capabilities were going to be a "neat" way of me adding the custom capabilities without cluttering up the role list when manually adding a user. It looks like this won't work for me. Anyone confirm what I am reading/finding?


title: How to change the case of all post titles to "Title Case"

text: I am helping my father with his WordPress website.   It has over 1,700 posts with TITLES IN UPPERCASE. We'd like to change these to "Title Case" in the database (possibly using this PHP script). The WordPress "To Title Case" plug-in changes the case at the template level - we'd like to change it at the database level. What would be the best way to apply the script to all titles in the WordPress database?   I could write some code from scratch but I'm guessing there's existing code/methods out there that can apply a function/method across all titles.


title: Deleted pages showing up when querying for child pages

text:
I'm using the following code to display the featured image, post_title and custom field data from relevant child pages.               <?     $child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = ".$post->ID." AND post_type = 'page' ORDER BY 'title ASC' ", 'OBJECT');          if ( $child_pages ) :         foreach ( $child_pages as $pageChild ) :             setup_postdata( $pageChild );             $thumbnail = get_the_post_thumbnail($pageChild->ID, 'thumbnail');             if($thumbnail == "") continue; // Skip pages without a thumbnail     ?>
               <a href="<?= get_permalink($pageChild->ID) ?>" rel="bookmark" title="<?= $pageChild->post_title ?>">                 <?= $thumbnail ?>
                <?php echo get_post_meta($pageChild->ID, 'textfield', true); ?>
 <! -- Add riding-->                 <?= $pageChild->post_title ?>
         <?             endforeach;         endif;         ?>      However, it's also displaying child pages that have been deleted. How can I prevent it from checking the trash and displayed deleted pages? Thank you!


title: the_time() returning wrong date/time (way in the future)

text: Within a loop, that otherwise works fine, `the_time()` is giving me a date and time about 25 days and a few hours ahead of the actual date.   For instance, if I post today, it lists it as "April 30th, 2013" (today is April 6th, 2013). I can't for the life of me figure out why it's doing this. A couple things: This is on the front-end of my site and I am looping through a users posted attachments (sort of like a front-end media manager). The loop is working fine to grab the thumbnail, the attached post (and it's date), etc but the time of the actual upload of the file is just not right. That being said, the date/time that lists in the wp-admin section is correct, which is even more confusing... Pastebin of the entire page


title: Add a file upload field

text: I am building a plugin which has a file upload field in it's settings page. The files should not be image files but should be .doc, .txt etc. Struggling with the code for it. Any help would be greatly appreciated ! Edit 1: Here is the code -               $options = get_option('nn_sub_general_options');     if(!isset($options['nn_file_uploader'])) $options['nn_file_uploader'] = '';     require_once( ABSPATH . 'wp-admin/includes/file.php' );     echo "<form method='post' action='options.php' enctype='multipart/form-data'>     <input type='file' name='nn_sub_general_options[nn_file_uploader]' id='nn_sub_general_options[nn_file_uploader]' /></form>";     $uploadedfile = $_FILES['nn_sub_general_options[nn_file_uploader]'];     $upload_overrides = array( 'test_form' => false );     $movefile = wp_handle_upload( $uploadedfile, $upload_overrides );      There seems to be some problem with the 3rd last line of the code as it gives me an Undefined index error there