Archive list for custom post type categories

I am using a recipe plugin that uses a custom post type of 'recipe'. I currently have multiple lists of recipes from each category on a page. I am trying to get the title of each category list to link to an archive list of those posts within each category. This is not working, and I'm not sure if I need to create a new archive template, or if I can do it within this code.

<a href="<?php echo get_category_link(39); ?>" title="No Cook"><?php echo get_cat_name(39); ?>
                     <?php                     $recipes = new WP_Query();                     $recipes->query('showposts=5&orderby=rand&cat=39&post_type=recipe');                          while ($recipes->have_posts()) : $recipes->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?>
                     <?php endwhile; ?>
      NOTE: the title for each category list does currently link to the category archive page, but there are no posts listed. Just a black archive page.


Grab last part of the url inside rule

I have an url like this `http://example.com/en/username/Pimpampum` And I have one rule to map it into a search page, but I want to grab that Pimpampum inside the rule. So that I can call the search for that name               add_rewrite_tag("%u%", '(.*)');          add_rewrite_rule(       'username/(.+?)$',       "index.php?pagename=search-result&u=".$matches[1],       "top"     );      But I can't see how to grab the last part of the url. Any help? Thanks


How to insert date in topNav

In my theme i have a menu on the top of the page where i've links for my pages, this is the line of code in the **header.php** that generates topNav,                            <?php wp_nav_menu(array('theme_location' => 'topNav', 'depth' => 3, 'fallback_cb' => false, 'menu_class' => 'topNav')); ?>               And this is the output of the above line,

Copyright Policy

Disclaimer

Privacy Policy

Sample Page

           What i want to do is to add date function on the right side of the menu, i don't know how to edit the above PHP code, i can do this manually by adding HTML code directly into the **header.php** but i have to do that every time just for adding a link. Please Guide me how can i add a div which holds the date function right after the `<ul>` tag ends. Thanks


Is it duplicated if I cache an object that uses data from postmeta?

I have an object that saves its data in postmeta. When there is a post_id, the object class will query data by using get_post_cutom(); After get data, it starts to do its jobs, the end result is a graphic presentation based on the data. I understand that wordpress handles postmeta caching, but I would like to know: Should I cache the end result of the graphic presentation?


Rewrite rule to redirect to a particular filename.php

I'm using the Monkeyman Rewrite Analyzer plugin (http://wordpress.org/extend/plugins/monkeyman-rewrite-analyzer/) I want to write a rule that will be take a URL (that is specified in the user's accnt on a video encoding service as a callback URL) and then run the .php at the end of the callback URL. In short, the video encoding service will send a callback once a file has been encoded. I need to catch that notification and then act on it. btw, I also looked at WP Router (https://github.com/jbrinley/WP-Router) but it feels like overkill to me. I've used the Monkeyman plugin before with much success. I just can't seem to zero in on this particular add_rewrite_rule so I can process the callback request.


woocommerce and is_user_logged_in() if not redirect to homepage

I am currently using woocommerce and would like to redirect none logged in users to the home page, however i am having a little trouble determining where i should implements this I have done research and determined that using the is_user_logged_in() i can see if the user is logged in. I tryed implementing in the woocommerce/woocommerce-functions.php               // When default permalinks are enabled, redirect shop page to post type archive url         if (is_user_logged_in() && isset($_GET['page_id']) && $_GET['page_id'] > 0 && get_option( 'permalink_structure' )=="" && $_GET['page_id'] ==     woocommerce_get_page_id('shop') ) :             wp_safe_redirect( get_post_type_archive_link('product') );             exit;         endif;      but it still allows the page to be visible


5 posts per page from single category, paginated

I've been trying to create a "blog" page within a portfolio site of mine that only displays posts that I've categorized as "Blog". My goal is to only display 5 posts per page and have pagination at work. So basically just a simple blog within my site. I could just do a loop, but my portfolio entries are also posts (categorized as well: "Illustration" "Graphic" etc) and I just want "Blog" on this page. I tried a query but the pagination wouldn't show up. My answer may be as simple as referencing this codex post: http://codex.wordpress.org/Pages#A_Page_of_Posts I think what they are trying to communicate is their example category name is "Category" and I need to c/p the whole code and switch out "Category" for my category, "Blog". However, I am sure the word category is an essential part of the code in specific places so I am not sure where the word is just part of the code and where I'm supposed to change it out. Things would be far more clear if they had chosen a different word as an example instead of one that already exists within the code, but whatever. Or maybe I'm just misunderstanding the whole thing? Cutting to the chase:   * What "Category"s in that article should I replace with "Blog"?   * Conversely, is what I'm looking to accomplish not to be found in that article? If you made it through my long-winded question without wincing too hard, I really appreciate it!!


Add Meta box Befoure Post Title

i would like to add an image above the post title... in the old days i would change that directly in wordpress code but thats not very affective.. you know, upgrades and such. is ther a way using add_meta_box or some othere way to add a box directly above the post title? tried this Priority of Meta Box for Custom Post Type BUt that didnt work.. help Please :)


Show content only on front page?

I want to add some content (slider) only on the home page. I don't want it to apear on the other pages. I am trying following:               <?php if(is_home()) { ?>     <div>     ...     <div>     } ?>      But the content still appears on the second page (in pagination). How can i show some content to homepage only, so that id does not appear on second page? Thanks.


Im Trying to link the thumbnail image

I am trying to link my thumbnail image that is displayed by the list-category- post plugin on this page... http://elizabeth.vernetti.com/featured-properties/ I am using a custom template and have managed to get it linked to "#" using this code.                //Post Thumbnail     $lcp_display_output .= '';     $lcp_display_output .= $this->get_thumbnail($single);     $lcp_display_output .= '';      I know there is a way to use the_permalink to link it properly to the right post but I haven't been able to figure out the right syntax... i don't have much programming background. Thanks for any help.


detect when shortcode ran for the last time

I'm wondering, given this code: `add_shortcode( $tag , $func );` Is there a hook I can use that will always be called AFTER the last time `$func` was called, but soon enough, so I can still call `wp_localize_script()`? WP Function referencres: add_shortcode, wp_localize_script


show custom post type category dropdown sorting result on same page

I made a custom post type "kaubad" and i also want to add sorting option on website front end - users can select between this custom post type categories. here is screenshot about what i want to do. but i want to do it with costum post type and display results also on costum post type page(on same page where i can filter posts by categories). When i choose custom post type category,then only thing that will change is category ID on my web browser nav bar. Results i got so far are like,example:tooted/?cat=15 here is this post type page full code so far Sorry for my bad english,its not my native language,but i tried to explain it as good as i can.


Development (multi)site indexed - recommendations to redirect 301 to correct url?

Have just finished working on a dev site and the live site has been launched (on a different server/url) - unfortunately, Google bots were very efficient and have inadvertently indexed the dev site (which became 'open/live' during the last few days of development for testing purposes) I have now archived the site, but if visitors reach it, all they receive is a 'suspended' message - so I was wondering how best to 'redirect' users to the new/correct url and server using multisite? e.g. would it be best to use a plugin like Redirection and direct all traffic away? Or to leave it as archived so 'suspended'? And would it be advisable to use Google's Remove URL tool? Thanks in advance


Page output in strange characters

