How to add the source url as custom field in autoblogged Wordpress plugin

My website working on Autoblogged plugin and the theme installed is iPin Pro. I wanted to autoblogged posts to add source url also, in page shows uploaded by user. please help. I wanted to "uploaded by user" to autoblogged custom field value, screenshot attached here http://imgur.com/EOxtrje ,my autoblogged custom page screen shot is here- http://i.imgur.com/LlA2HTN.jpg?1 What are the values in custom field? Here is the source page of page_source.php in theme               <?php     /*     Template Name: _source     */     ?>          <?php get_header(); global $user_ID, $wp_rewrite; ?>
         <?php         if(isset($wp_query->query_vars['domain'])) {             $source = rawurlencode($wp_query->query_vars['domain']);         } else {             $source = '...';         }         ?>

<?php _e('Pins from', 'ipin') ?> <a href="http://<?php echo $source; ?>" target="_blank"><?php echo $source; ?>

              <?php         $pnum = intval($_GET['pnum']) ? $_GET['pnum'] : 1;         $args = array(             'meta_key' => '_Photo Source Domain',             'meta_value' => $source,             'paged' => $pnum         );              query_posts($args);         $maxpage = $wp_query->max_num_pages;         ?>

             <?php $count_ad = 1; if (have_posts()) : while (have_posts()) : the_post(); ?>                  <?php if (of_get_option('frontpage1_ad') == $count_ad && of_get_option('frontpage1_ad_code') != '' && ($pnum == 1  || of_get_option('infinitescroll') == 'disable')) { ?>

                                   <?php eval('?>' . of_get_option('frontpage1_ad_code')); ?>

             <?php } ?>                  <?php if (of_get_option('frontpage2_ad') == $count_ad && of_get_option('frontpage2_ad_code') != '' && ($pnum == 1  || of_get_option('infinitescroll') == 'disable')) { ?>

                                   <?php eval('?>' . of_get_option('frontpage2_ad_code')); ?>

             <?php } ?>                  <?php if (of_get_option('frontpage3_ad') == $count_ad && of_get_option('frontpage3_ad_code') != '' && ($pnum == 1  || of_get_option('infinitescroll') == 'disable')) { ?>

                                   <?php eval('?>' . of_get_option('frontpage3_ad_code')); ?>

             <?php } ?>                  <?php if (of_get_option('frontpage4_ad') == $count_ad && of_get_option('frontpage4_ad_code') != '' && ($paged == 0 || $paged == 1 || of_get_option('infinitescroll') == 'disable')) { ?>

                                   <?php eval('?>' . of_get_option('frontpage4_ad_code')); ?>

             <?php } ?>                  <?php if (of_get_option('frontpage5_ad') == $count_ad && of_get_option('frontpage5_ad_code') != '' && ($paged == 0 || $paged == 1 || of_get_option('infinitescroll') == 'disable')) { ?>

                                   <?php eval('?>' . of_get_option('frontpage5_ad_code')); ?>

             <?php } ?>                  <div id="post-<?php the_ID(); ?>" <?php post_class('thumb'); ?>>

                         <?php if (current_user_can('administrator') || current_user_can('editor') || current_user_can('author') || !is_user_logged_in()) { ?>                         <a class="ipin-repin btn btn-mini" data-post_id="<?php echo $post->ID ?>" href="#"> <?php _e('Repin', 'ipin'); ?>                         <?php } ?>                         <?php if ($post->post_author != $user_ID) { ?>                          <button class="ipin-like btn btn-mini<?php if(ipin_liked($post->ID)) { echo ' disabled'; } ?>" data-post_id="<?php echo $post->ID ?>" data-post_author="<?php echo $post->post_author; ?>" type="button"> <?php _e('Like', 'ipin'); ?></button>                         <?php } else { ?>                         <a class="btn btn-mini" href="<?php echo home_url('/pins-settings/'); ?>?i=<?php the_ID(); ?>"><?php _e('Edit', 'ipin'); ?>                         <?php } ?>                         <a class="ipin-comment btn btn-mini" href="<?php the_permalink(); ?>#respond" data-post_id="<?php echo $post->ID ?>"> <?php _e('Comment', 'ipin'); ?>
                          <a class="featured-thumb-link" href="<?php the_permalink(); ?>">                         <?php                         if (of_get_option('price_currency') != '') {                             remove_filter('the_title', 'ipin_the_title');                             $title_unfiltered = get_the_title();                             preg_match_all('/\$[0-9,]+(?:\.[0-9]{2})?/', $title_unfiltered, $match);                             add_filter( 'the_title', 'ipin_the_title');                             if ($match[0]) {                         ?>

<?php echo str_replace('$', of_get_option('price_currency'), array_pop($match[0])); ?>

                         <?php                             }                         }                         ?>                              <?php                         //if is youtube or vimeo video                         $photo_source = get_post_meta($post->ID, "_Photo Source", true);                         if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', str_replace('&', '&', $photo_source), $match) || (strpos(parse_url($photo_source, PHP_URL_HOST), 'vimeo.com') !== FALSE && sscanf(parse_url($photo_source, PHP_URL_PATH), '/%d', $video_id))) {                         ?>

                         <?php } ?>                              <?php                         $imgsrc = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'medium');                         if ($imgsrc[0] == '') {                             $imgsrc[0] = get_template_directory_uri() . '/img/blank.gif';                         }                              //if is animted gif                         $animated_gif = false;                         if (substr($imgsrc[0], -4) == '.gif' && get_post_meta(get_post_thumbnail_id($post->ID), 'a_gif', true) == 'yes') {                                 $animated_gif = true;                                 $animated_gif_imgsrc_full = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');                                 echo '

';                              }                         ?>                         <img class="featured-thumb<?php if ($animated_gif) echo ' featured-thumb-gif-class" data-animated-gif-src-medium="' . $imgsrc[0] .  '" data-animated-gif-src-full="' . $animated_gif_imgsrc_full[0]; ?>" src="<?php echo $imgsrc[0]; ?>" alt="<?php the_title_attribute(); ?>" style="width:<?php echo $imgsrc[1] ?>px;height:<?php echo $imgsrc[2] ?>px" />                                               <div class="post-title" data-title="<?php esc_attr_e($title_unfiltered); ?>">                         <?php                         $post_title_strip_tags = get_the_title();                         if (of_get_option('posttags') == 'enable') {                             $post_title_strip_tags = preg_replace('/tags\[(.*?)\]/', '', get_the_title(), 1);                         }                              echo mb_strimwidth(strip_tags($post_title_strip_tags), 0, 255, ' ...');                              $posttags = get_the_tags();                         if ($posttags) {                             echo '

';                                  foreach($posttags as $tag) {                                 echo 'term_id). '">' . $tag->name . ' ';                              }                                  echo '
';                         }                         ?>

                      <?php                  $likes_number = get_post_meta($post->ID, '_Likes Count', true);                 $repins_number = get_post_meta($post->ID, '_Repin Count', true);                 $comments_number = get_comments_number();                 ?>
                 <?php                     if ($likes_number == '' || $likes_number == '0') {                         echo 'ID . '" class="likes-count hide">';                     } elseif ($likes_number == '1') {                         echo 'ID . '" class="likes-count">1 ' . __('like', 'ipin') . '';                     } else {                         echo 'ID . '" class="likes-count">' . $likes_number . ' ' . __('likes', 'ipin') . '';                     }                          if ($comments_number == '0') {                         echo 'ID . '" class="comments-count hide">';                     } elseif ($comments_number == '1') {                         echo 'ID . '" class="comments-count">1 ' . __('comment', 'ipin') . '';                     } else {                         echo 'ID . '" class="comments-count">' . $comments_number . ' ' . __('comments', 'ipin') . '';                     }                          if ($repins_number == '' || $repins_number == '0') {                         echo 'ID . '" class="repins-count hide">';                     } elseif ($repins_number == '1') {                         echo 'ID . '" class="repins-count">1 ' . __('repin', 'ipin') . '';                     } else {                         echo 'ID . '" class="repins-count">' . $repins_number . ' ' . __('repins', 'ipin') . '';                        }                 ?>

                     <?php if (current_user_can('administrator') || current_user_can('editor') || current_user_can('author') || !is_user_logged_in()) { ?>                     <a class="ipin-repin btn btn-small" data-post_id="<?php echo $post->ID ?>" href="#"><?php _e('Repin', 'ipin'); ?>                     <?php } ?>                     <?php if ($post->post_author != $user_ID) { ?>                      <button class="ipin-like btn btn-small<?php if(ipin_liked($post->ID)) { echo ' disabled'; } ?>" data-post_id="<?php echo $post->ID ?>" data-post_author="<?php echo $post->post_author; ?>" type="button"><?php _e('Like', 'ipin'); ?></button>                     <?php } else { ?>                     <a class="btn btn-small" href="<?php echo home_url('/pins-settings/'); ?>?i=<?php the_ID(); ?>"><?php _e('Edit', 'ipin'); ?>                     <?php } ?>                     <a class="ipin-comment btn btn-small" href="<?php the_permalink(); ?>#respond" data-post_id="<?php echo $post->ID ?>"><?php _e('Comment', 'ipin'); ?>

