How to add drag and drop functionalities to a div inside option panel

Hi to all it's a few days that I'm trying to add some new functions to my theme option-panel, you can see my questions here:   * How to add an export function to a custom Option Theme Page   * Add a preview to a Wordpress Control Panel   * Modify CSS via Theme Control Panel What's wrong with it? I'm trying to add a live preview of some modification BEFORE saving them but...I'm not able to add it...I'm almost a completely newbie in JS, I know a little PHP, enough CSS and HTML so here are the reasons of my questions... Anyway my new idea is to add the possibility to DRAG & DROP some DIVs, place them on a map, save their position and show them inside my website. I try to explain it better. Actually in my option-panel I have 10 functions: zona1, zona2, zona3 ..... with 4 values:   * zona1c = checkbox to choose if you want to show it or not   * zona1x = X Axys position (it changes LEFT CSS ATTRIBUTE)   * zona1y = X Axys position (it changes BOTTOM CSS ATTRIBUTE)   * zona1l = user have to write the URL of the post linked to this point Everything is working so if I write a value inside zona1x and zona1c is set to TRUE it shows the div in my website. But I would like to improve this because sometimes I make mistakes so I don't want to go "live" before everything is good. What I would like you to teach me is how to add a preview of that page then if zona1c is set to true I want to be able to move this DIV inside the preview (that is visible in my admin-panel) choose the right position, drop it and SAVE. Is there any easy or STEP BY STEP (Please, I would like to learn something new) solution for my problem? Thank you very much to all! Let's start with the code: This is my Functions.php : http://pastebin.com/8cVmne1s This is my admin-panel.php: http://pastebin.com/xX8G4Zxr or:               <?php     /** Declare the themename and shortname -- Ecco il nome del template e la sua abbreviazione **/     $themename = "Appartamenti Acquario";          $shortname = "appaqua";     /** Set the array with all the theme options -- Impostiamo l'array con tutte le opzioni del tema **/          $options = array (          array(          "desc" => "
IMPOSTAZIONI GENERALI
",     "type" => "title"),     array( "name" => "Prima di cominciare",         "type" => "section"),     array( "type" => "open"),     array( "name" => "Link pagina mappa",         "desc" => "Inserisci il link alla pagina della mappa",         "id" => $shortname."_pama",         "type" => "text",         "std" => " "),     array( "type" => "close"),     array( "name" => "General",         "type" => "section"),     array( "type" => "open"),     array( "name" => "Logo URL",         "desc" => "Inserisci il link all'immagine del tuo logo",         "id" => $shortname."_logo",         "type" => "text",         "std" => " "),       array( "type" => "close"),     array( "name" => "Homepage",         "type" => "section"),     array( "type" => "open"),     array( "name" => "Homepage Immagine Slide 1",         "desc" => "Inserisci il link alla prima immagine degli slide",         "id" => $shortname."_header_img",         "type" => "text",         "std" => "http://nextube.info/images/ImmijQuery/image-1.jpg"),     array( "name" => "Homepage Immagine Slide 2",         "desc" => "Inserisci il link alla seconda immagine degli slide",         "id" => $shortname."_header_img2",         "type" => "text",         "std" => "http://nextube.info/images/ImmijQuery/image-2.jpg"),     array( "name" => "Homepage Immagine Slide 3",         "desc" => "Inserisci il link alla terza immagine degli slide",         "id" => $shortname."_header_img3",         "type" => "text",         "std" => "http://nextube.info/images/ImmijQuery/image-3.jpg"),     array( "name" => "Homepage Immagine Slide 4",         "desc" => "Inserisci il link alla quarta immagine degli slide",         "id" => $shortname."_header_img4",         "type" => "text",         "std" => "http://nextube.info/images/ImmijQuery/image-4.jpg"),     array( "name" => "Homepage Immagine Slide 5",         "desc" => "Inserisci il link alla quinta immagine degli slide",         "id" => $shortname."_header_img5",         "type" => "text",         "std" => "http://nextube.info/images/ImmijQuery/image-5.jpg"),     array( "name" => "Homepage Immagine Slide 6",         "desc" => "Inserisci il link alla sesta immagine degli slide",         "id" => $shortname."_header_img6",         "type" => "text",         "std" => "http://nextube.info/images/ImmijQuery/image-6.jpg"),     array( "type" => "close"),     array( "name" => "Footer",         "type" => "section"),     array( "type" => "open"),     array( "name" => "Google Analytics Code",         "desc" => "Inserisci il tuo codice Google Analytics per tracciare le visite che ricevi.",         "id" => $shortname."_ga_code",         "type" => "textarea",         "std" => ""),     array( "type" => "close"),     array( "name" => "Social",         "type" => "section"),     array( "type" => "open"),     array( "name" => "Indirizzo Feed",         "desc" => "Feedburner è un sistema fornito da Google per ottimizzare la distribuzione dei tuoi feed, inserisci qui il link al tuo feed",         "id" => $shortname."_feedburner",         "type" => "text",         "std" => get_bloginfo('rss2_url')),     array( "name" => "Facebook URL",         "desc" => "Inserisci il link alla tua pagina Facebook",         "id" => $shortname."_facebook",         "type" => "text",         "std" => "http://facebook.com/pages/Downloadtaky/325661998362"),     array( "name" => "Twitter URL",         "desc" => "Inserisci il link al tuo account Twitter",         "id" => $shortname."_twitter",         "type" => "text",         "std" => "http://twitter.com/downloadtaky"),     array( "type" => "close"),     array( "name" => "Punti sulla mappa",         "type" => "section"),     array( "type" => "open"),     /** Copia da qui per aggiungere un nuovo punto - start copy to add a new point on the map **/     array( "name" => "Zona 1",         "type" => "section"),     array( "type" => "open"),     array(  "name" => "Attivare zona 1?",             "desc" => "Seleziona se vuoi il primo fermaposto",             "id" => $shortname."_zona1c",             "type" => "checkbox",             "std" => "false"),     array( "name" => "Zona 1 Nome",         "desc" => "Inserisci il nome del primo appartamento",         "id" => $shortname."_zona1n",         "type" => "text",         "std" => "Nome dell'appartamento"),     array( "name" => "Zona 1 Asse x",         "desc" => "Scegli dove posizionare il primo punto, se attivato asse x",         "id" => $shortname."_zona1x",         "type" => "text",         "std" => "Left:???"),     array( "name" => "Zona 1 Asse y",         "desc" => "Scegli dove posizionare il primo punto, se attivato asse y",         "id" => $shortname."_zona1y",         "type" => "text",         "std" => "Top:???"),     array( "name" => "Zona 1 URL",         "desc" => "Inserisci il link al post della zona 1",         "id" => $shortname."_zona1l",         "type" => "text",         "std" => "Indirizzo del post qui"),     array( "type" => "close"),     /** Copia fino a qui e rinomina progressivamente in zona2, zona3, zona4 ecc -- Copy from here to add a new zone like zone3, zone 4 and so on**/     array( "name" => "Zona 2",         "type" => "section"),     array( "type" => "open"),     array(  "name" => "Attivare zona 2?",             "desc" => "Seleziona se vuoi il secondo fermaposto",             "id" => $shortname."_zona2c",             "type" => "checkbox",             "std" => "false"),     array( "name" => "Zona 2 Nome",         "desc" => "Inserisci il nome del secondo appartamento",         "id" => $shortname."_zona2n",         "type" => "text",         "std" => "Nome dell'appartamento"),     array( "name" => "Zona 2 Asse x",         "desc" => "Scegli dove posizionare il secondo punto, se attivato asse x",         "id" => $shortname."_zona2x",         "type" => "text",         "std" => "Left:???"),     array( "name" => "Zona 2 Asse y",         "desc" => "Scegli dove posizionare il secondo punto, se attivato asse y",         "id" => $shortname."_zona2y",         "type" => "text",         "std" => "Top:???"),         array( "name" => "Zona 2 URL",         "desc" => "Inserisci il link al post della zona 2",         "id" => $shortname."_zona2l",         "type" => "text",         "std" => "Indirizzo del post qui"),     array( "type" => "close"),     array( "name" => "Zona 3",         "type" => "section"),     array( "type" => "open"),     array(  "name" => "Attivare zona 3?",             "desc" => "Seleziona se vuoi il terzo fermaposto",             "id" => $shortname."_zona3c",             "type" => "checkbox",             "std" => "false"),     array( "name" => "Zona 3 Nome",         "desc" => "Inserisci il nome del terzo appartamento",         "id" => $shortname."_zona3n",         "type" => "text",         "std" => "Nome dell'appartamento"),     array( "name" => "Zona 3 Asse x",         "desc" => "Scegli dove posizionare il terzo punto, se attivato asse x",         "id" => $shortname."_zona3x",         "type" => "text",         "std" => "Left:???"),     array( "name" => "Zona 3 Asse y",         "desc" => "Scegli dove posizionare il terzo punto, se attivato asse y",         "id" => $shortname."_zona3y",         "type" => "text",         "std" => "Top:???"),         array( "name" => "Zona 3 URL",         "desc" => "Inserisci il link al post della zona 3",         "id" => $shortname."_zona3l",         "type" => "text",         "std" => "Indirizzo del post qui"),     array( "type" => "close"),     array( "name" => "Zona 4",         "type" => "section"),     array( "type" => "open"),     array(  "name" => "Attivare zona 4?",             "desc" => "Seleziona se vuoi il quarto fermaposto",             "id" => $shortname."_zona4c",             "type" => "checkbox",             "std" => "false"),     array( "name" => "Zona 4 Nome",         "desc" => "Inserisci il nome del quarto appartamento",         "id" => $shortname."_zona4n",         "type" => "text",         "std" => "Nome dell'appartamento"),     array( "name" => "Zona 4 Asse x",         "desc" => "Scegli dove posizionare il quarto punto, se attivato asse x",         "id" => $shortname."_zona4x",         "type" => "text",         "std" => "Left:???"),     array( "name" => "Zona 4 Asse y",         "desc" => "Scegli dove posizionare il quarto punto, se attivato asse y",         "id" => $shortname."_zona4y",         "type" => "text",         "std" => "Top:???"),         array( "name" => "Zona 4 URL",         "desc" => "Inserisci il link al post della zona 4",         "id" => $shortname."_zona4l",         "type" => "text",         "std" => "Indirizzo del post qui"),     array( "type" => "close"),     array( "name" => "Zona 5",         "type" => "section"),     array( "type" => "open"),     array(  "name" => "Attivare zona 5?",             "desc" => "Seleziona se vuoi il quinto fermaposto",             "id" => $shortname."_zona5c",             "type" => "checkbox",             "std" => "false"),     array( "name" => "Zona 5 Nome",         "desc" => "Inserisci il nome del quinto appartamento",         "id" => $shortname."_zona5n",         "type" => "text",         "std" => "Nome dell'appartamento"),     array( "name" => "Zona 5 Asse x",         "desc" => "Scegli dove posizionare il quinto punto, se attivato asse x",         "id" => $shortname."_zona5x",         "type" => "text",         "std" => "Left:???"),     array( "name" => "Zona 5 Asse y",         "desc" => "Scegli dove posizionare il quinto punto, se attivato asse y",         "id" => $shortname."_zona5y",         "type" => "text",         "std" => "Top:???"),         array( "name" => "Zona 5 URL",         "desc" => "Inserisci il link al post della zona 5",         "id" => $shortname."_zona5l",         "type" => "text",         "std" => "Indirizzo del post qui"),     array( "type" => "close"),     array( "name" => "Zona 6",         "type" => "section"),     array( "type" => "open"),     array(  "name" => "Attivare zona 6?",             "desc" => "Seleziona se vuoi il sesto fermaposto",             "id" => $shortname."_zona6c",             "type" => "checkbox",             "std" => "false"),     array( "name" => "Zona 6 Nome",         "desc" => "Inserisci il nome del sesto appartamento",         "id" => $shortname."_zona6n",         "type" => "text",         "std" => "Nome dell'appartamento"),     array( "name" => "Zona 6 Asse x",         "desc" => "Scegli dove posizionare il sesto punto, se attivato asse x",         "id" => $shortname."_zona6x",         "type" => "text",         "std" => "Left:???"),     array( "name" => "Zona 6 Asse y",         "desc" => "Scegli dove posizionare il sesto punto, se attivato asse y",         "id" => $shortname."_zona6y",         "type" => "text",         "std" => "Top:???"),         array( "name" => "Zona 6 URL",         "desc" => "Inserisci il link al post della zona 6",         "id" => $shortname."_zona6l",         "type" => "text",         "std" => "Indirizzo del post qui"),     array( "type" => "close"),     array( "name" => "Zona 7",         "type" => "section"),     array( "type" => "open"),     array(  "name" => "Attivare zona 7?",             "desc" => "Seleziona se vuoi il settimo fermaposto",             "id" => $shortname."_zona7c",             "type" => "checkbox",             "std" => "false"),     array( "name" => "Zona 7 Nome",         "desc" => "Inserisci il nome del settimo appartamento",         "id" => $shortname."_zona7n",         "type" => "text",         "std" => "Nome dell'appartamento"),     array( "name" => "Zona 7 Asse x",         "desc" => "Scegli dove posizionare il settimo punto, se attivato asse x",         "id" => $shortname."_zona7x",         "type" => "text",         "std" => "Left:???"),     array( "name" => "Zona 7 Asse y",         "desc" => "Scegli dove posizionare il settimo punto, se attivato asse y",         "id" => $shortname."_zona7y",         "type" => "text",         "std" => "Top:???"),         array( "name" => "Zona 7 URL",         "desc" => "Inserisci il link al post della zona 7",         "id" => $shortname."_zona7l",         "type" => "text",         "std" => "Indirizzo del post qui"),     array( "type" => "close"),     array( "name" => "Zona 8",         "type" => "section"),     array( "type" => "open"),     array(  "name" => "Attivare zona 8?",             "desc" => "Seleziona se vuoi l/'ottavo fermaposto",             "id" => $shortname."_zona8c",             "type" => "checkbox",             "std" => "false"),     array( "name" => "Zona 8 Nome",         "desc" => "Inserisci il nome dell/'ottavo appartamento",         "id" => $shortname."_zona8n",         "type" => "text",         "std" => "Nome dell'appartamento"),     array( "name" => "Zona 8 Asse x",         "desc" => "Scegli dove posizionare l/'ottavo punto, se attivato asse x",         "id" => $shortname."_zona8x",         "type" => "text",         "std" => "Left:???"),     array( "name" => "Zona 8 Asse y",         "desc" => "Scegli dove posizionare l/' ottavo punto, se attivato asse y",         "id" => $shortname."_zona8y",         "type" => "text",         "std" => "Top:???"),         array( "name" => "Zona 8 URL",         "desc" => "Inserisci il link al post della zona 8",         "id" => $shortname."_zona8l",         "type" => "text",         "std" => "Indirizzo del post qui"),     array( "type" => "close"),     array( "name" => "Zona 9",         "type" => "section"),     array( "type" => "open"),     array(  "name" => "Attivare zona 9?",             "desc" => "Seleziona se vuoi il nono fermaposto",             "id" => $shortname."_zona9c",             "type" => "checkbox",             "std" => "false"),     array( "name" => "Zona 9 Nome",         "desc" => "Inserisci il nome del nono appartamento",         "id" => $shortname."_zona9n",         "type" => "text",         "std" => "Nome dell'appartamento"),     array( "name" => "Zona 9 Asse x",         "desc" => "Scegli dove posizionare il nono punto, se attivato asse x",         "id" => $shortname."_zona9x",         "type" => "text",         "std" => "Left:???"),     array( "name" => "Zona 9 Asse y",         "desc" => "Scegli dove posizionare il nono punto, se attivato asse y",         "id" => $shortname."_zona9y",         "type" => "text",         "std" => "Top:???"),         array( "name" => "Zona 9 URL",         "desc" => "Inserisci il link al post della zona 9",         "id" => $shortname."_zona9l",         "type" => "text",         "std" => "Indirizzo del post qui"),     array( "type" => "close"),     array( "name" => "Zona 10",         "type" => "section"),     array( "type" => "open"),     array(  "name" => "Attivare zona 10?",             "desc" => "Seleziona se vuoi il decimo fermaposto",             "id" => $shortname."_zona10c",             "type" => "checkbox",             "std" => "false"),     array( "name" => "Zona 10 Nome",         "desc" => "Inserisci il nome del decimo appartamento",         "id" => $shortname."_zona10n",         "type" => "text",         "std" => "Nome dell'appartamento"),     array( "name" => "Zona 10 Asse x",         "desc" => "Scegli dove posizionare il decimo punto, se attivato asse x",         "id" => $shortname."_zona10x",         "type" => "text",         "std" => "Left:???"),     array( "name" => "Zona 10 Asse y",         "desc" => "Scegli dove posizionare il decimo punto, se attivato asse y",         "id" => $shortname."_zona10y",         "type" => "text",         "std" => "Top:???"),         array( "name" => "Zona 10 URL",         "desc" => "Inserisci il link al post della zona 10",         "id" => $shortname."_zona10l",         "type" => "text",         "std" => "Indirizzo del post qui"),     array( "type" => "close"),     array( "type" => "close"),     );          function appaqua_add_admin() {          global $themename, $shortname, $options;          if ( $_GET['page'] == basename(__FILE__) ) {              if ( 'save' == $_REQUEST['action'] ) {                  foreach ($options as $value) {             update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }          foreach ($options as $value) {         if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); } }              header("Location: admin.php?page=admin-panel.php&saved=true");     die;          }      else if( 'reset' == $_REQUEST['action'] ) {              foreach ($options as $value) {             delete_option( $value['id'] ); }              header("Location: admin.php?page=admin-panel.php&reset=true");     die;          }     }          add_menu_page($themename, $themename, 'administrator', basename(__FILE__), 'appaqua_admin');     }          function appaqua_add_init() {     $file_dir=get_bloginfo('template_directory');     wp_enqueue_style("functions", $file_dir."/includes/css/functions.css", false, "1.0", "all");     wp_enqueue_script("rm_script", $file_dir."/includes/js/rm_script.js", false, "1.0");     wp_enqueue_script("site_preview", $file_dir."/includes/js/preview.js", false, "1.0");     };          function appaqua_admin() {          global $themename, $shortname, $options;     $i=0;          if ( $_REQUEST['saved'] ) echo '