Apparently a lot of people complain that they only see random letters and characters: ![enter image description here](http://i.stack.imgur.com/sBWPt.png) My biggest problem is that I can't reproduce the problem on ANY of my devices! Not on my Windows XP laptop, not on my Windows 7 laptop, not on my Android phone or my iPod Touch. It doesn't matter which browser I'm using. The only time I see the problem myself is when I try to share one of my blog posts on Google+, because the blog description then appears in strange characters. So, **first of all** I need to find a way to reproduce the problem somehow. Otherwise I won't be able to see if what I did fixed the problem or not. I did everything that @toscho recommended, but nothing helped. Did anybody ever run into a similar problem or would you know where I could start to look for the problem? Edit: I contacted my webhost. They couldn't reproduce the problem, just like me. They said that they have enabled gzip compression on their servers. They suggested turning off one plugin after another to see what happens, but as I can't reproduce the problem, I can't do that. Please help! More and more readers are complaining about this problem. Most of them just need to refresh the page or wait a few minutes and then the site loads normally, but I'm still using a lot of traffic because of that. EDIT 2: The W3 Total Cache Plugin FAQ says: **I see garbage characters instead of the normal web site, what's going on here?** If a theme or it's files use the call php_flush() or function flush() that will interfere with the plugins normal operation; making the plugin send cached files before essential operations have finished. The flush() call is no longer necessary and should be removed. I am pretty sure that none of my code has this call anywhere, but I'm not 100% sure. Is there any way to find out other than searching through millions of characters in all of my files?


If 'editor' is empty, then

Is there a way to write a php conditional in WordPress that says: `"If 'editor' is not filled out (i.e. empty), then, do some code..."` I know it's sort of a strange request but basically I have a portfolio set up where if I don't fill out the editor for a post (i.e. project), I don't want a certain link to show.


Wordpress native "playlist" shortcode. Next and Prev there are but with no icons. How to fix?

If I use on my Wordpress 4.0 the beautiful playlist shortcode I don't see the famous "Next" and "Prev" icons, but only this code in my Html code: `<div class="wp-playlist-next"></div>` and `<div class="wp-playlist-prev"></div>` How to display icons to next and prev commands?


How to create a functions.php in child theme?

I want to create a functions.php file in my child theme and put some code in it, but i can't do it because everytime i create a functions.php file and put a code in it an error occurs. Does anybody know the way to do it?               <? php          add_action('iphorm_post_process_1', 'mytheme_create_wp_post', 10, 1);     function mytheme_create_wp_post($form)     {     $title = $form->getValue('iphorm_1_1');     $content = 'Content: ' . $form->getValueHtml('iphorm_1_30') . '
';     $content .= 'Link: ' . $form->getValueHtml('iphorm_1_11') . '
';     $content .= 'Creator: ' . $form->getValueHtml('iphorm_1_36') . '
';     $content .= 'Category: ' . $form->getValueHtml('iphorm_1_39') . '
';     $content .= 'Facebook: ' . $form->getValueHtml('iphorm_1_26') . '
';     $content .= 'Area: ' . $form->getValueHtml('iphorm_1_15') . '
';     $content .= 'Date: ' . $form->getValueHtml('iphorm_1_8') . '
';     $content .= 'Time: ' . $form->getValueHtml('iphorm_1_9') . '
';     $content .= 'Terms: ' . $form->getValueHtml('iphorm_1_32') . '
';     $content .= 'Info: ' . $form->getValueHtml('iphorm_1_35') . '
';          $post = array(         'post_title' => $title,         'post_content' => $content         'post_status' => 'draft'     );          wp_insert_post($post);     }          ?>      P.S. I use this code to automatically take the data from a submitted form (QuForm Plugin) and create a draft post. I already work it in the parent theme.               [Wed May 01 00:26:01 2013] [warn] [client 188.4.45.92] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /var/www/vhosts/e-win.gr/httpdocs/wp-content/themes/e-win/functions.php on line 20, referer: http://www.e-win.gr/     [Wed May 01 00:26:06 2013] [warn] [client 216.52.242.14] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /var/www/vhosts/e-win.gr/httpdocs/wp-content/themes/e-win/functions.php on line 20     [Wed May 01 00:26:06 2013] [warn] [client 188.4.45.92] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /var/www/vhosts/e-win.gr/httpdocs/wp-content/themes/e-win/functions.php on line 20, referer: http://www.e-win.gr/     [Wed May 01 00:26:23 2013] [warn] [client 188.4.45.92] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /var/www/vhosts/e-win.gr/httpdocs/wp-content/themes/e-win/functions.php on line 21, referer: http://www.e-win.gr/wp-admin/admin.php?page=options.php     [Wed May 01 00:29:12 2013] [warn] [client 188.4.45.92] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /var/www/vhosts/e-win.gr/httpdocs/wp-content/themes/e-win/functions.php on line 21, referer: http://www.e-win.gr/wp-admin/admin.php?page=options.php     [Wed May 01 00:29:41 2013] [warn] [client 157.56.93.230] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /var/www/vhosts/e-win.gr/httpdocs/wp-content/themes/e-win/functions.php on line 21     [Wed May 01 00:29:46 2013] [warn] [client 173.199.114.187] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /var/www/vhosts/e-win.gr/httpdocs/wp-content/themes/e-win/functions.php on line 21     [Wed May 01 00:30:08 2013] [warn] [client 188.4.45.92] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /var/www/vhosts/e-win.gr/httpdocs/wp-content/themes/e-win/functions.php on line 21, referer: http://www.e-win.gr/wp-admin/admin.php?page=options.php     [Wed May 01 00:37:57 2013] [warn] [client 188.4.45.92] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected $end in /var/www/vhosts/e-win.gr/httpdocs/wp-content/themes/e-win/functions.php on line 31, referer: http://www.e-win.gr/wp-admin/admin.php?page=options.php     [Wed May 01 00:42:05 2013] [warn] [client 188.4.45.92] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected $end in /var/www/vhosts/e-win.gr/httpdocs/wp-content/themes/e-win/functions.php on line 31, referer: http://www.e-win.gr/wp-admin/options-general.php?page=wp-viewer-log


add_settings_field Data not passing to Options Page Like it should

I am creating an options page with some fields. As you can see from the code below, I only have one field registered. However, when I try to send that field to my options page, it does not display the field. I cannot seem to find out what I am doing wrong. Any help would be greatly appreciated. Thanks                <?php           class WH_Options{          public function _construct()     {         $this->register_settings_and_fields();     }          public function add_menu_page()     {         add_menu_page('Portable OP', 'Portable OP', 'administrator', __FILE__, array(WH_Options, 'display_options_page'));     }          public function display_options_page()     {          ?>

Portable Theme Options
             <form method="post" action="options.php" enctype="multipart/form-data">                 <?php settings_fields('wh_plugin_options'); ?>                 <?php do_settings_sections(__FILE__); ?>             </form>
         <?php     }          public function register_settings_and_fields()     {         register_setting('wh_plugin_options', 'wh_plugin_options' ); // 3rd paramater is a call back function         add_settings_section('wh_main_section', 'Main Settings', array($this,'wh_main_section_cb'), __FILE__ ); // id, title of section, cb, which page         add_settings_field('wh_banner_heading', 'Banner Heading', array($this,'wh_banner_heading_setting'), __FILE__, 'wh_main_section' );     }          public function wh_main_section_cb()     {          }              /*         The inputs         */              // Banner Heading         public function wh_banner_heading_setting()        {          echo "<input />";        }          }           add_action('admin_menu', function(){         WH_Options::add_menu_page();     });          add_action('admin_init', function(){       new WH_Options();      });      ?>


Can't upload media, permissions are correct

I did a manual backup and re-install of a WP site, and it worked fine. Then my client updated some plugins, regretted it and asked me to restore the site to its previous state. I used the same backup I had from the first time, but now it turns out my client can't upload media. I go to the site to try and upload an image and I get no error messages, as if the image had uploaded just fine. But I get a broken image icon instead of the usual preview, and if I follow the image link I get a 'page not found (404)'. The URL path is were the image should have been uploaded to, but checking the FTP folder the image is not there. All folders have 755 permissions (all files are 644). I tried changing the folders' to 777 (just for test) but to no avail. I still get a broken image icon and no image uploads to the actual folder. The only place I can see the image is if I go to the edit option (and click edit again) I can see it in the editing textarea. And if I open that same image in a new tab the URL is something like mysite.com/blog/wp-admin/admin- ajax.php?action=imgedit-preview[...]. I searched some questions before posting, but most were solved changing permissions back and forth, or it was an issue between user and owner permissions. I tried the first and didn't work, and the second doesn't really apply to me, I think, because the first time I did the install the site was working fine under the same user as now. The problem is pretty much the same as this question, except I have no .htaccess file in the way. Does anyone have an idea of what the problem could be?


Random category URLs not working

I have been having problems with a custom taxonomy not working with a url. For example mysite.com/testcat/test1 will 404 but mysite.com/make/ford will work. More troubling is that mysite.com/?make=ford&testcat=test1 will bring up my test page (both taxonomies where included). Here is a clipping of the functions.php               register_taxonomy( 'testcat', 'videos', array( 'hierarchical' => True, 'label' => 'testcat', 'query_var' => true, 'rewrite' => true ) );      Any ideas of what i'm doing wrong?


Grouped products and minimum

I have a group of 4 products. When I press the add to cart button, I want these products to be added to the cart, only if they are no less than 6. That goes in any combination. For example if I choose 1 productA, 2 productB and 3 productC it should let you buy the group. If I choose 1productA and 2 productB I should not let me. Is this possible? Any ideas?


How to dispaly post informations (such as titles) in an admin plugin menu page?

I'm trying to develop a WP plugin to show post(or page) related information (such as show all post title in a list) in an admin menu page. I tried to use "The Loop", but it seems like "The Loop" cannot be accessed in Dashboard. I have achieved my goal by using $wpdb to query database directly. But is there a better or safer way to load post information in a dashboard menu page? Thank you in advance.


Comment-Meta doesn't work with latest wordpress update

I already had this script working, but since the last update of the wordpress core it doesn't save the comment-meta anymore.               /**      * Comments Winner      */          // Add new heading to comments tables     add_filter( 'manage_edit-comments_columns', 'winner_comment_column' );     function winner_comment_column( $columns ) {         $columns['winning_comment'] = __( '(lieb)gewonnen' );         return $columns;     }          // Print comment meta for new meta column     add_action( 'manage_comments_custom_column', 'myplugin_comment_column', 10, 2 );     function myplugin_comment_column( $column, $comment_ID ) {         if ( 'winning_comment' != $column )             return;         echo esc_attr( get_comment_meta( $comment_ID, 'winning_comment', true ) );     }          // Replace the quickedit action to call an additional expandedOpen function     add_filter( 'comment_row_actions', 'my_quick_edit_action', 10, 2 );     function my_quick_edit_action( $actions, $comment ) {         global $post;         $actions['quickedit'] = 'comment_ID.');commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( 'Quick Edit' ).'" href="#">' . __( 'Quick Edit' ) . '';         return $actions;     }          // Add some javscript into the footer for the edit comments page     add_action('admin_footer-edit-comments.php', 'edit_winning_comment_ajax');     function edit_winning_comment_ajax() {              // Create nonce         $nonce = wp_create_nonce( 'my_cmeta' );         ?>                  <?php     }          // Setup ajax callback for the new action     add_action( 'wp_ajax_update_winning_comment', 'update_winning_comment_ajax' );     function update_winning_comment_ajax() {              // Check nonce         check_ajax_referer( 'my_cmeta' );         // Check expected fields are there         foreach( array( 'comment_ID', 'comment_metaKey', 'comment_metaValue' ) as $field )             if( !isset( $_POST[$field] ) )                 die;              // Validate ID         $commentID  = absint( $_POST['comment_ID'] );         if( !$commentID )             die;              // Validate meta key         $commentKey = sanitize_title( $_POST['comment_metaKey'] );         if( empty( $commentKey ) )             die;              // Validate meta value(or empty)         $commentVal = sanitize_title( $_POST['comment_metaValue'] );              // Update meta          update_comment_meta( $commentID, $commentKey, $commentVal );              // Success response         echo 'success';// Echoed value is received as the response         // And die, expected behaviour for ajax actions         die;     }          // Run filter on the comment reply box(necessary to add new fields into the quickedit box)     add_filter( 'wp_comment_reply', 'wr_editComment_menu', 10, 2 );     function wr_editComment_menu($str, $input) {              extract( $input );         $table_row = true;              if ( $mode == 'single' )             $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');         else              $wp_list_table = _get_list_table('WP_Comments_List_Table');              // Get editor string         ob_start();             $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' );         wp_editor( '', 'replycontent', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings, 'tabindex' => 104 ) );         $editorStr = ob_get_contents();         ob_end_clean();              // Get nonce string         ob_start();             wp_nonce_field( "replyto-comment", "_ajax_nonce-replyto-comment", false );             if ( current_user_can( "unfiltered_html" ) )             wp_nonce_field( "unfiltered-html-comment", "_wp_unfiltered_html_comment", false );         $nonceStr = ob_get_contents();         ob_end_clean();              $content = '<form method="get" action="">';         if ( $table_row ) :             $content .= '

get_column_count().'" class="colspanchange">';         else :             $content .= '

';         endif;              $content .= '

Reply to Comment

Add new Comment

';              $content .= '
                         Name                         <input type="text" name="newcomment_author" size="50" value="" tabindex="101" id="author" />

                         E-mail                         <input type="text" name="newcomment_author_email" size="50" value="" tabindex="102" id="author-email" />

                         URL                         <input type="text" id="author-url" name="newcomment_author_url" size="103" value="" tabindex="103" />
';              // Add new quick edit fields                $content .= '
                         Gewonnen                         <input type="checkbox" id="comment-meta-winner" name="comment-meta-winner" value="gewonnen" style="width:auto; margin-top:5px;" />

';              // Add editor         $content .= "
\n";            $content .= $editorStr;         $content .= "
\n";                $content .= '
                 Cancel                                  Add Comment                 Update Comment                 Submit Reply

';                  $content .= '                 <input type="hidden" name="user_ID" id="user_ID" value="'.get_current_user_id().'" />                 <input type="hidden" name="action" id="action" value="" />                 <input type="hidden" name="comment_ID" id="comment_ID" value="" />                 <input type="hidden" name="comment_post_ID" id="comment_post_ID" value="" />                 <input type="hidden" name="status" id="status" value="" />                 <input type="hidden" name="position" id="position" value="'.$position.'" />                 <input type="hidden" name="checkbox" id="checkbox" value="';              if ( $checkbox ) $content .= '1'; else $content .=  '0';         $content .= "\" />\n";             $content .= '<input type="hidden" name="mode" id="mode" value="'.esc_attr( $mode ).'" />';              $content .= $nonceStr;         $content .="\n";              if ( $table_row ) :             $content .= '

';         else :             $content .= '

';         endif;         $content .= "\n</form>\n";         return $content;     }          ?>      Does anyone have an idea why this wouldn't work. The additinal checkbox in the comments-menu appears, however when trying to save it, it doesn't work. The comment-meta doesn't get stored in the db. Kind Regards, Matt


Dynamically switch template on click

I have a custom post type setup with a couple custom fields. I am creating a page where I display all of the custom post types, except I want to have multiple views. See the examples below. One is a list view, the other is a tiled project view with an image. At the top there will be buttons to switch between templates. Is there a way to switch between page templates dynamically? I've never done anything like this and would appreciate any help on the matter! I would rather not have each view of the portfolio be a new page. Thanks! ![enter image description here](http://i.stack.imgur.com/CSgR1.jpg) ![enter image description here](http://i.stack.imgur.com/gjhQk.jpg)


If statement for catergories

I was wondering if someone could explain how to roughly code this into php:               if catergory = Cars && user is unregistered     <my code>     else     <my code>


Limit file downloads to logged in users (WP + Nginx)

I am looking for a way to restrict access to mp3 files on my site to logged in users only. The approach listed here sounds pretty much like what I need:               RewriteEngine On     RewriteBase /     RewriteCond %{REQUEST_FILENAME} ^.*(mp3|m4a)$     RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]     RewriteRule . - [R=403,L]      except how would I convert these .htaccess rules to nginx?


Adding jquery and thickbox to WordPress theme

I would like to add thickbox for the template which I develop to WordPress. At this time I'm trying with a clean template that have only `header.php`, `footer.php`,`index.php`, and `functions.php`. I've included the `<?php wp_head(); ?>` into `header.php` and the `<?php wp_footer(); ?>` into `footer.php`. I've included the `wp_head` like this:               <?php     wp_enqueue_script('jquery');     wp_enqueue_script('thickbox');     wp_enqueue_style('thickbox');     wp_head();     ?>      I've changed the gallery link classes to thickbox with this code in `functions.php`               <?php add_filter( 'wp_get_attachment_link', 'sant_prettyadd');          function sant_prettyadd ($content) {         $content = preg_replace("/<a/","<a class=\"thickbox[slides]\"",$content,1);         return $content;     }     ?>      When I'm clicking on to a gallery image it should open with thickbox but it opens the imagefile only.


Lightbox Post Pop-up on homepage

I've been working on sampression lite theme and what I want to achieve is when a post' thumbnail/read more link on homepage is clicked, a modal will pop-up ( similar to pinterest and this wp theme here http://goo.gl/3wBeR ) I've tried bootstrap-lightbox js, shadow js, colorbox js but none of them work for me (perhaps It's too difficult for my stupid brain) I've modified the loop.php and add codes too when using bootstrap lightbox which looks like the following:                   <?php if ( has_post_thumbnail() ) { ?>
                 <a data-toggle="lightbox" href="#myLightbox-<? the_ID(); ?>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" >                     <?php the_post_thumbnail( 'featured-thumbnail','',true ); ?>
                   <?php } ?>          //ADDING CODES BEFORE SECTION         <div id="myLightbox-<? the_ID(); ?>" class="lightbox hide fade" tabindex="-1" role="dialog" aria-hidden="true">
         <?php the_post_thumbnail(); ?>
                   <?php the_title();?>

                <?php the_content();?>

                 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

      Since I'm just a super low grade wannabe, please be kindly to tell me what I have to do in a very idiot way (what to add, which files to modify, etc etc etc) Any answers are very highly appreciated. Thank you very much in advance Cheers! :)


Redirect based on log-in status per JavaScript

I want to check if a user is logged in. If he is, I want to redirect him to page A, and if he isn’t to page B. The redirect should happen per JavaScript after a button has been clicked – so I need the status or the URL to be available in JavaScript. How can I get these data from WordPress into JavaScript?


Search box with field hidden till drop down selection is made

I have a search widget with a drop down populated with my custom taxonomies. I need one of the other input fields to only show when a certain taxonomy or its children are selected. Before you say this is only a jquary question, please bare with me. I think I need to edit wp_dropdown_categories() with Walker_CategoryDropdown to add data-select="select1" in the tag. I found this code that does what I want I just dont know how to implement it. The HTML (Updated to reflect my code):               <form role="search" method="get" id="equipfilter" action="<?php bloginfo('url'); ?>/">         <fieldset>             <?php                 $dropdown_args = array(                     'taxonomy'          => 'exc_equipment_cat',                     'name'              => 'exc_equipment_cat',                     'show_count'        => 1,                     'orderby'           => 'name',                     'hierarchical'      => true,                     'echo'              => 0,                     'walker'            => new Walker_SlugValueCategoryDropdown                     );                 /*                 wp_dropdown_categories( $dropdown_args );                 */?>                 <?php                 $select = wp_dropdown_categories($dropdown_args);                 $select = preg_replace("#<select([^>]*)>#", "<select$1 data-select='select1'>", $select);                 echo $select;                 ?>         </fieldset>         <fieldset class="hidden" data-select="NOT SURE WHAT TO PUT HERE">             <legend>Kw Range:</legend>             <input type="text" name="kw_min" placeholder="min" value>
             <input type="text" name="kw_max" placeholder="max" value>         </fieldset>         <fieldset>             <legend>Price Range:</legend>             <input type="text" name="pr_min" placeholder="from" value>
             <input type="text" name="pr_max" placeholder="to" value>         </fieldset>         <input type="submit" id="filtersubmit" value="Search" />     </form>      The css:               .hidden {      display:none;        }      The jquery (Updated to where its working now when tested with my test category):               jQuery(function ($){         $(function(){             $('.postform').change(function() {                 var selectData = $(this).attr("data-select");                 var selectValue = $(this).val();                         $('.hidden').hide();                  if($("fieldset[data-select='" + selectData + selectValue +"']").css("display") == "none"){                      $("fieldset[data-select^='" + selectData + "']").hide();                      $("fieldset[data-select='" + selectData + selectValue +"']").show();                  }             });         });     });


Display all pages - in order

My goal a single-page vertically-scrolling site. I'm using this code to display all the pages one after the other:                                    <?php                     $pages = get_pages();                      foreach ($pages as $page_data) {                         $content = apply_filters('the_content', $page_data->post_content);                          $title = $page_data->post_title;                          $order = $page_data->menu_order;                         echo "
".$content."
";                      }             ?>      I'm new to php, any advice how I can echo the pages in the correct **order**?


Plugin options page - save two related options as one entry

I created an options page for my plugin where the user can specify image dimensions which will be saved for later use. So far the image dimensions are entered by the user in one input field like 200x200. To make it easier for the user I want to split that into two input fields with a x between them(one for x, one for y dimension). My question is: How can I do that and still save those fields as one entry like 200x200? I mean, how can I tell wordpress that these two fields belong together? So far my options page form looks like this:               <form method="post" action="options.php">         <?php wp_nonce_field('update-options'); ?>                 Defined sizes so far:
                 <?php foreach($sizes as $size):?>                     <?php if($size!=""):?>
<input type="text" name="gpp_image_sizes[]" value="<?php echo $size;?>" readonly="readonly">-
                         <?endif;?>                     <?endforeach;?>
<input type="text" name="gpp_image_sizes[]">+

                 <input type="hidden" name="action" value="update" />                 <input type="hidden" name="page_options" value="gpp_image_sizes" />                 <input type="submit" value="Save" />             </form>      As you can see, the already defined sizes get listed and can be removed(that's js in the background) and a new input is created if the user wants to define a new size and save it.


My WordPress comments appear repeated even though it is not. It get repeated n times as comment exists. Here is my `comment.php` code:               <?php        function my_comments_callback( $comment, $args, $depth ) {           $GLOBALS['comment'] = $comment;          ?>      <?php $args = array(     'status' => 'approve',      'post_id'=>11,      'type' => 'comment'     );         $comments = get_comments($args);         foreach($comments as $comment) :                  ?>

                        <article id="comment-<?php comment_ID(); ?>" class="comment">           <?php echo $comment->comment_content; ?>

<?php echo $comment->comment_author ;?>

          <?php endforeach;?>      and this is the template page where I called `comments.php`:               <?php              /*             Template Name: visitor              */                 ?>                 <?php get_header(); ?>
                  <img style="float:right; margin-right:20px;" src="<?php                                  bloginfo('template_directory'); ?>/images/visitor_title.png"/>
                           <img src="<?php bloginfo('template_directory'); ?>/images/edit_pin.gif"                        id="LearnMoreBtn"/>

               <?php             $commenter = wp_get_current_commenter();            $req = get_option( 'require_name' );            $aria_req = ( $req ? " aria-required='true'" : '' );           $fields =  array(              'author' => '
' . '' . __(               'name' ) . ' ' . ( $req ? '*' : '' ) .           '<input id="author" name="author" type="text" value="' . esc_attr(               $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />
',                );                    $comments_args = array(           'fields' =>  $fields,             'title_reply'=>'',          'comment_notes_after'=>'',        'comment_notes_before'=>'',               'label_submit' => 'send',             'comment_field' =>  '
' .                 _x( 'message', 'noun' ) .                    '<textarea id="comment" name="comment" cols="45" rows="8" aria -                   required="true">' .              '</textarea>
',              );              ?>
                <?php               comment_form($comments_args);                       ?>
       ClosePopup

             <?php        comments_template();            wp_list_comments(array( 'callback' => 'my_comments_callback' ));           ?>                      <?php get_footer(); ?>      any help would be appreciated


How to add a hyperlink to the email content in WordPress?

$message = sprintf(__('Dear: %s'), $user_login) . "\r\n\r\n";         $message .= __('As per your request on ') . date_i18n('j F Y', time());"\r\n\r\n";         $message .= __('Please visit the following link to reset your email address:') . "\r\n\r\n";         $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";         $message .= __('In case of any queries, you can write to us at') . "\r\n\r\n";         $email_id_reset = 'Email';         $message .= __('Thanks and Best Regards,') . "\r\n\r\n";      I want to show the message like the below mentioned. In case of any queries, you can write to us at e-mail. Thanks and regards


Send email on Job Dispatched from WP e-commerce

I sell a product using WP e-commerce that is downloadable only after I check some information that the customer sends me. After checking the information I would like to go to the WordPress dashboard, change the order status to "Job Dispatched", and have that trigger a new email to the customer with instructions on what to do next. Any ideas or experience with attaching some trigger event or option to the "Job Dispatched" status change?


Custom Post Formats for Custom Post Types

The weight of opinion seems to favour using custom post types _instead of_ custom post formats. I have several custom post types that I want to style in 4 different formats in a way that is not public ie not a category, tag or custom taxonomy. Custom post formats would seem to provide an ideal solution for this - they're built-in functionality, easily implemented, come with handy meta box, easily applied with conditional statements etc. The major draw back being they are not readily customisable - I could rename them for the sake of clarity. So given the prevailing thought, what would be a better approach to creating the same functionality.


I have created a custom post type 'hotel' and custom 'taxonomy' so when administrator creates a new hotel and saves it it related custom taxonomy automatically get created but I don't want to show custom metabox in the admin side hotel edit page so for that I used WordPress function but nothing happen. ## My custom post code                 $Hotel_labels = array(     'name' => _x('Hotels', 'post type general name'),     'singular_name' => _x('Hotel', 'post type singular name'),     'add_new' => _x('Add New', 'Hotel'),     'add_new_item' => __('Add Hotel'),     'edit_item' => __('Edit Hotel'),     'new_item' => __('New Hotel'),     'all_items' => __('All Hotels'),     'view_item' => __('View Hotel'),     'search_items' => __('Search Hotel'),     'not_found' =>  __('No Hotel found'),     'not_found_in_trash' => __('No Hotel found in Trash'),      'parent_item_colon' => '',     'menu_name' => __('Hotel'),     );          register_post_type('Hotel',$Hotel_args);      ## Custom taxonomy code               $Package_labels = array(     'name' => _x( 'Package Hotels', 'taxonomy general name' ),     'singular_name' => _x( 'hotel', 'taxonomy singular name' ),     'search_items' =>  __( 'Search hotels' ),     'popular_items' => __( 'Popular hotels' ),     'all_items' => __( 'All hotels' ),     'parent_item' => null,     'parent_item_colon' => null,     'edit_item' => __( 'Edit hotel' ),      'update_item' => __( 'Update hotel' ),     'add_new_item' => __( 'Add New hotel' ),     'new_item_name' => __( 'New hotel Name' ),     'separate_items_with_commas' => __( 'Separate hotels with commas' ),     'add_or_remove_items' => __( 'Add or remove hotels' ),     'choose_from_most_used' => __( 'Choose from the most used hotels' ),     'menu_name' => __( 'Package Hotels' ),     );           register_taxonomy('package_hotel','package',array(     'hierarchical' => false,     'labels' => $Package_labels,     'show_ui' => true,     'update_count_callback' => '_update_post_term_count',     'query_var' => true,     'show_in_nav_menus' => false,     'rewrite' => array( 'slug' => 'hotels' ),     ));      ## code to remove custom taxonomy metabox form custom post type hotel page               function my_remove_meta_boxes() {         remove_meta_box('tagsdiv_hotels', 'Hotel', 'side');     }          add_action( 'admin_menu', 'my_remove_meta_boxes' );


Widget items disappearing

if ( function_exists('register_sidebar') )         register_sidebar(array(             "name" => "Top Widget Area",             "id" => "topWidgetArea-$i",         ));      I just create a new sidebar with this.   I'm displaying this sidebar in my `header.php` like this:               <?php dynamic_sidebar( "Top Widget Area" ); ?>       It's displaying no problem and I can put every widget to my sidebar in wp- admin's Appearance -> Widgets page. When I refresh this widgets page, all the widgets (which are in the Top Widget Area) are disappearing. I'll explain it with a video. Please check: http://screenr.com/szG8


Wordpress as Wishlist Application

What I'm trying to do is allow registered users to create a list of gift items they would like for Christmas. So I've created a custom post type called 'gift' and a custom taxonomy of 'list' but I can't figure out how to relate the 'list' to the user. I would like to allow users to create multiple lists, but I can see a problem where 2 users may create the same list name and therefore causing headaches on which list belongs to who. Have I set this up the right way? What would you do differently?


Integrating WP-TLC-Transients with Wordpress - Where to Begin?

Last week, I asked about creating transients that would update before expiry to prevent users from waiting for the long loading time. I was pointed to WP- TLC-Transients which sound like exactly what I need, but unfortunately, I am at a loss with where to begin. Here are the associated files:   * class-tlc-transient-update-server.php   * class-tlc-transient.php   * functions.php   * tlc-transients.php Hopefully this is not too basic a question, but I'm interested in where to place the associated files to even begin trying to work with the code. EDIT: I placed `class-tlc-transients-update-server.php`, `class-tlc-transient.php`, and `tlc-transients.php` to my theme's directory and added `include( get_stylesheet_directory() . '/tlc-transients.php' );` to my `functions.php` With that settled, I plan on following the example in the readme. Are tlc- transients saved in the same place at wordpress transients? I'm wondering how I can best check if my implementation is successful. Thank you!


Referencing parent theme image from child theme

Apologies if this has been answered elsewhere, but I've had some trouble finding the solution via Google. I've set up a parent theme and a child theme. Inside the parent theme I have a directory named img which contains a number of images I want to use in the child theme too. The problem is, I can't seem to find the best way to reference an image from the parent theme whilst inside the child theme. Surely there is a particular way to reference the path dynamically? Whilst in the child theme, using `<?php bloginfo('template_directory'); ?>/img/` seems to look for the `img` folder inside the child theme, but I am looking to reference the img folder inside the parent folder. Any help on this would be great!


Adding a div to wrap widget content after the widget title

I'm trying to add a div to a widget's content in my dynamic sidebar. Here is the register code;               register_sidebar(array(             'name' => "Sidebar1",             'id' => 'home-sidebar-1',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));      But this code causes like this;

{WIDGET TITLE}
          {WIDGET CONTENT}
      Here is what I am trying to do;

{WIDGET TITLE}

                {WIDGET CONTENT}

      How it can be done?


Add extra class to wp-caption?

How do you add a new class to the HTML generated when an image with captions is added? For example, from this:               <div id="attachment_xyz" class="wp-caption alignleft"...      to this:               <div id="attachment_xyz" class="wp-caption alignleft my_new_class"...      Adding, in this case, **my_new_class**. Thanks, Scott


Post to inherit custom category background image from parent

I have a custom field on a category where you can add an image. I have it as a background image to show on the category's archive page, like so: archives.php               <body style="background:url('<?php echo z_taxonomy_image_url($cat->term_id); ?>')">      It uses the Categories Images plugin to achieve this. Is there a way for the posts in this parent category to inherit this background image? something like $cat->parent_id?


How can template identify what page it's being used on?

I have a template that is used for many different sections of my site (About, News, etc.). The nav bar needs to show a little graphic arrow below the section you're in. I was passing this via the template:               $page = 'about';     require('header.php');      ...but then I realized that won't work since the template file I was editing is used for a bunch of different sections, not just 'about'. So I need something on the `'page'` interface screen where I can somehow indicate the page that the user is on. Some ideas for solutions:   * Idea #1: does WordPress would set some kind of class on the 'body' tag to indicate the page you're on (like if it generated a slug based on the page name and added that as a class to the body tag)? Then just do everything I need to do in CSS without complicating things.   * Idea #2: some kind of built-in field on WordPress's 'page' admin that would let my header know what page it is on.   * Idea #3: I could make copies of my template for each major section. Very stupid way to go about it. I would REALLY prefer to not go the whole extra-fields route, manually adding a metadata field to my pages, pulling it from the db on page load, etc. That seems like super overkill for just having a way to let my template code identify what page it is being used on.


select wordpress custom post type

I have one wordpress theme which contain Custom Post Type. And in my theme I can add that as a page which show some different URL. Now when I call a WP function `(is_page('some-page'))` for wordpress page so this code is working. Now for my Custom page I write that same code but it's not working. So my question is how can we call this kind of specific custome page in wordpress.


How to add or delete default value theme options while activate and deactivate theme

I want to add & reset default value for my theme options while activate and deactivate a theme More clearly something like this               if(theme active)       add_option();        // add new option to the theme and register default setting for one time only          if(theme deactivate)        delete_option();       // reset current option and delete default setting  for one time only      Question How know is theme active or not? What a function or hook for this one. Let me know


Delete post from admin but not from database

Is it possible to have a post not deleted from the MySQL database on deleting from the wp-admin panel ?


Multiple blogs, different domain names, one install to rule them all

I've read a couple questions/answers on here but still am a little bit confused. My goal: To have domain1.com and domain2.com under one wordpress installation but have different content (separate blogs) accessible through one admin login (domain1.com/wp-admin). I currently have GoDaddy hosting but I'm using document root for another site so I currently have wordpress installed in a sub-directory. Do I need to have wordpress installed in doc root? I hear terms like MultiSite and Create a Network but I see them as basically the same thing. Am I wrong in thinking this? What do I need to do to accomplish this goal? What steps do I need to follow first? How do I point the 2 domain names to one installation? Thanks in advance.


Why there is a gap between <UL> and it's container (A drop down menu in wordpress)

This drop down menu works well in HTML but when i move it to wordpress template, there is a gap between and it's container (.menu-top-container). when the mouse on the menu you will find the gap. http://www.jamesxu.com.au/temp/ The funny thing is I copy all the css in the wordpress to a HTML,the gap is gone.Why?               .menu-top-container {margin: 0 auto 20px auto; text-align: center; font-family: 'Libre Baskerville', serif; font-size:1.1em !important; line-height:normal !important;background:#e41f3a;}     .menu-top-container ul ul {display: none;}       .menu-top-container ul li:hover > ul {display: block;}       .menu-top-container ul {     padding:0;     margin:0;     list-style: none;     position: relative;     display: inline-table;     background:#e41f3a;}     .menu-top-container ul:after {         content: ""; clear: both; display: block;}     .menu-top-container ul li {float: left;}         .menu-top-container ul li:hover {             background: #FFF;}       .menu-top-container ul li:hover a {color: #333;}                             .menu-top-container ul li a {             display: block; padding: 10px 12px;             color: #FFF; text-decoration: none;}             .menu-top-container ul ul {         background: #FFF;  padding: 0;         position: absolute; top: 100%;}      .menu-top-container ul ul li {             float: none;              border-bottom: 1px  dotted #575f6a; position: relative;}             .menu-top-container ul ul li a {padding: 5px 30px;color:#FFF;}                   .menu-top-container ul ul li a:hover { background: #e41f3a; color:#FFF;}         .menu-top-container ul ul ul {position: absolute; left: 100%; top:0;}


Children Shortcodes?

I started creating WordPress plugins a few weeks ago, and I would like to know if it's possible to somehow "embed" shortcodes in some others. Basically what I want to do is create a table or a list, based on a set of items entered by the user of the plugin. Is it possible to have something like :                [data]         [item1] something [/item1]         [item2] something else[/item2]         [item3] something else[/item3]      [/data]      In short, I want to create something based on the elements contained in the _itemX_ "children" shortcodes. Is there any way to do something like that? Thanks


SEO images in Nextgen Galleries

I have a couple blogs / wordpress sites that I post pictures on. I have noticed that most of the pictures I post with the nextgen gallery plug in never show up in google images search. Is there a way to fix this?


Submitting form in wordpress plugin

I am new to wordpress and currently making a plugin. I am getting list of authors using               <?php wp_dropdown_users(array('name' => 'author'));?>      Now when submitting my form I want to retain the current value entered by the user but as soon I submit the form the values get back to the default ones. I have searched on net and tryed alot but somehow not able to do this task.


Is there a way to create a "copy post" link?

Much like the "edit" link when viewing a post, is here a "copy post" function I can include with my theme?


Adding html format on tinymce visual editor

Need to add more html format tag to TinyMCE Editor as visualized below ![tinymceeditor - highlighted **Format** dropdown](http://i.stack.imgur.com/Cc80R.jpg) Using Wordpress 3.6.1 Can't found any good example/guide for these modification. Another solution welcome. Thanks & Cheers :-)


wp_generate_attachment_metadata sizes lose directory prefix

I am trying to programmatically add image attachments. What I have done is put the images in the correct sub-directory (.../wp-content/uploads/2013/09/*.jpg) and then use the following code to insert attachments: (code almost entirely from `wp_insert_attachment()` \- Codex)               $filename = $image->filename; // where $filename = ABCD.jpg, in uploads/2013/09/          $wp_filetype = wp_check_filetype(basename($filename), null);     $wp_upload_dir = wp_upload_dir();     $attachment = array(         'guid' => $wp_upload_dir['url'] . '/' . basename($filename),         'post_mime_type' => $wp_filetype['type'],         'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),         'post_content' => '',         'post_status' => 'inherit'     );     $attach_id = wp_insert_attachment($attachment, $filename, $post_id);          require_once(ABSPATH . 'wp-admin/includes/image.php');     $attach_data = wp_generate_attachment_metadata($attach_id, $wp_upload_dir['path'] . '/' . basename($filename));     wp_update_attachment_metadata($attach_id, $attach_data);      The problem is when I inspect `$attach_data` the `['sizes']` array is missing the /2013/09 prefix in `['file']`. I'm not quite sure what I'm doing wrong, I could go ahead and modify that before continuing, but was wondering if I'm doing something wrong? Any Ideas?


only display Pages which have children

Here is my website structure(wordpress pages)                - HOME -      - Tutorial -         + PHP Tutorial +         + Photoshop Tutorial +         + Css Tutorial +          + HTML Tutroial +         - news -         + November         + September         + May          + April      - about -      - contact -      How do I have the output just the pages which have children pages? so when I click tutorial page, the tutorial page has following list. (but pages list stays static when click subpages.   * Tutorial -      * PHP Tutorial +     * Photoshop Tutorial +     * Css Tutorial +      * HTML Tutroial +  I am using this code, but this only displays all children pages no parent.               <?php       if($post->post_parent)       $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=1");       else       $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");       if ($children) { ?>       <ul>       <?php echo $children; ?>       </ul>       <?php } ?>


file.php not loaded?

I feel like I'm being really stupid.   I want to make use of some functions in `wp-admin/includes/file.php` (like `download_url`), but it doesn't seem to be included, not in the dashboard/admin, or in the front end. I've put:               if (function_exists('download_url')) {         echo "YES!";     } else {         echo "NO!";     }      in my theme's `functions.php`, and it always prints "NO!". Do I need to do something to make these functions available?   I'm normally pretty expert with WP but I'm stumped by this very simple thing. Thanks in advance for help.


Wordpress rewrite question

I am new here and have a question about URLs in WordPress. The very front- facing portion of my website uses WordPress just so I can use the CMSs and blog for my SEO. I have a real estate portion of the site written in basic PHP and I would like to see if there is a way to rewrite URLs so I can have a customer visit:               http://mysite.com/RepfirstnameReplastname      instead of               http://mysite.com/?rep=RepfirstnameReplastname      When a person now visits:               http://mysite.com/?rep=RepfirstnameReplastname      I have a header across the top float down and show the reps details. What I would like to do is just have a person go to a URL like this one instead:               http://mysite.com/RepfirstnameReplastname      I have put this code in my WordPress theme header file (`header.php`) and my homepage has id[10]               if(is_page(10)){                       $url = $_SERVER['REQUEST_URI'];                       $repurl2 = parse_url($url, PHP_URL_PATH);                       $repurl = $_GET['rep'];                            $config = array(                     'host'      => 'xxx',                     'username'  => 'xxxx',                     'password'  => 'xxxxx',                     'dbname'    => 'xxxxxx'                 );                      $db = new PDO('sqlsrv:Server=' . $config['host'] . ';Database=' . $config['dbname'], $config['username'], $config['password']);                 $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);                 $getInfo = $db->prepare("SELECT * FROM representatives WHERE Website = ?");                 $getInfo->bindValue(1, $repurl);                 $getInfo->execute();                 $rep = $getInfo->fetch(PDO::FETCH_ASSOC);                 if(isset($rep['DisplayName'])){                     $_SESSION['repage'] = $_GET['rep'];                     $_SESSION['repphoto'] = $rep['PhotographURL'];                     $_SESSION['repname'] = $rep['DisplayName'];                     $_SESSION['reptext'] = $rep['WelcomeText'];                      }          }          if(isset($_SESSION['repage'])){             ?>

<img src="<?=$_SESSION['repphoto'];?>">

<? echo $_SESSION['repname']; ?>
<? echo $_SESSION['reptext']; ?>

         <?     }     ?>      The above grabs the info I need from an old SQL server for the rep and displays their info properly. I would just like to know how to remove `?rep=` out of the URL.


How to pass query string to page

How to pass query string to page Hi guys, I got a page which let's say page name is Actor the permalink is something like this               http://www.mywebsite.com/actor      I wanna be able to pass a query string let's say Albert Roberto and I would so something like               http://www.mywebsite.com/actor/Albert Roberto      Inside the page of actor, there a plugin I created which use shortcode e.g [actor] and it will display the data, as current I hardcode the actor in the plugin, I want able pass the parameter so my plugin can fetch the data by the query string from my database. I had done the fetching with a hardcode actor name, now wanna change the hardcode to query string base on user input. I want to be able to grab the query string that was pass in, and use it in my plugin, is it possible? How do I achieve it Thanks for all the help !! Sincerely


Get the blog page URL set in Options

I have set the blog to be a different page other than the home page. I want to have a link from single.php to this blog page. Is there any function that pulls out URL for the blog ?


How to Insert Self-Hosted Video in WordPress Post

Does WordPress have an easy way to insert video in a post? I am not referring to YouTube, Vimeo or other hosting sites, just video I upload myself on the server or through the Media manager. I have an mp4 video for example, and I'd like to have it play within the post, it's hosted on the same server as the website.


i want attachment.php to return the image

I use a lightbox to display images from posts in a website that is updated by differents authors. Or course, the lightbox only works if the author makes sure that he uses link to the image directly while uploading the file. 1/3 of the time, the author forgets and the lightbox shows the html of the attachment.php page. Is there possible to have a function, placed into attachments.php, that would return the image instead of the html page ? It would be simple to find the image itself, but I guess this would requires to change headers somewhere so the webserver returns the 'image/jpg' header. I would manage the details but I would need some help to start with. Thank you.


Like/Dislike Bar not working when updating

I'm trying to integrate Like/Dislike Bar in a Wordpress plugin . It Works Properly when total page reload/refresh . But whentime Like/Dislike Bar refresh from ajax that time its not working . **This is my html code .**

      **And this is my code in ajax for update**               $('.bar .bar-success').css('width','80%');     $('.bar .bar-danger').css('width', '20%');      but my like/dislike bar not updated . Whats wrong in my code ?


Why do I lose all the slashes, i.e., " \ ", in my blogs when I import XML files by the WordPress Importer plug-in?

When I want to import the XML files with the aid of the WordPress Importer plugin, the blogs imported will lose all the slashes, i.e., "\", which are really contained in the XML files imported. Since I have to use the LaTeX plug-in (Latex for WordPress plug-in), it becomes terrible. In fact, maybe weeks ago, it worked well. There was no such problem at all. But from one day, I find that all changed. TT Is there any one who know what's happening? Thank you very much!


Varying the number of posts per page from the first one

I want to have the index page to have a different number of posts than the rest of the pages (page 2, page 3 of the index page, as well as the archive pages). In my case I want to limit the number of posts on the front page to 5, while the rest will follow the configuration parameter from wordpress admin (in my case 8). I followed the example on this page here, and hooked in the `pre_get_posts` filter as follows:               function limit_posts_per_home_page()      {         $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;              if ( is_front_page() && ($paged == 1))             $limit = 5;         else             $limit = get_option('posts_per_page');              set_query_var('posts_per_archive_page', $limit);         set_query_var('posts_per_page', $limit);     }     add_filter('pre_get_posts', 'limit_posts_per_home_page');      This 'seems' to work fine. However in actual fact with the `posts_per_page` parameter set to 8, Page 2 of the index page shows item 9 to 16, rather than 6 to 13, thus missing 3 items. Is there to modify the offset in some way to make wordpress count from 6 rather than 8 from the 2nd page onwards?


What happens to the text in functions.php file outside of the php enclosure?

I have a very basic question. In the `functions.php` file of a theme, what happens to the text that is outside a function and outside the <?php ?> tags? Can I place notes before and after the functions without commenting it and without affecting the system? Or should I at least enclose the out-of-php text in html comments? For example:               comment/note/reference text     <?php     function my_function() {     code;     return results;     }     ?>     more comment/note/reference text     <?php     function my_function_2() {     code;     return results;     }     ?>     more comment/note/reference text      cheers,   Gregory


sortable custom column in media library

trying to make a custom column sortable in the media library. Found lots of examples for posts, and users but can't get them to work on the media library page.               function wpse_hook_isv_columns() {         add_action('manage_media_custom_column', 'isv_custom_media_column_content',10,2);         add_filter('manage_media_columns', 'isv_custom_media_column_headings');         add_filter('manage_media_imwidth_sortable_columns', 'imwidth_column_register_sortable' );     }     add_action( 'admin_init', 'wpse_hook_isv_columns' );               function isv_custom_media_column_headings($defaults) {        $defaults['isv_width'] = __( 'Width', 'imwidth' );        $defaults['isv_height']    = 'Height';        return $defaults;     }          function isv_custom_media_column_content($column_name,$id) {        $meta = wp_get_attachment_metadata($id);        switch ($column_name) {                    case 'isv_width':              $imWidth = get_post_meta($id, "_im_width", true);              if(  $imWidth ) :                       echo $imWidth .' ('.$meta['width'].')';              else : //  add meta value if not there...                      update_post_meta($id, '_im_width', $meta['width']);                 echo $meta['width'].' (updated)';              endif;                        break;                case 'isv_height':              $desc = get_the_content();              echo $meta['height'] ? $meta['height'] : $none;              break;        }     }          // Register the column as sortable ???     function imwidth_column_register_sortable( $columns ) {         $custom = array(               // meta column id => sortby value used in query               'imwidth'    => 'Width',         );         return wp_parse_args($custom, $columns);     }          // This example i found works!          function registerdate($columns) {         $columns['registerdate'] = __('Registered', 'registerdate');         return $columns;     }     add_filter('manage_users_columns', 'registerdate');          function registerdate_columns( $value, $column_name, $user_id ) {         if ( 'registerdate' != $column_name )            return $value;         $user = get_userdata( $user_id );         $registerdate = $user->user_registered;         return $registerdate;     }     add_action('manage_users_custom_column',  'registerdate_columns', 10, 3);          function registerdate_column_sortable($columns) {           $custom = array(           // meta column id => sortby value used in query           'registerdate'    => 'registered',           );       return wp_parse_args($custom, $columns);     }     add_filter( 'manage_users_sortable_columns', 'registerdate_column_sortable' );      how can i make isv_width sortable? Any help appreciated!


Widget header unique classes

I have created the code below for one of my widget sections. Currently I am able to manipulate the title bar with (h3.home-widget-header) which is good. But obviously it will be for all widgets in that section. There is 1 or two widgets that I need to style the positioning of the title bar slightly different. My question is - is this possible and how would I go about writing a unique class so I can manipulate each widget in that section individually. Thanks ahead of time!   * Mike if ( function_exists('register_sidebar') ) {               register_sidebar(array(              'name' => 'Homepage Widget Area',              'before_widget' => '
',              'after_widget' => '
',              'before_title' => '
',              'after_title' => '
',          ));      }


Prevent save_post from running when preview button pressed?

I have a bug where my content gets saved twice (2 seperate rows in the posts table). This post creation is for a custom post type so the bug is to do with my code. To reproduce I:   * Create a new post.    * Press preview (this creates the first row in the posts table).   * Close the preview window.   * Press save (this creates the second row in the posts table). If I press preview/save again then the duplication no longer occurs. If I edit an already created post then the bug also does not occur. When you press preview, it passes &preview=true in the querystring. In my save_post function I have:                 if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )            return;            if ($post->post_type=='gmc_recipe' && !$GET['preview']) {         //Save logic here       }      But the save logic still gets executed when the preview button is pressed! Any ideas on how to prevent saving when the preview button is pressed? I can't seem to capture the preview being in the querystring.


Create custom [sourcecode] shortcode, the right way?

## What I want to do Sharing code in posts on WordPress is quite a pain with all the HTML escaping to take care of. So, I plan to enclose code in posts within a custom shortcode called `[sourcecode]`, as shown below, and let it automatically escape the special characters.               [sourcecode]     <?php              // Some code here.          ?>     [/sourcecode]      * * * ## The code And this is what the relevant function (in my theme's functions.php) looks like:               /**      * Functionality to set up custom shortcode correctly.      *      * This function is attached to the 'the_content' filter hook.      */     add_filter( 'the_content', 'run_bbcodes', 7 );     function run_bbcodes( $content ) {         global $shortcode_tags;              $orig_shortcode_tags = $shortcode_tags;         $shortcode_tags = array();              // New shortcodes below         add_shortcode( 'sourcecode', 'bbcode_code' );              $content = do_shortcode( $content );         $shortcode_tags = $orig_shortcode_tags;              return $content;     }          /**      * Add Custom shortcode functions below      *      * This function is attached to the 'sourcecode' shortcode hook.      */     function bbcode_code( $atts, $content = null ) {              // Ensure contents of a
...
 HTML block aren't converted into paragraphs or line-breaks         $content = clean_pre( $content );              $content = str_replace(                  // Replace these special characters...             array( '&', '\0', '<', '>', '\'', '"', '/', '[', ']' ),                  // ...with the HTML entities below, respectively             array( '&', '\0', '<', '>', ''', '"', '/', '[', ']' ),                  $content         );              return '
' . trim( $content ) . '
';     }          /**      * Related sourcecode worth reading:      *      * https://bitbucket.org/cbavota/syntax-highlighter-plugin/src      *      * https://github.com/mdawaffe/Highlight.js-for-WordPress/blob/master/highlight-js.php      *      * https://github.com/fracek/highlight-wp/blob/master/highlight.php      *      * http://plugins.svn.wordpress.org/syntaxhighlighter/trunk/      *      * http://blog.webspace.jp/235      *      * http://core.trac.wordpress.org/browser/trunk/src/wp-includes/shortcodes.php      */      * * * ## Question(s) Now that the explanation is out of the way...   1. Am I missing anything else? For example, until I read the source of SyntaxHighlighter Evolved plugin, I didn't know that `\0` also needs to be replaced with `\0` "to work around kses" (which wasn't clear enough for me).   2. And other than escaping the special characters, is there anything else that I could possibly be missing? Am I doing it the right way? (It would be great if anyone could take a look at this file (PHP source code of SyntaxHighlighter Evolved plugin) and see if you can find something that I need to implement. I already did try my best though.) * * * **PS:** Why not use the plugin itself? For one, I don't want the syntax highlighting that it does; and I want to know if what it does can be implemented easily.


What is the Multisite way to handle user_register when adding a new user from $SUBSITE/wp-admin/user-new.php? 3.9.1

I am integrating with an external authentication server using the `user_register` action. We manually create users via the admin panel and do not allow self registration. Now I need to handle a similar scenario but in a sub-site while using Multisite. I was running through a debugger and noticed that when posting a new user in multisite mode to `wp-admin/user-new.php`, there are no actions fired that work the same way as `user_register`. The closest I see is the `wpmu_validate_user_signup` filter but I know that is not the right place to do this. I log into the admin panel as a super admin, select the site via the My Sites menu, then go to `Users > Add New`. The function `wpmu_signup_user` does the insert and it does not contain any `do_action` calls Is this an oversight in WordPress core for not providing such an action or am I doing it wrong? If it is the former I will open a ticket about adding a new action. I am using 3.9.1


Exclude specific post from displaying

I am trying to exclude a specific post ID from displaying. I've included the post ID as a `post__not_in` but being given an error I am unsure of, any obvious changes needed here?                                   <?php                         // Create a variable to hold our custom Loop results                         $frontpageposts = get_posts( array(                               'numberposts' => 1, // only the 3 latest posts                              'post__not_in' => '-4135'                         ) );                              // Create output only if we have results                         // Customize to suit your HTML markup                         if ( $frontpageposts ) {                                    foreach ( $frontpageposts as $fppost ) {                                    // setup postdata, so we can use template tags                                   setup_postdata($fppost);                                   ?>                                        <div <?php post_class(); ?>>
<a href="<?php the_permalink(); ?>"><?php //the_title(); ?>Latest News #1

                                             <?php the_post_thumbnail(); ?>                                             <?php //the_excerpt(); ?>

                              <?php }                         }                          ?>      **Error** > Warning: array_map(): Argument #2 should be an array in > /var/www/vhosts/testdomain.co.uk/faiauto/wp-includes/query.php on line 2451 > > Warning: implode(): Invalid arguments passed in > /var/www/vhosts/testdomain.co.uk/faiauto/wp-includes/query.php on line 2451


javascripts files not linking to my category slugs?

I have a wordpress custom theme set-up and what i want is to create separate category templates, now seeing the template hierarchy i created the category-{slug} file and now when i am linking my custom JavaScript files inside its header part the script inserted in header is -               <script type="text/javascript" src="../literature/js/head.min.js"></script>      And the scripts in the footer to be executed after my content loads are -               <script>             head.js(                 { jquery : "js/jquery.min.js" },                 { mousewheel : "js/jquery.mousewheel.js" },                 { mwheelIntent : "js/mwheelIntent.js" },                 { jScrollPane : "js/jquery.jscrollpane.min.js" },                 { history : "js/jquery.history.js" },                 { stringLib : "js/core.string.js" },                 { easing : "js/jquery.easing.1.3.js" },                 { smartresize : "js/jquery.smartresize.js" },                 { page : "js/jquery.page.js" }             );     </script>      Now i am getting a 404 error for all these files not present there , here's the firebug result :-               "NetworkError: 404 Not Found - http://localhost/deadman/wordpress/category/literature/wp-content/themes/testing/js/literature/core.string.js"      Now the things which i already tried are   * `"<?php bloginfo('template_url');/js/literature?>"`   * `"wp-content/themes/testing/js/literature"` Anyone got a possible solution for this, i think it is because of the javascript prototyping i am using in the footer part but still i ain't able to fix this.


Reading Wordpress sessions in Magento

I'm looking for a way to read a session set in Wordpress, in Magento. Reading Magento sessions in Wordpress proved to be no problem but the other way around seems nearly impossible. Here's my situation: I have a user area in Wordpress where people can login. I need to check in Magento if a user is logged in. IMPORTANT: I am not/ will not use Magento's customer model for this. Even if I retrieve a Magento session in WP and write to this session, I can not retrieve these changes in Magento. Hope anyone can shed some light on this.


Wordpress directing to Posts page (edit.php) instead of saving post

I have got a clean build ( **WordPress 3.9.1** running Twenty Fourteen theme). I've **installed WooCommerce** plugin and added one product. The product is a variable product with 65 variations. When I **link all variations** and save, there are no issues. But editing any information such as stock quantities or price etc and hitting Update will cause the problem below. Once I **click Update** , I am redirected to edit.php (the Posts page) and the **changes were not saved**. There is no error and everything seems to be running just fine. Upon removing variations one by one I realised that **once there's less than 50** , the post **updates perfectly**. I've tried increasing memory in PHP.ini, .htaccess, wp-config.php and nothing. Any ideas at all as I'm absolutely lost on this one. Many thanks in advance. Michael **EDIT** : In actual fact, you don't have to even attempt to change the properties of the new product. Even just trying to change this as it is will cause this issue.


Does code run faster in functions.php than in different theme templates?

For example I have this code which gets the post title:               function baracuda_sinlge_post_title(){ // Single Post Title             $post_title = single_post_title('','0');             return $post_title;         }      Where do you think it would run faster, in functions.php or direcly in the template I need it to be like this:               $post_title = single_post_title('','0');


Get declared variable in single.php to work in comments.php without re-declaring it

I have declared a variable in my single.php               $title  = 'myvar';      Can I get it in my comments.php without re-declaring it again? I use this code to get the comments.php templage:               <? comments_template( '', true );  ?>      Ty


Creative Clans Embed Script plug-in equivalent?

I need to add unique JavaScript snippets to several pages on a client's WordPress site. I used to use the above-mentioned plug-in until I encountered a nasty bug.* The thing I like(d) about Creative Clans Embed Script is that it doesn't require you to build a library of snippets in advance. You simply paste whatever code you want to append/prepend to a page into a dedicated field on the Edit Page ... page. Another advantage to this is that it completely isolates the snippet from the page content; you don't even have to reference a shortcode. Is there an alternative that's equally simple and flexible? * The WordPress page editor auto-saves a draft every few minutes, right? When this happens, Creative Clans Embed Script loses any snippets for that page. I've replicated the behavior in different browsers, on different computers, and on different websites. The plug-in hasn't been updated in two years.


Wordpress redirect to landing page if not logged in

I'm using the following code in my functions.php file to redirect users who are not logged in to a particular landing page                   <?php     if(!is_user_logged_in()) {         wp_redirect( 'http://www.mysite.com/landingpage', 301 ); exit;     }      The problem is I cannot access my wp-login or wp-admin anymore. Every url redirects to landingpage. Is there a way I can exclude certain urls from redirecting?


echo term name outside the loop, using term slug

I have a strange question... I have my term as a variable...               $mailer = 'may-2012-newsletter';      And I'm trying to echo on my page the Name of my term, using the variable above. But this is not in a loop. My term name is: **May 2012 Newsletter** But I'm trying to echo this from using my term slug: **may-2012-newsletter** This term is grouped in my taxonomy called: **mailers** I've tried this below but this doesn't work? I think I'm totally off track.               <title><?php echo get_term_by( 'name', $mailer, 'mailers'); ?></title>         Any help would be awesome thanks. Josh


sort posts by getPostViews in functions.php

I have the following function in functions.php that allows sorting alphabetically or by recency. I want to change the alphabetic to sort by most viewed. This is the code I have for the sorter, which is a dropdown select menu:               function sorter($wp_query) {                  if(mysql_real_escape_string($_REQUEST["sorting"]) == "date"){                 usort($wp_query->posts, 'cmp_date');             }else if(mysql_real_escape_string($_REQUEST["sorting"]) == "title"){                 usort($wp_query->posts, 'cmp_alpha');             }     }      And this is the code for the sorter:               function custom_sort(){      // retrieve the sorting variables         $sort_selected = mysql_real_escape_string($_REQUEST["sorting"]); ?>     <form action="" method="post">
             Sorting:             <select name="sorting" onchange="this.form.submit();">             <?php switch($sort_selected){                 case "";                 case "date";                 ?>                     <option value="date">Recency</option>                     <option value="title">Alphabetic</option>                     <option value="views">Views</option>             <?php break;             case "title";?>                     <option value="title">Alphabetic</option>                     <option value="date">Recency</option>                     <option value="views">Views</option>             <?php break;             case "views";?>                     <option value="views">Views</option>                     <option value="title">Alphabetic</option>                     <option value="date">Recency</option>             <?php break;             } // end switch ?>             </select>
     </form>      <?php }      And I think I need to use something like this (which I saw in another question on this site):               <?php $args = array(           'post_status' => 'publish',           'meta_key' => 'post_views_count',           'orderby' => 'meta_value_num',           'order' => 'ASC'         );         $the_query = new WP_Query($args); //http://codex.wordpress.org/Class_Reference/WP_Query          //the loop     while ( $the_query->have_posts() ) : $the_query->the_post();          //do your magic     endwhile;      But I don't understand how I can translate the code above into code that will fit my current function. I'm using this to get post views:               function getPostViews($postID){         $count_key = 'post_views_count';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');             return "0 View";         }         return $count.' Views';     }     function setPostViews($postID) {         $count_key = 'post_views_count';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             $count = 0;             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');         }else{             $count++;             update_post_meta($postID, $count_key, $count);         }     }      I hope this makes sense, and thanks in advance.


Make WordPress process admin group comments using $allowedtags

WP uses `$allowedtags` to limit the set of allowable tags for comments.However, comments from administrators are unfiltered. What's the easiest way to ensure admin comments are also constrained to the tags contained in `$allowedtags`?


How can run the multiple website sites or domains into single wordpress intallation

I want to run multiple sites into wordpress 3.8.1, when the user access my website the url and language of my website is auto change to its country by it's ip address of user and website will also be translates into it's local language. if someone has the willingness to solve this issue.please resolve the issue. thanks in advance.


How to add the sidebar in all category page

I created custom post type. I created category called product-categories. I listed all categories in sidebar.php. How to show the sidebar in all the category pages listing all the categories. Sidebar.php code is, 'name', 'order' => 'ASC', 'hide_empty' => 0, 'use_desc_for_title' => 1, 'child_of' => 21, 'hierarchical' => 1, 'number' => null, 'echo' => 1, 'taxonomy' => 'product-categories', 'walker' => null, 'title_li' =>'' ); ?> I want to display this code visible in all the category pages. Please guide me


wp_nav_menu() customized

Menu

sub-menu

sub-menu

sub-menu

Menu

sub-menu

sub-menu

sub-menu

      I'm trying to make a menu with wp_nav_menu() and I want to achieve a clean code like this. I'm trying to do it with a custom walker but I don't have experience with this. I think I have to overwrite a class but ... Coud you help me with the code?? Thanks for all


TInyMCE object Tag stripped

I need to add the following object tag to a page               <object id="myExperience" class="BrightcoveExperience">      <param name="bgcolor" value="#FFFFFF" />      <param name="width" value="648" />      <param name="height" value="630" />      <param name="playerID" value="801136430001" />      <param name="playerKey" value="**********" /><param name="isVid" value="true"/>      <param name="isUI" value="true" /><param name="dynamicStreaming" value="true" />     </object>      However Wordpress is stripping the object tag and everything inside and replacing it with non-breaking spaces. The editor I'm using in TinyMCE Advanced on WP .3.2.1, I tried installed TinyMCE config and adding the following to the extended_valid_elements               object[class|id|width|height|codebase|*],param[name|value|_value]      But it's had no effect, can anyone point me in the right direction?


Localize Plugin Description

Currently i'm working on a simple WordPress Plugin. I know within the Plugin i need to write my strings as `__()` or `_e()` and call `load_plugin_textdomain()` but i wonder how to localize the Plugin Description. Example:   ![example](http://i.stack.imgur.com/jleHL.png) _This is not the Plugin i'm working on. It's just an example to show what i mean._


Uploading avatar from the frontend

in the codepad link you can find what I am using to edit profile from the front-end. http://codepad.org/QJjDEA7p The code is working (which I got from How to edit a user profile on the front end? and change some things for me to work correctly). I have installed Simple Local Avatar plugin to allow avatar uploading, but how can I modify the code to have it also from the front-end ? I found these below, which I tested, showed the upload button, did not showed the current avatar and didn't let me to change it. Thank you for your help on this.               do_action('show_user_profile');     do_action('edit_user_profile');          do_action('personal_options_update');     do_action('edit_user_profile_update');      UPDATE There goes a 50 bounty for a working example. Unfortunately I can not get Bainternet's example to work that I tested with User Avatar plugin also, and I am really stuck with this issue can't finding the solution.


determine if specific page is in list?

It's not hard i think, but i run out of ideas... In template file I have code like this;               $current = $post->ID;     $parent = $post->post_parent;     $pages = get_pages('child_of='.$parent.'&parent='.$parent.'&sort_column=post_title&title_li&hierarchical=0');     $front_id = get_option('page_on_front');      I cant figure out how will statement to determine if `$front_id` is in `$pages` array look like ! thx for Your time!


Bulk Move Users from one site to another within a network ( Multisite )

I have a multisite install with 2 sites. I am working on site A, and I have a lot fo users on site B. I can individually move users from B to A, but there is a nontrivial number of users, and this could take days of repetitive work to do. How would I move assign all of the users at once to site A from site B?


what is the maximum number of post a wordpress loop can work with? how many post can i display with `'posts_per_page' => -1`? ive got 50,000+ pages and I want to sort through them, but I just get a blank page whenever I try and do anything to more than 10,000 pages (`'posts_per_page' => 10000`).


Admin WP List Table Columns Missing

The wordpress admin tables used on pages like www.example.com/wp- admin/edit.php uses a class class-wp-list-table.php In this class there are two functions that hide specific table columns with `{display: none;}` that can be seen at the following links: wordPress/wp-admin/includes/class-wp-list-table.php wordPress/wp-admin/includes/class-wp-list-table.php Recently, I had been trying to improve the wordpress tables, working on a plugin addming fixed table headers and live filtering. I was using Jquery FilterTable which works awesome, along with a sticky header script. Most sticky table header scripts clone the existing header when it reaches the top of the screen and fix it, while hiding the old one with css display:none or visibility:hidden. Everything can be seen here Jquery Filter Table uses display: none as well to do it's live filtering by hiding the results not found in the users search. For some reason these styles interfere with the class-wp-list-table when updating pages/posts. It causes display: none to become permanent. I thought it was a caching issue at first, however I disabled all my plugins and cleared my cache. I even went as far as reinstalling wordpress. I did first notice this after installing codepress-admin-columns but have deleted the plugin and it hasn't fixed anything. `display : none;` was embedded inline on several of the table headers and their relating columns It seems like wordpress stores the values of all the table columns html, not just the values. I know that it caches the tables for pagination, but I'm not really sure how this all occurs. I'm wondering why this happened, but more importantly how can I fix the tables as it seems like they're stored/cached somewhere in the database? I've deactivated every plugin, Reset to the twenty-fourteen, ran the allow_repair script, and cleared all orphans/transients. I've cleared my server cache as well as my computers browser cache. Image showing missing columns: ![Image showing missing columns](http://i.stack.imgur.com/wrYin.png) ![Image showing display:none added to title](http://i.stack.imgur.com/SsyN1.png) ![Display none also added to td columns](http://i.stack.imgur.com/V2Kpi.png) ![enter image description here](http://i.stack.imgur.com/Zvnxy.png)


How to hide post metadata from homepage and show only in post page?

could anyone please tell me how to hide post metadata from home page? I would like to have them displayed only in post page. This is my website http://studyor.comuf.com and the theme was made with artisteer Thanks! ## Edit Code copied/pasted from below:                   <?php get_header(); ?>

             <?php get_sidebar('top'); ?>             <?php                  if(have_posts()) {                          /* Display navigation to next/previous pages when applicable */                     if ( theme_get_option('theme_' . (theme_is_home() ? 'home_' : '') . 'top_posts_navigation' ) ) {                         theme_page_navigation();                     }                          /* Start the Loop */                      while (have_posts()) {                         the_post();                         get_template_part('content', get_post_format());                     }                          /* Display navigation to next/previous pages when applicable */                     if (theme_get_option('theme_bottom_posts_navigation')) {                          theme_page_navigation();                     }                      } else {                           theme_404_content();                      }              ?>             <?php get_sidebar('bottom'); ?>

               <?php get_sidebar('default'); ?>

               <?php get_sidebar('secondary'); ?>


Retrieve Product category 'NAME' by product category ID - WooCommerce?

Can I retrieve woocommerce product category name by ID? Not thumbnail, not the URL, not the Sub-categories, just raw Category name.


Extracting Address from Custom Post via Javascript for Google Maps API

I am created a theme with custom posts which outputs to a Google Map with place markers. Users will create a custom post users and include street addresses which will be geocoded using Google's Map API v3 and a marker is placed on a Google Map. I am relatively new to coding and designing custom Wordpress themes, so I am trying to wrap my head around how to grab information from each custom post in javascript for the Google Maps API. Can someone please explain how this is done? Thanks, AME


cubepoints/buddypress show new rank on activity?

i wanted to display on each user's profile activity stream the rank they have unlocked and which will be shown in the activity streams for example on the activity   * user1 has unlocked level 2   * user4 has unlocked level 4   * user1 has changed there avatar ![img](http://i.stack.imgur.com/bBX00.jpg)


How to create a cumulative posts and members count

I need to show my users cumulative posts and members registered count by date. It has to be displayed in an array format like this **for posts**               array(array(2011,08,02), 500)     array(array(2011,08,03), 520)     array(array(2011,08,04), 540)     array(array(2011,08,05), 560)     array(array(2011,08,06), 580)      the same case for members iam using wordpress.com stats to for statistics, i cant figure out how to do this, could anyone help me...


Is it possible to use wordpress.com with a custom domain without switching nameservers?

I want to move my blog to wordpress.com but I do run my own nameservers and I need to do it. Is it possible to use wordpress.com pointing the IPs of the hostname to it but not switching the nameservers?


How to make that all posts with a category belong also to another

I'd like to make that all my posts in the category A belong also to category B (so after that they would belong both to A and B), is there any plugin or MySQL query that could allow me to do that easily?


How do I transfer my own domain name to Wordpress

I have had a Google blogger blog for several years and I have a domain name purchased through Go Daddy. The blog itself is hosted by Google, free. So my domain name is www.Wordchipper.com It's probably a re-direct from Go Daddy so that when a user types in the above address, it gets them to me without the "blogspot.com" What I want to know is if I switch to Wordpresses's free blog service, can I use my Go Daddy registered www.Wordchipper.com or do I have to pay Wordpress for that? I don't have to pay Google now. This is a stumbling block on moving to Wordpress. Need a clear answer to this..thank you...Larry


Is there a WordPress form plugin that can easily be configured for Google Analytics goals?

I don't want to have to make use of a destination url, so ideally I would like to be able to add the onclick="_gaq.push(['_trackPageview', '/G1/whatever']);" event to the submit button on the form.


Calling a plugin from a page template in TwentyEleven

I'm desperately trying to call a pretty simple-looking plugin (this one: http://wordpress.org/extend/plugins/wp-random-posts/ ) from a TwentyEleven page template. The goal being to get the thing to display not in the sidebar, but in the middle of a single page. Thing is, I just don't have the skills... can anybody help? I imagine this is an easy one... hopefully. Thanks, Brin


Add nav menu CSS class to body

I would like to add the CSS class of the current menu item (and the classes of its parents & ancestors) to the current page body classes. For example, if the current menu item has a CSS class "products" (as defined in Appearance | Menus), then the body for the corresponding page should also have the class "products". If that makes sense to anyone, any ideas how to do it? I've looked at "How to add current, parent, and ancestor menu item IDs to body_class()?" but can't get those ideas to work in my case.