title: Redirect after password update

text: A client gave a WP page to fix some problems. Specifically, there was a front end profile page that was not updating information as it was meant to. After I started testing, it all updates, but if you update your password it leaves you logged in. What I want to happen is to log the user out, send them to the login page with a "enter new password" message. Can anyone point me in the right direction? Here is the submit:               <p class="form-submit">          <input name="updateuser" type="submit" id="updateuser" class="submit button" value=" <?php _e('Update Profile', 'profile'); ?>" />          <?php wp_nonce_field( 'update-user' ) ?>          <input name="action" type="hidden" id="action" value="update-user" />          <input type="hidden" name="updated" value="is-update" />     </p>      And here is the password update:               if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {         if ( $_POST['pass1'] == $_POST['pass2'] ) {                      wp_update_user( array( 'ID' => $current_user->ID, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );             $success[] = __('Password successfuly updated.', 'profile');             //wp_logout();             // $logInLink = wp_login_url( get_bloginfo('url') );             // wp_logout_url($logInLink);             // wp_login_form();         }         else {             $error[] = __('The passwords you entered do not match.  Your password was not updated.', 'profile');         }     }      The commented stuff is what I have tried without success.


title: Hide widgets/plugins from dashboard

text: I have two plugins in the dashboard, SEO Wordpress and Custom Content Type Manager, and for security reasons I want to hide these from dashboard. How to do that? I tried to hide the SEO Wordpress with this:               // Remove Admin Dashboard menus      function wp_admin_dashboard_remove_menus() {          global $menu;          $restricted = array(('Comments'), __('Users'), __('Updates'), __('wpseo_dashboard'));          end ($menu);          while (prev($menu)){              $value = explode(' ',$menu[key($menu)][0]);              if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){                  unset($menu[key($menu)]);              }          }      }           add_action('admin_menu', 'wp_admin_dashboard_remove_menus');      Tried many combinations like:               __('wpseo')     __('wp-seo')     __('wp_seo')      But the SEO menu did not hide.


title: Query Posts but only return 1 from a custom taxonomy?

text: I want to query my posts and only return one post from a custom taxonomy. Is this possible? Here is an example: I have a custom taxonomy called Author. I have 200 posts with various authors. I want to query and display 6 posts, but I don't want the same author ever repeated within the query. This is my query below. Thanks!               <?php $args = array('posts_per_page' => 6, 'orderby' => 'rand');                     $taximg_loop = new WP_Query( $args );                     while ( $taximg_loop->have_posts() ) : $taximg_loop->the_post();?>     <?php endwhile; ?>                 <?php wp_reset_postdata(); ?>


title: esc_url returns incorrect URL

text: What would be the reason for `<?php echo esc_url( home_url( '/' ) ); ?>` to be sending me to an incorrect website? I use it in my search bar and when I search a value it sends me to one of my other websites, but I am not sure what I did to make this happen.


title: How to let user set password on registration

text:
I´m working on a front end registration form adn have gotten as far as getting the standard registration form to work, but... I´d like to add the oportunity to let the user choose his/her own password. I´m a bit noob at this so could anyone plese help me? :) Here is my code so far:               <?php if(!is_user_logged_in()) { ?>               <?php     if(get_option('users_can_register')) {     //Check whether user registration is enabled by the administrator     ?>          <?php          if($_POST){         //We shall SQL escape all inputs         $username = $wpdb->escape($_REQUEST['username']);         if(empty($username)) {             echo "Error..

You have to fill in the username.";             exit();         }         $email = $wpdb->escape($_REQUEST['email']);         if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/", $email)) {             echo "Error..

please use a calid e-mailadress.";             exit();         }              $random_password = wp_generate_password( 12, false );         $status = wp_create_user( $username, $random_password, $email );         if ( is_wp_error($status) )             echo "Feil..

Username allready exist. please try another one.";         else {             $from = get_option('admin_email');             $headers = 'From: '.$from . "\r\n";             $subject = "Registration ok!";             $msg = "Welcome, you are now registered. Here is your username and password.\Info:\Username: $username\Password: $random_password";             wp_mail( $email, $subject, $msg, $headers );             echo "You are now registered. An e-mail is now sent to you with your username and password..";         }              exit();          }      else     {     //Embed the register form and javascript here          ?>

Fill in your info to register.
          <form id="wp_signup_form" action="" method="post">     <input type="text" name="username" style="width:250px; margin-bottom:3px;" placeholder="Username">
     <input type="text" name="email" placeholder="E-mail" style="width:250px; margin-bottom:3px;">
     <input type="submit" id="submitbtn" name="submit" value="Register" class="knapp" style="padding:8px;">     </form>          <?php     // embedded          }     ?>          <?php         }          else      ?>
     Allready registered? Login to your account with the form in the sidebar.     <?php } else { ?>     You are allready logged in...     <?php } ?>


title: wp user role,username and email id is missing on wp admin panel

text: i am facing a totally strange problem on my wordpress blog. recently i have migrate my wp blog to a new server. but on the new server everything is working fine. but my author are not able to login. then i checked the admin panel all user. there i can see lots of user/author role, username and email id is missing. I have restored wp-admin and wp-include folder i have already checked my database there is everything perfect. disable some plugins but no result. I request please check the screenshot to more clear and please help me urgent. thanks. SCREENSHOT IS HERE http://oi40.tinypic.com/257q134.jpg


title: Hourly Routine Not Firing ( wp_schedule_event() )

text: _This is a practically copy/pasted version_ of the hourly wp_schedule_event example taken from the .org site. Its not moving...and I know I have visitors to "trigger" it. Its kind of a pain to wait an hour to see if it goes or not. Can someone tell me where I'm going wrong? The only thing I can think is that I'm running it in a theme, and maybe it only works in a plugin setting? **I'm lost.**               //set up hourly fetching of symbiocards     register_activation_hook( __FILE__, 'symbiostock_chron_activation' );     add_action( 'symbiostock_twicedaily_symbiocard_update', 'update_symbiocards' );          function symbiocards_activation() {         if ( !wp_next_scheduled( 'symbiocards_hourly_event' ) ) {             wp_schedule_event( time(), 'hourly', 'symbiocards_hourly_event');         }     }     add_action('wp', 'symbiocards_activation');          function update_symbiocards() {              $update = new network_manager();         $sites  = $update->get_connected_networks();         foreach ( $sites as $site ) {             $update->fetch_symbiocard( $site[ 'address' ] );         } //$sites as $site              symbiostock_save_network_info();              update_option('symbiocards_last_update', current_time( 'mysql' ));              wp_mail( get_bloginfo( 'admin_email' ), '[symbiostock_network_update] Network Symbiocards Updated - ' . current_time( 'mysql' ), 'Network Symbiocards Updated - ' . current_time( 'mysql' ) );     }


title: Contact Form 7 Data As Attachment

text: I want data submitted through Contact Form 7 to be sent as an attachment as opposed to text / html inside the email body. Specifically I want this attachment to be in CSV format, which should be relatively straight forward to format based on the contact form 7 fields, but this depends upon whether it is possible to place this text into an attachment. Is this possible? Thank you.


title: Wordpress Translate Explaination

text: I'm dissecting Wordpress's default theme TwentyThirteen in attempts to learn more about wordpress. I ran into a function call that I simply don't understand even after reading the short codex description. I would greatly appreciate insight on why the programmers/developers decided to format the edit link in this way.               edit_post_link( __( 'Edit', 'twentythirteen' ), '', '' );


title: Pagination only won't work in author template

text:
I using custom $wp_query for most of my archive pages like, taxonomy,index,category and author page. Everything working fine, except one weird thing - the author template page pagination failed to work. The pagination stop to work on page 2 it direct to the 404 page. Pagination on other archive page, works perfectly. Here is my codes for author.php template :               <?php get_header(); ?>

          <?php $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));     ?>                      <?php toolbox_content_nav( 'nav-above' ); ?>                           <?php                    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                 $args = array(                 'showposts'=> 2,                 'paged' => $paged,                 'post_type'=> array('cpt1','cpt2'));                                  $query = new WP_Query( $args );                  ?>             <?php if ($query ->have_posts() ) : ?>
Posts from <?php echo $curauth->first_name; ?>
                   <?php while ( $query->have_posts() ) : $query->the_post(); ?>
                                       <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent    Link: <?php the_title(); ?>">                                      <?php the_title(); ?>,                                       <?php the_time('d M Y'); ?> in <?php the_category('&');?>
                      <?php endwhile; ?>                      <?php wp_pagenavi( array( 'query' => $query) );  ?>                  <?php else : ?>

<?php _e( 'Nothing Found', 'toolbox' ); ?>

<?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'toolbox' ); ?>
                         <?php get_search_form(); ?>

                  <?php endif; ?>

               <?php get_sidebar(); ?>          <?php get_footer(); ?>      I am using wp_pagenavi plugin for the pagination anyway. Apparently the wp_pagenavi knows there are pages (because it show more than 1 page at the pagination link), but when i goto page two, turns out no post was found (404 page). I've googled this issue and applied all the suggestion that I searched, still no help. What is the problem?


title: Removing the "Website" Field from Comments and Replies?

text: In an effort to combat comment spam, I'd like to hide or remove the _"Website"_ field from the _"Leave a Reply"_ section for page and site comments. I have no desire to increase others page rankings by having them embed their URLs in my sites comments, which seems to be what 99% of the comments on my site are wanting to do. I'm using the Twenty Ten theme if that makes any difference in the answer. Thanks!


title: How to know which archive page is active