<a href="<?php echo home_url('/' . $wp_rewrite->author_base . '/') . get_the_author_meta('user_nicename'); ?>/"><?php echo get_avatar(get_the_author_meta('ID'), '30'); ?>

                         <?php the_author_posts_link(); ?>                          <?php                              $original_post_id = get_post_meta($post->ID, "_Original Post ID", true);                             if ($original_post_id != '' && $original_post_id != 'deleted') {                                 $original_postdata = get_post($original_post_id, 'ARRAY_A');                                 $original_author = get_user_by('id', $original_postdata['post_author']);                             ?>                             <?php _e('via', 'ipin'); ?>                              <a href="<?php echo home_url('/' . $wp_rewrite->author_base . '/') . $original_author->user_nicename; ?>/"><?php echo $original_author->display_name; ?>                             <?php                             }                             if ($board_info = get_the_terms($post->ID, 'board')) {                                 _e('onto', 'ipin');                                 foreach ($board_info as $board) {                                 ?>                                  <a href="<?php echo home_url('/board/'); ?><?php echo $board->term_id ?>/"><?php echo $board->name; ?>                                 <?php                                 }                             }                         ?>

                      <?php                 if ('0' != $frontpage_comments_number = of_get_option('frontpage_comments_number')) {                 ?>                  <div id="masonry-meta-comment-wrapper-<?php echo $post->ID; ?>">                  <?php                     if ($comments_number >  $frontpage_comments_number) {                         $offset = $comments_number - $frontpage_comments_number;                     } else {                         $offset = 0;                         }                          $args = array(                         'number' => $frontpage_comments_number,                         'post_id' => $post->ID,                         'order' => 'asc',                         'offset' => $offset,                         'status' => 'approve'                     );                     $comments = get_comments($args);                     foreach($comments as $comment) {                     ?>
                         <?php $comment_author = get_user_by('id', $comment->user_id); ?>
                             <?php if ($comment_author) { ?>                             <a href="<?php echo home_url('/' . $wp_rewrite->author_base . '/') . $comment_author->user_nicename; ?>/">                             <?php } ?>                                 <?php echo get_avatar($comment->user_id, '30'); ?>                             <?php if ($comment_author) { ?>                                                          <?php } ?>

                                                              <?php if ($comment_author) { ?><a href="<?php echo home_url('/' . $wp_rewrite->author_base . '/') . $comment_author->user_nicename; ?>/"><?php } ?><?php echo $comment->comment_author; ?><?php if ($comment_author) { ?><?php } ?>                                                          <?php echo $comment->comment_content; ?>

                     <?php                      }                     ?>
                 <?php                 }                       if (is_user_logged_in()) {                 ?>                 <div id="masonry-meta-commentform-<?php echo $post->ID ?>" class="masonry-meta hide">
<?php echo get_avatar($user_ID, '30'); ?>

                     <?php                      $id_form = 'commentform-' . $post->ID;                     $id_submit = 'submit-' . $post->ID;                          comment_form(array(                         'id_form' => $id_form,                         'id_submit' => $id_submit,                         'title_reply' => '',                         'cancel_reply_link' => __('X Cancel reply', 'ipin'),                         'comment_notes_before' => '',                         'comment_notes_after' => '',                         'logged_in_as' => '',                         'label_submit' => __('Post Comment', 'ipin'),                         'comment_field' => '<textarea placeholder="' . __('Add a comment...', 'ipin') . '" id="comment" name="comment" aria-required="true"></textarea>'                     ));                     ?>

                 <?php } ?>
             <?php             $count_ad++;             endwhile;              else :             ?>

<?php _e('Nothing yet . . .', 'ipin'); ?>

             <?php              endif;             wp_reset_query();              ?>
              <?php if ($maxpage != 0) { ?>

                           <?php if ($pnum != 1 && $maxpage >= $pnum) { ?>
                     <a href="<?php $permalink = get_permalink(); if (substr($permalink,-1) == '/') { $permalink = substr($permalink,0,-1); } echo $permalink . '/' . $source . '?pnum=' . ($pnum-1); ?>"><?php _e('« Previous', 'ipin') ?>
                 <?php } ?>                      <?php if ($maxpage != 1 && $maxpage != $pnum) { ?>
                     <a href="<?php $permalink = get_permalink(); if (substr($permalink,-1) == '/') { $permalink = substr($permalink,0,-1); } echo $permalink . '/' . $source . '?pnum=' . ($pnum+1); ?>"><?php _e('Next »', 'ipin') ?>
                 <?php } ?>

         <?php } ?>

<?php _e('Top', 'ipin'); ?>

              <?php get_footer(); ?>


How to make use of WP templates within a nested site structure?

I am working on a site that highlights neighborhoods. Within each neighborhood there are places (that will be added by the client on the back end). Each neighborhood will have its own unique set of places. I figured out how to lead a list of all neighborhoods (neighborhood.php) to it's specific single neighborhood (single-neighborhood.php). However once i get into a single neighborhood i don't understand how to create a link to a list of places (which would be a Custom Post Type) that would then link to their single place page. I was considering using the concept of creating a Places Custom Post Type and then a single-place.php page template but i'm wondering how WordPress would interpret that and how it would lead to the correct post. Here is an image that shows the heirarchy, i have completed levels 1 through 3 and am trying to figure out 4-5. ![Quick Map Site Structure](http://i.stack.imgur.com/VagNu.png) I know how to create Custom Post Types, I know how to make custom fields, I know how to connect the custom fields to templates. What i don't know and am trying to figure out is how to link to the single places from a specific neighborhood? How does wordpress understand what Place post to go to? In Summary I:   1. Created 27 neighborhoods   2. Each neighborhood has a sub navigation that leads to "Places" "History" "Gallery" "Points of Interest"   3. I need to figure out how to link a list of Places to the "Places" sub nav link and have it pull the content from a specific Place Custom post and then have that list lead to a single place page I understand the concept of neighborhood.php template permalinking to single- neighborhood.php but i don't get how to make a further nested site heirarchy work under this logic would it still be place.php to single-place.php? If so how do i link to a list of places relevant to specific neighborhoods within the single-neighborhood page? Thank you.


How do I fully migrate post images from one WordPress site to another?

I know WordPress has a built-in tool for exporting content, but this does not actually export images associated with each post...it only exports an XML file. How do I actually export images in each post and upload them to my new WordPress site?


Multi site and media uploader

There seems to be a strange issue with my multisite on my live blog. Maybe its because I have one site set to "deleted" - so I can edit it, but the public can't see it? My current upload is set up as such: `wp-content/blogs.dir/10/files` This gives me a link such as (the link is real, I replaced my site address with example.com): `http://example.com/files/2013/01/Screenshot- from-2013-01-04-141248-300x150.png` This works on every single site I have, I recently created a new site and uploading images via the uploaded shows me a broken image and the console states it cannot find it. So I went to FPT and went into blogs.dir (stored at the base of wp-content) and went to site 10 and sure enough, under `files/2013/03/` are the files I have uploaded. I then went to my media uploader, looked at the broke image and clicked view, this showed me that the image was going from `example.com/files/2013/03/` \- this is simmilar to all the other sites I have on the network, they all map images like this and the images work. My next suspicion was file permissions, I checked the permission of "10" folder, it was not same as the rest so I did `sudo chown -R user-name 10` which changed the owner from apache to me. Still the images get uploaded yet they are "broken" as in they cannot be found. So I come to you guys to ask, **what's going on?**


Disqus Comment System not working