'.$themename.' settings saved.

';     if ( $_REQUEST['reset'] ) echo '

'.$themename.' settings reset.

';          ?>

<?php echo $themename; ?> Settings

     <form method="post">     <?php foreach ($options as $value) {     switch ( $value['type'] ) {          case "open":     ?>          <?php break;          case "close":     ?>

               <?php break;          case "title":     ?>
To easily use the <?php echo $themename;?> theme, you can use the menu below.
               <?php break;          case 'text':     ?>
         <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?>         <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(get_settings( $value['id'])  ); } else { echo $value['std']; } ?>" />      <?php echo $value['desc']; ?>

     <?php     break;          case 'textarea':     ?>
         <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?>         <textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(get_settings( $value['id']) ); } else { echo $value['std']; } ?></textarea>      <?php echo $value['desc']; ?>

          <?php     break;          case 'select':     ?>
         <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?>          <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">     <?php foreach ($value['options'] as $option) { ?>             <option <?php if (get_settings( $value['id'] ) == $option) { echo 'selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?>     </select>              <?php echo $value['desc']; ?>

     <?php     break;          case "checkbox":     ?>
         <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?>          <?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = "";} ?>     <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />                   <?php echo $value['desc']; ?>

     <?php break;      case "section":          $i++;          ?>