text: I have two custom post type name as 'product' and 'blog'. And I have also two archive page 'archive-product.php' and 'archive-blog.php'. Now, I want to know which archive page is active. Example: We know `is_page('contact')` if page is contact then it return true. But what about archive pages. I've used `is_archive('blog')`, but this function always returns true on both product archive or blog archive active. So is there any way to know is this archive page 'product' or 'blog' is active


title: Confused on loading page content

text:
I'm building my first full site into WP and I am rather confused on the process involved to load the content you enter via the WP Pages editor into the actual page. For example, I am having a static home page and I have this in `index.php` of my theme file.               // Output header     get_header('home');          // Start Code that wraps the content          /***** Content of the page ******/          // End Code that wraps the content          get_sidebar();          get_footer();      Now the "Content of the page" should be the code/content that the user has control over via the WP Admin Pages menu. How do I get this into the page? I have read you need to do something like this..               if (have_posts()) {              /* Start the Loop */              while (have_posts()) {             the_post();             get_template_part('content');         }          }      But I'm confused as this uses another content page yet again (content.php). Why do I need to create another content page when all I need is the code/data from the pages content area? I don't need to add any more coding myself. I played around with it a bit and if I call it this way and make a `content.php` file and just put `<?php the_content(); ?>` inside of it, the content shows. Still confused on the purpose of doing it this way. I'm assuming so that you can use the index file for many things and then put specific code differences inside the content file!? To help you understand my question even more, I have included the exact code from my `index.php` file below and I'm wondering how I would split this up between `index.php` and `content.php`?               <?php          // Output header     get_header('home');          ?>

We Navigate the

Maze for You

                             We provide a start-to-finish service in an area
                             that can often be complex and confusing.

                             Read more about
registering a trademark

<a href="<?php echo get_permalink(10); ?>">Free Trademark Search

                             <a href="<?php echo get_permalink(10); ?>">Get Started Now!

                               <?php                          if (have_posts()) {                              /* Start the Loop */                              while (have_posts()) {                             the_post();                             get_template_part( 'content', get_post_format() );                         }                          }           ?>
                                   <?php get_sidebar(); ?>

          <?php          // Ouput footer     get_footer();          ?>      Thanks very much!


title: Audio Playlist : How to bind events for "track change", "track end"?

text: I'm customizing native Wordpress playlist               echo do_shortcode('[playlist ids="3267,3266,821"]');      I'd like to bind events to detect "track change" and "track end" and do something when those events fired. So, I checked wp-playlist.js. I see some events but I have no idea how to bind it on a separate js file (jquery)               events : {             'click .wp-playlist-item' : 'clickTrack',             'click .wp-playlist-next' : 'next',             'click .wp-playlist-prev' : 'prev'         },              clickTrack : function (e) {             e.preventDefault();                  this.index = this.$( '.wp-playlist-item' ).index( e.currentTarget );             this.setCurrent();         },              ended : function () {             if ( this.index + 1 < this.tracks.length ) {                 this.next();             } else {                 this.index = 0;                 this.current = this.tracks.at( this.index );                 this.loadCurrent();             }         },              next : function () {             this.index = this.index + 1 >= this.tracks.length ? 0 : this.index + 1;             this.setCurrent();         },              prev : function () {             this.index = this.index - 1 < 0 ? this.tracks.length - 1 : this.index - 1;             this.setCurrent();         },      Is it possible to bind those events?


title: Call another page in forms

text: I am doing some practice for WordPress plugin. In plugin I am working on a form and what I need is to call another page on submission. I have tried that but nothing seems to work.               <form method = "Post" action = "some_file.php">          </form>


title: Alternative to Back End Dashboard?

text: For the past few years the WP third party development community has trended to creating custom Front End forms for Users. This has been the "solution" to keeping unsophisticated users out of the "complicated WP Admin dashboard". The other "solution" is to dumb down the WP Admin dashboard so that developers only allow their users to see what they can more reasonably handle when it comes to posting inside the WP Admin environment. But both of these "solutions" are partial fixes necessitated by the Admin-in- a-box restrictions of WordPress architecture. **What I have not seen is a single Front End template or plugin for "Front End page editing", even from WP core contributors like Mark Jaquith, that INCLUDES the Plugins Dashboard Menus of installed plugins.** All Front Ends I have seen eliminate the Plugins themselves that I would install to give extra post options and goodies. For instance, a plugin that gives post Authors the ability to create, name, and add individual calendars to each post uniquely. In the WP Core WP Admin dashboard you see the plugin name in the Dashboard view and you see the Settings and Options in sub-menus if you are a registered user with the Author role. The plugin itself confers special permissions to Authors to make individual saved settings just for themselves. But such plugins are not viewable or usable in Front End "solutions" or in the custom User template applied by, say, a Real Estate theme. All Front End Editing projects I have seen go no farther than tapping the "design" elements of a post. None of them take the next step of displaying installed plugins that can add other elements to that post and a facsimile of the Settings and Options that can be saved. Does anyone here know of a project now underway that will add a "dashboard" view of installed plugins to a Front End template for post creation and modifications? **I have Googled incessantly for the last 2 years and no where do I hear of someone working on extending the full functionality of the WordPress back end... including the exposure of the installed plugins dashboard menus and sub-menus so that settings and options associated with that plugin can be utilized and changed in a Front End editor?**


title: Filter Wordpress post Dynamically on dropdown selection?