I've recently got myself Disqus for my blog. Worked fine until today. I don't know what I did - I tried disabling all the plugins, switching between versions 2011 and 2012. Also cleared the cache and paused Cloudflare. Not Working! :( Please have a look at my website and see what's the problem! Disqus doesn't seem to work at all!


How do I display the latest posts from three different categories?

I'm trying to set up the homepage of my site in this manner. Right now, the only post on the homepage contains an article with an podcast. To make it simple, The podcast has two people discussing sports and they want to write their commentary for each podcast. I created a separate category for each person and I'd like to display their commentaries below the podcast as below. Podcast, Steve's commentary, Matt's commentary I haven't worked much with the Loop and like I said I have only the latest podcast article but now I need to add the two commentaries, 1 from each category. Can anyone help me, i'm really confused ? I've posted my existing loop               <?php      query_posts('category_name=Weekly Show&showposts=1');     if (have_posts()) : while (have_posts()) : the_post(); ?>

     <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">     <?php the_title(); ?>
     <?php ob_start(); ?>     <?php $icons = array(); ?>     <?php if (!is_page()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostDateIcon.png" width="18" height="18" alt="" />     <?php the_time(__('F jS, Y', 'kubrick')) ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page()): ?>    <?php ob_start(); ?><?php _e('Author', 'kubrick'); ?>: <?php the_author_posts_link() ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (current_user_can('edit_post', $post->ID)): ?><?php ob_start(); ?><?php edit_post_link(__('Edit', 'kubrick'), ''); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
     <?php echo implode(' | ', $icons); ?>
     <?php endif; ?>     <?php $metadataContent = ob_get_clean(); ?>     <?php if (trim($metadataContent) != ''): ?>
     <?php echo $metadataContent; ?>
     <?php endif; ?>
                <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>           <?php if (is_page() or is_single()) wp_link_pages(array('before' => '
Pages: ', 'after' => '
', 'next_or_number' => 'number')); ?>

     <?php ob_start(); ?>     <?php $icons = array(); ?>     <?php if (!is_page()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostCategoryIcon.png" width="18" height="18" alt="" />     <?php printf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostTagIcon.png" width="18" height="18" alt="" />     <?php the_tags(__('Tags:', 'kubrick') . ' ', ', ', ' '); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostCommentsIcon.png" width="18" height="18" alt="" />     <?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
     <?php echo implode(' | ', $icons); ?>
     <?php endif; ?>     <?php $metadataContent = ob_get_clean(); ?>     <?php if (trim($metadataContent) != ''): ?>
     <?php echo $metadataContent; ?>
     <?php endif; ?>

          <?php comments_template(); ?>     <?php endwhile; endif; ?>
     <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>

          <?php get_footer(); ?>


Add new page with preselected parent

I do not want my clients to select a parent page from the drop down list, when creating a child page, so I would like to create a link on the dashboard which links to "add new page" - but with a preselected parent page. Is this possible? And if not, then is there a way to change the default parent from "(no parent)" to a parent of my choice?


Getting all ID's matching a title in a custom post type

I am trying to pull out all post ID's that have the same post title. This is in a custom post type called 'course-manager'. Here is what I have so far:                   $pages = array();              $args1 = array(             'post_type' => 'course-manager',             'posts_per_page' => -1,         );         query_posts( $args1 );         $page = get_page_by_title( $current_post_title, 'OBJECT', 'course-manager' );         while ( have_posts() ) : the_post(); //query all pages and get id's of pages with the specific title. Put id's in an array and use array in query below to query each id                     $pages[] = $page->ID;             echo $page->ID;              endwhile;         wp_reset_postdata();      This should work in my opinion. I have four posts - two with the title I am searching for and 2 with a different title... however instead of getting the two differnt post ID's I want, I am getting 4 post ID's all the same. :/ Thanks


How can I find plugins' slug?

I'm wondering how can I find plugins' slug (slug = internal name used by WordPress to do plugin updates and to determine which plugins are currently active)? It is usually plugin's folder name but if a plugin doesn't have a folder, it is its file name (like hello.php). Are there any other exceptions?   1. Do lowercase and uppercase characters matter?   2. Can a plugin have different slug than its folder name? What if there's a plugin called hello.php and another /hello.php/hello.php?


WP Build-In Post selector for CPT

I'm quite sure to remember any WP build-in function that generates post selector based on several args (post_type, etc.) like on the nav-menus admin page, here a screenshot: ![enter image description here](http://i.stack.imgur.com/SNiFI.jpg) Is there something like this or must I have been dreaming about it? How would you implement this?


Moving a WordPress site - Installation issue

I have moved Wordpress sites before and have occasionally encountered issues but always been able to resolve them. I have tried to do this several times with this site but I am still having the same problem installing WordPress at the new location. My database seems to move over no problem and I can login to my site at the admin but if I try to visit my site I just get the "index of" list of files. I have put the contents of the WordPress install folder into /public_html/tassolarpanels.com.au. and I have added .htaccess file with 'DirectoryIndex index.php index.html' and I am still having no success. Does any one know where my issue might be? I've tried following so many different instructions on moving wordpress and I can't figure out where I'm going wrong!


Multi language site using only .mo and WPLANG

Hello world/ Bonjour le monde, What technical limitations exist that would prevent the following from working (assume all static content with translations made in .mo file) Pseudo code: For every request:   * Check if query string contains field :myLang:   * If value of :myLang: equals "en_US"   * Then ~somehow change WPLANG to "en_Us"   (Or force Wordpress to behave as if WPLANG was actually set to '')   * Else- serve request as French using the fr_FR.mo as defined in wp-config.php I am vaguely aware that it has something to do with the way Wordpress is initialized. I know WPLANG can't be changed on the fly.


Admin pages have no content

Not the usual white screen of whatever horror, my site is shown normally until you go to the admin dashboard. While the dashboard (or the admin menu if you will) is visible and responds accordingly, the content is not shown for any of the sections/pages. Except for one two things: adding a post and editing an old one. And so, this is what I get: http://dumpt.com/img/files/jdyvf8206fkmi1w01e6u.png The page update animation just rolls and rolls without any actual changes even made. Haven't found any discussions about the said problem anywhere so... Need help :D


admin page passing $_POST variables to itself

I'm new to wordpress but I really like this and I would love to write my applications inside of wordpress. However there are still many things to learn and after a while one can lose it's head, as I just did. I've been searching for a sollution the last 2 day's on a very simple problem. I want to reload an admin page and pass $_POST variables. Actually I want to write a little crm program inside the admin panel as it is nicely put away from the public (front) section. Maybe this is not the right way to work, if it isn't please let me know. The first problem I'm facing is that I can't seem to pass the $_POST variables naam and voornaam when reposting the page. As wordpress passes the page itself as a variable. this is the simple code:               /** Step 2 (from text above). */     add_action( 'admin_menu', 'patientenbeheer' );          /** Step 1. */     function patientenbeheer() {         add_menu_page(__('patientenbeheer'), __('patientenbeheer'),'manage_options', basename(__FILE__), 'patientenbeheer_options');     }                     /** Step 3. */     function patientenbeheer_options() {         if ( !current_user_can( 'manage_options' ) )  {         wp_die( __( 'You do not have sufficient permissions to access this page.' ) );     }     ?>

<?php _e('patientenbeheer'); ?>

            <form action="" method="post" enctype="multipart/form-data">
naam: <input type="text" name="naam" value="" /> voornaam: <input type="text" name="vnaam" value="" />
             <input type="submit" value="Submit" />         <?php         if ( isset($_POST)) {             if (! isset($_POST['vnaam'])){                 echo "
 naam: ".$_POST['naam']."
";             }elseif ( ! isset($_POST['naam'])){                 echo "
 vnaam: ".$_POST['vnaam']."
";             } else {                 echo "
 beide
";             }         }         ?>
         </form>
             reload returns this: ../wp-admin/admin.php?page=martial-patientenbeheer.php if I change the form tag to this: I get: ../wp- admin/admin.php?naam=naam&vnaam= the $_POST values are include but the link is missing the page: martial- patientenbeheer.php. It shoud reload to: ../wp-admin/admin.php?page=martial- patientenbeheer.php?naam=naam&vnaam= Is this possible or is my working method wrong? putting it more simply, I want to add text to my page each time variables are passed. Text being the info from a sql select query or fields to add a new patient.


Get query result before posts are displayed?

If I want to modify the query, I can use `pre_get_posts` filter. But what if I want to loop through the queried posts before they are ran through the `The Loop`? Is there a filter/action hook for that? I want to find out if all the queried posts belong to same `term` and then do something if they are not. Please note that creating a custom `Query` is not an option.


Change order of Custom Taxonomy List

By default WordPress orders custom taxonomies (as tags in this case) by alphabetical order not by the order they were entered in the tag box. Is anyone aware of a way to show the custom taxonomies in the order they were entered in the post edit screen? The url in question is: http://granadatheater.com/ The GGW (Goes Good With) artists are currently in alphabetical order and they want it changed so that they are ordered the same way they were entered. So if the enter it Artist1, Artist3, Artist2 that's how it should show up on the frontend of the site.


How to unindex a single blog in Multisite?

Is there anyway to un-index a single blog in Multisite from search engines ?


Custom taxonomy list in two columns

I am using this to get taxonomy list. For each post, there are more than 20 terms. How can I get them in two columns.               echo '
'; echo strip_tags( get_the_term_list( $post->ID, 'trade', '
', '

', '
' ) ,'
'); echo '
';


Rename "Portfolio" slug?

I have a WordPress theme that I am working with called "Forte". Yes, it is a premium theme. I have reached out to the developer but apparently he doesn't really want to help in this situation. Well I need to change the "portfolio" slug to something else. "Portfolio" doesn't really work at all with the website I am working on. In the past what I've done is find `‘rewrite’ => array(“slug” => “portfolio”),` in `functions.php` and I would change it to `‘rewrite’ => array(“slug” => “NEW-SLUG-NAME”),`. However, in this theme the developer seems to do it differently. Below is the code in a file called `pix_post-types.php` which seems to handle this. I am not a PHP developer but I can do a good deal of editing and understand it more-or-less. I would really appreciate some help!               <?php     add_action('init', 'register_testimonial');          function register_testimonial() {       $args = array(         'labels' => array(       'name' => __( 'Testimonials' ),        'singular_name' => __( 'Testimonial' ),       'add_new' => _x('Add new', 'testimonial'),       'add_new_item' => __('Add a new testimonial'),        'edit_item' => __('Edit testimonial'),       'new_item' => __('New testimonial'),       'view_item' => __('View testimonial'),       ),     'capability_type' => 'page',     'has_archive' => false,     'hierarchical' => false,     'menu_position' => 22,     'public' => false,     'singular_label' => __('Testimonial'),     'show_ui' => true,     'supports' => array(       'title',       'thumbnail',       'editor',       'custom-fields',       'revisions')       );            register_post_type( 'testimonial' , $args );     }          add_action('init', 'register_portfolio');          function register_portfolio() {       $args = array(     'labels' => array(       'name' => __( 'Portfolio' ),        'singular_name' => __( 'Portfolio' ),       'add_new' => _x('Add new', 'portfolio'),       'add_new_item' => __('Add a new item'),        'edit_item' => __('Edit item'),       'new_item' => __('New item'),       'view_item' => __('View item'),       ),     'capability_type' => 'page',     'has_archive' => true,     'hierarchical' => false,     'menu_position' => 20,     'public' => true,     'rewrite' => true,     'singular_label' => __('Portfolio'),     'show_ui' => true,     'supports' => array(       'title',       'thumbnail',       'editor',       'excerpt',       'trackbacks',       'custom-fields',       'comments',       'revisions')       );                register_post_type( 'portfolio' , $args );         }          add_action( 'init', 'create_portfolio_taxonomies', 0 );          //create two taxonomies, genres and writers for the post type "book"     function create_portfolio_taxonomies()      {       // Add new taxonomy, make it hierarchical (like categories)       $labels = array(     'name' => _x( 'Galleries', 'taxonomy general name' ),     'singular_name' => _x( 'Gallery', 'taxonomy singular name' ),     'search_items' =>  __( 'Search Gallery' ),     'all_items' => __( 'All Galleries' ),     'parent_item' => __( 'Parent Gallery' ),     'parent_item_colon' => __( 'Parent Gallery:' ),     'edit_item' => __( 'Edit Gallery' ),      'update_item' => __( 'Update Gallery' ),     'add_new_item' => __( 'Add New Gallery' ),     'new_item_name' => __( 'New Gallery Name' ),     'menu_name' => __( 'Galleries' ),       );                register_taxonomy('gallery',array('portfolio'), array(     'hierarchical' => true,     'labels' => $labels,     'show_ui' => true,     'query_var' => true,     'rewrite' => array('hierarchical' => true )       ));            // Add new taxonomy, NOT hierarchical (like tags)       $labels = array(     'name' => _x( 'Tags', 'taxonomy general name' ),     'singular_name' => _x( 'Tag', 'taxonomy singular name' ),     'search_items' =>  __( 'Search tags' ),     'popular_items' => __( 'Popular tags' ),     'all_items' => __( 'All tags' ),     'parent_item' => null,     'parent_item_colon' => null,     'edit_item' => __( 'Edit tag' ),      'update_item' => __( 'Update tag' ),     'add_new_item' => __( 'Add New tag' ),     'new_item_name' => __( 'New tag name' ),     'separate_items_with_commas' => __( 'Separate tags with commas. They will be used for filtering portfolio items' ),     'add_or_remove_items' => __( 'Add or remove tags' ),     'choose_from_most_used' => __( 'Choose from the most used tags' ),     'menu_name' => __( 'Tags' ),      );             register_taxonomy('portfolio_tag','portfolio',array(     'hierarchical' => false,     'labels' => $labels,     'show_ui' => true,     'query_var' => true,     'rewrite' => array( 'slug' => 'portfolio_tag' ),       ));          }                      /*=========================================================================================    */          ?>


login in wordpress using gmail account

I implementing log in in my WordPress website for only company employees. I want user can only log in with company given Gmail Email id and no one else can see the details of website what should i do .I m new on this please help me. Thank in advance....


Migrating only media files

I have sort of a specific situation. I want to move my Wordpress site to a new hosting situation. The site has had weird problems in the past, so I was planning to do a fresh installation of Wordpress and rebuild the site to avoid bringing any baggage along. However, I'll want to recreate some of the pages exactly. To make the process easier I would like to just copy and paste the HTML of those pages straight over. The only problem is that the image URLs won't be the same. Can I just copy my media files over to the new Wordpress installation so that the image URLs will be the same? Or is there some problem with that?


Embed YouTube video from custom field value

I'm collecting Youtube video links in custom fields, but when I echo out the value it just prints the URL. How do I get WordPress to convert it to be embedded? Example:               <?php global $post;     $video = get_post_meta( $post->ID, '_my_video_link', true );     echo ( $video ); ?>      Just outputs `http://www.youtube.com/watch?v=tkEvSjdDfiA` But I want it to display the actual video... Thanks for any advice


I have a problem with Home Page title

I am using WordPress and "All in one SEO pack" plugin. I set up the title, descriptions, and keywords, and everything is working nice on site. Then I accidentally looked for my site on Google. I enter my domain in search and when I found my site, I was surprised that my title is not the same as on my site. It's a totally different title, but the description is good. I try some changes but it's not showing in that moment when I change. I don't know what the problem can be. Can someone tell me why is this happening?


Sort plugins by rating

When I want to install a new Wordpress plugin, I do a search for the plugin I want, and I receive a list of results. Is there any way to sort the results by rating, or name? If not, it would be a useful addition to Wordpress.


How to reduce the number of pages in pagination

The code below is the function for pagination in my wordpress blog. Presently it outputs 7 pages and then the .. last page number. How can I reduce this number so it shows only 5 pages and then ... last page number?               function emm_paginate_loop($start, $max, $page = 0) {         $output = "";         for ($i = $start; $i <= $max; $i++) {             $output .= ($page === intval($i))                  ? "$i"                  : "$i";         }         return $output;     }


Use the page slug in a WP_Query?

I'm doing some custom loops that I initialize with a query like this               $the_query = new WP_Query('page_id=266');      It works fine. It's just I'ld to call my page with its slug and not its ID. Would it be possible ?


Avoid WP_Query's duplicate posts with taxonomies

Given a blog featuring several categories (such as "Sport", "Nature", etc), I've then proceded to create a custom taxonomy, which allows me to show articles in certain areas of my blog with terms such as "slideshow", "sidebar- highlight", "top-category", etc. Inside my sidebar, I've created an area where articles (from the same category, lets say "Nature") are shown using two different loops. The first one shows only one article (the first one in chronological order, from the nature category and which is also inside the "sidebar-highlight" taxonomy's term) with a featured image, title and excerpt, whilst the second, only shows the latest 3 articles from the Nature category. In order to avoid duplicates, I've been using the following code: ` $nature_loop_1 = new WP_Query( array (                   'category_name' => 'nature',          'tax_query' => array (             array (                 'taxonomy'  => 'highlight',                 'field'     => 'slug',                  'terms'     => 'sidebar-highlight',                 'operator'  => 'IN'              )          ),         )       );     $nature_loop_2 = new WP_Query( array (               'category_name' => 'nature',          'tax_query' => array (             array (                 'taxonomy'  => 'highlight',                 'field'     => 'slug',                  'terms'     => 'sidebar-highlight',                 'operator'  => 'NOT IN'              )          ),         )       );       ` Yet, while this works, this means articles from "sidebar-highlight" will never show inside the second loop, no matter when they were posted. So I was wondering if is there any way I could manage to avoiding duplicates while allowing articles from "sidebar-highlight" term show. Thanks in advance.


How does adding custom meta to signup form work?

Following along with the answer posted here, How to add Custom Blog Options to new blog setup form? I am attempting to understand why the custom meta is added to the options table for the blog as long as I do not let the update_blog_option() run. I added echos and an exit() before that function to be sure the values were correct, and it populated the correct value in the options table. But when I remove the exit() and let it run through, it does NOT populate. The code in question is,               add_action('wpmu_new_blog', 'process_extra_field_on_blog_signup', 10, 6);     function process_extra_field_on_blog_signup($blog_id, $user_id, $domain, $path, $site_id,     $meta) {     update_blog_option($blog_id, 'extra_field', $meta['extra_field']);     }      Additionally, what exactly does the table wp_signups do? Is it a temporary holding location for signups until activated? And does that data get passed to the blog once activated? In which case, the meta that is stored there would get passed anyway right? The code used to add the custom meta is,               add_filter('add_signup_meta', 'append_extra_field_as_meta');     function append_extra_field_as_meta($meta) {     if(isset($_REQUEST['extra_field'])) {         $meta['extra_field'] = $_REQUEST['extra_field'];     }     return $meta;     }      And that is getting stored proper in the wp_signups table. Thank you for your help.


Delete the original big size image after upload and leave only 3 images crunched by media gallery

I need to know is it possible to somehow erase the original image uploaded via Gravity form : post image - post field?! With the situation now I receive 4 images. 1 original (can be whatever user has on his PC - up to 4 MB which clutters the server) and 3 which Wordpress creates according to specifications (thumbnail, medium, large). I would like to have the ability when user uploads the "original big image" to be deleted upon upload and be left with 3 remaining in media gallery?!. It will dramatically improve the storage on my server. Cheers!


Suggestion and Voting Plugin for Wordpress

I'm looking for a plugin for wordpress 3 that will allow me to setup a suggestion page. I'll post a question or idea at the top, and then users can post thier suggestions in the comments. then other users can vote for the best suggestions, and comments get sorted by the number of votes they get. i'm thinking of something sort of like the way the digg dialogg system would work, where the best 10 questions would get voted up from the bottom and get used in the show. I did some hunting around and couldn't find anything quite like it. If anyone could point me in the right direction that would be great! Thanks,


List recent 25 blogs across the network

I need to list recent 25 blogs in the network with their title. How to edit this code ?               $bcount = get_blog_count();            global $wpdb;       $blogs = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE spam = '0' AND deleted = '0' and archived = '0' and public='1'"));        if(!empty($blogs)){     ?>
<?php     foreach($blogs as $blog){         $details = get_blog_details($blog->blog_id);         if($details != false){             $addr = $details->siteurl;             $name = $details->blogname;             if(!(($blog->blog_id == 1)&&($show_main != 1))){                 ?>                 <li class="menu-item<?php if($counter == get_current_blog_id()){ echo ' current-menu-item';}?>">                     <a href="<?php echo $addr; ?>"><?php echo $name;?>
                 <?php             }         }     }     ?>
<?php     }


Sort posts by custom field numeric value using dropdown

I've read umpteen answers and questions about things that are very similar to this but I just can't get it to work for my specific situation. I have some posts with a category of "property". In `category.php` I want these posts to appear in ascending date order initially (as per usual). I then want to have a dropdown menu, which gives the option of viewing:   * price high to low   * price low to high   * latest (default). Each post has been assigned a custom field of "property_price" which is a numeric value. I also need pagination to work. Initial goes with this as my `query_posts`:               <?php     if ( have_posts() ) :       $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;       $args = array(          'meta_key' => 'property_price',          'orderby'  => 'meta_value_num',          'order'    => 'ASC',          'paged'    => $paged       );       query_posts( $args );       while ( have_posts() ) :         the_post();      This just renders a list obviously. However, even at this point, I am stuck as WordPress insists on ordering things like this: 1, 10, 100, 2, 3 so not actually in proper order. I thought using `'orderby' => 'meta_value_num'` was supposed to sort this out? If anyone can help I'd be very grateful. Be gentle on me, I'm no expert so fool-proof instructions gladly received. Thanks in advance.


WP_Query with custom post type ID

This code isn't echoing out anything, even though I'm 100% positive $mixtape_id is set to an integer which corresponds to one of the posts within the 'mixtapes' custom post type               $query = new WP_Query(array(       'post_type'      => 'mixtapes',       'p'              => (int)$mixtape_id,       'posts_per_page' => -1,       'orderby'        => 'meta_value_num',       'meta_key'       => 'track_number'     ));          while ( $query->have_posts() ) : $query->the_post(); ?>          <track>         <location>track1.mp3</location>         <creator>Artist name</creator>         <title>Track 1</title>     </track>          <?php endwhile; ?>


toolbar not visible on pages using front-page template

My profile is set to show the WP toolbar when viewing the site, but on a page using the front-page.php template the toolbar space is reserved but its contents are not visible. What could be the reason for this?


404 Page when emptying spam or deleting a plugin

I have recently had a website migrated by my host over to a new server within the same network. I have now noticed that within the WordPress dashboard, if I try and do any of the following...               Empty Spam     Delete Plugin      I get a 404 error, I imagine it is something to do with the migration but in terms of tackling my hosts can anyone suggest an area to concentrate on for fixing it?


Editing a list of several fields

I need to edit a list of quotes. Every quote consists of a (short) text, author's name, author's title. What is the best way to create an editor of such data in WordPress? It seems that the simplest solution is to create a custom post type. Should the quote text become the title of a post? (It is not quite the title, logically.) If not with post types, then how? Note, that I need two lists of quotes (in two languages).


Facebook sharer and parameters in URL

So after a lot of troubles (and thanks to this answer) I managed to make a GET parameter look better in URL, from `www.url.com/mypage/?id=123` to `www.url.com/mypage/123/` I hoped that would solve the redirection problem with Facebook sharer, but it doesn't. Facebook still recognizes my shared url as `www.url.com/mypage/` How is it even possible? Studying some Wordpress rewrite rules, I learned that when I type (link1) `www.url.com/nameofpage/` in fact I get redirected to (link2) `www.url.com/?pagename=nameofpage`. So why when I share link1 it recognizes it without redirecting to link2? How can I share the link I want (with id parameter) and make it work without redirections? * * * Edit: my code to rewrite the URL               add_action( 'init', 'miareg' );     function miareg(){         add_rewrite_tag("%id%", '(\d+)');         add_rewrite_rule('^flipbook/([^/]*)/?','index.php?page_id=6031&id=$matches[1]','top');     }      The real name of the page I have to share is /flipbook/ and the parameter is "id"; for example I have to share `www.mywebsite.com/flipbook/?id=82`. To explain `page_id=6031` : it's of course the id of the page (has nothing to do with the id mentioned before - the parameter)


Exclude one category from get_the_term_list

I want to exclude one of the categories from my posts, which will always be the same, named "documentaires" and with the ID 20. Here is the code :               <?php echo get_the_term_list( get_the_ID(), 'project_category', '', ', ' ); ?>


register_settings callback function posing problem

Hi I am writing this plugin as an exercise and everything is working except when I try to validate image upload through register_setting callback function it doesn't save data to options.php at all. Here is the code. I will highlight the problematic area. This is the line where I am having problem.               register_setting('JW_options_page',  'JW_options_page',array($this,  'jw_validate_setting'));      If I remove array($this, 'jw_validate_setting')); everything works except that I can't upload image.               <?php     /*         Plugin Name: Theme Admin Panel         Plugin URI: http://www.orangecreative.net         Description: Add extra functionality to restricted users.         Author: S. Abdullah         Version: 1.0         Author URI: http://www.orangecreative.net      */          class JW_options{         public $options;         public function __construct(){             $this->options = get_option('JW_options_page');             $this->register_settings_and_fields();         }              public function admin_menu_page(){             add_options_page('Theme Options', 'Theme Options', 'administrator', __FILE__, array('JW_options', 'display_options_page'));         }              public function display_options_page(){             ?>

My Theme options
                 <?php var_dump(get_option('JW_options_page')); ?>                 <form action="options.php" method="post" enctype="multipart/form-data">                     <?php settings_fields('JW_options_page'); ?>                     <?php do_settings_sections(__FILE__); ?>
                         <input type="submit" value="Save Changes" class="button-primary"/>
                      </form>
         <?php         }              public  function register_settings_and_fields(){             register_setting('JW_options_page', 'JW_options_page',array($this, 'jw_validate_setting'));             add_settings_section('jw_main_section', 'Main Settings', array($this, 'jw_main_section_cb'), __FILE__);             add_settings_field('jw_banner_heading', 'Banner Heading :', array($this, 'jw_banner_heading_settings'), __FILE__, 'jw_main_section');             add_settings_field('jw_logo', 'Your Logo :', array($this, 'jw_logo_setting'), __FILE__, 'jw_main_section');             add_settings_field('jw_color_scheme', 'Your Desired Color :', array($this, 'jw_color_scheme_setting'), __FILE__, 'jw_main_section');              }                        public  function jw_validate_setting($plugin_options){                 echo('ccsjdncjncdjcndjcndjcncjdncjdcndj');     //        if(!empty($_FILES['jw_logo_upload']['temp_name'])){     //            $override = array('test_form' => false);     //            $file = wp_handle_upload($_FILES['jw_logo_upload'], $override);     //            print_r($file);     //     //        }         }         public function jw_main_section_cb(){             //optional         }              public function jw_banner_heading_settings(){             echo "<input name='JW_options_page[jw_banner_heading]' type='text' value='{$this->options['jw_banner_heading']}'/>" ;              }         public function jw_logo_setting(){             echo "<input type='file' name='JW_options_page[jw_logo_upload]'/>" ;         }         public function jw_color_scheme_setting(){             $items = array('Red','Blue','Black');             echo '<select name="JW_options_page[jw_options_page]">';             foreach($items as $item){                 echo "<option value='$item'>$item</option>";             }             echo '</select>';         }          }     if(is_admin()){     add_action('admin_menu',function(){         JW_options::admin_menu_page();          });     add_action('admin_init', function(){         new JW_options();     });     }


Custom post type filter is being applied to all of my posts

I've created a filter to alter `the_title` hook in one of my custom post types (thanks Chip Bennett for the snippet). The function is supposed to tell Wordpress to call the title from a custom field (`_location`) within my custom post type page. The problem is that all of my pages and posts in Wordpress are displaying 'No Title'. Instead, I want plain 'ole posts to display their titles normally, then I want my custom post title to display the contents from my custom field. Here's the code that filters the titles:               function change_title ( $title ) {      if ( !'events' == get_post_type() ) {          return $title;      } else {          global $post;          $custom = ( get_post_custom( $post->ID ) ? get_post_custom( $post->ID ) : false );          $custom_title = ( isset( $custom['_location'][0] ) ? $custom['_location'][0] : '(No Title)' );          return $custom_title;      }           }      add_filter( 'the_title', 'change_title' );       Here's my entire functions.php file:               <?php               // Registers the new post type and taxonomy     function wpt_event_posttype() {     register_post_type( 'events',         array(             'labels' => array(                 'name' => __( 'Custom Widgets' ),                 'singular_name' => __( 'Custom Widget' ),                 'add_new' => __( 'Add Custom Widget' ),                 'add_new_item' => __( 'Add New Custom Widget' ),                 'edit_item' => __( 'Edit Custom Widgets' ),                 'new_item' => __( 'Add New Custom Widgets' ),                 'view_item' => __( 'View Custom Widgets' ),                 'search_items' => __( 'Search Custom Widgets' ),                 'not_found' => __( 'No custom widgets found' ),                 'not_found_in_trash' => __( 'No custom widgets found in trash' )             ),             'public' => true,             'supports' => array( 'custom_fields' ),             'capability_type' => 'post',             'rewrite' => array("slug" => "events"), // Permalinks format             'menu_position' => 99,             'register_meta_box_cb' => 'add_events_metaboxes'         )     );     }     add_action( 'init', 'wpt_event_posttype' );                    // Add the Custom Widgets Title Meta Box     function add_events_metaboxes() {     add_meta_box('wpt_events_location', 'Custom Widget Title', 'wpt_events_location', 'events', 'normal', 'high');          // Add the Page Template Assignments Meta Box     add_meta_box('pagetemplate', 'Page Template Assignments', 'pagetemplate', 'events', 'normal', 'high');          // Add the Post Assignments Meta Box     add_meta_box('postassignments', 'Post Assignments', 'postassignments', 'events', 'normal', 'high');          // Add the Additional Filters Meta Box     add_meta_box('additionalfilters', 'Additional Filters', 'additionalfilters', 'events', 'normal', 'high');     }               // The Callback for Custom Widget Title Metabox     function wpt_events_location() {     global $post;     // Noncename needed to verify where the data originated     echo '<input type="hidden" name="eventmeta_noncename" id="eventmeta_noncename" value="' .     wp_create_nonce( plugin_basename(__FILE__) ) . '" />';     // Get the title data if its already been entered     $boxtitle = get_post_meta($post->ID, '_location', true);     // Echo out the field     echo '<input type="text" name="_location" value="' . $boxtitle  . '" class="widefat" />';     }               // The Callback for Page Template Assignmets Metabox     function pagetemplate() {     global $post;     // Noncename needed to verify where the data originated     echo '<input type="hidden" name="pagetemplatemeta_noncename" id="pagetemplate_noncename" value="' .     wp_create_nonce( plugin_basename(__FILE__) ) . '" />';     // Get the title data if its already been entered     $boxtitle2 = get_post_meta($post->ID, 'page_template', true);     // Echo out the field     echo '<input type="text" name="page_template" value="' . $boxtitle2  . '" class="widefat" />';     }               // The Callback for Post Assignmets Metabox     function postassignments() {     global $post;     // Noncename needed to verify where the data originated     echo '<input type="hidden" name="postassignmentsmeta_noncename" id="postassignments_noncename" value="' .     wp_create_nonce( plugin_basename(__FILE__) ) . '" />';     // Get the title data if its already been entered     $boxtitle3 = get_post_meta($post->ID, 'post-assign', true);     // Echo out the field     echo '<input type="text" name="post_assign" value="' . $boxtitle3  . '" class="widefat" />';     }               // The Callback for Additional Filters Metabox     function additionalfilters() {     global $post;     // Noncename needed to verify where the data originated     echo '<input type="hidden" name="additionalfiltersmeta_noncename" id="additionalfilters_noncename" value="' .     wp_create_nonce( plugin_basename(__FILE__) ) . '" />';     // Get the title data if its already been entered     $boxtitle4 = get_post_meta($post->ID, 'additional_filters', true);     // Echo out the field     echo '<input type="text" name="additional_filters" value="' . $boxtitle4  . '" class="widefat" />';      }               // Save the Metabox Data     function wpt_save_events_meta($post_id, $post) {     // verify this came from the our screen and with proper authorization,     // because save_post can be triggered at other times     if ( !wp_verify_nonce( $_POST['eventmeta_noncename'], plugin_basename(__FILE__) )) {     return $post->ID;     }     // Is the user allowed to edit the post or page?     if ( !current_user_can( 'edit_post', $post->ID ))         return $post->ID;     // OK, we're authenticated: we need to find and save the data     // We'll put it into an array to make it easier to loop though.     $events_meta['_location'] = $_POST['_location'];     // Add values of $events_meta as custom fields     foreach ($events_meta as $key => $value) { // Cycle through the $events_meta array!         if( $post->post_type == 'revision' ) return; // Don't store custom data twice         $value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)         if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value             update_post_meta($post->ID, $key, $value);         } else { // If the custom field doesn't have a value             add_post_meta($post->ID, $key, $value);         }         if(!$value) delete_post_meta($post->ID, $key); // Delete if blank     }     }     add_action('save_post', 'wpt_save_events_meta', 1, 2); // save the custom fields                         add_filter( 'manage_edit-events_columns', 'my_edit_events_columns' ) ;          function my_edit_events_columns( $columns ) {          $columns = array(         'cb' => '<input type="checkbox" />',         'title' => __( 'Custom Widget Title' ),         'page_assign' => __( 'Page Template Assignments' ),         'post_assign' => __( 'Post Assignments' ),         'additional' => __( 'Additional Filters' ),         'date' => __( 'Date' )          );          return $columns;     }                         add_action( 'manage_events_posts_custom_column', 'my_manage_events_columns', 10, 2 );          function my_manage_events_columns( $column, $post_id ) {     global $post;          switch( $column ) {              /* If displaying the 'duration' column. */         case 'page_assign' :                  /* Get the post meta. */             $page_assign = get_post_meta( $post_id, 'page_assign', true );                  /* If no duration is found, output a default message. */             if ( empty( $page_assign ) )                 echo __( 'Unknown' );                  /* If there is a duration, append 'minutes' to the text string. */             else                 printf( __( '%s minutes' ), $page_assign );                  break;              /* If displaying the 'duration' column. */         case 'post_assign' :                  /* Get the post meta. */             $post_assign = get_post_meta( $post_id, 'post_assign', true );                  /* If no duration is found, output a default message. */             if ( empty( $post_assign ) )                 echo __( 'Unknown' );                  /* If there is a duration, append 'minutes' to the text string. */             else                 printf( __( '%s minutes' ), $post_assign );                  break;                               /* If displaying the 'genre' column. */         case 'additional' :                  /* Get the genres for the post. */             $terms = get_the_terms( $post_id, 'additional' );                  /* If terms were found. */             if ( !empty( $terms ) ) {                      $out = array();                      /* Loop through each term, linking to the 'edit posts' page for the specific term. */                 foreach ( $terms as $term ) {                     $out[] = sprintf( '%s',                         esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'additional' => $term->slug ), 'edit.php' ) ),                         esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'additional', 'display' ) )                     );                 }                      /* Join the terms, separating them with a comma. */                 echo join( ', ', $out );             }                  /* If no terms were found, output a default message. */             else {                 _e( 'No Additional Filters' );             }                  break;              /* Just break out of the switch statement for everything else. */         default :             break;     }     }               function change_title ( $title ) {       global $post;       if ( !'events' == get_post_type( $post ) ) {           return $title;       } else {           $custom = ( get_post_custom( $post->ID ) ? get_post_custom( $post->ID ) : false );           $custom_title = ( isset( $custom['_location'][0] ) ? $custom['_location'][0] : '(No Title)' );           return $custom_title;       }            }       add_filter( 'the_title', 'change_title' );


Why time functions show invalid time zone when using 'c' time format?

These are the functions I use in my theme to display the "entry-meta" which includes **published** and **last modified** dates (among others) of an article:               // Shows Author and Published Date     if ( ! function_exists( 'reddle_posted_on' ) ) :     function reddle_posted_on() {         printf( __( 'Posted by %7$s — <time datetime="%3$s" pubdate>%4$s</time>', 'reddle' ),             esc_url( get_permalink() ),             esc_attr( get_the_time() ),             esc_attr( get_the_date( 'c' ) ),             esc_html( get_the_date() ),             esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),             sprintf( esc_attr__( 'View all posts by %s', 'the-wolf' ), get_the_author() ),             esc_html( get_the_author() )         );     }     endif;          // Shows Last Modified Date     if ( ! function_exists( 'reddle_last_modified_on' ) ) :     function reddle_last_modified_on() {         printf( __( 'Last updated on <time class="updated" itemprop="dateModified" datetime="%2$s">%3$s</time>', 'reddle' ),             esc_attr( get_the_modified_time() ),             esc_attr( get_the_modified_date( 'c' ) ),             esc_html( get_the_modified_date( 'F j, Y ~ H:i' ) )         );     }     endif;      Do you see anything wrong with these functions? The problem is, despite setting the time zone of my blog to `GMT-05:00` (-04:00 DST) in **WordPress Dashboard > Settings > General** the timestamp that is output shows `GMT+00:00`. Any idea why?


Ordering Pages and Increasing Navigation

Is there a way of ordering my pages on my WordPress site so they appear in the navigation bar of the order i choose? ALSO: When i have too many wordpress pages for the navigation, it hides some pages. Is there a way to stop this so all pages are shown?


Custom posts and get_post_meta in {$post_status}_{$post_type}

I am making a function to parse a .csv file uploaded in a custom field of a custom post. The name of the custom **phone** and the field's name is **plan_information** . The problem is when I `var_dump(get_post_meta($post_id, 'plan_information', TRUE))` , I get an empty string. The code I use is the following:               add_action('publish_phone', 'parse_csv', '99', 2);          function parse_csv($post_id) {          global $post;          $csv_file = get_post_meta($post_id, 'plan_information', TRUE);          $csv_file = wp_get_attachment_url($csv_file);          $title = get_post_meta($post_id, 'manufacturer', TRUE);     $title .= ' '.get_post_meta($post_id, 'model', TRUE);     $title .= ' '.get_post_meta($post_id, 'memory', TRUE);          $url = get_bloginfo('wpurl').'/';          $csv_file = str_replace($url, ABSPATH, $csv_file);          if($csv_file && !$carriers) {         $fp = fopen($csv_file ,"r");         if($fp) {             fgetcsv($fp, 1000, ",");                  while (($data = fgetcsv($fp, 1000, ",")) !== FALSE)             {                      $new_carrier = array(                     'post_title' => $title. ' '. $data[0] . ' ' . $data[3],                     'post_status' => 'publish',                     'post_type' => 'carrier'                     );                 $post_id = wp_insert_post($new_carrier);                 add_post_meta($post_id, 'operator', $data[0], true);                 add_post_meta($post_id, 'logo', $data[1], true);                 add_post_meta($post_id, 'cost', $data[2], true);                 add_post_meta($post_id, 'plan_name', $data[3], true);                 add_post_meta($post_id, 'hero', $data[4], true);                 add_post_meta($post_id, 'summary', $data[5], true);                 add_post_meta($post_id, 'phone_id', $post_id, true);             }         }              fclose($fp);     }          }


Activating child theme returns "active theme is broken"

I was using the Pinboard theme, but want to make modifications to it. Instead of editing the theme files directly, I wanted to try to make my changes using a child theme. Following the codex, I created a new folder named **pinboard-child** under **/wp-content/themes/**. I created a **style.css** file, added the code below, and threw it in the folder.               /*     Theme Name: Pinboard Child     Theme URI:      Template: pinboard-child     Description: Child theme for the Pinboard theme     Author: One Designs, modified by me     Version: 1.0     Tags:      */          @import url("../pinboard/style.css");          body {        background-color: #FF0000;     }      (I added the body styling just to see if everything worked as expected) I navigated to **/wp-content/themes/pinboard-child/style.css** to verify my file was in the correct location, and everything showed correctly. After I network-enabled the theme, I found the theme sitting in my Appearance menu, although the preview image was gray. I clicked on "activate", and Wordpress came back with the message "The active theme is broken. Reverting to the default theme." and set my site's theme to Twenty Twelve. After scouring the internet, I'm at a complete loss as to what more I can do. Does anyone know 1. what might be causing this issue and/or 2. what I might be able to do to fix it?


Store records for a table in wordpress

I need to create a page in wordpress that displays a table with 3/4 fields, and let editors add and update the records in this table. I'm a drupal developer and don't have much experience with wordpress. I know that in drupal I would just create a content type 'record' and than create a view to display a list. I can't think of any way to achieve that in wordpress (in a user friendly way. apperenetly my suggestion to have an unpublished post for each record with a tag 'record' isn't acceptable on my employers...) Thank you for your help...


Custom css per category and per single post belong in each category

the condition is: there's a wordpress site that has 8 categories, and each category has sub- category, and each subcategory has several posts (and still will be updating/counting) :   * Category A - 8 subcat    * Category B - 5 subcat   * Category C - 4 subcat   * Category D - 3 subcat    * Category E - 2 subcat    * Category F - 1 subcat   * Category G - 5 subcat    * Category H - 4 subcat * * * The body_class() function is already exist in header, and I want to make   * Each category has different background image and custom header (ex: instead of Browsing the "xx" Category text- i'll be using custom words/image)   * For each single post page belong to certain category, the style is inherit. (i dont know how to explain that on english - but what I want to achieve is: A single post that belong to **category A** have the same style with **Category A** archive pages. I did add:                   .category-A          { /* css here */ }              .category-B         { /* css here */ }              etc      but for each single page, the styling did not work.. and to tweak single page that belong to category who- I don't know the code. So... there's pretty much the rough description of my problem, though. Please help :(


Category menu that filters out empty categories

I'm trying to build a menu which can be administered from the menu editor, but gets filtered before being output. More specifically the menu contains Woocommerce product categories, organised into a hierarchy, and I want to exclude empty categories from being output. This will allow administrator to set the hierarchy once and have the menu reflect which products are currently in stock dynamically. After follwoing ENTHUSIAST's comment about a similar thread I have the code below but am not getting the right result. All items are being output               function exclude_empty_cat_menu_items( $items, $menu, $args ) {       // Get a list of product categories that excludes empty categories       $non_empty_categories = get_categories(array('taxonomy' => 'product_cat'));       // Iterate over the menu items       foreach ( $items as $key => $item ) {         $is_empty = true;         // check current item is in the non-empty categories array         foreach ( $non_empty_categories as $key => $cat )           if ($item->title == $cat->name)              $is_empty = false;           // if it is empty remove it from array           if ($is_empty) unset($items[$key]);       }       return $items;     }     add_filter( 'wp_get_nav_menu_items', 'exclude_empty_cat_menu_items', null, 3 );


wp_localize_script() dont parse values

I try to parse php values to js file using wp_localize_script()               wp_enqueue_script( 'countdown_js', plugin_dir_path( __FILE__ ) . 'js/countdown.js', array(), '1.0.0', true );              $dataToBePassed = array(         'seconds'            => 10,         'minutes'            => '20'         );     wp_localize_script( 'countdown_js', 'parse_vars', $datatoBePassed );      I get NULL for the values:               <script type="text/javascript">      /* <![CDATA[ */      var parse_vars = null;      /* ]]> */     </script>


How to use add_action inside files included by theme's functions.php

I've a functions.php inside my theme folder. The first line of `functions.php` is               require_once 'custom.php';      inside `custom.php` I have this simple code:               add_action('wp_print_scripts','add_js_vars');     function add_js_vars(){          //some stuff here     }      The problem with the code above is that add_js_vars is not executed. If I move `add_action('wp_print_scripts','add_js_vars');` inside themes `functions.php` everything works fine. I'm not able to understand what's the problem. Any ideas? Thanks for your help.


Save both current and new version of post meta

I want to save two versions of my custom meta box data called "sidebar". I want to compare a new and old version of this data later on, so that is why I want to save a copy of the current "sidebar" to a field called "sidebar_old", just before saving a new version. Here's my attempt at doing just that:               add_action('pre_post_update', 'content_old_save');          function content_old_save() {         global $post;         $sidebar_old = get_post_meta($post->ID, 'sidebar', true);              update_post_meta($post->ID, "sidebar_old", $sidebar_old); // current/old sidebar     }      This is how I save the new version:               add_action('save_post', 'sidebar_title_update');          function sidebar_title_update($post_id) {         global $post;              if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {         return $post_id;         }              update_post_meta($post->ID, "sidebar", $_POST["sidebar"]); // new sidebar     }      Thing is, only the new sidebar value is inserted into the database, to both "sidebar" and "sidebar_old", so somehow the new value is already inserted into the db even before pre_post_update?


Instead of submiting an entire post, is there any way to submit a lite-post or a simple message?

I was wondering if there is a way or a plugin to post something like twitter update messages instead of a post. Something like http://p2demo.wordpress.com/ but better, where a user will post update messages not an entire post (in database matters). That means you will save space, make it quicker and fewer database resources. I am looking for a way to post lite messages, that database will only save the must, like IDs, title, post and a thumb, through php maybe. No taxonomies and and and. I hope you understand what I am trying to say (sorry for any bad English) Thank you. **Updated** : I found this code, should I use this as a twitter posting feature? (As I said I need fewer db resources)               // Create post object     $my_post = array();     $my_post['post_title']    = 'My post';     $my_post['post_content']  = 'This is my post.';     $my_post['post_status']   = 'publish';     $my_post['post_author']   = 1;     $my_post['post_category'] = array(0);     // Insert the post into the database     wp_insert_post( $my_post );"


WP_Query and next_posts_link

I cannot figure out how to make next_posts_link() work within my custom WP_Query. Here is the function:               function artists() {       echo '
';       $args = array( 'post_type' => 'artist', 'posts_per_page' => 3, 'paged' => get_query_var( 'page' ));       $loop = new WP_Query( $args );       while ( $loop->have_posts() ) : $loop->the_post();         echo '';         echo '
'.get_the_title().'
';         $attachments = attachments_get_attachments();         $total_attachments = count( $attachments );         for( $i=0; $i<$total_attachments; $i++ ) {           $thumb = wp_get_attachment_image_src( $attachments[$i]['id'], 'thumbnail' );           echo '';         }         echo '';       endwhile;       echo '
';       next_posts_link();     }      Can anyone tell me what I am doing wrong? Thanks


Is wordpress good enough for ecommerce?

I'm familiar with Wordpress and some e-commerce back-ends like Magento, etc. I think I could build it with these, but I got advice not to do this as it will be hard to scale in the future. Should I listen to them? Also, I will need custom features like custom product pages, user profile pages, voting elements, file uploads. Will I abe able to implement such features and more with wordpress?


fetching posts and showing on frontpage

I am having two sites viz. **www.a.com** and **www.a.com/b** . Now, these are two seperate wp installations, in the same /root where 'b' is kind of an extended vertical site of 'a'. I want to achieve the technique where I'd be able to show recent (or all that I publish) posts of B on A's front page. The post should look like as it the usual part of A's native posts. For ex- if I post any topic title "my post" on B, then it should appear on its front page plus, it should also appear on A's frontpage. Any help?


Making a plugin only available on the front-end for the logged in super admin

I made a little plugin that enqueues 1 .js file and 1 .css file into a theme's front-end. All it does it load a grid on top of the theme so I can visualise the design. If this plugin was activated on a live site, is it possible that only I (the super admin) can see the JS and CSS files included onto the front-end? All I have inside the plugin file is this:               function load_grid() {         wp_enqueue_style('grid_css', plugins_url('/lib/css/grid.css', __FILE__) );         wp_enqueue_script('grid_js', plugins_url('/lib/js/grid.js', __FILE__), array('jquery') );     }     add_action('wp_enqueue_scripts', 'load_grid');


How to avoid repeatedly use the new statement to instantiate a class?

I have a Class with a lot of variables. To get a variable, I have to write this line in each function:               $x = new MY_Class();      I guess there has to be another way? I tried:               function my_data(){     global $x;     $x = new MY_Class();     return apply_filters( 'my_data', $x )     }      Then, I tried to use `$x->var` in other functions that need the variables, but it doesn't work. How can I make the `global $x` and its variables accessable by other functions? Thanks!


Fetch Google Calendar in a custom way

I have to integrate the next upcoming events from a Google Calendar. Just a custom list of the events with a few CSS-enhancements to style the date and the title. Is there a way to do so? I checked plugins etc but I don't find solutions to integrate it in my theme. Is there a way to do this with the rss- feed? Thank you!


Divs appearing everywhere in post content

Whenever somebody writes a post on our site, the Paly Voice (http://palyvoice.com) there are automatically a lot of `<div>` elements created. This is bad for layout, since we have a style that applies to divs that we don't want to apply to story styles. Is there a way to remove the automatic div insertion? If not, can I add a function hook to parse the post and remove them before saving to the DB? Edit: Example here: http://palyvoice.com/2012/08/22/new-grade-reports-to-be- mailed-home-every-four-weeks-2/


How to display list of child pages of parent page in wordpress?

I have following format of menu.               Treatment      -Beauty       --Services       --Products      -Surgery      -washing      I have followed follwed following link: How to Display a List of Child Pages For a Parent Page in WordPress But I do not want subpages of "Beauty" page. I want only "Treatment" Subpages.


Creating custom user roles

I need to create a custom user role who will be able to create posts (of a specific post type) but not publish them (just like the current contributor role. I'm being a bit confused on how to create a new role or capability to achieve this. How/where do I start? Thanks **UPDATE:** I added these to the custom post function as suggested by Eric Holmes               'capabilities' => array(         'edit_posts' => 'edit_helps',         'edit_post' => 'edit_help',         'read_post' => 'read_helps',     ),      Added these to plugin activation hook, and the opposite in deactivation hook (I'm modifying the contributor role itself):               function modify_user_capabilities() {       $role = get_role( 'contributor' );       $role->remove_cap( 'delete_posts' );       $role->remove_cap( 'edit_posts' );       $role->add_cap('edit_helps');       $role->add_cap('edit_help');       $role->add_cap('read_helps');       }          register_activation_hook( __FILE__, 'modify_user_capabilities' );      Now only the contributor can edit this post type, not other users (Eg admin) Is there a better way to batch assign them these capabilities? I edited my activation hook to:               function modify_user_capabilities() {       $role = get_role( 'contributor' );       $role->remove_cap( 'delete_posts' );       $role->remove_cap( 'edit_posts' );            foreach (array('administrator', 'editor', 'author', 'contributor') as $user_role) {         $role = get_role($user_role);         $role->add_cap('edit_helps');         $role->add_cap('edit_help');         $role->add_cap('read_helps');       }       }      **UPDATE 2:** I totally forgot to assign someone to delete the posts. So I updated the function:               function modify_user_capabilities() {            //remove the contributor from editing any post       $role = get_role( 'contributor' );       $role->remove_cap( 'delete_posts' );       $role->remove_cap( 'edit_posts' );            foreach (array('administrator', 'editor', 'author', 'contributor') as $user_role) {         $role = get_role($user_role);         $role->add_cap('edit_helps');         $role->add_cap('edit_help');         $role->add_cap('read_helps');       }       //let admins delete posts       $role = get_role('administrator');       $role->add_cap('delete_helps');       $role->add_cap('delete_publised_helps');       $role->add_cap('delete_others_helps');       $role->add_cap('delete_help');     }      Now the admin can delete these posts.


How to find all links between pages

I'm trying to have sort of a functionality that will let me find all internal links on my site that are pointing to a page. i.e - I want to know all pages on my site that are linking to (any) page in my site. I tried to find sort of a ready made plugin for that, but didn't seem to find. I can develop one by myself, but I wonder what will be the best way to have such functionality. Any ideas will be very welcomed . Thanks


The Correct Way to Use Nonce Field without Settings API

I'm trying to create an admin option page without the Settings API for some reasons. Then if I do so, I've heard that I need to use nonces for security. I'd like to know the correct way to use them. This is what I've tried by following this page: Using nonce external of WP Admin admin.               <?php     /*     Plugin Name: Demo for Using Nonce     Description: Demo plugin demonstrating how to use nonce     Author: Teno     */          // define constants     define("DEMONONCE", "demo_nonce");     define("DEMONONCEPAGESLUG", "demo_nonce_adminpage");          // create an option array     $arrOption = get_option(DEMONONCE);     update_option(DEMONONCE, array_merge(array(), is_array($arrOption) ? $arrOption : array()));          // admin menu     add_action('admin_menu', 'demo_nonce_adminmenu');     function demo_nonce_adminmenu() {         add_options_page('Demo Plugin Menu for Nonce without Settings API', 'Demo Plugin Menu for Nonce without Settings API', 'manage_options', DEMONONCEPAGESLUG, 'demo_nonce_adminpage');     }     // admin page     function demo_nonce_adminpage() {         $options = get_option(DEMONONCE);              print_r($_POST); // for debugging         echo '
';              if(isset($_POST[DEMONONCE]['submitted']) && !wp_verify_nonce($_POST['name_of_nonce_field'], 'name_of_my_action')){             return;         }              if(isset($_POST[DEMONONCE]['submitted']) && $_POST[DEMONONCE]['submitted'] == 1){             if (strlen(trim($_POST[DEMONONCE]['option_a'])) == 0) {                 $options['invalid'] = True;                      echo '

Options are not saved.

';             } else {                     $options = array_merge($options, $_POST[DEMONONCE]); // it seems the tab caption is erased here                 update_option(DEMONONCE, $options);                 echo '

Updates are saved.

';             }         }            ?>
             <?php // heading              screen_icon(); ?>
Demo Plugin for Nonces without Settings API

Page 1
             <form method="post" action="">  <?php // 'action=""' means to send the form post data to this page itself. ?>                 <?php wp_nonce_field('name_of_my_action', 'name_of_nonce_field'); ?>                 <input type="hidden" name="<?php echo DEMONONCE; ?>[submitted]" value="1" />

                         Option A	                                                      <input name="<?php echo DEMONONCE; ?>[option_a]" size="40" type="text" value="<?php echo $options['invalid']  ? $_POST[DEMONONCE]['option_a'] : $options['option_a']; ?>" />                             <?php echo ($options['invalid'] && $options['invalid'] ) ? '* cannot be blank.' :'' ?>

                         Option B	                                                      <input name="<?php echo DEMONONCE; ?>[option_b]" size="40" type="text" value="<?php echo $options['invalid'] ? $_POST[DEMONONCE]['option_b'] : $options['option_b']; ?>" />

                 <?php submit_button(); ?>                </form>
          <?php     }     ?>      I placed `if(isset($_POST[DEMONONCE]['submitted']) && !wp_verify_nonce($_POST['name_of_nonce_field'], 'name_of_my_action')){ return; }` before displaying the form and placed `<?php wp_nonce_field('name_of_my_action', 'name_of_nonce_field'); ?>` in the form tag. I'm still not sure if this is all okey. What strings should I put for 'name_of_nonce_field' and 'name_of_my_action' ? Could they be whatever I name? And what else should I do besides nonces for creating a more secure administration page?


Detect featured image among the attached images

I use the following code to extract the attached images from a post with ID:               $args            =   array(         'post_type'      => 'attachment',         'post_parent'    => $product_id,         'post_mime_type' => 'image',         'orderby'        => 'menu_order',         'order'          => 'ASC',         'numberposts'    => -1     );          $attachments     =   get_posts($args);      The problem is that the above code return all the attached files. Is there a way to remove from the results the featured image ? I don't mind if I will do it through the $args query, by some if statement or by filtering the $attachments array. Kind regards Merianos Nikos


Cannot post comments if I don't post a website?

I have a severe problem with my comment template. For some reason comments won't show up unless somebody also clicks on the website field. It's not necessary to actually post a website, but you have to click on the field, otherwise the comment just won't show up. Here's my website so you can try yourself. Here's my comment.php: http://pastebin.com/pgpQ2Cx3 And here my comment- template.php (which I haven't changed but maybe a plugin did): http://pastebin.com/5zaubXWm Any ideas? :( I already tried various things modifying my comment.php, but nothing worked. Thanks a lot in advance.


Add metabox with media uploader in a custom post type

I need to create a "media uploader metabox" and add it to my custom post type. I've already create normal metaboxes, the function to add to the custom post type and the function to save them, I only need to use the wordpress' media uploader but I can't figured out how to do that. After that I would insert something like "Add more image" that add more metaboxes into the page.   Something like that: ![enter image description here](http://i.stack.imgur.com/PFe5P.jpg)


Scheduling a task using class methods

I need to implement a scheduled task in my plugin, and I tried to follow the examples in the documentation, passing one of class methods as the target. I installed Cron Manager plugin, and I see that my hook has been scheduled, but the first schedule is a few seconds in the past. I guess that's because WP sets the very first schedule to "now", which, supposedly, should call the hook straight away. The issue is that the method I attached to the hook is not called, and Cron Manager displays " _seconds left: -X_ " (where X is the amount of seconds passed from the moment I scheduled the task). I will skip the `wp_schedule` stuff as I know that it works (the hook is in the scheduled list, although with a timestamp in the past), so here's the relevant code:               // Cron hook is called myclass_cron     class MyClass {         public function __construct() {             add_action('init', array($this, 'wordpress_loaded'));         }              public function wordpress_loaded() {             add_action('myclass_cron', array($this, 'cron_tasks'));         }              public function cron_tasks() {             // Cron stuff. I tried adding a "sleep()" command to see if page load was slower, but it clearly doesn't go through this method         }     }      If I add a `do_action('myclass_cron')`, `cron_tasks()` runs as expected. I was wondering if I was calling `add_action()` too late (i.e. when WP is loaded), but I tried to move it to the Class Constructor, and the issue persisted. Thanks in advance for the answers.


how to open page, defined in plugin, from dashboad widget

I have a plugin that adds a number of admin pages, and drives two page templates for the public facing documents. It also loads one dashboard widget for "subscribers". In this widget is a list of links to a summary pages. The summary page is located in the plugin directory tree, and has the same ownership and privileges as all other php files. The links appear and I can click on them, but get the "you do not have permissions to access this page" notice. In the plugin functions, I have declared this function:               function pgc_certificate_display() {         include('pg-certificate-display.php');     }      In plugin initialization I declare the page slug:               add_users_page('edit.php?post_type=page', 'Certificates', 'Certificates', 'read', 'certificate-display', 'pgc_certificate_display');      In the code that manufactures the list of summary pages is in the dashboard widget php, where the URL is constructed as follows:               $_SERVER['SCRIPT_NAME'] . '?page=certificate-display&cert_number=' . $cert['cert_number']      I have error display enabled and none are being raised. What are the incorrect bits in this?


How to export/import theme customizer settings?

I am wondering if it is possible to export theme customizer settings(theme_mods) to be imported into another install of the same theme. I know that the settings are saved into the database so I am wondering if there is a plugin or tool to create a XML file for import like many themes have for settings.


Complex WP_Query Using Post Date And Post Meta

I am using Wordpress as a CMS on a website which has standard posts, a custom advert post type and a custom event post type. The event post type has some custom meta which stores the event start date. I am attempting to make a feed of all three post types on the home page (i.e. index.php). The standard posts and advert posts need to be ordered by their post date, but the events need to be ordered by their start date and slotted into the feed in the correct position. Is it possible to run a query which selects all three post types and two of the post types by post date and one post type by a meta value? I'm currently using this query to bring in the standard posts and advert posts:               if (is_home() && $query->is_main_query())         $query->set( 'post_type', array('post', 'ecs_adverts'));


Change category block name/title in add/edit post screen

`Category` taxonomy is a default taxonomy comes with wordpress on `post` type. I want to change the name of this taxonomy to something else. How can I achieve that?


Show a Category Specific Info Box

I have a number of categories which are regions of the country (north, south, etc). I would like to display some kind of info box at the end of each post which falls into one of these categories with an icons and links specific to that category, such as MAPS, HISTORY. Each region category would have the same link names and icons, but each would direct to a different URL relevant to that category. For instance NORTH Maps - maps.com/north History - history.com/north SOUTH Maps - maps.com/south History - history.com/south Thought about creating a widget area, but it could become messy. Any better ideas?!?


wordpress problem

After wordpress installation, i try to access and make current config. but it shows:               <?php     /**      * Front to the WordPress application. This file doesn't do anything, but loads      * wp-blog-header.php which does and tells WordPress to load the theme.      *      * @package WordPress      */          /**      * Tells WordPress to load the WordPress theme and output it.      *      * @var bool      */     define('WP_USE_THEMES', true);          /** Loads the WordPress Environment and Template */     require('./wp-blog-header.php');     ?>


Adding a wp_head hook from an included PHP file

I am using a WordPress plugin for including PHP code within posts and pages, and it's working great - however, I need to insert some styles and scripts, and in order to do that, I need to add a hook to wp_head. I tried it, creating a function and using `add_action('wp_head','my_func');` but it didn't work - my stuff is not being included. I think its because wp_head is being called before my script it being included. I would like to do this without changing any of my themes files. Is there any way to do this? I am using the latest WordPress version.


basic shortcode - Why 1st paragraph not wrapped in p tag, but 2nd is

I'm working on a basic plugin that adds shortcodes for columns, buttons, panels, ect. Nothing new here. I haven't altered wpautop in anyway; I've tried removing it and delaying it - no change. What happens with all shortcodes used is, the first paragraph isn't wrapped within a p tag (the p tags are actually appearing directly after the first paragraph and empty), but all paragraphs after the first within the same shortcode ARE wrapped in p tags. I need to figure out WHY the first paragraph isn't being wrapped. Function:               function vc_shortcode_panel($atts, $content = null) {       extract( shortcode_atts( array(         'type' => ''       ), $atts) );      return '
' . do_shortcode( trim($content) ) . '
';      }     add_shortcode('panel', 'vc_shortcode_panel');      Shortcode:               [panel type=""]paragraph 1          paragraph 2[/panel]      Output looks like this:
       paragraph 1

paragraph 2

      I know if I add a line break between the [panel] and the first paragraph, it will then wrap that first paragraph in a p tag. But shouldn't shortcodes be able to be formatted correctly without requiring that line break? What am I doing wrong and can anyone tell me why this is happening?


Theme Options page not saving data correctly

I am struggling to save the correct data in my themes options page. Here is my code in my functions.php file:               <?php      if ( get_option( 'everes_options' ) ) {          $everes_options = get_option( 'everes_options' ); }     else {         add_option( 'everes_options', array(             'everes_pdf' => '1',              'everes_showBlog' => '1'         ) );         $everes_options = get_option( 'everes_options' ); }     }          function everes_options(){         global $everes_options;         ?>

Resume Options
           <form action="edit.php?post_type=employment&page=resume_options" method="post">

                 Print as PDF?	                                    <select name="everes_pdf">                     <option value="1" <?php selected( '1', $everes_options['everes_pdf'] ); ?> >Yes</option>                     <option value="0" <?php selected( '0', $everes_options['everes_pdf'] ); ?> >No</option>                   </select>

                 Show blog	                                    <select name="everes_showBlog">                     <option value="1" <?php selected( '1', $everes_options['everes_showBlog'] ); ?> >Yes</option>                     <option value="0" <?php selected( '0', $everes_options['everes_showBlog'] ); ?> >No</option>                   </select>

                 <?php submit_button(); ?>

           </form>
     <?php } ?>      When I submit the data, it will save the data, but after a few clicks in the menu, or refreshed in the website, the data disappears. I can't see where the issue is, but I do believe that it would be glaringly obvious to someone here. Any help? Please?