<img src="<?php bloginfo('template_directory')?>/includes/css/images/trans.png" class="inactive" alt="""><?php echo $value['name']; ?>
<input name="save<?php echo $i; ?>" type="submit" value="Save changes" />

     <?php break;     }     }     ?>     <input type="hidden" name="action" value="save" />     </form>     <form method="post">
     <input name="reset" type="submit" value="Reset" />     <input type="hidden" name="action" value="reset" />
     </form>
Icons: WooFunction

      <iframe id="themepreview" name="themepreview" src="<?php echo get_option('appaqua_pama'); ?>/?preview=1">     <?php     }     ?>     <?php     $nonce = wp_create_nonce('site_preview');     ?>     <?php     add_action('admin_init', 'appaqua_add_init');     add_action('admin_menu', 'appaqua_add_admin');     ?>      This is the css stylesheet of the divs I would like to move with DRAG & DROP **(only in backend** ): http://pastebin.com/pih7yaT1 or:               <?php define('WP_USE_THEMES', true);     require('./wp-blog-header.php');?>     .mappa{width:960px;height:394px;background:url(<?php bloginfo(template_url);?>/mappa/images/mappa.png);margin:0 auto;}     #zona1{width:27px;height:27px;background:#000;z-index:10000;position:relative;top:<?php echo get_option('appaqua_zona1x');?>px;left:<?php echo get_option('appaqua_zona1y');?>px;}     #zona2{width:27px;height:27px;background:#000;z-index:10000;position:relative;top:<?php echo get_option('appaqua_zona2x');?>px;left:<?php echo get_option('appaqua_zona2y');?>px;}     #zona3{width:27px;height:27px;background:#000;z-index:10000;position:relative;top:<?php echo get_option('appaqua_zona3x');?>px;left:<?php echo get_option('appaqua_zona3y');?>px;}     #zona4{width:27px;height:27px;background:#000;z-index:10000;position:relative;top:<?php echo get_option('appaqua_zona4x');?>px;left:<?php echo get_option('appaqua_zona4y');?>px;}     #zona5{width:27px;height:27px;background:#000;z-index:10000;position:relative;top:<?php echo get_option('appaqua_zona5x');?>px;left:<?php echo get_option('appaqua_zona5y');?>px;}     #zona6{width:27px;height:27px;background:#000;z-index:10000;position:relative;top:<?php echo get_option('appaqua_zona6x');?>px;left:<?php echo get_option('appaqua_zona6y');?>px;}     #zona7{width:27px;height:27px;background:#000;z-index:10000;position:relative;top:<?php echo get_option('appaqua_zona7x');?>px;left:<?php echo get_option('appaqua_zona7y');?>px;}     #zona8{width:27px;height:27px;background:#000;z-index:10000;position:relative;top:<?php echo get_option('appaqua_zona8x');?>px;left:<?php echo get_option('appaqua_zona8y');?>px;}     #zona9{width:27px;height:27px;background:#000;z-index:10000;position:relative;top:<?php echo get_option('appaqua_zona9x');?>px;left:<?php echo get_option('appaqua_zona9y');?>px;}     #zona10{width:27px;height:27px;background:#000;z-index:10000;position:relative;top:<?php echo get_option('appaqua_zona10x');?>px;left:<?php echo get_option('appaqua_zona10y');?>px;}      I hope that someone can help me and please, if you need more info just ask... Thank you very much to all!


How do I add version control to my workflow?

I develop themes, lots of them. I am given a PSD, code up the HTML/CSS, slap the code into Wordpress, and make corrections as they get QC'd. Once live, clients can edit blog posts like normal or upload photos using a custom plugin. Sometimes I have to make changes to the theme or to the page/post content, which means I either make them live or have to download and setup the site to a development environment to be approved by the client. I have no backup, I have no version control, and I realize this needs to change. Git and Mercurial have been suggested, and I would like to take advantage of these tools, but I am confused about how to fit them into a workflow. Do I require all changes to a site on a development server and then push them live once approved? What about writing blog posts? Seems like overkill to write posts on dev and push the changes live, but then how do I sync the databases if they are edited on the live site? I have scoured the internet. Some guidance would be appreciated.


Detect if a plugin was included in a certain page

I´m developing a theme that include plugins. One of this plugins is a contact form. And this plugin have an asociate code to validate input data. Because I don´t know in what pages contact form was been added... I want to find a right way to detect if a plugin is included in a current page. Sample: page.php               <?php get_header(); ?>          <?php if( is contact form included ) : ?>         //include php form valdiation...     <?php endif; ?>          //page content code ...          <?php get_footer(); ?>      **Note** : I don´t want to check if a plugin is activated. The plugin is included with theme, therefore is active. I want to detect if is current using for example in page.php. The issue should be include php form validation only when page include contact form. Any suggestion or advice are welcome :) Thanks.


My new Wordpress theme based on the TwentyEleven theme doesn't display the front page OR the blog page

I copied TwentyEleven and used all its resources to start, I've done all the steps, added my own widgets, menus, css, js and all but I'm stuck with this issue: I set the front page to be static and set a page for it (it has content in it), also set a blank page for the blog posts. The theme just shows the pages as blank for both in all situations unless I specify a wrong file name in which it will show the 'Not found' text. I'm sure I'm doing something horribly wrong, but what? Here's the part that loads the content in index.php:                           <?php /* Start the Loop */ ?>                 <?php while ( have_posts() ) : the_post(); ?>                          <?php get_template_part( 'content', get_post_format() ); ?>                      <?php endwhile; ?>                  <?php else : ?>

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

<?php _e( 'Page not found.', 'twentyeleven' ); ?>

                  <?php endif; ?>


pagination hook doesn't work with search results

I use my custom **Pagination function** on my web site;               #Pagination          function pagination($prev = '«', $next = '»') {             global $wp_query, $wp_rewrite;                 $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;                 $pagination = array(                     'base' => @add_query_arg('paged','%#%'),                     'format' => '',                     'total' => $wp_query->max_num_pages,                     'current' => $current,                     'prev_text' => __($prev),                     'next_text' => __($next),                     'type' => 'plain'                 );             if( $wp_rewrite->using_permalinks() )             $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'sayfa/%#%/', 'paged' );                     if( !empty($wp_query->query_vars['s']) )                         $pagination['add_args'] = array( 's' => get_query_var( 's' ) );                          echo paginate_links( $pagination );             };      Also i use **search by title custom hook** ;               #Search Just in Title.     function __search_by_title_only( $search, &$wp_query ) {         global $wpdb;              if ( empty( $search ) )             return $search; // skip processing - no search term in query              $q = $wp_query->query_vars;             $n = ! empty( $q['exact'] ) ? '' : '%';              $search =         $searchand = '';              foreach ( (array) $q['search_terms'] as $term ) {             $term = esc_sql( like_escape( $term ) );             $search .= "{$searchand}($wpdb->posts.post_title LIKE '{$n}{$term}{$n}')";             $searchand = ' AND ';         }              if ( ! empty( $search ) ) {             $search = " AND ({$search}) ";             if ( ! is_user_logged_in() )                 $search .= " AND ($wpdb->posts.post_password = '') ";         }              return $search;     }     add_filter( 'posts_search', '__search_by_title_only', 500, 2 );      But whenever you call **search results page** ; For example "wordpress tema" _(search results for wordpress tema)_ the pagination hook doesn't work. Please check the link also you can find some functions on SE here, for search results page . I think problem is about my second hook: What is wrong with this ? **_What should we do?_** Thanks any help.


Twenty Eleven header resize

I seem to have a problem customizing the Twenty Eleven theme. I would like that the top header above the header image to have a background color that goes from side to side in the window. Found out that the problem may come from max-width set to 1000px, but could not find where to put it so it doesn't mess up the theme elsewhere. How can I achieve to have a color on the top of the page (ex. like facebook top blue header) that has the width of the browser?


Wordpress API Menu/Submenu Order

I'm developing a child-theme using _Wordpress 3.4.2_ and the development version of the _Options Framework_ by _David Price_. This is my first theme and I'm relatively new to this, so I've had a look into the _Wordpress Codex_ and checked out registering items into the API. Without tampering with any external files outside of my theme, I was wondering if there was a way to re-arrange where the _Theme Options_ page is located within the hierarchy of the _Appearance_ menu - so when my theme is activated, the position is not like the first image but like the second. ![old](http://i.stack.imgur.com/AEZMG.jpg)![new](http://i.stack.imgur.com/prXjj.jpg) I know you can create either a menu (such as the _Appearance_ tab, _Plugins_ , _Users_ etc.) or a sub-menu ( _Themes_ , _Widgets_ , _Menus_ etc.), but how would I go about setting a sub-menu say, second from the top? From what I gather, somewhere there is an order being called and any other additional pages within the `functions.php` file are placed after those? In my functions.php file:               // Add our "Theme Options" page to the Wordpress API admin menu.     if ( !function_exists( 'optionsframework_init' ) ) {         define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/' );         require_once dirname( __FILE__ ) . '/inc/options-framework.php';     }      Thanks.


How to pass custom field value to shortcode?

I want to call custom field in `single.php` template to complete a short code and thus show a menu. I places the below code but it is not working               <?php echo do_shortcode("[custommenu menu=<?php echo get_post_meta($post->ID, ‘tabmenu’, true); ?>]?>")


PHP form is not sending mail if I use mime type and version in header. How to solve this?

If I use the following code, then the form works fine and I am getting form submissions to my email.               <?php          if($_POST["submit"]) {         $recipient="meemail@gmail.com";         $subject="New request";         $headers  = 'MIME-Version: 1.0' . "\r\n";         $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";         $sender=$_POST["sendername"];         $senderEmail=$_POST["senderEmail"];         $message=$_POST["message"];         $name_title=$_POST["name_title"];                 $mailBody = "Name: $name_title $sender\n                      Email: $senderEmail\n\n                      Message: $message";              $mail_sent = mail($recipient, $subject, $mailBody, "From: $sender <$senderEmail>");     }          if ($mail_sent) {     ?>
Mail sent
     <?php } ?>      If I change the `$mail_sent = mail($recipient, $subject, $mailBody, "From: $sender <$senderEmail>");` **TO** `$mail_sent = mail($recipient, $subject, $mailBody, "From: $sender <$senderEmail>", $headers);`, then the form stops working. What is the issue?


WordPress trims an encrypted field

Problem is that when I try to insert a new post into WordPress, the password (encrypted, see code below) is cut. For example: encrypted `Ivt9=f:;itKun+TiIarze-GyX5Rt` is only `Ivt` in WordPress.               add_action( 'eb_register_user', 'eb_register_user_callback' );     function eb_register_user_callback() {            $posts = $_POST;       $esc_posts = array_map( 'esc_post', $posts );       extract( $esc_posts, EXTR_PREFIX_ALL, 'eb' );                 $new_customer = wp_insert_post( array(         'post_title' => $eb_f_name . ' ' . $eb_surname . ', ' . $eb_city,         'post_status' => 'publish',         'post_type' => 'customer'       ) );            update_post_meta( $new_customer, 'type', $eb_type );       update_post_meta( $new_customer, 'company_name', $eb_company_name );       update_post_meta( $new_customer, 'company_nip', $eb_company_nip );            update_post_meta( $new_customer, 'f_name', $eb_f_name );       update_post_meta( $new_customer, 'surname', $eb_surname );            update_post_meta( $new_customer, 'street', $eb_street );       update_post_meta( $new_customer, 'city', $eb_city );       update_post_meta( $new_customer, 'email', $eb_email );       update_post_meta( $new_customer, 'phone', $eb_phone );            update_post_meta( $new_customer, 'uuid', get_uuid( $new_customer ) );            require_once 'classes/crypt.class.php';       $cryptastic = new cryptastic;       $key = $cryptastic->pbkdf2( 'SOME!$#pass', 'SOME!$#salt', 1000, 32 );       $encrypted = $cryptastic->encrypt( $_POST['password'], $key );       update_post_meta( $new_customer, 'password', $encrypted );            wp_redirect( home_url() . '?ep = ' . $encrypted );     }      When redirected to home url, `ep` GET parameter contains correctly encrypted password, but meta field not. Any idea?


how to display the repeatable meta field value in front end?

I would like to display my all meta field value in template file but i have no idea on displaying repeatable meta field value would anybody please help me.. My code is ..               <?php     /**      * Plugin Name: (SO) Repeatable fields demo      * Plugin URI:  http://stackoverflow.com/a/14452453/1287812      * Description: How to make repeatable fields in a meta box      * Author:      brasofilo      * License:     GPLv3      */          add_action( 'admin_init', 'add_post_gallery_so_14445904' );     add_action( 'admin_head-post.php', 'print_scripts_so_14445904' );     add_action( 'admin_head-post-new.php', 'print_scripts_so_14445904' );     add_action( 'save_post', 'update_post_gallery_so_14445904', 10, 2 );          /**      * Add custom Meta Box to Posts post type      */     function add_post_gallery_so_14445904()      {         add_meta_box(             'post_gallery',             'Custom Uploader',             'post_gallery_options_so_14445904',             'post',             'normal',             'core'         );     }          /**      * Print the Meta Box content      */     function post_gallery_options_so_14445904()      {         global $post;         $gallery_data = get_post_meta( $post->ID, 'gallery_data', true );              // Use nonce for verification         wp_nonce_field( plugin_basename( __FILE__ ), 'noncename_so_14445904' );     ?>

         <?php          if ( isset( $gallery_data['image_url'] ) )          {             for( $i = 0; $i < count( $gallery_data['image_url'] ); $i++ )              {             ?>

                   Image URL                   <input type="text"                          class="meta_image_url"                          name="gallery[image_url][]"                          value="<?php esc_html_e( $gallery_data['image_url'][$i] ); ?>"                   />

                   Description                   <input type="text"                          class="meta_image_desc"                          name="gallery[image_desc][]"                          value="<?php esc_html_e( $gallery_data['image_desc'][$i] ); ?>"                   />

                 <img src="<?php esc_html_e( $gallery_data['image_url'][$i] ); ?>" height="48" width="48" />

                 <input class="button" type="button" value="Choose File" onclick="add_image(this)" />
                 <input class="button" type="button" value="Remove" onclick="remove_field(this)" />

             <?php             } // endif         } // endforeach         ?>

                     Image URL                     <input class="meta_image_url" value="" type="text" name="gallery[image_url][]" />

                     Image Link                     <input class="meta_image_desc" value="" type="text" name="gallery[image_desc][]" />

                  <input type="button" class="button" value="Choose File" onclick="add_image(this)" />
                 <input class="button" type="button" value="Remove" onclick="remove_field(this)" />

           <input class="button" type="button" value="Add Field" onclick="add_field_row();" />

            <?php     }          /**      * Print styles and scripts      */     function print_scripts_so_14445904()     {         // Check for correct post_type         global $post;         if( 'post' != $post->post_type )             return;         ?>                                  <?php     }          /**      * Save post action, process fields      */     function update_post_gallery_so_14445904( $post_id, $post_object )      {         // Doing revision, exit earlier **can be removed**         if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )               return;              // Doing revision, exit earlier         if ( 'revision' == $post_object->post_type )             return;              // Verify authenticity         if ( !wp_verify_nonce( $_POST['noncename_so_14445904'], plugin_basename( __FILE__ ) ) )             return;              // Correct post type         if ( 'post' != $_POST['post_type'] )              return;              if ( $_POST['gallery'] )          {             // Build array for saving post meta             $gallery_data = array();             for ($i = 0; $i < count( $_POST['gallery']['image_url'] ); $i++ )              {                 if ( '' != $_POST['gallery']['image_url'][ $i ] )                  {                     $gallery_data['image_url'][]  = $_POST['gallery']['image_url'][ $i ];                     $gallery_data['image_desc'][] = $_POST['gallery']['image_desc'][ $i ];                 }             }                  if ( $gallery_data )                  update_post_meta( $post_id, 'gallery_data', $gallery_data );             else                  delete_post_meta( $post_id, 'gallery_data' );         }          // Nothing received, all fields are empty, delete option         else          {             delete_post_meta( $post_id, 'gallery_data' );         }     }      Thank you in advance.


Exporting a portfolio with pictures

I wonder if a kind soul could help, as I'm going crazy here. I just recently started using Wordpress, and created a website where I have a lot of portfolios. The images in the portfolios have been fully SEO optimized with tags, etc. So this is my question: I have created another website where I want to use some of the portfolios from the first website, but the thought of importing all the images and optimizing them again is putting me off, so is there a way to export the portfolios from the first website to the new one with the pictures included? I used the Wordpess export tool, but the .xml file has no pictures on it; it did import the portfolio, but without any pictures. Kind Regards Jorge


Display pages in alphabetical order

I think I am missing something in my `functions.php` because my pages in the admin are displayed randomly. How can you display the pages in admin alphabetically? Thanks!


Wordpress special characters coming in ascii code

The article title on this website is `"Meet Youngest Art Director of Pakistan – Babrus Khan"` The special character in the title is not encoded back when retrieved from Database and Hence I can see in Html code, the title is `"Meet Youngest Art Director of Pakistan – Babrus Khan"` When shared on Social Media the ASCII codes appear rather than the special characters. How can I solve this problem?


How to trap "Publish" button to check for meta box validation?

I'm trying to do some form validation on my custom meta box, and I remember somewhere reading about some javascript function to disable/enable the Publish button - except I can't find it. How do I either a) enable/disable the publish button or, b) when Publish is clicked, trap it and prevent the update and alert the user, but in such a way that it can be updated later I've tried just a simple click handler with e.preventDefault() and e.stopPropagation however the swily icon comes up and the button stays disabled because it never finishes Thanks


bbpress plugin moderation

I am using the bbpress wordpress plugin for the first time and I can't see any settings for moderation. Does bbpress have moderation built in? I did a search for any moderation plugins but only found one for the standalone version. Is there a way to enable moderation?


Premium Members Section of website

Have used emember in the past and looked at Tadlock's membership as well as another premium offering by jigowatt. However, I don't want to just hide the post's content.... I want to hide the entire post... and entire categories/taxonomies. I'd like the menu to show "Products" and when you visit that particular page you are prompted to log in to view it. Logging it would also "unlock"/reveal sections of the site that weren't previously visible. For instance, the menu might now have widgets and gizmos underneath the main "products". to me this seems different than what the plugins i mentioned before can handle. is there a plugin that does this or am i looking at creating my own?


Admin area for user, custom theme or admin theme?

In my WordPress site, I need to provide some backend functions for logged in user, so currently I have two choices   1. use the wp-admin, customize the menu by hiding irrelevant items   2. create a custom theme (for the backend), and switch the user theme from public theme to this customized backend theme when they visit the url, say `/admin/*` The advantage for the (1) is I can re-use the existing functions such as menu, dashboard, topbar, post type / taxonomy CRUD, wordpress settings functions etc. But to customize the wp-admin is quite difficult and might break when WordPress is upgraded in the future. For (2), it is more easy, but more code need to be written, e.g. need to re- implement the CRUD for basic post type / taxonomy etc. Are there any better suggestions for my requirement besides the above?


Renaming wp-admin without hard-coding it. Is it really possible?

I would like to rename my wp-admin folder due to some security concerns. Is it really possible? **The less it looks/is built like default WP, the harder it is to attack known vulnerabilities. Being able to rename those directories can help stop an exploit dead in its tracks.** Otto mentioned in this thread its possible using "admin_url" filter. Is it really possible? If yes can someone give me some sample code. I hope this is a useful question


Wordpress Jquery Confliction with Plugin

Hey guys, thanks in advance for your help. I've done my research and I'm a bit stumped with this... I'm building a Wordpress website for a client and it is going to have an e-store. I'm using wp-ecommerce. All of the store pages are loading with a javascript error: http://www.thecollectiveclothingco.com/products-page/t-shirts/               jQuery("form.product_form").livequery is not a function     [Break On This Error] jQuery("form.product_form").livequery(function(){       After some extensive google-age, I believe I've diagnosed the issue as a script conflict. In other words, either WP or the plugin itself is serving up jquery, and I'm also including it for some other things on the site. When I delete my jquery script call, the issue goes away and the store works fine. But I need that jquery... I've read about using WP enqeue to fix the issue:               function my_init_method() {         if (!is_admin()) {             wp_deregister_script( 'jquery' );             wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js');             wp_enqueue_script( 'jquery' );         }     }         add_action('init', 'my_init_method');php wp_head();       I believe I've done this right, but does not seem to be fixing anything. Any ideas? Thanks again. ## EDIT: Alright, I figured it out... it was the enqueue script that fixed things. I wp(head); had to come before the deregister and enqueue part. I must have read the documentation wrong. Here's what I added to my header:               <?php     wp_head();     wp_deregister_script('jquery');     wp_enqueue_script('jquery', MYURL .'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', FALSE, '1.4.4');      ?>


Site not getting correct featured image from my query

On the home page of my site I have a series of tiles that link to various parts of the site. One tile links to the blog and I have written some code to pull the latest post with an image attached to it and output it along with the post title. Here is the code from the theme file:               $z=0; //sets post counter     query_posts(array(  'meta_key' => '_thumbnail_id'  )); ?>     <?php if(have_posts()) : ?>     <?php while(have_posts() && $z<1) : the_post();                //Call a post image attachment         $args = array( 'post_type' => 'attachment', 'numberposts' => 1, 'post_status' => null, 'post_parent' => $post->ID );          $attachments = get_posts($args);              if ($attachments) {                  foreach ( $attachments as $attachment ) {             $image = wp_get_attachment_image_src($attachment->ID,'homethumbs');      ?>     <a href="<?php echo get_posts_page_url(); ?>" title="Visit the Serge Blog" id="homelink3" class="top_homelink"><img src="<?php echo $image[0]; ?>" width="308" height="308" id="home-blogthumb" class="side-homethumb wp-post-image" />
Blog
Latest Post: <?php the_title(); ?>
        <?php $z++;     }     //$usedthumbnails[] = get_the_post_thumbnail();      }     ?>     <?php        endwhile;      endif;      wp_reset_query(); ?>      I realise that this code doesn't in fact get the featured image but instead gets 1 image that is attached to a post. This is because the blog posters sometimes forgot to "set as featured image" but any pic uploaded to the post was attached automatically. With 3.5 it now seems that featured images are not necessarily attached to the posts so will be missed by the above code. What's the best approach to solve this? Perhaps by only calling the latest featured image... I can just make sure post writers add a featured image to their posts. The site is http://sergedenimes.com **EDIT:** Here is my renewed code:               <?php     global $post;     $args = array( 'numberposts' => 1, 'meta_key' => '_thumbnail_id' );     $myposts = get_posts( $args );          foreach( $myposts as $post ) :  setup_postdata($post);      $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'homethumbs' );     ?>          <a href="<?php echo get_posts_page_url(); ?>" title="Visit the Serge Blog" id="homelink3" class="top_homelink"><img src="<?php echo $thumb[0]; ?>" width="308" height="308" id="home-blogthumb" class="side-homethumb wp-post-image" />
Blog
Latest Post: <?php the_title(); ?>
           <?php endforeach; ?>      What I want to make sure is that say I posted a new post but didn't give it a featured image, would the above query just ignore it and output the last post that _does_ have a featured image? I'm hoping that the `'meta_key' => '_thumbnail_id'` arguement should do this. If I am wrong I would expect that no url of the attachment would be got and the tile on the home page would just be blank (no image).


Strip the folder path away from wp_get_attachment_url to show filename only

I'm using a function to display all files attached to a post and listing them as links. The result is something like this:               echo 'ID) .                '" class="dir-attachment" />' . wp_get_attachment_url($attachmentImage->ID) . '';      As expected, this display a hyperlinked version of the hyperlink, but I'd like to clean it up. Is there some way to strip the http://mydomain/wp- content/uploads from the second instance display the file name only, rather than the full path?


I've got a theme I can't update and won't let go

I created a custom theme for a client a while back and then it sorta mysteriously broke several months later by reverting to an early version that had a few links to my website hard coded into it. I made the fixes but then discovered that no matter how I tried to make the changes - ftp'ing up the file, fixing from right within wordpress, etc. - wordpress just went right back to the version that was currently up there. I even added random text to check my theory and that wouldn't show up either. Yet, oddly enough, I could go into the theme editor in Wordpress and see the correct version of the file showing up. I finally decided to just switch to another theme, nuke that one and try to fix it and upload it again. Wordpress won't let me switch to another theme. I'll pick another theme and activate it, the website will completely stop showing up, and I'll go back to the Theme editor and the original theme will be appearing as the default theme. At this point, I'm a little afraid to remove the template. I'm wondering if this is some type of database issue. However, my client's control panel does not give her access to the database. Does anyone have any thoughts?


Two-way synchronizing of a post type among multisite blogs

Is it possible to two way sync a post type between multiple sites on a multisite install? For example if someone makes a change to an entry under post type "inventory" on Site A how can I make that reflect on Site B automatically and vice versa? I am thinking that there are two main possible way of doing this, neither of which I'm sure can easily be done. 1) A plugin hooks into the edit_post so when a change is made the plugin edits the sister entry in the other blog's database table. 2) Anytime Site B views or edits an "inventory" post type it is reading it from Site A's database table.


Bookshelf plugin and/or widget

I'm looking for some kind of plugin and/or widget to display a list of book covers in the sidebar. Are there any good options out there?


Row actions not showing? Why?

I have constructed a `WP_List_Table` that displays on a custom theme page that I have built. I am having some trouble getting the row actions to display, despite me reviewing all the possible info on the Internet about WP_List_Table. Any help would be great!               class Testimonials_List_Table extends WP_List_Table {          function __construct() {         parent::__construct( array(         'singular'=> 'testimonial', //Singular label         'plural' => 'testimonials', //plural label, also this well be one of the table css class         'ajax' => false //We won't support Ajax for this table        ) );     }          function get_bulk_actions() {         $actions = array(         'delete' => 'Delete'         );         return $actions;     }          function process_bulk_action() {         if( 'delete'===$this->current_action() ) {         wp_die('Items deleted (or they would be if we had items to delete)!');        }       }          function get_columns() {     return $columns= array(         'cb' => '<input type="checkbox" />', //Render a checkbox instead of text         'name'=> 'Name',         'company_name'=> 'Company Name',         'company_url'=> 'Website URL',         'testimonials_quote'=> 'Testimonial'     );     }          function column_name($item){         $actions = array(             'edit'      => sprintf('Edit',$_REQUEST['page'],'edit',$item['ID']),             'delete'    => sprintf('Delete',$_REQUEST['page'],'delete',$item['ID']),         );              //Return the title contents         return sprintf('%1$s (id:%2$s)%3$s',             /*$1%s*/ $item['name'],             /*$2%s*/ $item['ID'],             /*$3%s*/ $this->row_actions($actions)         );     }                    function column_cb($item){         return sprintf(             '<input type="checkbox" name="%1$s[]" value="%2$s" />',             /*$1%s*/ $this->_args['singular'],  //Let's simply repurpose the table's singular label ("movie")             /*$2%s*/ $item['ID']                //The value of the checkbox should be the record's id         );     }          function prepare_items() {     global $wpdb, $_wp_column_headers;     $screen = get_current_screen();     $wpdb->show_errors();          $query = "SELECT * FROM wp_testimonials";      $orderby = !empty($_GET["orderby"]) ? mysql_real_escape_string($_GET["orderby"]) : 'ASC';     $order = !empty($_GET["order"]) ? mysql_real_escape_string($_GET["order"]) : '';         if(!empty($orderby) & !empty($order)){ $query.=' ORDER BY '.$orderby.' '.$order; }         $totalitems = $wpdb->query($query); //return the total number of affected rows         $perpage = 8;         $paged = !empty($_GET["paged"]) ? mysql_real_escape_string($_GET["paged"]) : '';         if(empty($paged) || !is_numeric($paged) || $paged<=0 ){ $paged=1; }         $totalpages = ceil($totalitems/$perpage);         if(!empty($paged) && !empty($perpage)){             $offset=($paged-1)*$perpage;             $query.=' LIMIT '.(int)$offset.','.(int)$perpage;         }     $this->set_pagination_args( array(         "total_items" => $totalitems,         "total_pages" => $totalpages,         "per_page" => $perpage,         ) );     $columns = $this->get_columns();         $hidden = array();         $sortable = $this->get_sortable_columns();         $this->_column_headers = array($columns, $hidden, $sortable);         $this->items = $wpdb->get_results($query);          }          function display_rows() {     $records = $this->items;     list( $columns, $hidden ) = $this->get_column_info();     if(!empty($records)){foreach($records as $rec){         echo '
name.'">';         foreach ( $columns as $column_name => $column_display_name ) {             $class = "class='$column_name column-$column_name'";             $style = "";             if ( in_array( $column_name, $hidden ) ) $style = ' style="display:none;"';             $attributes = $class . $style;                 $editlink  = '/test/wp-admin/themes.php?page=testimonials&tab=add_new_testimonial='.urlencode((int)$rec->id);             switch ( $column_name ) {                case "cb": echo '<input type="checkbox" />	';break;                case "id": echo ''.stripslashes($rec->id).'	';break;                case "name": echo ''.stripslashes($rec->name).'	'; break;                 case "company_name": echo ''.stripslashes($rec->company_name).'	'; break;                     case "company_url": echo ''.stripslashes($rec->company_url).'	'; break;                     case "testimonials_quote": echo ''.stripslashes($rec->testimonials_quote).'	'; break;             }         }         echo'
';         }}         }               } // End WP_List_Table class


Similar Posts - NO plugin

How can I make a similar posts section in my theme, but without using a plugin. I'm going to be giving my theme away for free, so I don't want to have to force people to install plugins to use my theme. How can it be done?


Give Children Unique ID's

Is there a way I can give each wordpress children (subcategory UL lists) unique ID's? I'm creating a dropdown list for subcategories and I want to position them but `:nth-child` isn't supported by everything yet.


Is there a way to backdate posts?

Is there a way to backdate posts on WordPress? The reason is that I am migrating content over from another site and want to keep their original publishing dates. * * * ## Edit The content is being migrated manually from a non-wordpress website


wp_schedule_event not working

I 'm going to create a sheduled update_post_meta and for some uknown reason the function is never fired. Below is the code:               add_action( 'save_post', 'scheduled_upm');          function scheduled_upm() {              wp_schedule_event( time(), 'hourly', 'do_this_every_hour');          }               add_action( 'do_this_every_hour','do_this_every_hour' );          function do_this_every_hour() {               update_post_meta('3197', 'meta_key', '8');               }      The normal (as far as I can understand), is that do_this_every_hour function, will run immediately and after this, it will run every hour. Am I wrong somewhere? Thanx in advance!


Save selectlist value (taxonomy) in wp:wp_set_object_terms

In my admin for part i have additional fields (like price or brand - which is taxonomy). When i edit or create new part, i set up additional data. and price saving is without any problem, but saving value from select list is something strange - it didn't save:               wp_set_object_terms($post_id, $_POST['part_brand'], 'brands', true);      according to wp doc: this function update value from taxonomy select. But for me it didn't work. All code you could see here: http://pastebin.com/N4gZL3uN how to save value from select list (taxonomy) in wp? whole code:               <?php     /*     Plugin Name: parts     Plugin URI: http://wp.tutsplus.com/     Description: descr     Version: 1.0     Author: Me     Author URI: http://wp.tutsplus.com/     License: GPLv2     */     add_action('init', 'part_init');          function part_init()     {       $args = array(         'label' => __('Parts') ,         'labels' => array(           'edit_item' => __('Edit Part') ,           'add_new_item' => __('Add New Part') ,           'view_item' => __('View Part') ,         ) ,         'singular_label' => __('Part') ,         'public' => true,         'show_ui' => true,         '_builtin' => false,         'capability_type' => 'post',         'hierarchical' => false,         'rewrite' => array(           "slug" => "parts"         ) , // формат ссылок         'supports' => array(           'title',           'editor',           'thumbnail'         )       );       register_post_type('part', $args);       $labels_gr = array(         'name' => 'Группы',         'singular_name' => 'Группы',         'search_items' => 'Поиск групп',         'all_items' => 'Все группы',         'parent_item' => 'Родительская группа',         'parent_item_colon' => 'Родительская группа:',         'edit_item' => 'Редактирование группы',         'update_item' => 'Обновить группу',         'add_new_item' => 'Добавить новую группу',         'new_item_name' => 'Имя новой группы',         'menu_name' => 'Группы',       );       $labels_brands = array(         'name' => 'Бренды',         'singular_name' => 'Бренд',         'search_items' => 'Поиск брендов',         'popular_items' => 'Популярные бренды',         'all_items' => 'Все бренды',         'edit_item' => 'Редактировать бренд',         'update_item' => 'Обновить бренд',         'add_new_item' => 'Добавить новый бренд',         'new_item_name' => 'Имя нового бренда',         'menu_name' => 'Бренды',         'separate_items_with_commas' => 'Разделять бренды запятыми',         'add_or_remove_items' => 'Добавить или удалить бренд',         'choose_from_most_used' => 'Выберите бренд из наиболее используемых',         'menu_name' => 'Бренды',       );       register_taxonomy('groups', 'post', array(         'hierarchical' => true,         'labels' => $labels_gr,         'show_ui' => true,         'show_admin_column' => true,         'query_var' => true,         'rewrite' => array(           'slug' => 'group'         ) ,       ));       register_taxonomy('brands', 'post', array(         'hierarchical' => false,         'labels' => $labels_brands,         'show_ui' => true,         'show_admin_column' => true,         'update_count_callback' => '_update_post_term_count',         'query_var' => true,         'rewrite' => array(           'slug' => 'brands'         ) ,       ));     }          function part_add_meta_box()     {       add_meta_box('part_additional_fields', __('Дополнительные поля', 'part_textdomain') , 'part_meta_box_callback', 'part');     }          add_action('add_meta_boxes', 'part_add_meta_box');          function part_meta_box_callback($post)     {       wp_nonce_field('part_meta_box', 'part_meta_box_nonce');       $part_weight = get_post_meta($post->ID, 'part_weight', true);            // $part_brand = get_post_meta( $post->ID, 'part_brand', true );            $part_brand = get_terms('brands', 'hide_empty=0');       $part_price = get_post_meta($post->ID, 'part_price', true);       $part_group = get_terms('groups', 'hide_empty=0');       echo '';       _e('Вес', 'myplugin_textdomain');       echo ' ';       echo '<input id="part_weight" name="part_weight" value="' . esc_attr($part_weight) . '" size="25" type="number" />';       echo "
";     ?>       Бренд       <select name='part_brand' id='part_brand'>               <option value=''               <?php       if (!count($part_brand)) echo "selected"; ?>>None</option>               <?php       foreach($part_brand as $brand)       {         if (!is_wp_error($part_brand) && !empty($part_brand) && !strcmp($brand->slug, $part_brand[0]->slug)) echo "<option value='" . $brand->slug . "' selected>" . $brand->name . "</option>\n";         else echo "<option value='" . $brand->slug . "'>" . $brand->name . "</option>\n";       }          ?>       </select>           <?php       echo "
";       echo '';       _e('Цена', 'myplugin_textdomain');       echo ' ';       echo '<input id="part_price" name="part_price" value="' . esc_attr($part_price) . '" size="25" type="number" />';       echo "
";     ?>       Группа       <select name='part_group' id='part_group'>               <option value=''               <?php       if (!count($part_group)) echo "selected"; ?>>None</option>               <?php       foreach($part_group as $brand)       {         if (!is_wp_error($part_group) && !empty($part_group) && !strcmp($brand->slug, $part_group[0]->slug)) echo "<option value='" . $brand->slug . "' selected>" . $brand->name . "</option>\n";         else echo "<option value='" . $brand->slug . "'>" . $brand->name . "</option>\n";       }          ?>       </select>           <?php     }          function part_save_meta_box_data($post_id)     {       if (!isset($_POST['part_meta_box_nonce']))       {         return;       }            if (!wp_verify_nonce($_POST['part_meta_box_nonce'], 'part_meta_box'))       {         return;       }            if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)       {         return;       }            if (isset($_POST['post_type']) && 'part' == $_POST['post_type'])       {         if (!current_user_can('edit_page', $post_id))         {           return;         }       }       else       {         if (!current_user_can('edit_post', $post_id))         {           return;         }       }            if (!isset($_POST['part_weight']) || !isset($_POST['part_weight']) || !isset($_POST['part_weight']) || !isset($_POST['part_group']))       {         return;       }            $part_weight_data = sanitize_text_field($_POST['part_weight']);            // $part_brand_data = sanitize_option( $_POST['part_brand'], $_POST['part_brand']);            wp_set_object_terms($post_id, $_POST['part_brand'], 'brands', true);       $part_price_data = sanitize_text_field($_POST['part_price']);            // $part_group = sanitize_option( $_POST['part_group'] );            wp_set_object_terms($post_id, $_POST['part_group'], 'groups', true);            // Update the meta field in the database.            update_post_meta($post_id, 'part_weight', $part_weight_data);            // update_post_meta( $post_id, 'part_brand', $part_brand_data );            update_post_meta($post_id, 'part_price', $part_price_data);            // update_post_meta( $post_id, 'part_group', $part_group );          }          add_action('save_post', 'part_save_meta_box_data');     ?>


Forms won't submit

I have a brand new theme that I just built out using _s's (underscores) that won't submit forms. Here are the errors I get in the console: On submit:               Uncaught Typeerror: cannot read property: 'checkValidity' of undefined      Followed by:               Resource interpreted as Script but transferred with MIME type text/html: "about:blank”.      Steps I’ve taken:   1. Verify that WP is able to send emails by submitting ‘reset password’    2. Installed a plugin that verify’s emails can be sent   3. Narrowed it down to the theme itself because _I am_ able to submit forms when twenty thirteen is installed   4. the problem occurs in both Contact Form 7 and Gravity Forms, so isn't either of them   5. I uninstalled all plugins and I’m still not able to submit Anybody have an idea of what could be causing this in my theme?


Custom field not displaying when category specified in loop/tag

I'm using custom fields (via Advanced Custom Fields) to display particular bits of information. One of them, author (for which there are sometimes multiple entries), displays fine across the site but will not show on the home page when I identify a specific category in the loop parameters or on the tag page. The code is:               <?php $i = 0; foreach(get_field('author') as $related): ?>     <?php if($i > 0) { echo "and"; } ?>     <?php echo get_the_title($related->ID) ?>     <?php ++$i; endforeach;  ?>      Any pointers on why this isn't working would be much appreciated! Thanks!


Edit Custom Post Type on Custom Admin Page instead Post Admin

Background: I am still quite fresh to coding and WordPress. For me the best way to understand, is to work on a specific project. **Project:** I want to build a Customer Relationship Tool for WordPress that will be used primarly from the Wordpress Backend. I have custom post types: Contacts / People and Orders. The fields I've added using Advanced Custom Fields. What concerns me right now is that the UI of the post admin doesn't seem very adjustable. E.g., I want to select orders in a selection field and then assign them to a customer. I don't want to see any multiselect field on the customer afterwards but a nice table of all orders assigned. As well I want to record relationships between people, such as e.g. one person being the mail recepient of another one that is a firm. Then I would like to show a list for each person, with all mail addresses, be they form this person itself or from an assigned recipient. **Idea** : I have seen some plugins that use an admin options page with a form to display and edit both list of posts and one specific post itself what seems to allow much more flexibility to create the UI. So I would like to make such an admin form to create, edit and display my custom post types. Yet I am totally stuck and lost in what and how to do it. I am still to much a noob to understand all the code from those plugins. **Supperior question:** How do I create, display and edit a custom post type on an admin options page insted of the post admin page? **My attempt:** I guess I need to break down this problem to junks like:   1. register a custom admin page   2. add a form to this custom admin page, that displays the fields from the custom post type with the desired UI design.   3. functionality to create a new post:      * redirect to this custom admin page, if i click on a link / button to create a new post     * make the form save the entered values to a new post   4. functionality to view and edit an existing post:      * redirect to this custom admin page, if i click on an existing post to edit it     * display values of the post's fields in the form and allowing me to change them and update the values. Aspects 3 and 4 pose issues to me. **I know those are different questions.** I list them here for you to see, what my brain twists are and will research and ask for those separately. **Question:** To be able to approach that project (and ask the right further questions), first I need to know, if those are the right stepps to solve or if I should approach the project completely different. Please provide me with some enlightenment! Thanx a lot!


Order posts by date and then by custom field

I am trying to do something like this one. Ordering posts by day (not time) AND meta value I want to list blog posts ordered by date (not time) and then within that day, I want to sort them by custom field my_post_rating. This simply outputs posts ordered by rating.               $args = array(       'post_type' => 'post',       'posts_per_page' => '-1',       'meta_key' => 'my_post_rating',       'orderby' => 'meta_value_num',       'ignore_sticky_posts' => 1,     );          $new_query = new WP_Query( $args );      I have also tried suggested solution but it did not worked. Please suggest what is wrong? **Edit //** Var dump added > string(344) "SELECT wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON > (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND wp_posts.post_type = > 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = > 'private') AND (wp_postmeta.meta_key = 'my_post_rating' ) GROUP BY > wp_posts.ID ORDER BY wp_postmeta.meta_value+0 DESC "


wp_insert_post generated mixed permalinks

I'm writing a plugin which uses `wp_insert_post()` to insert posts programatically and my permalink setting is `/%category%/%postname%/` Of all the post inserted, `wp_posts.guid` shows 2 types of output. Some post will be following `/%category%/%postname%/` and some `/?p=POST_ID`. When I use `get_permalink()`, I also get mixed results much like what's stored in `wp_posts.guid` I wonder what causes this and how can I force all the posts to follow my permalink configuration? At the same time, how do I force all link of `/p=POST_ID` to redirect according to the permalink setting, which in this case `/%category%/%postname%/`? Thank you EDIT: I later found out that those with default permalink are actually 'draft' posts. Sorry for the confusion.


Remind a user about their account if they have not used it for 6 months

I have a website working with a user registration/login system all working also. I wish to automatically send all users an email that have not used their account for 6 months. I have an idea, but just wondered if there would be a better/more convenient solution. Because this will be done in PHP, I guess this requires a cron job, which isnt a problem as I have done many of them before. Wordpress just doesnt seem to store the last time a user visits my site (to my knowledge). I then thought I could just store in the database (manually) the last time a user visits the site, and run a comparison to the current date in a PHP cron file. Has anyone got a better suggestion? Or even a plugin to do it for me :p Thanks!


How could I fix the lowercase problem in nextgen gallery?

I am using nextgen gallery plugin with this code:               $galleries = $wpdb->get_results(     "SELECT t.*, tt.*      FROM $wpdb->nggallery AS t      INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid      WHERE tt.exclude != 1      GROUP BY tt.galleryid ORDER by tt.galleryid");          echo do_shortcode('[nggallery id='.$galleries[0]->gid.' template=galleryview images=0]');           echo '
';     foreach ( $galleries as $gallery ) {         $img_date = explode("-", $gallery->imagedate);         $ano = $img_date[0];         $mes = $img_date[1];         $img_gallery_url = get_bloginfo('url').'/wp-content/uploads/'.$ano.'/'.$mes.'/'.$gallery->filename;         // $gallery->filename trazendo lowercase         echo              '
                 alttext.'"/>                 '.$gallery->name.'
';     }     echo '
';      But the `$gallery->filename` is coming lowercase. My images are being saved without being mandatory to be lowercase.   * How could I fix this ?   * Is there a way to make mandatory lowercase in wordpress image upload (nextgen gallery)?   * Is there a way to make `$gallery->filename` bring the right filename, without making it lowercase ?


Which plugin will let me relate one post to another?

Here is what I am trying to do: I am trying to allow users to create a post under 'category-A'. Then Create a post under 'category-B' which is linked to the post under 'category-A' For example: category-A Post Title Post content... link to additional post under category-B


Can I decide what categories show on my posts page?

Forgive me if this is too basic of a question... I am using Twenty Eleven and am wanting to only allow my "news" category show on the front page, excluding all other categories. How can I do this?


Buddypress User Settings template location?

I am trying to customize my BuddyPress layout and I can't find where to edit the user profile page layout. EG: /members/username-nice/settings/ This is just the page where you can change your password. The header and footer appear as they should, and there's a form to change your password, but I can't find the template file where this is coming from. I've copied all the files from from /wp-content/plugins/buddypress/bp- themes/bp-default/members/single over to my theme. There is ** NO ** settings folder within this folder. I was able to edit all the other profile templates (activity, profile, etc) because these templates were there in the theme. 1) where/do these files exist? 2) is this content being generated by WP and not BP? If so, which default template is is falling back on? And how do I edit around it?


How can I move (or create another) publish button?

How do I create a "publish" button to put in a custom metabox? Or if you can point me to the code that creates the current publish box, that'd help me out. -attempting to simplify my custom post type-


How to have Wordpress send a user confirmation/validation email on signup

I have a WP 3.3 installed and running great. My client would like to confirm a valid email address by sending the user a confirmation email containing a link to "confirm". I have played around with Pie Register a little bit but cannot get it to send emails like it says it can. Are there other plugins or tools out there capable of the same thing? I don't think its a huge deal but the client won't budge on it. Also the site sends other emails just fine. ideas?


Ordering system through Wordpress

I don't use Wordpress much, but I was wondering if anyone knew whether this would be possible in WP. Basically I want an online ordering system, so just like a normal cart where you can put things in your basket etc, except, instead of paying for it you just place an order and it generates an order email to me? Jonny?


I'm trying to add an image in my CSS

I'm trying to add an image in my CSS with the theme folder code, `<?php bloginfo('template_directory'); ?>`, which works in HTML but for some reason it's not working in the CSS. Does anyone know why or a solution? Here's my code:               background: url("<?php bloginfo('template_directory'); ?>/images/bg.jpg");


Why is the editor showing up in custom post type?

I am creating a custom content type and on the add new page and edit page the _editor_ is currently showing up when I have it coded not to be there. This was working fine about a week ago and I'm unsure what went wrong. Any ideas? Here is the code from my functions page:               add_action('init', 'recipe_register');          function recipe_register() {         $labels = array(             'name' => _x('Recipes', 'post type general recipe'),             'singular_name' => _x('Person', 'post type singular name'),             'add_new' => _x('Add New Recipe', 'recipe'),             'add_new_recipe' => __('Add New Recipe'),             'edit_recipe' => __('Edit Recipe'),             'new_recipe' => __('New Recipe'),             'view_recipe' => __('View Recipe'),             'search_recipes' => __('Search Recipes'),             'not_found' =>  __('Nothing found'),             'not_found_in_trash' => __('Nothing found in Trash'),             'parent_item_colon' => ''         );              $args = array(             'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,             'query_var' => true,             'rewrite' => array("slug" => "recipes"),             'capability_type' => 'post',             'hierarchical' => true,             'menu_position' => null,             'supports' => array('title','author','thumbnail')           );                    register_post_type('recipe',$args);              register_taxonomy('type','recipe',array(             'hierarchical' => true,             'label' => 'Type',             'show_ui' => true,             'query_var' => true,             'rewrite' => array( 'slug' => 'type' ),         ));     }                    add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'recipe',             array(                 'labels' => array(                     'name' => __( 'Recipe' ),                     'singular_name' => __( 'Recipe' )                 ),                 'public' => true,                 'has_archive' => true,                 'rewrite' => array('slug' => 'recipe')             )         );     }               add_action("admin_init", "admin_init");          function admin_init(){         add_meta_box("recipedetails_meta", "Recipe Information", "recipe_meta",  "recipe", "normal", "low");     }          function recipe_meta() {       global $post;       $custom = get_post_custom($post->ID);       $name = $custom["recipe_name"][0];       $yield = $custom["recipe_yield"][0];       $time = $custom["recipe_time"][0];       $ingredients = $custom["recipe_ingredients"][0];       $directions = $custom["recipe_directions"][0];       $calories = $custom["recipe_calories"][0];       $done = $custom["recipe_done"][0];       $original = $custom["recipe_original"][0];       ?>

Name
<input name="recipe_name" value="<?php echo $name; ?>">

Yield
<input name="recipe_yield" value="<?php echo $yield; ?>">

Time
<input name="recipe_time" value="<?php echo $time; ?>">

Calories
<input name="recipe_calories" value="<?php echo $calories; ?>">

URL
<input name="recipe_fat" value="<?php echo $done; ?>">

Original
<input name="recipe_original" value="<?php echo $original; ?>">

Ingredients:
                 <textarea cols="50" rows="5" name="recipe_ingredients"><?php echo $ingredients; ?></textarea>

Directions:
                 <textarea cols="50" rows="5" name="recipe_directions"><?php echo $directions; ?></textarea>

       <?php     }          add_action('save_post', 'save_details');          function save_details(){       global $post;            update_post_meta($post->ID, "recipe_name", $_POST["recipe_name"]);       update_post_meta($post->ID, "recipe_yield", $_POST["recipe_yield"]);       update_post_meta($post->ID, "recipe_time", $_POST["recipe_time"]);       update_post_meta($post->ID, "recipe_ingredients", $_POST["recipe_ingredients"]);       update_post_meta($post->ID, "recipe_directions", $_POST["recipe_directions"]);       update_post_meta($post->ID, "recipe_calories", $_POST["recipe_calories"]);       update_post_meta($post->ID, "recipe_done", $_POST["recipe_done"]);     }                    add_filter('manage_edit-recipe_columns', 'add_recipe_columns');          function add_recipe_columns($gallery_columns) {         $new_columns['cb'] = '<input type="checkbox" />';         $new_columns['title'] = _x('Recipe', 'column name');         $new_columns['calories'] = __('Calories');         $new_columns['time'] = __('Time');         $new_columns['type'] = __('Type');         return $new_columns;     }               add_action('manage_recipe_posts_custom_column', 'manage_recipe_columns', 10, 2);          function manage_recipe_columns($column_name, $id) {         global $post;         switch ($column_name) {             case 'calories':                 echo get_post_meta( $post->ID , 'recipe_calories' , true );                  break;             case 'time':                  echo get_post_meta( $post->ID, 'recipe_time' , true );                 break;             case 'type':                 echo get_the_term_list($post->ID, 'type', '', ', ','');                 break;                  default:                 break;         }      }          ?>


What methods should be used to fend off splogs in a multiuser install?

We're running 3.1.1 multi-user with the latest BuddyPress plugin, but we're having all sorts of issues with splog signups. So far, we've started using Anti-Splog, Bad Behavior, ReCaptcha on the signup page and have changed our .htaccess as described here and elsewhere. Is manually spotting and removing them a fact of life with open registration or are we missing something else that could help?


Nginx config for NGG / NextGen Gallery

I run wordpress on nginx + php-fpm in a subfolder `abc`. I want to upload images into a NextgenGallery and the ajax-based uploader yields this:               POST 404 for http://example.com/abc/index.php/photocrati_ajax      Obviously the rewrite in the `nginx.conf` does not work. Here are the relevant parts of it:               try_files $uri $uri/ /index.php?q=$request_uri;          location ~ \.php$ {          try_files                $uri =404;          fastcgi_split_path_info  ^(.+\.php)(/.+)$;          fastcgi_pass             php-fpm;          fastcgi_index            index.php;     }      So, how to serve `photocrati_ajax` via nginx and make the uploads work?


How to make custom posts to behave like taxonomy?

I would like to have a database of fashion models on my blog. The models section will be located under `/models/`. There shall be a loop of recent posts with models as well as the full list of models names. Singe page of a model shall have URL: `/models/kate-moss`. Each model's single page should be a custom wordpress post, including basic description, photos and special fields like age and birth date, weight and height etc. On the single page template below the description of the model there shall be a list of posts related to the person. One more important thing: when an author publishes a post they should be able to simply choose the related person from the list with a checkbox. In other words the person is neither custom taxonomy nor custom post, it is both. But how to implement it?


dynamically generating plugin syntax

I have downloaded an audio player plugin for WP. the syntax is very simple. You just add the line `[audio:my_file.mp3]` to your post editor/excerpt, and call it in the loop with `the_content()` or `the_excerpt()` respectively. I would like to build a metabox in which the user would upload a file, and the plugin syntax would automatically be generated accordingly. I know how to insert the meta-data into the DB, but pulling it with `get_post_meta()` or `the_meta()` just gets the syntax as it is, without replacing it with the desired plugin content (i.e the audio player). I thought about dynamically injecting the syntax to the editor/excerpt with the use of the filter `default_content` but this filter only applies to normal posts, whereas mine is a custom post type (audio). your ideas are most welcomed.


How can I use WordPress as a job board ? (but free)

I wish to use WordPress installation for a job board. Looking online I found the following two posts that give a list of options: http://www.wpmods.com/turn-wordpress-into-job-board/ http://skyje.com/2010/01/job-board-solutions-for-wordpress/ But all of the options (except 1) cost money. Is there a free (good) solution for WP job board (theme/plugins) ?


External/non-WP rewrite rules

I have a fairly complex wordpress with multiple sub-directories:               example.com/sub1/     example.com/sub2/      I'm trying to implement some history/bookmark support, and to do that I need the URLS containing these directories to be rewritten to the directory, not the index page. From there AJAX can take over, interpret the first URL and load the content. I believe to do this I need to use `$wp_rewrite->non_wp_rules` So far I have not even been able to write a simple rewrite from one directory to another:               //flush the rules//     function test_flush_rewrites()      {      global $wp_rewrite;      $wp_rewrite->flush_rules();     };     //add new rule//     function test_add_rewrites()      {      global $wp_rewrite;      $test_new_non_wp_rules = array(         'sub1/' => 'sub2',      );      $wp_rewrite->non_wp_rules = $test_new_non_wp_rules + $wp_rewrite->non_wp_rules;     };     //add the actions//     add_action('generate_rewrite_rules', 'test_add_rewrites');     add_action('admin_init', 'test_flush_rewrites');      This results in a `404` when I navigate to the "`sub1`" directory. also               'sub1'    => 'sub2' // does nothing     '/sub1/'  => 'sub2' // does nothing     '/?sub1/' => 'sub2' // does nothing      I believe the rule i'd like to write in `.htaccess` should look something like this:               RewriteRule ^([^/]+)/.*$ /$1/       ideally i'd like to redirect `sub1/anythinghere` to `sub1`, `sub2/anythinghere` to `sub2` and so on. Thanks for any help.


Block comments from search engine indexing

I remember there used to be an option on WordPress to block comments from search engine indexing. I can't find it anywhere, though. Does anyone have suggestions or alternatives? Thanks.


W3 Total Cache Minification: way to revert back?

W3 Total Cache Minification: after adding all my js files in the minification settings, what if something screws up? Is is possible to revert back to the original un-minified files? Thanks.


How should I best target dynamically served content?

I am editing the 'Bizz' portfolio Wordpress theme(http://www.wpexplorer.com/bizz-wordpress-theme). It includes custom post types for managing portfolio examples, the highlights on the homepage, etc. I want to style the background color displayed behind each 'highlights' heading with a different color, but since they're served dynamically, I'm not sure how I should target each h2. Would it be best to attach a unique class to each of the three headings through the php, or try to target them through CSS selectors? And how would I best do that? My major concern in using CSS selectors would be backward compatibility, I dont know that I want to bulk up the page with extra bootstraps. How should I go about it? Thanks!


highlight specific text in the content box

This is an idea that came through my mind, and I would like to know if possible and how to approach it if so... I have my own wordpress framework that I use as based for all my projects, I manage the content position generated in the content box using shortcodes which respond to an especific div with a location... Said this, sometimes I find myself into a mess really hard to understand, for sample: [one_column] content [/one_column] [one_column] content [/one_column] [one_column] content [/one_column] [one_column] content [/one_column] when the among of text is big, is hard to find where the shortcodes are placed. So, is there any way to highlight the shortcode (like with a different color) into the content box? or maybe easier, is there any way to indent the content and keep that indent once I save or update the post? I would like to hear you opinion, Thanks in advanced. Kind Regards.


Default scripts added to each admin page

Whilst jQuery is available on all admin pages, only selected jQuery UI libraries are added for certain pages (i.e. it is different for each admin page). I am trying to find out where the jQuery UI libraries are actually registered for each admin page. For instance the widgets.php page has draggable, droppable added.


php loading different structure than source code

I was trying to code in a conditional statement into a template file and had a bit of an issue. This is the code in the file                    else                 {                     echo('

' . the_post_thumbnail( 'product-thumb', array( 'class' => 'product-thumb' ) ) . '

' . the_title() . '

Design No.:	' .  get_post_meta($post->ID, 'prod_id', true) . '

Product Status:	' . get_post_meta($post->ID, 'prod_status', true) . '

Style:	' . get_post_meta($post->ID, 'prod_style', true) . '

Size:	' . wpautop(get_post_meta($post->ID, 'prod_sizes', true)) . '
' . ($post->prod_price && $post->prod_sale == ""?('
Original Price:	' . get_post_meta($post->ID, 'prod_price', true) . '
'):($post->prod_sale != ""?('

Sale Price:
	' . get_post_meta($post->ID, 'prod_sale', true) . '

Original Price:

' . get_post_meta($post->ID, 'prod_price', true) . '

') : '

')) . '

' . ($post->post_content?('

' . the_content() . '

'):'') . '

Click here to view more Details

' . ($post->post_content?('

' . the_content() . '

'):'') . '

Click here to view more Details

'     );}      This is what it's supposed to output

Gabbeh Rug-12767

Design No.:	12767

Product Status:	In Stock

Style:	Allover

Size:
4.1 x 6.6
            Click here to view more Details Click here to view more Details                         But instead, for some reason, when the page loads in the browser, this is what it looks like:                   http://dev.imagecarpets.com/products/contemporary-rug/moroccan-rug-140105/Moroccan Rug-140105

Design No.:	140105

Product Status:	In Stock

Style:	Allover

Size:
8.5 x 10
            Click here to view more Details Click here to view more Details The thumbnail image and permalink are loaded outside the thumblist class as it was intended and the link doesnt turn into a link. It just prints the path unformatted. I probably did something dumb but I can't figure it out. Can anyone help


Display WooCommerce newest product reviews on top

By default, woocommerce product reviews are listed in chronological order. How do you get the newest review to appear first?


Removing My Sites menu from Admin

I am trying to find a solution to remove the "My Sites" menu that comes under the Dashboard section of a multi-site install. Any ideas on which hook to use? ![enter image description here](http://i.stack.imgur.com/IQWw4.png)


Post Via Email to a Custom Post Type

I have a scenario where we would like to post to our blog via email. However, it needs to be to a custom post type. I've done a bit of research but haven't found any examples or ideas on how to do this. Any help would be appreciated.


How to display date of blog creation

Is it possible to display (in PHP) the year when the blog was created? I want use this in footer (copyright) on my several blogs with my theme.


How to show the real post date in a draft

When looking at a draft post, `get_the_date()` only seems to return today's date, not the post date, even if I have selected another date on the post edit screen. Is there a way to show the "actual" post date, the one I selected? I can see in the MySQL database that it's saved in the post_date column. But, like get_the_date, `$post->post_date` doesn't return it. If the post is a draft, it shows the current date and time.


Can't get rid of minify after uninstalling W3 Total Cache

I've tried to replace my WP Super Cache for W3 Total Cache but it didn't worked. It was bugged all over and minify wouldn't work properly. So I uninstalled it s suggested by the plugin creator in one forum topic. The problem is my CSS still seems to be cached. I edit my theme's default style.css and it still loads the old version no mater what I do. I've cleaned my cache for however many times. And even if you access the css file right from the browser it still gives you the old version (taking a look at it via FTP will show the right version). What the hell is going on? To me it looks like minify is creeping somewhere in my WP installation and delivering the old cached CSS. Could you guys point out where should I look? EDIT I've changed the theme folder name and the issue has gone, which kinda prove there's some minify remains messing up with my code. I'd still like to get rid of it if someone can help EDIT 2 So, this is seriously driving me nuts now. Despite what I've said the issue persisted. So I've decided to DELET IT ALL and start from zero. I've cleaned the database and the files. Installed a fresh WP install. Restored the database and only the uploads WP folder. And guess what? The issue is still there. Is that an indication it's in the DB?


Previous / next posts using featured image thumbnail as links

I need navigation to two previous and two next posts, inside same category. I made it working great for one previous and one next post inside same category. This is what I have now. Previous post:               <?php     $prev_post = get_previous_post(TRUE);     $prev_post_thumb_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($prev_post->ID), 'thumbnail');     if (!empty( $prev_post )): ?>          <a href="<?php echo get_permalink( $prev_post->ID ); ?>"<img src="<?php echo $prev_post_thumb_image_url[0]; ?>">          <?php endif; ?>      Next post:               <?php     $next_post = get_next_post(TRUE);     $next_post_thumb_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($next_post->ID), 'thumbnail');     if (!empty( $next_post )): ?>          <a href="<?php echo get_permalink( $next_post->ID ); ?>"><img src="<?php echo $next_post_thumb_image_url[0]; ?>">          <?php endif; ?>      What I need is to check if there is two previous posts and to display than two previous thumbs and also check if there is next two posts and to display them if they exist. Of course it would be nice to display one previous/next post thumbs if there is no two previous posts. Even better to display next 4 posts on first and previous 4 posts on last page.