text: Want to filter Wordpress post Dynamically on dropdown selection? But am not able to find out any solution how it can be done.Any help appreciated. Thanks ![Filter looks like this](http://i.stack.imgur.com/tEMcT.png) On Clicking On Latest to Old the post should display in ASC and vice versa in oldest to new. I Have create a form on dropdown. How i can perform this via ajax.


title: How to get posts by content?

text:
I found the following codes to get post details. However, it is not possible to **get the posts by content**. Does any one has any ideas? **get_posts()**               //// get post ////     $args = array(         'numberposts'     => -1, // number of posts to display; display all: -1.         'offset'          => 0,         // 'category'        => , // post category ID         'orderby'         => 'post_date',         'order'           => 'DESC', // Latest post first: 'ASC'; Olderest post first: 'DESC'         // 'include'         => ,         // 'exclude'         => ,         // 'meta_key'        => ,         // 'meta_value'      => ,         'post_type'       => 'post', // get post type         // 'post_mime_type'  => ,         // 'post_parent'     => ,         // 'post_status'     => 'publish'     );          // http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters     $posts_array = get_posts( $args );     foreach( $posts_array as $post ) : setup_postdata($post);         echo "
" . the_title() .              "" .              $post->blog_ID .               $post->post_date .               $post->post_title .               $post->pubtimes .               $post->post_author .               $post->post_content .               $post->post_excerpt .               $post->post_status;             "
";     endforeach;


title: Global site feed plugin/function for custom post type?

text: Is there a well-coded plugin or function that will enable me to create a global feed for only one post type in a multisite setup?


title: how can i embed wordpress backend in iframe

text: I have 2 websites http://www.aaa.com and http://www.bbb.com and need it show the same. now i put iframe in index.html and upload to aaa.com. it's ok for frontend but it's doesn't work for backend, it's show blank page. anyone can suggest me how can i do with this problem ? thank you very much :D


title: Editing Complex Pages in Visual Mode

text: This might be a stupid question, and maybe I've missed some best practices thing, but I've been having this problem with clients using sites on WordPress. Let's say we have a fairly complex page that requires some good amount of HTML code inside the page itself. We put it up and it looks great. Now, month later client wants to edit couple words there, goes in and edits them in Visual Mode, and of course all markup that we did is now screwed up, so stuff is all over the place. What are the approaches we can use to handle cases like that?


title: Unable to use get_page_by_title() more than once per page?

text: On one of my page templates I need to include the contents of several other pages. For example, if my page template is called Fruit, I need to pull in page content from pages named Apple, Pear, Orange, Lime, etc. This gives my user the ability to edit Apple and Lime individually from admin area.   I'm trying to use **get_page_by_title()** to pull in these sub pages, but that function only seems to want to work once per page. The first time I call               get_page_by_title('Apple')      works perfectly. When I later call               get_page_by_title('Lime')      it displays Apple again. Is this function limited to once per page, or am I doing something else wrong? **Edit:** It seems that no matter what title I pass to get_page_by_title() it will always get the content of the current page. So if I'm on **example.com/fruit** and call               get_page_by_title('Apples')      with in the page, it will always display the content from Fruit. Not Apples.


title: WP-Minify 400 errors and open_basedir restriction in effect

text: i've been having a world of difficulty w/ the WP-minify plugin. usually i get 400/bad request errors when i try to access the combined/minified script or style files. this tends to break the entire look of my site. but on my last site i came across a new error... when i try to view the combined script i see the following warning/errors followed by a bunch of gibberish. anybody know what the heck this is about? `   **Warning** : is_file() [function.is-file]: open_basedir restriction in effect. File(/home/kathyi/public_html/wp-content/plugins/wp- minify/cache//minify_2fac368eb244a71e24b5c8bb929e8107.gz) is not within the allowed path(s): (/var/www/vhosts/soulmatesummit.net/httpdocs:/tmp) in **/var/www/vhosts/soulmatesummit.net/httpdocs/online-course/wp- content/plugins/wp-minify/min/lib/Minify/Cache/File.php** on line **71**      **Warning** : is_file() [function.is-file]: open_basedir restriction in effect. File(/home/kathyi/public_html/wp-content/plugins/wp- minify/cache//minify_2fac368eb244a71e24b5c8bb929e8107) is not within the allowed path(s): (/var/www/vhosts/soulmatesummit.net/httpdocs:/tmp) in **/var/www/vhosts/soulmatesummit.net/httpdocs/online-course/wp- content/plugins/wp-minify/min/lib/Minify/Cache/File.php** on line **33**      **Warning** : is_file() [function.is-file]: open_basedir restriction in effect. File(/home/kathyi/public_html/wp-content/plugins/wp- minify/cache//minify_2fac368eb244a71e24b5c8bb929e8107.gz) is not within the allowed path(s): (/var/www/vhosts/mysite.net/httpdocs:/tmp) in **/var/www/vhosts/mysite.net/httpdocs/online-course/wp-content/plugins/wp- minify/min/lib/Minify/Cache/File.php** on line **33**      **Warning** : Cannot modify header information - headers already sent by (output started at /var/www/vhosts/mysite.net/httpdocs/online-course/wp- content/plugins/wp-minify/min/lib/Minify/Cache/File.php:71) in **/var/www/vhosts/soulmatesummit.net/httpdocs/online-course/wp- content/plugins/wp-minify/min/lib/Minify.php** on line **312**      `


title: Why WordPress developer still using timthumb and what are advantages using them?

text: > **Possible Duplicate:**   >  What is your take: TimThumb vs. WordPress Thumbnails? The great debate Can you explain to me why timthumb is much better than WP image resizer inside wp core function? Any other image manipulation script? thanks


title: Pagination Not Working (pages duplicating content)

text:
My pagination pages echo out the same content on every page. Page one is queried to show two posts, which it shows up correctly. Page two shows the exact same two posts as page one does. Here is my code: (functions.php) (this is a pre-made code I found on the web).               function wp_corenavi() {       global $wp_query, $wp_rewrite;       $pages = '';       $max = $wp_query->max_num_pages;       if (!$current = get_query_var('paged')) $current = 1;       $a['base'] = str_replace(999999999, '%#%', get_pagenum_link(999999999));       $a['total'] = $max;       $a['current'] = $current;            $total = 1; //1 - display the text "Page N of N", 0 - not display       $a['mid_size'] = 5; //how many links to show on the left and right of the current       $a['end_size'] = 1; //how many links to show in the beginning and end       $a['prev_text'] = '« Previous'; //text of the "Previous page" link       $a['next_text'] = 'Next »'; //text of the "Next page" link            if ($max > 1) echo '
';       if ($total == 1 && $max > 1) $pages = 'Page ' . $current . ' of ' . $max . ''."\r\n";       echo $pages . paginate_links($a);       if ($max > 1) echo '
';     }      (Custom Page Template)               <?php          get_header();           if ( have_posts() ) : ?>

                          <?php query_posts( 'category_name=category&showposts=2'); ?>                     <?php while ( have_posts() ) : the_post(); ?>

                                           <?php the_post_thumbnail('thumbnail'); ?>

<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>

                                             <?php echo content(15, __('(Read More)')); /* twentyten_posted_on(); */ ?>

                          <?php endwhile; // end of the loop. ?>
                     <?php if (function_exists('wp_corenavi')) wp_corenavi(); ?>

     <?php endif; ?>


title: Loading custom jQuery and HTML in a WordPress page

text: I have a simple application I have worked on and would like to load it into my WordPress theme. This app has a `/js` folder with `myscript.js`, a `/css` folder with `mystyle.css` and an HTML file `index.html`. Here is the fiddle to the whole app. I am using the default WordPress theme and all I want to do is create a page for this app and load it there. This way I can create another page and load another app. Efforts made: From what I have read I need to enqueue my custom JS script which I have done like this and added to `functions.php` file:               /**      * A small function to load my custom JScript file for WordCount      */     function my_script() {         if ( is_page(23) ) {             wp_enqueue_script(                 'my-script',                 get_template_directory_uri() . '/js/my-script.js',                 array('jquery')             );         }     }     add_action( 'wp_enqueue_scripts', 'my_script', 1 );      My only challenge is: where would my `index.html` code go to?


title: Custom Page Templates

text: I am trying to find the feature to add a page template. I am adding an archive but when I go into pages->Add New-> I get no option in the sidebar to use the existing archives.php file I want to use. Can anyone help me out?


title: Display post from specific category

text:
I'm trying to display posts from specific categories. And I believe I have the correct code:               <?php if ( in_category('11') ) { ?>

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

                    <?php the_content(); ?>

     <?php } ?>      I know there are posts in that category, because if I use the querystring `?cat=11` I can see them. Only not here. Nothing is showing. What am I doing wrong? Edit: As requested, I'm posting the results from `<?php print_r( $GLOBALS['post'] ); ?>`               WP_Post Object ( [ID] => 10 [post_author] => 1 [post_date] => 2013-03-08 12:46:36 [post_date_gmt] => 2013-03-08 12:46:36 [post_content] => This is the content from my static frontpage.php [post_title] => Forside [post_excerpt] => [post_status] => publish [comment_status] => open [ping_status] => open [post_password] => [post_name] => forside [to_ping] => [pinged] => [post_modified] => 2013-03-12 07:30:56 [post_modified_gmt] => 2013-03-12 07:30:56 [post_content_filtered] => [post_parent] => 0 [guid] => http://vsandbox.net/wordpress/?page_id=10 [menu_order] => 0 [post_type] => page [post_mime_type] => [comment_count] => 0 [filter] => raw )      On a sidenote, I noticed in a different thread that someone had problems with this when not using it in single.php. I'm not even sure what that means. I mean, each layout of the webdesign has to be put in it's own page template php-file right? Edit2: Here is the full code of the frontpage.php file:               <?php     /*     Template Name: Forside     */     ?>     <?php get_header(); ?>

                                                       <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>             <?php print_r( $GLOBALS['post'] ); ?>
                             <?php the_content(); ?>

Innlemmet 2011
                             <?php if ( in_category('11') ) { ?>                     test
                                         <?php the_content(); ?>
                 <?php } ?>
Innlemmet 2012
                             <?php if ( in_category('12') ) { ?>

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

                                         <?php the_content(); ?>

                 <?php } ?>
Innlemmet 2013
                             <?php if ( in_category('12') ) { ?>

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

                                         <?php the_content(); ?>

                 <?php } ?>                                                               <?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
                             <?php endif; ?>

           <?php get_footer(); ?>


title: Select options not reloading after form submit

text: I have two forms. One for adding, one for deleting option values. Deleting and adding works, but I have to manualy reload page to see changes in select part. How to make theme apper after submit?                   <form method="post" action="">           <input type="text" name="add" class="foo-add" />           <input type="submit" value="Add" />         </form>              <form method="post" action="" name="foo-delete">             <select multiple="multiple" name="foo-values">             <?php             $foo_values = unserialize( get_option( 'foo_values' ));             $foo_values_keys = array_keys($foo_values);             $i = 0;             foreach($foo_values as $foo): ?>               <option value="foo_<?php echo $foo_values_keys[$i]; ?>"><?php echo $foo[0]; ?></option>               <?php $i++; ?>             <?php endforeach; ?>             </select>             <input type="submit" value="Delete" />         </form>                 </div>         <?php              if($_POST) {             if(isset($_POST['foo-values'])) {               preg_match('/\d/', $_POST['foo-values'], $foo_id);               unset($foo_values[$foo_id[0]]);               update_option( 'foo_values', serialize($foo_values));             } else {               array_push($foo_values, $_POST['foo-add']);               update_option( 'foo_values', serialize($foo_values));             }           }         ?>


title: Order query by post meta value

text: //Displaying latest post per author on front page       function filter_where($where = '') {         global $wpdb;         $where .= " AND vipwp_posts.id = (select id from {$wpdb->prefix}posts p2 where p2.post_status = 'publish' and p2.post_author = {$wpdb->prefix}posts.post_author order by p2.post_date desc limit 0,1)";         return $where;       }       add_filter('posts_where', 'filter_where');       I would like to modify the code above: Is it possible change the order of the record from date by meta_value? Example: CHANGE               order by p2.post_date      TO               meta_key='name_key' ORDER BY meta_value      * * * Thanks, but if I remove post_where do not Displaying latest post per author


title: Category List and Automatic jQuery classes

text:
Objective and layout:   1. I have two separate divs (this is in a Custom Page template). DIV1 has a listing subcategories of a specified parent category.   2. Clicking on any of the listed subcats brings up a list of posts in that category in DIV2. Just the titles with links to the posts. It's working now, but it's half manual. **Code in 1st DIV:**               <?php $products = get_categories('child_of=1143&hide_empty=1');       foreach ( $products as $product ) {       echo '
cat_ID .'>'.$product->cat_name.'
';       } ?>      **Code in 2nd DIV:**
     <?php $my_query = new WP_Query('category_name=lightbulbs&showposts=25&post_type=product&orderby=title&order=asc');     while ($my_query->have_posts()) : $my_query->the_post();     $do_not_duplicate = $post->ID;?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php endwhile; ?>

     <?php $my_query = new WP_Query('category_name=refrigerators&showposts=25&post_type=product&orderby=title&order=asc');     while ($my_query->have_posts()) : $my_query->the_post();     $do_not_duplicate = $post->ID;?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

           Script that makes it all work:   * http://code.jquery.com/jquery-latest.js in the header   * Plus this:                                    **I wanted to see if there's a way to automate the second part.** When I add a new subcategory, it gets listed in DIV1 automatically, but to show the posts in that category in DIV2, I have to manually a) add the div with the new list, and b) classes to the script.


title: why the current date do not update

text: I'm using the following query to update fields in my table if token is matching, but the current date is not getting inserted               $this->wpdb->update(                   'wp_competitors',                   array(                       'results' => $tips,  // json                       'update_time' => ' CURDATE()' //                   ),                   array( 'token' => $token ),                   array(                       '%s',   // value1                       '%d'    // value2                   ),                   array( '%d' )               );        than I was trying to use php's date('Y-m-d H:i:s') but no results


title: Featured Image metabox (postimagediv) doesn't appears when it should

text: I'm using a plugin called Co-Authors Plus for managing guest authors in my website. However, when creating a new guest author, the Featured Image metabox (postimagediv) doesn't appears. I'm almost sure that it's not a problem with this specific plugin, as I've tried it in other Wordpress installation and the metabox did appear. I've already checked the Screen Options and it's not there. Also, when adding a normal post the Featured Image metabox do appear. This is a screenshot from the non-working installation: ![Doesn't works](http://i.stack.imgur.com/5MIfl.jpg) And this is a screenshot from the working installation: ![Here it works](http://i.stack.imgur.com/3qQ4n.jpg) Do you know what can be keeping this metabox from appearing? Maybe file permissions?


title: add_action failed to display function by a plugin

text: I am using a plugin which has the following function: See end of question. And I've created a hook in my template file:               <?php custom_hook(); ?>      And this is what I have in my functions.php               function custom_hook() {         do_action('custom_hook');         echo 'Custom Hook works!';     }          add_action('custom_hook', 'wnw_overall_rating_comments', 1);      I am curious, as why this isn't loaded. I have even edit the add_action to the plugin to see if my filter works,               add_action('custom_hook','wnw_overall_rating_comments');      But no luck. Am I missing something here?               add_action('the_content','wnw_overall_rating_comments');     function wnw_overall_rating_comments($content)     {         global $post,$rating_table_name,$wnw_multi_rating_table,$multi_rating_image_on,$multi_rating_image_off,$multi_rating_image_half,$wpdb;              if($post->type != 'page')         {             //some function                  }             return $content.$rating_value;         }else             return $content;              }


title: blog post displaying within older post - loop issue?

text:
I've got an interesting issue with my blog page- Currently, I have two test posts- "Test Blog Post" and "Test Blog Post Deux." Test Blog Post displayed as it should, however when I added the second post(Test Blog Post Deux), the post content seemed to have overwritten the older content. You can see this in the post- the first paragraph begins with "This is another test blog post. Here’s some more ipsum.." and the second "This is a test blog post. Here’s some ipsum." without any post title, date, etc. in between. Any ideas what's going on/how to fix? Here's my code:

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

posted by ZOPA on <?php the_time('m/d/Y \a\t g:i A') ?> | <?php the_tags('tags: ',' , ','
'); ?>

                  <?php if (have_posts()) : ?>               <?php while (have_posts()) : the_post(); ?>                   <?php the_content('Read the rest of this entry »'); ?>               <?php endwhile; ?>               <?php else : ?>               //Something that happens when a post isn’t found.               <?php endif; ?>


title: Is there any plugin to publish exam result?

text: I am developing a WordPress site for a school. I need to add a result publishing module on it, so that the students can get their annual exam result through the website by entering their registration number. Is there any plugin available for this?


title: How to set post status to draft when theme membership expires

text: First post here and I'm not really a coder but have some understanding - I need to do the following in a directory theme that has a custom membership package as part of the theme. Its Atlas theme. The developer understandably does not support theme customizations, so hope someone can help. The theme has membership packages for users that enable users to post listings. When the user membership expires, the listings posts do not expire or change status. There is no link between packages and post status. The user does lose the ability to edit or publish posts when the membership expires but the post will still be visible. What I would like to do is this   1. Change post status to draft when the user membership expires Looking at the theme files there is a cronjob that runs to check when the membership is due to expire               <?php                    /*             Expiring Memberships                 */         add_action("tdp_cron_expire_memberships", "tdp_cron_expire_memberships");                function tdp_cron_expire_memberships()         {             global $wpdb;                  //make sure we only run once a day             $today = date("Y-m-d");                  //look for memberships that expired before today             $sqlQuery = "SELECT mu.user_id, mu.membership_id, mu.startdate, mu.enddate FROM $wpdb->tdp_memberships_users mu WHERE mu.status = 'active' AND mu.enddate IS NOT NULL AND mu.enddate <> '' AND mu.enddate <> '0000-00-00 00:00:00' AND DATE(mu.enddate) <= '" . $today . "' ORDER BY mu.enddate";                  $expired = $wpdb->get_results($sqlQuery);                  foreach($expired as $e)             {                                        //remove their membership                 tdp_changeMembershipLevel(false, $e->user_id);                      $send_email = apply_filters("tdp_send_expiration_email", true, $e->user_id);                 if($send_email)                 {                     //send an email                     $tdpemail = new TDpEmail();                     $euser = get_userdata($e->user_id);                          $tdpemail->sendMembershipExpiredEmail($euser);                          printf(__("Membership expired email sent to %s. ", "tdp"), $euser->user_email);                              }             }         }              /*             Expiration Warning Emails         */         add_action("tdp_cron_expiration_warnings", "tdp_cron_expiration_warnings");         function tdp_cron_expiration_warnings()         {                global $wpdb;                  //make sure we only run once a day             $today = date("Y-m-d 00:00:00");                  $tdp_email_days_before_expiration = apply_filters("tdp_email_days_before_expiration", 7);                  //look for memberships that are going to expire within one week (but we haven't emailed them within a week)             $sqlQuery = "SELECT mu.user_id, mu.membership_id, mu.startdate, mu.enddate FROM $wpdb->tdp_memberships_users mu LEFT JOIN $wpdb->usermeta um ON um.user_id = mu.user_id AND um.meta_key = 'tdp_expiration_notice' WHERE mu.status = 'active' AND mu.enddate IS NOT NULL AND mu.enddate <> '' AND mu.enddate <> '0000-00-00 00:00:00' AND DATE_SUB(mu.enddate, INTERVAL " . $tdp_email_days_before_expiration . " Day) <= '" . $today . "' AND (um.meta_value IS NULL OR DATE_ADD(um.meta_value, INTERVAL " . $tdp_email_days_before_expiration . " Day) <= '" . $today . "') ORDER BY mu.enddate";                  $expiring_soon = $wpdb->get_results($sqlQuery);                  foreach($expiring_soon as $e)             {                                $send_email = apply_filters("tdp_send_expiration_warning_email", true, $e->user_id);                 if($send_email)                 {                     //send an email                     $tdpemail = new TDpEmail();                     $euser = get_userdata($e->user_id);                          $tdpemail->sendMembershipExpiringEmail($euser);                          printf(__("Membership expiring email sent to %s. ", "tdp"), $euser->user_email);                 }                      //update user meta so we don't email them again                 update_user_meta($euser->ID, "tdp_expiration_notice", $today);             }         }      From the themes forums, these function will check a users membership id               //Find membership level of the author of this post -JKB     function author_membership_level($this_post_id) {         global $wpdb;         global $post_author_membership;              $post_author_info = "SELECT mu.membership_id, mu.status         FROM $wpdb->tdp_memberships_users mu          LEFT JOIN $wpdb->posts po ON mu.user_id = po.post_author          WHERE mu.status = 'active' AND po.ID = " . $this_post_id;              $post_author_membership = $wpdb->get_results($post_author_info);      Can anyone suggest what I would need to create do to check membership expiry date and then set all posts assigned to a membership to draft status when it expires Is it possible to just add an extra part to cron? I did come across this for gravity forms, sorry I am not sure how to combine the 2 parts of the code and its a slightly different scenario Change post status based on user role


title: wp_insert_term does not insert description.

text: I'm using this code. I cannot figure out what the heck is wrong with it?               $args = array(           'description',"My Desc",         'slug' => "My Slug",         'parent' => 0        );       $result = wp_insert_term("Term1", "category", $args);      The result is that term is added, term_taxonomy is added. Slug is added. But the darn description is skipped.               wp_terms:          term_id name            slug            term_group     1       Uncategorized   uncategorized   0     2       Blogroll        blogroll        0     3       Term1           my-slug         0          wp_term_taxonomy:          TT_id  T_id tax        description  parent  count     1      1    category                0           0     2      2    link_category           0           0     3      3    category                0           0


title: Create a Category with a front-end post

text:
I'm creating a buddypress site in which a single post will create the trunk of a related series of articles. From that trunk article, related branches of posts will stem outwards. Anyone signed up on the site can create an initial trunk article. Anyone can also respond to the trunk article. What I need to do is keep all hierarchical posts that stem from the trunk article in the same category. So when a user creates the trunk post, in the front-end post form they add a post title, and content, and at the same time I'd like the category automatically created. The title of the category would be the same as the post title. Then for any hierarchal posts stemming from this trunk article, the category will already be applied to them as well. Here is my front-end post form:               <?php     if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) &&  $_POST['action'] == "new_post") {              // Do some minor form validation to make sure there is content         if (isset ($_POST['title'])) {             $title =  $_POST['title'];         } else {             echo 'Please enter the Title';         }         if (isset ($_POST['description'])) {             $description = $_POST['description'];         } else {             echo 'Please enter some text';         }              $tags = $_POST['post_tags'];              // ADD THE FORM INPUT TO $new_post ARRAY         $new_post = array(         'post_title'    =>  $title,         'post_content'  =>  $description,         'post_category' =>  array(5),//array($_POST['cat']),   Usable for custom taxonomies too         'tags_input'    =>  array($tags),         'post_status'   =>  'publish',           // Choose: publish, preview, future, draft, etc.         'post_type' =>  'post',  //'post',page' or use a custom post type if you want to              );              //SAVE THE POST         $pid = wp_insert_post($new_post);                       //KEEPS OUR COMMA SEPARATED TAGS AS INDIVIDUAL         wp_set_post_tags($pid, $_POST['post_tags']);              //REDIRECT TO THE NEW POST ON SAVE         $link = get_permalink( $pid );         wp_redirect( $link );                   //INSERT OUR MEDIA ATTACHMENTS         if ($_FILES) {             foreach ($_FILES as $file => $array) {             $newupload = insert_attachment($file,$pid);             // $newupload returns the attachment id of the file that             // was just uploaded. Do whatever you want with that now.             }              } // END THE IF STATEMENT FOR FILES          } // END THE IF STATEMENT THAT STARTED THE WHOLE FORM          //POST THE POST YO     do_action('wp_insert_post', 'wp_insert_post');          ?>          <?php get_header(); ?>

          <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>                          <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                         <?php if ( is_front_page() ) { ?>
<?php the_title(); ?>
                         <?php } else { ?>
<?php the_title(); ?>
                         <?php } ?>
                             <?php the_content(); ?>
             <form id="new_post" name="new_post" method="post" action="" class="form-stacked storyForm" enctype="multipart/form-data">                                              <legend>* = indicates a required field</legend>                 <fieldset name="name">                     * Story Title:                     <input type="text" style="width:100%" id="title" value="" tabindex="5" name="title" rel="popover" data-content="Name your story." data-original-title="Story Title"/>                 </fieldset>                                                                                <fieldset class="tags">                     Additional Keywords (comma separated):                     <input type="text" style="width:100%" value="" tabindex="35" name="post_tags" id="post_tags" rel="popover" data-content="This will just help others find your story in searches." data-original-title="Additional Keywords" />                 </fieldset>                                                                    <fieldset class="content">                     Write your story here:                     <textarea id="description" tabindex="15" name="description" cols="80" rows="10" rel="popover" data-content="Write as much as you want. Let others finish it." data-original-title="Main Content"></textarea>                 </fieldset>
                      <fieldset class="submit">                     <input class="btn btn-primary pull-right" type="submit" value="Submit" tabindex="40" id="submit" name="submit" />                 </fieldset>                      <input type="hidden" name="action" value="new_post" />                 <?php wp_nonce_field( 'new-post' ); ?>                             </form>       Right now I have "`'post_category' => array(5)`" but it needs to dynamically create a new post category.


title: Permalink for pages

text: As you know we can change the post permalink as we want               /%postname%.htm -->/mypostname.htm      Can we do the same for the pages also?               /%pagename%.htm -->/mypagename.htm      permalink for the pages is %pagename% whe we use the custom permalink for the post.


title: Temporally disable password to login with empty password?

text: Does someone knows what part of wordpress code would I have to modify to be able to just enter into the admin panel without having to login? I need to work on a site but I wont have admin access until a few day (when my friend comes back from vacations), but I do have FTP access (only FTP, no cpanel or any other type of panel to get into the db and change the pwd) and have his permissions to do whatever I need to login. I checked wp-login.php file but couldn't find what to modify to allow me to login. Does someone knows what file shoul


title: How to add a Wordpress page with multiple picture links?

text: I'm new to WordPress.org and currently I'm making a food recipe website. What I want to do is to create a menu with different categories, eg Pork, Seafood, beef etc and when I clicked into each categories, it links to a page with a whole page of different images with the food names under each image, and when you click an image, you get directed to the page containing that food recipe. I'm just wondering how can I add multiple images links with food name under them in a single page?


title: Register an additional image size for only some images in my media library

text: There is a type of post on my blog which requires one extremely large image (such that it can be zoomed). I don't want to register a new image size, because I only need a certain small subset of images to have this large image size. I have managed to generate this additional large image and it sits alongside the other three "generated" images in the uploads directory, however since it is not registered with the Media Library, it does not get uploaded to the image CDN with W3 Total Cache. Can anyone suggest a better approach to my problem? Or suggest how I might register that large image with the media library (without it automatically creating the other image sizes which would not be needed). Or is there perhaps a way to register an additional image size for only some images in my media library?


title: Wordpress tax_input only if logged in

text: I am working on a wordpress plugin where a save lead data by forms in my website. When a user submits the form the following code will run so a post in post type "lead" will be added. Almost everything works fine except the tax_input. When I am logged in in Wordpress and submit the form in my website, the lead status "open" will be set. But when I am not logged in in Wordpress admin and submit the form (a visitor of website is never logged in off course) there is no lead status "open" set. Does anyone know what I am doing wrong?                   // Get the id of taxonomy "lead-status" by slug         $term = get_term_by('slug', 'open', 'lead-status' );         $term_id = $term->term_id;                $new_lead = array(             'post_title' => $lead_name,             'post_content' => $lead_message,             'post_type' => 'leads',             'post_status' => 'publish',             'tax_input' => array('lead-status' => $term_id)         );              $lid = wp_insert_post($new_lead);


title: Back up post tags

text: What is the best way to back up tags on posts? I want to delete all existing tags on all post types, but want to be able to restore them if something goes wrong..


title: How to modify the Register link in the login page?

text: This is probably very simple, but I would like to add a hook to my theme's `functions.php` file in order to change the `Register` link on the login page (`wp-login.php`). How would I do that?


title: Does WordPress work without a theme?

text: Does WordPress work without a theme? If so, then how does it work? Please explain in brief. If WordPress is displaying content without a theme, what controls the output?


title: Related post without plugin for custom post types

text:
I need some help modifying this script. I am trying to also show related posts by custom taxonomies and custom post types.               //* Define custom image size for featured image in Related Posts     add_image_size( 'related', 300, 0, true );               add_action( 'genesis_after_entry_content', 'child_related_posts' );     /**      * Outputs related posts with thumbnail      *      * @author Nick the Geek      * @url http://designsbynickthegeek.com/tutorials/related-posts-genesis      * @global object $post      */     function child_related_posts() {              if ( is_singular ( ) ) {                  global $post;                  $count = 0;             $postIDs = array( $post->ID );             $related = '';             $tags = wp_get_post_tags( $post->ID );             $cats = wp_get_post_categories( $post->ID );                  if ( $tags ) {                      foreach ( $tags as $tag ) {                          $tagID[] = $tag->term_id;                      }                      $args = array(                     'tag__in'               => $tagID,                     'post__not_in'          => $postIDs,                     'showposts'             => 8,                     'ignore_sticky_posts'   => 1,                     'tax_query'             => array(                         array(                                             'taxonomy'  => 'post_format',                                             'field'     => 'slug',                                             'terms'     => array(                                                 'post-format-link',                                                 'post-format-status',                                                 'post-format-aside',                                                 'post-format-quote'                                                 ),                                             'operator'  => 'NOT IN'                         )                     )                 );                      $tag_query = new WP_Query( $args );                      if ( $tag_query->have_posts() ) {                          while ( $tag_query->have_posts() ) {                              $tag_query->the_post();                              // $img = genesis_get_image() ? genesis_get_image( array( 'size' => 'related' ) ) : '';                         $img = genesis_get_image( array( 'size' => 'related' ) );                              $related .= '
' . $img . get_the_title() . '
';                              $postIDs[] = $post->ID;                              $count++;                     }                 }             }                  if ( $count <= 7 ) {                      $catIDs = array( );                      foreach ( $cats as $cat ) {                          if ( 6 == $cat )                         continue;                     $catIDs[] = $cat;                      }                      $showposts = 8 - $count;                      $args = array(                     'category__in'          => $catIDs,                     'post__not_in'          => $postIDs,                     'showposts'             => $showposts,                     'ignore_sticky_posts'   => 1,                     'orderby'               => 'rand',                     'tax_query'             => array(                                         array(                                             'taxonomy'  => 'post_format',                                             'field'     => 'slug',                                             'terms'     => array(                                                 'post-format-link',                                                 'post-format-status',                                                 'post-format-aside',                                                 'post-format-quote' ),                                             'operator' => 'NOT IN'                                         )                     )                 );                      $cat_query = new WP_Query( $args );                      if ( $cat_query->have_posts() ) {                          while ( $cat_query->have_posts() ) {                              $cat_query->the_post();                              // $img = genesis_get_image() ? genesis_get_image( array( 'size' => 'related' ) ) : '';                         $img = genesis_get_image( array( 'size' => 'related' ) );                              $related .= '
' . $img . get_the_title() . '
';                     }                 }             }                  if ( $related ) {                      printf( '

Related Posts

%s

', $related );                  }                  wp_reset_query();              }     }          //* Enqueue and initialize jQuery Masonry script     add_action( 'wp_enqueue_scripts', 'sk_masonry_script' );     function sk_masonry_script() {              if ( is_singular( 'post' ) ) {                  wp_enqueue_script( 'masonry-init', get_stylesheet_directory_uri().'/js/masonry-init.js', array( 'jquery-masonry' ), '1.0', true );              }          }      Here are the post types that I have: 1: post (tags, categories) 2: custom_post_type: (4 custom taxonomies) 3: custom_post_type: (2 custom taxonomies) 4: custom_post_type: (1 custom taxonomies) I was able to make some adjustments by just looking at the code and was able to get custom post types related posts to show up. However, i am sure that there is someone better than I am out there who can make this work.


title: Custom CSS Class Not Being Applied

text: I have some custom CSS being applied to a list of posts. The site is here If you are to check the css classes of the posts, you'll see that the last two css classes are `.floats` and `.colThree`. `.colThree` is applying just fine and everything is great there. `.floats` will not apply and I can't figure it out. I thought maybe it was a bad CSS class name but I've changed it a couple of times. Any help is greatly appreciated. Thanks in advance for your time.


title: I restricted wordpress by logged users. It's possible exclude a page?

text: Here is my code for restrict my wordpress site:               function restrict_access_if_logged_out(){       if (!is_user_logged_in() && !is_home()){         $redirect = home_url() . '/wp-login.php?redirect_to=' . esc_url($_SERVER["HTTP_HOST"] . urlencode($_SERVER["REQUEST_URI"]));         wp_redirect( $redirect );         exit;       }     }     add_action( 'wp', 'restrict_access_if_logged_out', 3 );      Now I want to add one exception for example for URL: example.com/home-page.


title: How do I change the gallery that is inserted in the post?

text: When I insert a gallery to a blog post using the `[gallery]` shortcode or simply the `insert media` button I get a default structured gallery in my blog through `the_content();` However the gallery comes with a lot of inline CSS and other stuff I want to remove, how can I do it?


title: Wordpress rewrite specific URL

text: How can I rewrite a specific URL? Example, orginal url is:               www.domain.com/category/slug-1      to               www.domain.com/slug-1      And the other category pages will not be affected.


title: Timthumb not working with Wordpess 4.0

text: I just updated Wordpress to the latest version, 4.0, and I had a bad surprise - timthumb stopped working. the thumbnails are not generated. I cleared theme's cache folder, and checked to see if chmod is 755 - it is. timthumb is also updated to the latest version. this is how I call the thumbnail               <img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&h=170&w=170&zc=1" alt="<?php the_title(); ?>"/>      What else can I do? thank you


title: Allow a role to edit one specific plugin

text: Is there any way to allow a particular role (Contributors, in this case) to use one plugin, and one plugin only? I would like them to be able to add images to a gallery when writing their post, but the gallery is a plugin that they have no access to. I don't want them to have access to other plugins. Thanks in advance for any help :) **Edit:** I have added the capability to `manage_options` and users can now see the plugin that I want them to in the menu. But, when the user hovers over the item in the menu to expand the sub-menu, they cannot see the top two items that me (an admin) can see. Why is this? Is it a plugin related issue? Also, I have been looking into the `add_menu_page` function - could this help me? I don't really understand where to put the code so if someone could help me out then that would be great. I'm not 100% on the parameters for it either. They can also see some other plugins but I will probably just hide them from the menu so that they can't be seen by the user.


title: How to get line breaks to translate to paragraphs?

text: How can I get the line breaks that I make in the TinyMCE editor to translate into new lines in the web page. Suddenly all posts when actually previewed on the theme are walls of text. In the final post's source code there are no surrounding <p> elements surrounding the elements.


title: Add new panel inside parent panel in WP Customize?

text: Is possible, add a panel within another panel. example: First Panel > child Panel > Section > First Setting ... Second Panel > Section > First Setting ...


title: Use mulitple usernames?

text: Can I configure wordpress to use two database usernames, one to read (which has read-only permissions in the database) and one to post (who is hidden in a protected wp-admin directory) for security purposes? The point is that even if someone hacks wordpress, they won't have permission to do any harm.


title: Preserving tabs and line breaks in <pre><code> when switching from HTML to Visual Editor

text: Tabs placed in a `<pre><code></code></pre>` block are stripped and line breaks are removed leaving a single continuous line of text. This occurs when switching from html to visual editors. Is there a setting in TinyMCE to avoid this? BEFORE: ![enter image description here](http://i.stack.imgur.com/VKwGV.png) AFTER: ![enter image description here](http://i.stack.imgur.com/77zH1.png) Here it even garbles the code and spits parts of it out the `<pre>`... **EDIT:** I seems the best option is to remove the `<code>` tag entirely and leave the pre. This still has the issue of removing duplicate blank lines, but it keeps the pre untouched even when switching between editors.


title: Can't find wp-cron.php but I can see it in the public folder

text: I have a problem with the wp-cron.php file. I can see it when I browse the public folder and it has the permissions set to 755. But still I am getting this error in my server error log: [Thu Mar 15 17:49:20 2012] [error] [client xx.xx.xxx.xxx] Couldn't find wp- cron.php, referer: http://secretsection.com/invizimals/?page_id=681 Can someone explain me why I get this error end what I can do to fix it? BTW... I am using WP v. 3.3.1 BR


title: WP insert post and custom taxonomy

text: I have create a custom post type in my WordPress attached with a custom taxonomy. The post collect date from the from end of the web site by using wp_insert_post(). This is my Custom post registration code:               $labels = array(             'name' => 'Films',             'singular_name' => 'Film',             'add_new' => 'Add new',             'add_new_item' => 'Add new film',             'edit_item' => 'Edit film',             'new_item' => 'New film',             'all_items' => 'All films',             'view_item' => 'View film',             'search_items' => 'Search films',             'not_found' =>  'No films found',             'not_found_in_trash' => 'No films found in Trash',              'parent_item_colon' => '',             'menu_name' => 'Films'         );              $args = array(             'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,              'show_in_menu' => true,              'query_var' => true,             'rewrite' => true,             'capability_type' => 'post',             'has_archive' => true,              'hierarchical' => false,             'menu_position' => null,             'taxonomies' => array('film_category'),             'supports' => array(                 'title',                 'editor'             )         );              register_post_type('film', $args);      And this is my Custom Taxonomy registration Code:               $labels = array(             'name' => 'Category',             'singular_name' => 'Film',             'search_items' =>  'Search Categories',             'all_items' => 'All Categories',             'parent_item' => 'Parent Category',             'parent_item_colon' => 'Parent Category:',             'edit_item' => 'Edit Category',              'update_item' => 'Update Category',             'add_new_item' => 'Add New Category',             'new_item_name' => 'New Category Name',             'menu_name' => 'Category'         );              $args = array(             'labels' => $labels,             'hierarchical' => true,             'rewrite' => false,             'capabilities' => array('manage_terms')          );              register_taxonomy('film_category', array('film'), $args);      both are fired on init action. And now when the end User submit the form from the front end I execute that code:               $post = array(                 'comment_status' => 'closed',                 'ping_status' => 'closed',                 'post_author' => 2,                 'post_content' => $_POST['synopsis'],                 'post_name' => sanitize_title($_POST['title']),                 'post_status' => 'private',                 'post_title' => $_POST['title'],                 'post_type' => 'film',                 'tax_input' => array(                     'film_category' => array(                         $_POST['category']                     )                 )             );                  $new_film_id = wp_insert_post($post);                  wp_set_object_terms($new_film_id, $_POST['category'], 'film_category', true);      In my front end form I have the "category" select field that contain the film categories. I have try to add on options values the terms ID, the terms Name and the terms Slug but it doesn't work. the new post is generated in my custom post type, but I can't assign the film categories. Any idea please ?


title: Too many variations in WooCommerce

text: I am working with a woocommerce install, and we have a product that has 2016 variations (between selections for each of 4 variables - size, color, type, and extra). The problem is that woocommerce out of the box breaks when more than a couple hundred variations are added to the product page. (the admin page will not load/update at all). I have been searching for a solution to this problem without any success. Does anyone have any suggestions or workarounds? Here are some of the things I have tried:   1. suggested to client that we break the product up so we can have fewer variations in each, but they are adamant that they want a single link to the product where all variations can be chosen on ONE product page, so that is out   2. Looked into Smart Manager plugin, but it does not appear to allow duplicating or adding variations, only managing existing ones   3. Have looked into gravity forms plugin and sent an email to the developer, but have not heard back and not entirely sure this would help in this situation. I am a bit bummed because we have come a long way down the road, and everything with woocommerce is almost perfect, except for this lack of large variation support.


title: Saving Media - Which Hook is Fired?

text: Howdi, I am trying to fire some code that will occur when I save an image in the media library, as per usual, I select the file, upload, enter the meta data and then click save. At this point I want to hook into wordpress, and redirect wordpress to another URL. This is so that rather than taking the user to a list of uploaded media, I can then take them to an image manipulation tool instead. I found a filter that fires just before the meta data is created, but nothing for when the file is saved? Thanks,


title: Anyone figured out how to use WordPress MultiSite with Domain Mapping & SSL?

text: I've been looking all over to find a solution for SSL with WordPress MultiSite and Domain Mapping. Ideally, I'd like to purchase an SSL cert for each domain (or potentially a wildcard cert) anyone have a solution that has worked for them. I'm fearing that I overlooked this detail and will now have to split up my happy MU home in order to secure this domain properly.


title: Is there a way to define a default caption to all uploaded images

text: As the title of this answer say, I want to define a default caption to all uploaded images in my WordPress... Is there a way to do something like this?


title: Why does Wordpress remove my variables in the URL?

text: I am trying to put variables into the URL, which I can then use in my Wordpress template. So for example I have created a wordpress template something.php and the page "somepage" with this template. Now in my something.php I am trying to get a variable (for example something.php?variable=whatever) into my script in order to use it there. Im doing this with $_GET["variable"]. Now everything worked fine on the test server. Now I have put it onto the real server (which is actually the same server, just another copy of wordpress) and there it doesnt work. Opening the URL www.example.com/somepage?variable=whatever will directly lead to www.example.com/somepage. So Wordpress is removing every variable in the URL. Another thing that doesnt work and that probably has to do with the same problem is a search, which I created and which has the post type "post", not "get". What do you think could be the problem, since it worked perfectly fine on the same server with another wordpress copy (same version). Thank you very much for your help! phpheini


title: Using Vagrant for customizable Wordpress Multi-sites

text: ## **Background:** My partner and I have a goal to create a customizable vagrant project that uses Wordpress multi site, as a local development environment. * * * **Ideal Use Case:** Various developers on our team (of varying skill levels) will be provided with a vagrant package. When they "vagrant-up" they should be provided a standard lamp stack containing a multi-site wordpress instance. Any resources they need are included in the process of provisioning, including the database, plugins, themes, uploads-file's. Support for grunt.js task-running is available. They can proceed to develop, and have an easy option for Version Control. * * * **The Reality (our challenges):** While there are many options available for using vagrant and a standard wordpress.org installation, we have not yet found a workable solution or adaptation. We have encountered these problems: **1. Wordpress Mult-site needs to be on port 80.** so rather than using Port forwarding (vagrant docs), we opted for private network, in addition to synced folders. **2. Hosts files.** There are several nice plugins that we have experimented with that allow us to edit the hosts file on the host-machine side Vagrant hosts manager and vagrant host updater. In windows host machines, it was necessary for permissions to be changed to prevent UAC from preventing the the updating. **3. The database** We have used options that exist in puphpet to experiment using SQL import as part of the provisioning process. Also, we have tried using a wordpress plugin that we are familiar with, migrate DB Pro.Our purpose with Migrate DB PRo was just to make the database connection work. Both my partner and myself are not able access sub-directories (rather we receive a file not found error) These are some of our major hurdles, there may be more details, but for the moment I would like to focus on the question at hand. * * * * * * ## **The Question:** There is no single question to capture what I hope to convey, but please consider the following: Do you have any successful experiences in implementing a WordPress multi-site? If so, how did you overcome some of the common pitfalls? Did you rely upon an existing source or process model? Where do I seem to be failing in my approach?


title: Grandchild themes and optimal network architecture

text: I'm trying to create a versatile Wordpress network . In order to speed up development, I imagine I'll need to channel projects to different themes at an early stage. At the core of my network install I'd like to have three or four themes, pre-configured to handle a specific class of website. What's more, I'd like each of these themes, though configured differently (as far as content-types, page templates, and layouts), to use the same basic functions, markup and general best practices (think html 5 boilerplate). In essence, each of these core themes should be a child theme of some parent that fits my basic technological requirements. The problem is that when it comes time to actually create specific websites, I would like them to each be a child of an appropriate core theme. In essence, I'm running into the problem of granchild themes as brought up in this article: http://justintadlock.com/archives/2010/08/16/frameworks-parent-child-and- grandchild-themes If you're not familiar with it, it argues that a lot of parent themes are wrongly considered frameworks, and that Wordpress is not built to accommodate grandchild themes. So my question is this: Is it better to duplicate a theme (no parent-child relationship) to create my few core themes and deal with updating them manually as needed, or should I have each core theme be a child theme of some parent and create an artificial (not wordpress native) grandchild inheritance system for the actual websites I create. I look forward to hearing your thoughts


title: Woocommerce: where Frontend and mailis French but backend must be Dutch

text: I would like the Frontend and mails to be in the French language but the backend (=admin settings etc) in the Dutch language? I've tried several plugins whereby the FrontEnd is in French and backend in Dutch but the transaction mails seems to be related the backend-language because they were in Dutch (should be French). Can somebody help me to solve this problem? I would also be helped by a hook that forces the transactional mail into the French language


title: Using WP_Query to grab custom meta values, foreach to json object

text: So I have 4 custom meta boxes for each post on a wordpress site relating to the product this client sells. I have 3 dropdown boxes, one for category, and two for two of the custom meta boxes. The meta boxes I'm dealing with are `adhesion_box` and `substrate_box`. My AJAX script works fine when I query the post titles, but when I try to grab the meta values, it won't work. I'm attempting to use `WP_Query` for this instead of `$wpdb`. Here is the php bit that isn't working:               $cat   = $post['cat'];     $query = new WP_Query( array( 'cat' => '$cat' ) );          if($query->have_posts()){         $posts = $query->get_posts();         foreach( $posts as $post ) {             $return[$post->id] = $post->meta_value;         }     }      Right now the JSON object it returns is:               OBJECT: {"":""}      So I'm a little lost. Here is the long $wpdb query that my friend wrote that grabs the post titles by category - it works just fine, but I need the `adhesion_box` meta value, not the post title.               $query = $wpdb->get_results(         "SELECT p.`id`,p.`post_title`         FROM $wpdb->posts `p`         JOIN $wpdb->term_relationships `tr` ON (`p`.`ID` = `tr`.`object_id`)         JOIN $wpdb->term_taxonomy `tt` ON (`tr`.`term_taxonomy_id` = `tt`.`term_taxonomy_id`)         JOIN $wpdb->terms `t` ON (`tt`.`term_id` = `t`.`term_id`)         WHERE `p`.`post_type`='post'         AND `p`.`post_status` = 'publish'         AND `tt`.`taxonomy` = 'category'         AND `t`.`term_id` = '$cat'");      I'm having a hard time figuring out how to grab that value, and do it in the simplest way. Any help appreciated. Here is the demo, so you can see it.


title: Why does my category page display "posted on..." when all I want it to do is display categories?

text: Refer to: http://blog.studentlife.uiowa.edu/svp/categories/ I just used a blank category template. What can I add to/change the code to make it so that it doesn't put in the category page like it's a post? I only want it to list the categories than cut to the footer/sidebar.


title: wordpress upgrade has broken my permalinks

text: I have just upgraded my wordpress installation from 3.1 to 3.1.1 and my custom structure permalinks are now broken, The permalinks were set to follow this procedure, > /%category%/%postname% however now they are just falling back to > ?page_id=30 How can I fix this what has changed in 3.1.1 I wonder if it is a problem with my .htaccess file? Or maybe I am running on IIS?


title: Disable wp_enqueue_styles action for specific page

text: I have an specific page on my website where I can't have any stylesheets being enqueued, so I need to unenqueue all stylessheets loaded there. Problem is I don't know their IDs, because they can come from either several different themes or other plugins. What I've tried to do is remove the wp_enqueue_styles action, but without luck. Here's what I've tried:               add_action( 'init', 'remove_enqueue_action', 99);     function remove_enqueue_action() {         remove_action( 'wp_enqueue_styles','' );     }      Any help is appreciated.


title: What is better for wordpress performace?

text: I'm developing a website using the WPML plugin. And I would like to know which is the better option, or even the correct way to change _classes_ or _IDs_ between the languages. **Sample code:**               <ul id="<?php _e('menu-topo'); ?>">          <ul id="<?php if ($lang = 'en') { echo "menu-topo-en"; } else { echo "menu-topo"; } ?>      I'm not sure that the `_e` function is supposed to be used this way so if someone could clarify this for me it would help me a lot, thanks.


title: Woocommerce filter item results on order page based on meta value

text: I would like to know if its possible if we could filter the results from the Add items field when adding new order. I have a custom post meta `branch_location` on the product post and want to only show specific products which contains a meta value of `cdo`. ![relevant image](http://i.stack.imgur.com/5I3xH.jpg) Thanks!


title: Blog parameter section to create a new page?

text: How to add Select Blog Parameter in the page ? I need to create a new page that show all my blog post .   I want to add two of my categories in a page name as Blog .   I need some thing like as See in this Iamge ?   ![enter image description here](http://i.stack.imgur.com/WvW3R.png)


title: Menu styling for last menu item

text: okay so I'm using the following code to get my links...               <?php wp_nav_menu( array('theme_location' => 'primary', 'container' => '', 'menu_class' => 'mainnav') ); ?>      This is my CSS for the nav...               .mainnav a {         font-family: gooddog_plainregular, Arial, sans-serif;         font-size: 30px;         color: #ffea00;         text-decoration:none;     }          .mainnav li:after {     content: url('images/nav-divider.png');     }          .mainnav li.last:after {     content: none;     }          .mainnav li {         list-style: none;         display: inline;         font-size: 30px;         margin-bottom: 10px;     }          .mainnav li.last {         list-style: none;         display: inline;         font-size: 30px;         margin-bottom: 10px;     }      The problem I'm having is that the `li.last` doesn't work, how do I add the class to it? Thanks :)


title: settings api store multiple array

text: If I am not mistaken, the settings api only storing one single data array in wp_options table. You can only change the field data in the array. What if I want to add multiple array in the same table with same array structure but different value. What I mean is :               $data = array(         '1' = array(             'cpt'=> 'cpt1',             'date'=> 'date1',             'role'=> 'subscriber'                     ),         '2' = array(             'cpt'=> 'cpt2',             'date'=> 'date2',             'role'=> 'eiditor'                ).....etc      );      and I can add new array, edit the field inside either one of the array,or delete unwanted array. What I found on goolge are only tutorial on how to store the data in single array, but I did see some plugin done this, but just couldn't understand how they done it with my current of programming level. I don't want to create another custom table,since the data that I want to store is not so much. I only store some setting (user,post-type,post date) for further use. Any guides or advice will be appreciated.


title: Form that sends data to an admin panel and can export it

text: Is there a way to have a form submit data to a admin control panel where the data is stored and can be rectified there? Could it also be able to export the data as excel for example?


title: Featured Image not appearing

text: I am very new to Wordpress but my site is coming along nicely. The issue that am experiencing is that I cannot get the 'featured image' to appear any where. I set it up on the home page. in the edit page section and the image appears at the bottom-right, within the 'featured image' section on the edit page. I have ensured that within the 'screen options" I have selected the 'featured image' tick box. But when I update the home page it has not changed. There is still no 'featured image'. I have ensured that I have removed my cookie and cleared my cache but this has not helped. Thanks


title: Pull custom fields from custom posts within a loop

text:
This is going to sound a little nuts. I have a situation where I'm displaying a list of products that a user selects to move to the products' page. I also have documents and videos that I created custom post types and fields for. I need to run a second loop within the current loop to pull a custom field from a custom post type. If that makes sense? for example this is the product "directory" loop (pardon my hackish techniques)
     <?php          $parent = $post->ID;          query_posts('post_type=page&order=ASC&orderby=title&post_parent='.$parent);?>     <?php while (have_posts()) : the_post(); ?>     <?php $model = get_the_title(); ?>

<a href="<?php the_permalink() ?>"><?php echo get_post_meta($post->ID, "product-main-title", true); ?>

Model <?php echo $model ?>
         <?php echo my_excerpts(); ?>

<a href="<?php the_permalink() ?>">Learn More

Specification Sheet

Video Tour

     <?php endwhile; ?>      And this is the loop I generally use to add documents to the pages (excluding the custom loop template)               <?php             $documents = array('numberposts' => 5, 'post_type' => 'documents', 'category_name' => $model);             query_posts( $documents );             get_template_part( 'loop', 'documents' );             wp_reset_query();      ?>      I tried combining the two where I would add the second loop to `<li><a href="">Specification Sheet</a></li>` but that caused the page to run in a perpetual loop. An alternative option I was looking for was to pull a single custom field from a post type without creating a loop. For example.               get post_type => document, meta_key => document-type, meta_value => spec-sheet      Any help would be appreciated.


title: How do I display custom post types through a common taxonomy?

text: I have posts and I have recipes. Recipes is a custom post type. Recipes make use of the category taxonomy and a newly added recipe has been categorized under beer. When I browse the listing page for the category beer I see all my previous posts categorized under beer while the new recipe does not appear. How do I link custom post types through their taxonomies? Or, how can I show all post types under a single category?


title: Featured Images stopped working with Sliding Door theme

text: And that's the whole point of the Sliding Door theme. It still seems to still be working for me in my main browser that I use, but when I open a different browser or have people check from other devices the sliding images do not work. When I go to the Edit Page to set the Featured Image I can go through the upload process but then when it goes back to the Edit Page the image never shower, it remains blank. Why? How? Help? Here's the website: http://lakezurichcatgroomer.com/test/ Here's a screenshot of what is SHOULD look like: http://i.imgur.com/JM6hPpk.png And I know it's hideous, forgive me.


title: Selectbox and Searchform and Custom Search Page

text: I'm in the very hard journey to make a Tire Website. You know , Lots of Cars, Tires , Brands, An absolutely headache. I'm using jigoshop as my main e-commerce plugin. and because is to difficult to filter attributes in jigoshop. I will use the simple search of wordpress for filtering words . but if I use a select box like:               <form role='search' method='post' id='searchform' action='/'>                                 A                                 <select>                                     <option id="s" value="255">225</option>                                     <option id="s" value="230">230</option>                                     <option id="s" value="">235</option>                                     <option id="s" value="">240</option>                                     <option id="s" value="">245</option>                                     <option id="s" value="">250</option>                                     <option id="s" value="">260</option>                                     <option id="s" value="">265</option>                                     <option id="s" value="">270</option>                                 </select>                                           At                                 <select>                                     <option id="s" value="40">40</option>                                     <option id="s" value="45">45</option>                                     <option id="s" value="">50</option>                                     <option id="s" value="">55</option>                                     <option id="s" value="">60</option>                                     <option id="s" value="">65</option>                                     <option id="s" value="">70</option>                                     <option id="s" value="">75</option>                                     <option id="s" value="">80</option>                                     <option id="s" value="">85</option>                                     <option id="s" value="">90</option>                                     <option id="s" value="">95</option>                                     <option id="s" value="">100</option>                                           </select>                                      Rin                                 <select>                                     <option id="s" value="10">10</option>                                     <option id="s" value="11">11</option>                                     <option id="s" value="">12</option>                                     <option id="s" value="">13</option>                                     <option id="s" value="">14</option>                                     <option id="s" value="">15</option>                                     <option id="s" value="">16</option>                                     <option id="s" value="">17</option>                                     <option id="s" value="">18</option>                                     <option id="s" value="">19</option>                                     <option id="s" value="">20</option>                                     <option id="s" value="">21</option>                                     <option id="s" value="">22</option>                                     <option id="s" value="">23</option>                                     <option id="s" value="">24</option>                                     <option id="s" value="">25</option>                                     <option id="s" value="">26</option>                                     <option id="s" value="">27</option>                                     <option id="s" value="">28</option>                                     <option id="s" value="">29</option>                                     <option id="s" value="">30</option>                                     <option id="s" value="">31</option>                                     <option id="s" value="">32</option>                                     <option id="s" value="">33</option>                                     <option id="s" value="">34</option>                                     <option id="s" value="">35</option>                                     <option id="s" value="">36</option>                                     <option id="s" value="">37</option>                                     <option id="s" value="">38</option>                                     <option id="s" value="">39</option>                                     <option id="s" value="">40</option>                                 </select>                                      <input class='btn' value='Search' type='submit'/>                             </form>      I don't get any result.. what is what am I doing wrong? thanks


title: wp query return post draft

text: How can I get wp-query to return a post's draft using the get variables provided when you click preview post in wp-admin. `?preview=true&preview_id=5&preview_nonce=96d5ce0bb5`


title: Pronamic Info Window

text: I am using Pronamic Google Maps (http://wordpress.org/extend/plugins/pronamic- google-maps/) to add Google Maps to my post...I would like to do a couple of things:   1. I noticed that the balloon, or info window, has to be clicked in order for it to appear, is there a way to make it appear by default?   2. Also on the balloon, or info window, I see a scrollbar which appears regardless of how much content is being shown...is there a way to remove the scrollbar when not in use? Thanks in advance! Josh


title: Per Post Type Revision Numbers

text: In `wp-config.php` you're able to change how WordPress deals with post revisions. Specifically you're able to turn them off or specify a max number of revisions. I'd like to be able to set a max number or revisions on a post type basis. Is this possible?


title: using the loop in custom meta is messing up 'add new' post type

text: When I use the following code in a (wpalchemy) custom meta box, everything works fine. That is until I pressed 'add new'. At this point, the title, slug, featured image, etc.. are being pre-populated with the content from my 'products' post type. The code builds a drop down within my 'case studies' post-type, and populates it with post titles/ids from my 'projects' post type. How can I use the loop in the backend like this without messing stuff up. I tried with `get_posts` as well as WP_Query.               global $post;     $args = array( 'post_type' => 'projects', 'posts_per_page' => 200 );     $custom_posts = get_posts($args);          foreach($custom_posts as $post) : setup_postdata($post);       echo '<option value="' . get_the_id() . '"';       echo '>' . get_the_title() . '</option>' . "\n";     endforeach;      **Edit: A little more background:** I'm using the wpalchemy class for custom meta boxes. The following code is included in my functions.php file, after `/wpalchemy/MetaBox.php` https://github.com/farinspace/wpalchemy/blob/dev/wp- content/wpalchemy/MetaBox.php               $assoc_project = new WPAlchemy_MetaBox(array(         'id' => '_assoc_project',         'title' => 'Associated Project',         'template' => get_stylesheet_directory() . '/metaboxes/case-studies-assoc_proj-meta.php',         'types'=> array('case-studies')     ));      **Edit 2: Update** I've tried and replicated this problem accross multiple browsers on my PC, but I just had a co-worker try on Ffox/mac and they don't have the problem. I don't understand why this would be platform specific - but there it is...


title: Skip foreach loop

text:
Here's a little coding problem for you. The code:               if ($categories) {               foreach ($categories as $tag) {                   $tag_link = get_category_link($tag->term_id);                   //new line              if (isset($instance['new-line'])) {                  $html .= "
";              }                   $html .= "";              $html .= "name} Tag" class="{$tag->slug}">";              $html .= "{$tag->name}{$tag->count}";                   //new line              if (isset($instance['new-line'])) {                  $html .= "
"; } }              }              else {                  $html .= "No Categories Available";              }              }          }      The problem: I want to exclude certain categories from displaying. Apparently, the way to do this is to skip the foreach loop for those categories I want to exclude. Unfortunately, I have no idea how to do this. Help much appreciated.


title: Custom post type causes php-error in php version 5.2.17

text: I'm getting an php-error on an server that runs php version 5.2.17 which doesn't support anonymous functions. I've never heard of that before (really new to php) but found out that only php 5.3.x supports the following code:                add_action('init', function() use($name, $args) {        Is there any way to solve that problem? It works fine on version 5.3.10 but I jhave to use an old host not using php 5.3... This is the full code to create the custom posts:               /* Add Post Type */     function add_post_type($name, $args = array() ) {            if ( !isset($name) ) return;              $name = strtolower(str_replace(' ', '_', $name));              add_action('init', function() use($name, $args) {                $args = array_merge(                 array(                     'label' => 'Members ' . ucwords($name) . '',                     'labels' => array('add_new_item' => "Add New $name"),                     'singular_name' => $name,                     'public' => true,                     'supports' => array('title', 'editor', 'comments'),                 ),                 $args             );                  register_post_type( $name, $args);         });     }               add_post_type('Netherlands', array(         'supports' => array('title', 'editor', 'thumbnail', 'comments')     ));


title: Is it possible to link to draft pages?

text: Problem: I have a overview-page with a sub-page. Both pages are still in status "draft". Now I want to create a link on the overview-page to the sub- page, a popup appears, but in the list of internal pages, the drafted pages do not appear.   1. Do I need to publish the sub-pages first to be able to link to them, or is there another way?   2. Why are they not appearing in the list of internal pages?