title: Theme Option won't show up in my template

text:
I've modified theme option from wp.tuts tutorials, And when I save the settings, it works. But the settings on the second tabs won't show up in my template. here my first theme option and the second First Theme option page                   <?php     /**      * Define page tabs      * $tabs['tab-slug']    = __('Tab Name', 'wpShop');      */     function dstheme_options_page_tabs() {              $tabs = array();              $tabs['header']     = __('Header', 'wpShop');            $tabs['slider']     = __('Slider', 'wpShop');            $tabs['opening']    = __('Opening Text', 'wpShop');          $tabs['terlaris']   = __('Terlaris', 'wpShop');         $tabs['artikel']    = __('Artikel', 'wpShop');           $tabs['testimoni']  = __('Testimoni', 'wpShop');                  return $tabs;     }     /**      * Define our settings sections      *      * array key=$id, array value=$title in: add_settings_section( $id, $title, $callback, $page );      * @return array      */     function dstheme_options_page_sections() {              // get the current tab         $tab = dstheme_get_the_tab();              // sections according to tab         switch ($tab) {             // Header             case 'header':                 $sections = array();                 $sections['logoaktif_section']  = __('', 'dstheme_textdomain');                              $sections['favicon_section']    = __('Pengaturan Header Template Anda', 'dstheme_textdomain');                                       break;                  // Slider             case 'slider':                 $sections = array();                     $sections['slidershow_section'] = __('', 'dstheme_textdomain');              break;                  // Opening             case 'opening':                      $sections = array();                 $sections['opening_section']    = __('', 'dstheme_textdomain');                      $sections['welcome_section']    = __('Ucapan Selamat Datang', 'dstheme_textdomain');                             $sections['kalimat_section']    = __('', 'dstheme_textdomain');                      break;                  // Terlaris Section             case 'terlaris':                 $sections = array();                 $sections['terlaris_section']   = __('', 'dstheme_textdomain');             break;                  // Artikel Section             case 'artikel':                 $sections = array();                 $sections['artikel_section']    = __('', 'dstheme_textdomain');                          break;                    // Testimoni             case 'testimoni':                 $sections = array();                 $sections['testimoni_section']  = __('', 'dstheme_textdomain');             break;               }              return $sections;        }           /**      * Define our form fields (options)       *      * @return array      */     function dstheme_options_page_fields() {              // get the current tab         $tab = dstheme_get_the_tab();              // setting fields according to tab         switch ($tab) {         // Header         case 'header':         $options[] = array(             "section" => "logoaktif_section",             "id"      => DSTHEME_SHORTNAME . "_logoaktif",             "title"   => __( 'Aktifkan Logo?', 'dstheme_textdomain' ),             "desc"    => __( 'Pilih Yes untuk mengakttifkan Logo. Jika Anda memilih YES, Anda diharuskan mengisi URL Logo dibawah', 'dstheme_textdomain' ),             "type"    => "select2",             "std"    => "Yes",             "choices" => array( __('Yes','dstheme_textdomain') . "|opt1", __('No','dstheme_textdomain') . "|opt2")         );              $options[] = array(             "section" => "favicon_section",             "id"      => DSTHEME_SHORTNAME . "_favicon",             "title"   => __( 'Icon Favicon', 'dstheme_textdomain' ),             "desc"    => __( 'Upload Favicon di Media Library, Kemudian Copy & Paste URL nya disini (Maksimal 16x16 Piksel)', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );              $options[] = array(             "section" => "favicon_section",             "id"      => DSTHEME_SHORTNAME . "_logo",             "title"   => __( 'URL Logo', 'dstheme_textdomain' ),             "desc"    => __( 'Upload Logo Anda di Media Library, Kemudian Copy & Paste URL Logo Disini', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );              $options[] = array(             "section" => "favicon_section",             "id"      => DSTHEME_SHORTNAME . "_marquee",             "title"   => __( 'Marquee Text', 'dstheme_textdomain' ),             "desc"    => __( 'Masukkan Text Marquee Info Terkini', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );                break;              // Slider Fields section         case 'slider':         $options[] = array(             "section" => "slidershow_section",             "id"      => DSTHEME_SHORTNAME . "_slideshow",             "title"   => __( 'Aktifkan Slideshow?', 'dstheme_textdomain' ),             "desc"    => __( 'Pilih Yes untuk mengakttifkan. Jika Anda memilih YES, Anda diharuskan melengkapi form dibawah', 'dstheme_textdomain' ),             "type"    => "select2",             "std"    => "Yes",             "choices" => array( __('Yes','dstheme_textdomain') . "|opt1", __('No','dstheme_textdomain') . "|opt2")         );              $options[] = array(             "section" => "slidershow_section",             "id"      => DSTHEME_SHORTNAME . "_link1",             "title"   => __( 'Link Slider 1', 'dstheme_textdomain' ),             "desc"    => __( 'Masukkan link untuk Slider 1', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );                    $options[] = array(             "section" => "slidershow_section",             "id"      => DSTHEME_SHORTNAME . "_slider1",             "title"   => __( 'Slider 1', 'dstheme_textdomain' ),             "desc"    => __( 'Upload Slider 1 di Media Library, Kemudian Copy & Paste URL nya disini (Minimal 940x300 Piksel)', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );                $options[] = array(             "section" => "slidershow_section",             "id"      => DSTHEME_SHORTNAME . "_slider2",             "title"   => __( 'Slider 2', 'dstheme_textdomain' ),             "desc"    => __( 'Upload Slider 2 di Media Library, Kemudian Copy & Paste URL nya disini (Minimal 940x300 Piksel)', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );                $options[] = array(             "section" => "slidershow_section",             "id"      => DSTHEME_SHORTNAME . "_link2",             "title"   => __( 'Link Slider 2', 'dstheme_textdomain' ),             "desc"    => __( 'Masukkan link untuk Slider 2', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );                        $options[] = array(             "section" => "slidershow_section",             "id"      => DSTHEME_SHORTNAME . "_slider3",             "title"   => __( 'Slider 3', 'dstheme_textdomain' ),             "desc"    => __( 'Upload Slider 3 di Media Library, Kemudian Copy & Paste URL nya disini (Minimal 940x300 Piksel)', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );                $options[] = array(             "section" => "slidershow_section",             "id"      => DSTHEME_SHORTNAME . "_link3",             "title"   => __( 'Link Slider 3', 'dstheme_textdomain' ),             "desc"    => __( 'Masukkan link untuk Slider 3', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );                $options[] = array(             "section" => "slidershow_section",             "id"      => DSTHEME_SHORTNAME . "_slider4",             "title"   => __( 'Slider 4', 'dstheme_textdomain' ),             "desc"    => __( 'Upload Slider 4 di Media Library, Kemudian Copy & Paste URL nya disini (Minimal 940x300 Piksel)', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );                $options[] = array(             "section" => "slidershow_section",             "id"      => DSTHEME_SHORTNAME . "_link4",             "title"   => __( 'Link Slider 4', 'dstheme_textdomain' ),             "desc"    => __( 'Masukkan link untuk Slider 4', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );                break;              // Opening Fields section         case 'opening':         $options[] = array(             "section" => "opening_section",             "id"      => DSTHEME_SHORTNAME . "_opening",             "title"   => __( 'Aktifkan Kalimat Pembuka?', 'dstheme_textdomain' ),             "desc"    => __( 'Pilih Yes untuk mengakttifkan. Jika Anda memilih YES, Anda diharuskan melengkapi form dibawah', 'dstheme_textdomain' ),             "type"    => "select2",             "std"    => "Yes",             "choices" => array( __('Yes','dstheme_textdomain') . "|opt1", __('No','dstheme_textdomain') . "|opt2")         );              $options[] = array(             "section" => "welcome_section",             "id"      => DSTHEME_SHORTNAME . "_judul",             "title"   => __( 'Judul Salam Pembuka', 'dstheme_textdomain' ),             "desc"    => __( 'Masukkan Judul yang singkat, padat, dan jelas. Berguna untuk memikat hati mbah Google', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => __('','dstheme_textdomain')         );                $options[] = array(             "section" => "kalimat_section",             "id"      => DSTHEME_SHORTNAME . "_welcome",             "title"   => __( 'Kalimat', 'dstheme_textdomain' ),             "desc"    => __( 'Masukkan beberapa kalimat untuk salam pembuka bagi pengunjung website Anda', 'dstheme_textdomain' ),             "type"    => "textarea",             "std"     => __('','dstheme_textdomain')         );                break;              // Terlaris Fields section         case 'terlaris':         $options[] = array(             "section" => "terlaris_section",             "id"      => DSTHEME_SHORTNAME . "_terlaris",             "title"   => __( 'Tampilkan Produk Terlaris?', 'dstheme_textdomain' ),             "desc"    => __( 'Pilih Yes untuk mengakttifkan. Jika Anda memilih YES, Anda harus membuat kategori dengan slug produk-terlaris', 'dstheme_textdomain' ),             "type"    => "select2",             "std"    => "Yes",             "choices" => array( __('Yes','dstheme_textdomain') . "|opt1", __('No','dstheme_textdomain') . "|opt2")         );           break;              // Artikel Fields section         case 'artikel':         $options[] = array(             "section" => "artikel_section",             "id"      => DSTHEME_SHORTNAME . "_artikel",             "title"   => __( 'Tampilkan Artikel Terkini?', 'dstheme_textdomain' ),             "desc"    => __( 'Pilih Yes untuk mengakttifkan. Jika Anda memilih YES, Anda harus melengkapi box dibawah', 'dstheme_textdomain' ),             "type"    => "select2",             "std"    => "Yes",             "choices" => array( __('Yes','dstheme_textdomain') . "|opt1", __('No','dstheme_textdomain') . "|opt2")         );                $options[] = array(             "section" => "artikel_section",             "id"      => DSTHEME_SHORTNAME . "_kategori",             "title"   => __( 'Kategori ID', 'dstheme_textdomain' ),             "desc"    => __( 'Masukkan ID Kategori (Pisahkan dengan koma tanpa spasi. Misal: 1,2,3)', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => "",             "class"   => "numeric"         );                $options[] = array(             "section" => "artikel_section",             "id"      => DSTHEME_SHORTNAME . "_postcount",             "title"   => __( 'Jumlah Artikel', 'dstheme_textdomain' ),             "desc"    => __( 'Jumlah Artikel yang akan ditampilkan. Masukkan angka GENAP supaya tidak ada ruang longgar.', 'dstheme_textdomain' ),             "type"    => "text",             "std"     => "",             "class"   => "numeric"         );               break;                // Testimonial         case 'testimoni':         $options[] = array(             "section" => "testimoni_section",             "id"      => DSTHEME_SHORTNAME . "_testimoni",             "title"   => __( 'Tampilkan Testimoni di Sidebar?', 'dstheme_textdomain' ),             "desc"    => __( '', 'dstheme_textdomain' ),             "type"    => "select2",             "std"    => "Yes",             "choices" => array( __('No','dstheme_textdomain') . "|opt1", __('Yes','dstheme_textdomain') . "|opt2")         );           break;           }              return $options;         }          /**      * Contextual Help      */     function dstheme_options_page_contextual_help() {         // get the current tab         $tab = dstheme_get_the_tab();              $text   = "
" . __('Bantuan','dstheme_textdomain') . "
";              // contextual help according to tab         switch ($tab) {             // Header             case 'header':                 $text   .= "
" . __('Aktifkan Logo: Jika Anda memiliki logo pribadi, Anda dapat mengatur untuk menampilkan logo Anda atau tidak
Icon Favicon: Ikon kecil yang biasa muncul di tab browser Anda
Marquee: Merupakan Effect teks berjalan yang ada di halaman paling atas website Anda
URL Logo: Alamat akses gambar Anda, Misal: http://website.com/gambar.png. Format yang valid adalah JPG, PNG, & GIF','dstheme_textdomain') . "
";             break;                  // Slider             case 'slider':                 $text   .= "
" . __('Aktifkan Slideshow?: Pilihan untuk menampilkan slideshow atau menyembunyikannya','dstheme_textdomain') . "
";             break;                  // Opening             case 'opening':                 $text   .= "
" . __('Form untuk menampilkan bagian "Salam Pembuka" di halaman utama website Anda','dstheme_textdomain') . "
";             break;                  // Terlaris Section             case 'terlaris':                 $text   .= "
" . __('Contextual help for the "Terlaris" settings fields goes here.','dstheme_textdomain') . "
";             break;                  // Artikel Section             case 'artikel':                 $text   .= "
" . __('Contextual help for the "Artikel" settings fields goes here.','dstheme_textdomain') . "
";             break;                    // Testimonial Section             case 'testimoni':                 $text   .= "
" . __('Contextual help for the "Testimoni" settings fields goes here.','dstheme_textdomain') . "
";             break;                   }              // must return text! NOT echo         return $text;     } ?>      Here is the second tab:                <?php     /**      * Define page tabs      * $tabs['tab-slug']    = __('Tab Name', 'wpShopTwo');      */     function dstheme_options_two_page_tabs() {              $tabs = array();              $tabs['detail-kontak']  = __('Detail Kontak', 'wpShopTwo');          $tabs['ekspedisi']      = __('Ekspedisi', 'wpShopTwo');          $tabs['bank']       = __('Bank', 'wpShopTwo');                return $tabs;     }          /**      * Define our settings sections      *      * array key=$id, array value=$title in: add_settings_section( $id, $title, $callback, $page );      * @return array      */     function dstheme_options_two_page_sections() {              // get the current tab         $tab = dstheme_get_the_tab();              // sections according to tab         switch ($tab) {             // Detail Kontak             case 'detail-kontak':                 $sections = array();                 $sections['kontakaktif_section']    = __('Tampilkan Kontak?', 'dstheme_textdomain');                 $sections['telepon_section']        = __('Masukkan Detail Kontak Toko Online', 'dstheme_textdomain');                                            break;                  // Ekspedisi             case 'ekspedisi':                 $sections = array();                 $sections['alltwo_section']     = __('Option untuk menampilkan Jasa Shipping', 'dstheme_textdomain');             break;                  // Bank             case 'bank':                 $sections = array();                 $sections['allthree_section']   = __('Menampilkan Pilihan Pembayaran', 'dstheme_textdomain');                            break;         }              return $sections;        }           /**      * Define our form fields (options)       *      * @return array      */     function dstheme_options_two_page_fields() {              // get the current tab         $tab = dstheme_get_the_tab();              // setting fields according to tab         switch ($tab) {             // Detail Kontak             case 'detail-kontak':                 $options[] = array(                     "section" => "kontakaktif_section",                     "id"      => DSTHEME_SHORTNAME . "_kontak",                     "title"   => __( 'Tampilkan Kontak di Homepage?', 'dstheme_textdomain' ),                     "desc"    => __( 'Pilih YES, Jika Anda ingin menampilkan kontak di halaman awal.', 'dstheme_textdomain' ),                     "type"    => "select2",                     "std"    => "Yes",                     "choices" => array( __('No','dstheme_textdomain') . "|opt1", __('Yes','dstheme_textdomain') . "|opt2")                 );                 $options[] = array(                     "section" => "telepon_section",                     "id"      => DSTHEME_SHORTNAME . "_nohp",                     "title"   => __( 'Nomor Telepon', 'dstheme_textdomain' ),                     "desc"    => __( 'Masukkan Nomor Telepon (Kosongkan jika tidak ada)', 'dstheme_textdomain' ),                     "type"    => "text",                     "std"     => __('','dstheme_textdomain'),                     "class"   => "nohtml"                 );                      $options[] = array(                     "section" => "telepon_section",                     "id"      => DSTHEME_SHORTNAME . "_nosms",                     "title"   => __( 'Nomor HP', 'dstheme_textdomain' ),                     "desc"    => __( 'Masukkan Nomor HP (Kosongkan jika tidak ada)', 'dstheme_textdomain' ),                     "type"    => "text",                     "std"     => __('','dstheme_textdomain'),                     "class"   => "nohtml"                 );                      $options[] = array(                     "section" => "telepon_section",                     "id"      => DSTHEME_SHORTNAME . "_nobbm",                     "title"   => __( 'Pin BB', 'dstheme_textdomain' ),                     "desc"    => __( 'Masukkan Nomor Pin BB (Kosongkan jika tidak ada)', 'dstheme_textdomain' ),                     "type"    => "text",                     "std"     => __('','dstheme_textdomain'),                     "class"   => "nohtml"                 );                                $options[] = array(                     "section" => "telepon_section",                     "id"      => DSTHEME_SHORTNAME . "_email1",                     "title"   => __( 'Email', 'dstheme_textdomain' ),                     "desc"    => __( 'Masukkan Email Toko Online (Kosongkan jika tidak ada)', 'dstheme_textdomain' ),                     "type"    => "text",                     "std"     => __('','dstheme_textdomain'),                     "class"   => "nohtml"                 );                            $options[] = array(                     "section" => "telepon_section",                     "id"      => DSTHEME_SHORTNAME . "_ym1",                     "title"   => __( 'Yahoo Messenger', 'dstheme_textdomain' ),                     "desc"    => __( 'Masukkan Yahoo Messenger (Kosongkan jika tidak ada)', 'dstheme_textdomain' ),                     "type"    => "text",                     "std"     => __('','dstheme_textdomain'),                     "class"   => "nohtml"                 );                        $options[] = array(                     "section" => "telepon_section",                     "id"      => DSTHEME_SHORTNAME . "_ym2",                     "title"   => __( 'Yahoo Messenger 2', 'dstheme_textdomain' ),                     "desc"    => __( 'Masukkan Yahoo Messenger 2 (Kosongkan jika tidak ada)', 'dstheme_textdomain' ),                     "type"    => "text",                     "std"     => __('','dstheme_textdomain'),                     "class"   => "nohtml"                 );                                    break;                  // Ekspedisi             case 'ekspedisi':                 $options[] = array(                     "section" => "alltwo_section",                     "id"      => DSTHEME_SHORTNAME . "_jne",                     "title"   => __( 'Tampilkan JNE?', 'dstheme_textdomain' ),                     "desc"    => __( 'Pilih YES, Jika Anda ingin menampilkan pilihan pengiriman JNE.', 'dstheme_textdomain' ),                     "type"    => "select2",                     "std"    => "Yes",                     "choices" => array( __('No','dstheme_textdomain') . "|opt1", __('Yes','dstheme_textdomain') . "|opt2")                 );                      $options[] = array(                     "section" => "alltwo_section",                     "id"      => DSTHEME_SHORTNAME . "_tiki",                     "title"   => __( 'Tampilkan TIKI?', 'dstheme_textdomain' ),                     "desc"    => __( 'Pilih YES, Jika Anda ingin menampilkan pilihan pengiriman TIKI.', 'dstheme_textdomain' ),                     "type"    => "select2",                     "std"    => "Yes",                     "choices" => array( __('No','dstheme_textdomain') . "|opt1", __('Yes','dstheme_textdomain') . "|opt2")                 );                      $options[] = array(                     "section" => "alltwo_section",                     "id"      => DSTHEME_SHORTNAME . "_pos",                     "title"   => __( 'Tampilkan Pos Indonesia?', 'dstheme_textdomain' ),                     "desc"    => __( 'Pilih YES, Jika Anda ingin menampilkan pilihan pengiriman Pos Indonesia.', 'dstheme_textdomain' ),                     "type"    => "select2",                     "std"    => "Yes",                     "choices" => array( __('No','dstheme_textdomain') . "|opt1", __('Yes','dstheme_textdomain') . "|opt2")                 );                               break;                  // Bank             case 'bank':                             $options[] = array(                     "section" => "allthree_section",                     "id"      => DSTHEME_SHORTNAME . "_paypal",                     "title"   => __( 'Tampilkan Pembayaran Paypal?', 'dstheme_textdomain' ),                     "desc"    => __( '', 'dstheme_textdomain' ),                     "type"    => "select2",                     "std"    => "Yes",                     "choices" => array( __('No','dstheme_textdomain') . "|opt1", __('Yes','dstheme_textdomain') . "|opt2")                 );                   $options[] = array(                     "section" => "allthree_section",                     "id"      => DSTHEME_SHORTNAME . "_bank1",                     "title"   => __( 'Tampilkan Bank Mandiri?', 'dstheme_textdomain' ),                     "desc"    => __( '', 'dstheme_textdomain' ),                     "type"    => "select2",                     "std"    => "No",                     "choices" => array( __('No','dstheme_textdomain') . "|opt1", __('Yes','dstheme_textdomain') . "|opt2")                 );                           break;         }              return $options;         }          /**      * Contextual Help      */     function dstheme_options_two_page_contextual_help() {         // get the current tab         $tab = dstheme_get_the_tab();              $text   = "
" . __('Kanal Bantuan','dstheme_textdomain') . "
";              // contextual help according to tab         switch ($tab) {             // Detail Kontak             case 'detail-kontak':                 $text   .= "
" . __('Informasi untuk menampilkan kontak Anda di Website','dstheme_textdomain') . "
";             break;                  // Ekspedisi             case 'ekspedisi':                 $text   .= "
" . __('Halaman ini digunakan untuk menampilkan beberapa pilihan Jasa Shipping yang tersedia. Anda dapat memilih "YES" untuk menampilkan, jika tidak pilih "No"','dstheme_textdomain') . "
";             break;                  // Bank             case 'bank':                 $text   .= "
" . __('Halaman ini digunakan untuk menampilkan beberapa pilihan Bank yang tersedia. Anda dapat memilih "YES" untuk menampilkan Bank tersebut, jika tidak pilih "No"','dstheme_textdomain') . "
";             break;         }              // must return text! NOT echo         return $text;     } ?>      Any suggestions? Thank you


title: Redirect Attachment Page to Attachment

text: I'm trying to change my attachment page to just automatically redirect to the attachment. Here's what I've tried: Get attachment ID and redirect to that URL:               $urlArr = wp_get_attachment_image_src($_GET['attachment_id'], 'full');          if(empty($urlArr))         $url = wp_get_attachment_url($_GET['attachment_id']);     else         $url = $urlArr[0];          wp_redirect($url, 301); exit;       The redirect to a textual version of the image, I've tried to send extra headers but run into a problem that headers have already been set... I've searched for it online but only found links where people want to redirect to a certain page, but I'm trying to redirect to the media itself, plugin free. I'm adding the above code directly into `attachment.php` template file.


title: Changing WordPress URL breaks some jquery functions

text: Old URL: http://www.pillerdesigns.com/foxterrier/ New URL: http://www.foxterrier.com/ Process: copied all files to new server, updated wp-config.php, changed site and WordPress URL in Settings, exported DB using phpMyAdmin then imported DB using phpMyAdmin. Issue: Three things no longer work on new site, and it seems they are all jQuery based:   * Slideshows in header (left and right image boxes) no longer transition   * jQuery masonry no longer arranges lavender area posts   * NextGen gallery plugin no longer works Can anyone help? Thanks!


title: Page attributes missing

text: _(I searched if anyone has same problem but found nothing. So if this is a duplicate question please let me know)_ My plan was to create a custome-page-template. So I found some tutorials and recognize that I have to create a `php-file` in template folder. All fine. Then I want to create a new page based on my template but there are no page attributes only empty dash bordered rectangl: ![enter image description here](http://i.stack.imgur.com/UgMuk.png) I remember my self that this empty rectangle was there for a while but I do not pay attention until now. I'm relative new in using/administrating WordPress so I'm not sure where to start bug-hunting. Any help would be welcome. WordPress-Version is 3.6 and theme is TwentyTen with some customizations in style.css (undo changes in css for test doesn't help)


title: How do i save and retrieve custom attachment meta?

text: I'm trying to save if a checkbox inside of the media uploader pop up is checked, so i can retrieve it from the front end. I'm using this code:               function filter_attachment_fields_to_edit( $form_fields, $post ) {         $foo = (bool) get_post_meta($post->ID, 'foo', true);              $form_fields['foo'] = array(             'label' => 'Is Foo',             'input' => 'html',             'html' => '<label for="attachments-'.$post->ID.'-foo"> ' . '<input type="checkbox" id="attachments-'.$post->ID.'-foo" name="attachments['.$post->ID.'][foo]" value="1"'.($foo ? ' checked="checked"' : '').' /> Yes</label>  ',             'value' => $foo,             'helps' => 'Check for yes'         );         return $form_fields;     }      from this question: How to add a checkbox element to attachments editor with example I have to admit i don't completely understand how this piece of code is put together. I tried using this function to save:               function image_attachment_fields_to_save($post, $attachment) {           if( isset($attachment['imageLinksTo']) ){               update_post_meta($post['ID'], '_imageLinksTo', $attachment['imageLinksTo']);           }           return $post;       }           add_filter("attachment_fields_to_edit", "image_attachment_fields_to_edit", null, 2);      add_filter("attachment_fields_to_save", "image_attachment_fields_to_save", null, 2);


title: Is custom menu name and category name linked in wordpress?

text: I have created a custom menu for each of my categories (to show subcategories of each category on that category page) and that menu will have the exact same name as the category name. The weird thing that happened is that when I changed the name of the custom menu, the name of the category also changed and the permalink of that category changed as well and so I get a 404 error page when I try to open the category page. Is it just me or is this a bug or am I doing something wrong here?   I tried it on 2 different WP installations and both showed the same behavior. I searched WP docs for this but failed to get anything related to this. Is there some sort of linking between the custom menu names and category name if they exactly the same?


title: Help solving t_echo php error while using echo do_shortcode

text: I am using the Orbit Slider plugin successfully on my site. The plugin supports its own categories. I would like to embed the slider within my page.php template but allow each page to have it's own slider based on the category. Inside my page.php I have this: `<?php echo do_shortcode('[orbit-slider category="page"]'); ?>` the category "page" is just the name of a category I created. It will display only slides that come from category. Instead of hard-coding the category, I wanted to use custom fields so that on each individual page my client can specify a category to be shown. I have tried something like this but it's causing an internal server error: `<?php echo do_shortcode('[orbit-slider category="' echo get_post_meta($post->ID, "slide-category", true);'"]'); ?>` > [09-Feb-2012 20:05:08] PHP Parse error: syntax error, unexpected T_ECHO in > /public_html/wp-content/themes/techmd960/page.php on line 21 Can someone point out what I am doing wrong? I figure it has to do with the quotes (double and single) but can't figure it out. Essentially I just want to output the custom field "slide-category" as the value for category="" in the shortcode.


title: URL rewrite rules for multiple taxonomies query

text: I'm trying to create some pretty URLs for links querying multiple taxonomies. I'm using the "Taxonomy drill-down" plugin, although the main usage is now integrated @ the core it still has some helpful function for templating :) An example URL querying multiple taxonomies ( working ) would be: _domain.com/?tax1=foo &tax2=bar_ My goal is to have links like - _domain.com/tax1/foo/tax2/bar_ - translating to the above example tax1/2 = taxonomy name foo/bar = required term I stumbled upon Examples of WP Rewrites but i think i suck with those patterns and something like:               $newrules['tax1/(.*)/tax2/(.*)/'] = 'index.php?tax1=$matches[1]&tax2=$matches[2]';      doesn't seem to work ( that's just a portion of the whole function based on the Wordpress example ) Any ideas? :)


title: Displaying Subpages while on Parent page?

text: I would like to create a navigation menu where I will be displaying two level pages. To illustrate that:   * Parent 1   * Parent 2    * Parent 3 (current)      * Child 1     * Child 2     * Child 3   * Parent 4 So I would like to display all the parent pages in my navigation container but only display children pages when the user is currently on its parent page.


title: Wordpress language problem

text: I recently bought a domain. I got the password and username, to logon to the wordpress edit site of the domain. The problem is, that it is in english, and i want it to be danish. Because when you go to the domain/website, it doesn't look good when the two languages are kind of mixed. Now how do i fix this? I never had wordpress before, so when i downloaded the danish version to my computer, it doesn't effect the domain wordpress :( can I somehow make it effect the site? I would appreciate your help and answers. Many thank, Kevin.


title: How we can get the user id by its display_name

text: I have user `display_name` and with this I want to get the `id` of that user. So, how can I get the user id?


title: Which hooks are essential for post templates?

text: Im in the process of building a very custom theme and Im beginning to work on the post templates, but I dont know which hooks are essential for them. So like, I've seen (but cant remember where)some themes or code snippets for commenting, and in the snippet the code was something like:               if comments allowed               comment hook      And I know there are a probably a few more for other features that Im not aware of like trackbacks right? Does anyone have a good tutorial listing out all the essentials?


title: 'Easy Table' Plugin has float issues

text:
Good day I am using the easy table plugin and I have a problem with floats with it: Any content I add below the table floats to the right of the table. Now I can solve this by using a

      but isn't there a more 'user-friendly' way of doing it? That way my clients (with no html/css experience) can use the tables without problems... Table Shortcode Code:               [table caption="Just test table" width="500" colwidth="20|100|50" colalign="left|left|center|left|right"]     no,head1,head2,head3,head4     1,row1col1,row1col2,row1col3,100     2,row2col1,row2col2,row2col3,20000     3,row3col1,,row3col3,1405     4,row4col1,row4col2,row4col3,23023     [/table]


title: Permalinks for single-[custom-post-types] not working

text:
I've been reading a lot about my simple issue, but wasn't able to find the simple answer, so, please excuse my noobieness. I have a custom post type registered in functions.php, like so:               <?php     function my_custom_post_procedimentos() {     $labels = array(         'name'               => _x( 'Procedimentos', 'post type general name' ),         'singular_name'      => _x( 'Procedimento', 'post type singular name' ),         'add_new'            => _x( 'Add New', 'Procedimento' ),         'add_new_item'       => __( 'Add New Procedimento' ),         'edit_item'          => __( 'Edit Procedimentos' ),         'new_item'           => __( 'New Procedimento' ),         'all_items'          => __( 'All Procedimentos' ),         'view_item'          => __( 'View Procedimentos' ),         'search_items'       => __( 'Search Procedimentos' ),         'not_found'          => __( 'No Procedimento found' ),         'not_found_in_trash' => __( 'No Procedimento found in the Trash' ),          'parent_item_colon'  => '',         'menu_name'          => 'Procedimentos'     );     $args = array(         'labels'        => $labels,         'description'   => 'Holds our Procedimentos specific data',         'public'        => true,         'menu_position' => 5,         'supports'      => array( 'title', 'editor', 'thumbnail' ),         'has_archive'   => true,         'publicly_queryable' => true,         'show_ui' => true,         'can_export' => true     );     register_post_type( 'procedimentos', $args );     }     add_action( 'init', 'my_custom_post_procedimentos' );     ?>      and this is the single-procedimentos.php loop:               <?php get_header(); ?>

          <?php if(have_posts()) : ?>           <?php while(have_posts()) : the_post(); ?>                 <?php the_title(); ?>                 <?php the_content(); ?>           <?php endwhile; ?>           <?php endif; ?>

     <?php get_footer(); ?>      I'm using /%category%/%postname%/ as the permalinks structure, but no cigar. So: When I have a custom post type to show a list of them on the front page, where each list-item (perma)links to its respective single page, what are the loop structure for the single-[cpt] and the page-[cpt]? Please let me know if I'm not being clear enough. ## Thank you in advance. This part refers to @Warwick's kind request on a comment below:               object(WP_Query)#168 (47) { ["query_vars"]=> array(58) { ["page"]=> int(0)       ["procedimento"]=> string(36) "prostatectomia-radical-laparoscopica" ["post_type"]=> string(12) "procedimento" ["name"]=> string(36) "prostatectomia-radical-laparoscopica" ["error"]=> string(0) "" ["m"]=> int(0) ["p"]=> int(0) ["post_parent"]=> string(0) "" ["subpost"]=> string(0) "" ["subpost_id"]=> string(0) "" ["attachment"]=> string(0) "" ["attachment_id"]=> int(0) ["static"]=> string(0) "" ["pagename"]=> string(0) "" ["page_id"]=> int(0) ["second"]=> string(0) "" ["minute"]=> string(0) "" ["hour"]=> string(0) "" ["day"]=> int(0) ["monthnum"]=> int(0) ["year"]=> int(0) ["w"]=> int(0) ["category_name"]=> string(0) "" ["tag"]=> string(0) "" ["cat"]=> string(0) "" ["tag_id"]=> string(0) "" ["author_name"]=> string(0) "" ["feed"]=> string(0) "" ["tb"]=> string(0) "" ["paged"]=> int(0) ["comments_popup"]=> string(0) "" ["meta_key"]=> string(0) "" ["meta_value"]=> string(0) "" ["preview"]=> string(0) "" ["s"]=> string(0) "" ["sentence"]=> string(0) "" ["fields"]=> string(0) "" ["menu_order"]=> string(0) "" ["category__in"]=> array(0) { } ["category__not_in"]=> array(0) { } ["category__and"]=> array(0) { } ["post__in"]=> array(0) { } ["post__not_in"]=> array(0) { } ["tag__in"]=> array(0) { } ["tag__not_in"]=> array(0) { } ["tag__and"]=> array(0) { } ["tag_slug__in"]=> array(0) { } ["tag_slug__and"]=> array(0) { } ["ignore_sticky_posts"]=> bool(false) ["suppress_filters"]=> bool(false) ["cache_results"]=> bool(true) ["update_post_term_cache"]=> bool(true) ["update_post_meta_cache"]=> bool(true) ["posts_per_page"]=> int(10) ["nopaging"]=> bool(false) ["comments_per_page"]=> string(2) "50" ["no_found_rows"]=> bool(false) ["order"]=> string(4) "DESC" } ["tax_query"]=> NULL ["meta_query"]=> object(WP_Meta_Query)#224 (2) { ["queries"]=> array(0) { } ["relation"]=> NULL } ["post_count"]=> int(1) ["current_post"]=> int(-1) ["in_the_loop"]=> bool(false) ["comment_count"]=> int(0) ["current_comment"]=> int(-1) ["found_posts"]=> int(1) ["max_num_pages"]=> int(0) ["max_num_comment_pages"]=> int(0) ["is_single"]=> bool(true) ["is_preview"]=> bool(false) ["is_page"]=> bool(false) ["is_archive"]=> bool(false) ["is_date"]=> bool(false) ["is_year"]=> bool(false) ["is_month"]=> bool(false) ["is_day"]=> bool(false) ["is_time"]=> bool(false) ["is_author"]=> bool(false) ["is_category"]=> bool(false) ["is_tag"]=> bool(false) ["is_tax"]=> bool(false) ["is_search"]=> bool(false) ["is_feed"]=> bool(false) ["is_comment_feed"]=> bool(false) ["is_trackback"]=> bool(false) ["is_home"]=> bool(false) ["is_404"]=> bool(false) ["is_comments_popup"]=> bool(false) ["is_paged"]=> bool(false) ["is_admin"]=> bool(false) ["is_attachment"]=> bool(false) ["is_singular"]=> bool(true) ["is_robots"]=> bool(false) ["is_posts_page"]=> bool(false) ["is_post_type_archive"]=> bool(false) ["query_vars_hash"]=> string(32) "1d123a103cba5a796526d6ce635a1001" ["query_vars_changed"]=> bool(false) ["thumbnails_cached"]=> bool(false) ["query"]=> array(4) { ["page"]=> string(0) "" ["procedimento"]=> string(36) "prostatectomia-radical-laparoscopica" ["post_type"]=> string(12) "procedimento" ["name"]=> string(36) "prostatectomia-radical-laparoscopica" } ["request"]=> string(184) "SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'prostatectomia-radical-laparoscopica' AND wp_posts.post_type = 'procedimento' ORDER BY wp_posts.post_date DESC " ["posts"]=> &array(2) { [0]=> object(WP_Post)#234 (24) { ["ID"]=> int(20) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2013-03-12 13:55:55" ["post_date_gmt"]=> string(19) "2013-03-12 13:55:55" ["post_content"]=> string(2188) "Vivamus nec i'm in the shizzle egizzle nisi mah nizzle pretizzle. Vivamizzle sit amizzle lacus. Nam for sure nisl lacus auctor boom shackalack. Shizzlin dizzle suscipit things ipsizzle. Mammasay mammasa mamma oo sa in mammasay mammasa mamma oo sa. Vestibulum enim enizzle, ass sizzle, ma nizzle pizzle, cool ma nizzle, check out this. Nullam vitae pede break it down erizzle mah nizzle pharetra. Quisque pede phat, ma nizzle pulvinizzle, doggy a, mollis black shit, yo mamma. Donizzle at dui. You son of a bizzle risus purus, elementum consectetuer, sollicitudizzle gangster, consequizzle imperdizzle, dizzle. Black away things eu mi rutrum cool. Curabitur da bomb sagittizzle ipsum. Pimpin' funky fresh morbi yo mamma senectizzle fo shizzle netus ghetto malesuada yo mamma fo shizzle turpis i'm in the shizzle. My shizz est. Fo shizzle elementum. Ut erizzle felizzle, crackalackin rizzle, suscipizzle ac, shut the shizzle up check it out, nisl. For sure sagittizzle gravida velizzle. The bizzle posuere auctizzle maurizzle. Sizzle a rizzle ut crunk its fo rizzle tincidunt. Maecenas mah nizzle fo. Boom shackalack izzle daahng dawg shut the shizzle up maurizzle elementizzle ass. Nunc izzle check it out sit amizzle fo shizzle my nizzle ultricizzle fo shizzle. In velizzle tortizzle, dang izzle, bizzle quizzle, adipiscing quizzle, i'm in the shizzle. The bizzle crazy leo, aliquam consequizzle, shizzle my nizzle crocodizzle nizzle, dictum sed, turpizzle. Dope fo shizzle. Crizzle hizzle. Prizzle vitae sheezy fizzle libero pizzle adipiscing. Ghetto izzle phat eu nibh ullamcorper cool. Fizzle rizzle sapizzle nizzle erat. Suspendisse lorizzle shit, sollicitudin sed, mattizzle izzle, dope nec, justo. Doggy shizznit ligula. Own yo' feugiat, bling bling a funky fresh tempizzle, bling bling metizzle tincidunt ante, dang dapibizzle pede boofron shizzlin dizzle we gonna chung. Phasellus quizzle pimpin', imperdiet id, tempus crunk, sempizzle we gonna chung, sapizzle. Ut mollizzle sizzle vizzle shut the shizzle up. Sizzle ante nibh, you son of a bizzle go to hizzle, vestibulizzle daahng dawg, funky fresh eu, velit. Sizzle a away. Dope nizzle magna sizzle dang risus ghetto congue." ["post_title"]=> string(48) "Pieloplastia Laparoscópica e Obstrução de JUP" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(45) "pieloplastia-laparoscopica-e-obstrucao-de-jup" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2013-03-12 13:55:55" ["post_modified_gmt"]=> string(19) "2013-03-12 13:55:55" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(55) "http://localhost:8888/?post_type=procedimento&p=20" ["menu_order"]=> int(0) ["post_type"]=> string(12) "procedimento" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [1]=> object(WP_Post)#235 (24) { ["ID"]=> int(19) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2013-03-12 13:51:38" ["post_date_gmt"]=> string(19) "2013-03-12 13:51:38" ["post_content"]=> string(601) "Lorizzle ipsum dolizzle ma nizzle amizzle, izzle adipiscing dope. Nullam sapizzle velizzle, shizznit volutpizzle, suscipizzle quizzle, fo shizzle mah nizzle fo rizzle, mah home g-dizzle vizzle, arcu. Pellentesque gizzle tortor. Dope erizzle. Yippiyo fo dolor dapibus turpis tempizzle dizzle. Mauris check it out nibh izzle gangster. Pizzle break yo neck, yall sheezy. Brizzle fo shizzle rhoncizzle nisi. In you son of a bizzle habitasse platea dictumst. Sure dapibizzle. Curabitizzle tellus urna, pretium eu, mattizzle ac, eleifend vitae, nunc. Dang suscipizzle. Integer semper things fizzle purizzle." ["post_title"]=> string(37) "Prostatectomia Radical Laparoscópica" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(36) "prostatectomia-radical-laparoscopica" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2013-03-13 13:12:58" ["post_modified_gmt"]=> string(19) "2013-03-13 13:12:58" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(55) "http://localhost:8888/?post_type=procedimento&p=19" ["menu_order"]=> int(0) ["post_type"]=> string(12) "procedimento" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } } ["post"]=> object(WP_Post)#226 (24) { ["ID"]=> int(19) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2013-03-12 13:51:38" ["post_date_gmt"]=> string(19) "2013-03-12 13:51:38" ["post_content"]=> string(601) "Lorizzle ipsum dolizzle ma nizzle amizzle, izzle adipiscing dope. Nullam sapizzle velizzle, shizznit volutpizzle, suscipizzle quizzle, fo shizzle mah nizzle fo rizzle, mah home g-dizzle vizzle, arcu. Pellentesque gizzle tortor. Dope erizzle. Yippiyo fo dolor dapibus turpis tempizzle dizzle. Mauris check it out nibh izzle gangster. Pizzle break yo neck, yall sheezy. Brizzle fo shizzle rhoncizzle nisi. In you son of a bizzle habitasse platea dictumst. Sure dapibizzle. Curabitizzle tellus urna, pretium eu, mattizzle ac, eleifend vitae, nunc. Dang suscipizzle. Integer semper things fizzle purizzle." ["post_title"]=> string(37) "Prostatectomia Radical Laparoscópica" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(36) "prostatectomia-radical-laparoscopica" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2013-03-13 13:12:58" ["post_modified_gmt"]=> string(19) "2013-03-13 13:12:58" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(55) "http://localhost:8888/?post_type=procedimento&p=19" ["menu_order"]=> int(0) ["post_type"]=> string(12) "procedimento" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } ["queried_object"]=> object(WP_Post)#226 (24) { ["ID"]=> int(19) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2013-03-12 13:51:38" ["post_date_gmt"]=> string(19) "2013-03-12 13:51:38" ["post_content"]=> string(601) "Lorizzle ipsum dolizzle ma nizzle amizzle, izzle adipiscing dope. Nullam sapizzle velizzle, shizznit volutpizzle, suscipizzle quizzle, fo shizzle mah nizzle fo rizzle, mah home g-dizzle vizzle, arcu. Pellentesque gizzle tortor. Dope erizzle. Yippiyo fo dolor dapibus turpis tempizzle dizzle. Mauris check it out nibh izzle gangster. Pizzle break yo neck, yall sheezy. Brizzle fo shizzle rhoncizzle nisi. In you son of a bizzle habitasse platea dictumst. Sure dapibizzle. Curabitizzle tellus urna, pretium eu, mattizzle ac, eleifend vitae, nunc. Dang suscipizzle. Integer semper things fizzle purizzle." ["post_title"]=> string(37) "Prostatectomia Radical Laparoscópica" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(36) "prostatectomia-radical-laparoscopica" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2013-03-13 13:12:58" ["post_modified_gmt"]=> string(19) "2013-03-13 13:12:58" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(55) "http://localhost:8888/?post_type=procedimento&p=19" ["menu_order"]=> int(0) ["post_type"]=> string(12) "procedimento" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } ["queried_object_id"]=> int(19) }


title: Site DOES NOT LOAD after 3.1 update

text: I recently updated my site to 3.1 and now the frontend of the site will not load. The weird thing is the admin section does load and is some what functional (sometimes the pages go blank and I have to reload, and sometimes reloads don't work). I had to install and activate a maintenance plugin while I try to trouble shoot the issue. I tried to recall anything that I mightve done to cause this and can't see what caused this. I notice that if I visit my domain, with my maintenance plugin activated, it will show the maintenance message, but if the maintenance plugin is not activate this site loads a blank page. In in the general settings, I changed the "wordpress address" to see if that would somehow load the site by putting the direct url location of the site, but that didn't work. With the actual domain in both fields (wordpress address and site address), the admin works but the frontend doesn't load except in maintenance mode. I would appreciate some advice with this. I just went in to do a little maintenance and I spending 4-5 hours on this problem. The link to my site is **here** Is this a common problem on updates? I hope this is fixable, if not is it possible to downgrade wp to the previous version (if its necessary)? Thanks in advance for any help with this.


title: Remove "From computer" media tab for posts with existing attachments?

text: On editing the attachments of a post whith at least one attachment previously uploaded, how do I remove the _From computer_ tab and redirect to the _Gallery_ tab? ![The "Add an Image" tabs](http://i.stack.imgur.com/ZqScV.png) This is my current code:               add_filter('media_upload_tabs','remove_medialibrary_tabs', 99);     function remove_medialibrary_tabs($tabs) {         if ($post_id = (isset($_REQUEST['post_id']) ? $_REQUEST['post_id'] : false)) {             if (count(get_posts("post_type=attachment&post_parent={$post_id}"))>0) {                 // MY QUESTION             }         }              unset($tabs['type_url']);         unset($tabs['library']);              return $tabs;     }


title: wp_nav_menu always falls back to a menu

text: hey all,   i'm writing an automated function that generates a menu from a function. it calls wp_nav_menu on each item from an array, because i want this to be dynamic. the problem is, no matter how i set it, if the menu doesn't exist, wp_nav_menu is generating a menu, eg the 'default'. here is my code (items is just a set of strings):               for($i=0;$i<count($items);$i++) {              $themenu=$items[$i];              $mymenu = wp_nav_menu(array(                 'menu' => $themenu,                 'menu_class' => 'mymenu',                 'container' => 'false',                 'fallback_cb' => 'false',                 'echo' => false                 )             );                echo $themenu;              }      i know its partially working, because if $themenu exists, it shows the correct one. but if it doesn't, it'll just show any menu! not just annoying, but also actively breaks the user experience.


title: Remove “%” from strings in serialized arrays in wp_postmeta

text: In the course of converting a blog from Blogger to WP and running a script to grab hot-linked images for hosting, I ended up with some funky images names like               act%252Bapandas-210x290.png      These image names prevent the image from displaying on a webpage, due the url encoding ending up in the file name itself (don't ask!). I renamed them on the file server, no prob, but the names are also in the attachment metadata for each post. How can I remove the "%" from all the image references in the wp_postmeta table? *Most of them occur in serialized arrays in meta_values for the meta_keys of _wp_attachment_metadata*. I've had no luck finding a plugin, and am unsure how to institute a pure SQL/PHP solution. Here is an example of a serialized array entry (further gummed up by the Smush.it plugin, ugh):               a:7:{s:5:"width";s:3:"210";s:6:"height";s:3:"339";s:14:"hwstring_small";s:22:"height='96' width='59'";s:4:"file";s:27:"2011/02/act%252Bapandas.png";s:5:"sizes";a:6:{s:9:"thumbnail";a:4:{s:4:"file";s:27:"act%252Bapandas-210x290.png";s:5:"width";s:3:"210";s:6:"height";s:3:"290";s:10:"wp_smushit";s:271:"Smush.it error: Could not get the image while processing http://new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-210x290.png (/home/xxxxxxxxx/new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-210x290.png)";}s:14:"soft-thumbnail";a:4:{s:4:"file";s:27:"act%252Bapandas-179x290.png";s:5:"width";s:3:"179";s:6:"height";s:3:"290";s:10:"wp_smushit";s:271:"Smush.it error: Could not get the image while processing http://new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-179x290.png (/home/xxxxxxxxx/new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-179x290.png)";}s:14:"mini-thumbnail";a:4:{s:4:"file";s:25:"act%252Bapandas-60x60.png";s:5:"width";s:2:"60";s:6:"height";s:2:"60";s:10:"wp_smushit";s:267:"Smush.it error: Could not get the image while processing http://new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-60x60.png (/home/xxxxxxxxx/new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-60x60.png)";}s:5:"slide";a:4:{s:4:"file";s:27:"act%252Bapandas-210x290.png";s:5:"width";s:3:"210";s:6:"height";s:3:"290";s:10:"wp_smushit";s:271:"Smush.it error: Could not get the image while processing http://new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-210x290.png (/home/xxxxxxxxx/new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-210x290.png)";}s:10:"soft-slide";a:4:{s:4:"file";s:27:"act%252Bapandas-179x290.png";s:5:"width";s:3:"179";s:6:"height";s:3:"290";s:10:"wp_smushit";s:271:"Smush.it error: Could not get the image while processing http://new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-179x290.png (/home/xxxxxxxxx/new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-179x290.png)";}s:10:"mini-slide";a:4:{s:4:"file";s:27:"act%252Bapandas-210x145.png";s:5:"width";s:3:"210";s:6:"height";s:3:"145";s:10:"wp_smushit";s:271:"Smush.it error: Could not get the image while processing http://new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-210x145.png (/home/xxxxxxxxx/new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas-210x145.png)";}}s:10:"image_meta";a:10:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:5:"title";s:0:"";}s:10:"wp_smushit";s:255:"Smush.it error: Could not get the image while processing http://new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas.png (/home/xxxxxxxxx/new.xxxxx.com/wp-content/uploads/2011/02/act%252Bapandas.png)";}      The issue is changing or removing the "%" character AND updating the array so it reports the correct number of characters (ie the s:13 would indicate yoursite.com is 13 char[]) I'm also open to using a php solution! Whatever can help me fix this mess. **FINAL SOLUTION** See my answer below.


title: I want to fill the comment with the comment count?

text: I am using a custom function to pre fill the comment text area with the number of comment count but getting an error header already sent can any body guide me here's the code I am using                 add_action('pre_comment_on_post', 'dump_comment');        function dump_comment($post_id, $author=null, $email=null) {        $comcnt = $cmntcount = comments_number( '#0', '#1', '#%' );        $comment = ( isset($_POST['comment']) ) ? trim($_POST['comment']) : null;        if (!$comment) {        $_POST['comment'] = 'Design' . '$comcnt';              }        }


title: How do I filter users based on email address?

text: Is there a method/plugin by which we can filter users by email address? I have lots of spam posts recently coming from users of a specific email domain.


title: Replace woocommerce | (pipe) separator in product variation to , or another character?

text: How to replace Woocommerce `|` (pipe) separator in product variation to `,` or another character? I use Cyrillic keyboard layout and there is no pipe symbol. To enter that symbol I have to switch to English layout, enter `|` and switch back. I have hundreds of variations of products.


title: Event Manager - How to get events for a custom taxonomy

text: I'm not a php programmer but i need to get events for a custom (already defined) taxonomy. I was trying to do that this way:               $args = array {       'size' => 'big',     }     $EM_Events = EM_Events::get($args)      but it didnt work :( I just need and example of code. best regards


title: wp_list_categories not working on my live site

text:
I am using `wp_list_categories` function it work on local server fine but on the live site its not working the code i am using for this is
                             Categories                                                       <?php $args = array(                                 'show_option_all'    => '',                                 'orderby'            => 'name',                                 'order'              => 'ASC',                                 'style'              => 'list',                                 'show_count'         => 0,                                 'hide_empty'         => 1,                                 'use_desc_for_title' => 1,                                 'child_of'           => 0,                                 'feed'               => '',                                 'feed_type'          => '',                                 'feed_image'         => '',                                 'exclude'            => '1',                                 'exclude_tree'       => '',                                 'include'            => '',                                 'hierarchical'       => 1,                                 'title_li'           => '',                                 'show_option_none'   => __('No categories'),                                 'number'             => null,                                 'echo'               => 1,                                 'depth'              => 0,                                 'current_category'   => 0,                                 'pad_counts'         => 0,                                 'taxonomy'           => 'category',                                 'walker'             => null                             ); ?>
                              <?php wp_list_categories($args); ?>

      So any idea where i am wrong. Thanks


title: Running a function only once when a taxonomy term is changed

text: Probably quite a simple problem.. I have a custom post type with taxonomy terms. I wish to run a function from my functions.php whenever the admin ticks a specific term box. My original thought was to use add_action along with a "save_post" action so when the post is saved, it would loop through my terms and if the desired one is selected, it would run the function. This is all good, except each time the admin updates the post it would run the function. The function is sends an email to a user, and I onyl want this email sent out ONCE. Is there any way I can set it so once the function runs it will not run again? I thought about updating a row in the DB and adding a "1" for example when the function runs, and having an if(){} within the fucntion to check if it had been ran before, but this seems like a dodgy way of doing it :/ Thanks!


title: Adding comment template on a loop into a page

text: I've created a loop in a page, with a single post per page. The type of post is the default "post". Now, I've resolved the problem of pagination on this page, but I cannot show the comment template on this page for each post. How can I enable it?


title: List categories based on current product

text: Using `WP e-commerce` I'm trying to display the product categories inside the major category of the product I am viewing: Example:   * Major Cat A     1. Cat 1 a. Minor 1a <-- I am viewing an item here     2. Cat 2     3. Cat 3   * Major Cat B While in the `Minor 1a` or the `Cat 1` category, I want to display the first level of categories in the `Major Cat A`. I tried using `wpsc_start_category_query` and similar methods but with no luck. How is this possible?


title: How to add and remove a page

text: I'm creating a plugin that will need to add a new WP page upon activation and then I want it to remove that same page upon uninstallation. Do I have to manually store that page id in the DB somewhere or is there a native WP option to remember that automatically? My code so far:               register_activation_hook(__FILE__, 'create_page');     register_uninstall_hook(__FILE__, 'remove_page');          function create_page() {         global $user_ID;              $page['post_type']    = 'page';         $page['post_content'] = 'Page content will go here.';         $page['post_parent']  = 0;         $page['post_author']  = $user_ID;         $page['post_status']  = 'publish';         $page['post_title']   = 'Page Title';         $pageid = wp_insert_post ($page);         if ($pageid == 0) {             echo "Something went wrong. Could not successfully add a new page.";         }     }


title: Why can wordpress not find the actions I add in my constructor?

text: I have a theme which has a page to display a keyword taxonomy called `taxonomy-keyword.php`. From this page I instantiate a sort of ViewModel called `KeywordPage`. It looks like this:               namespace MyTheme\ViewModels;     class KeywordPage {         __construct() {             wp_enqueue_script(                 'keywordpage_script',                 get_stylesheet_directory_uri() . '_inc/js/KeywordPage.js',                 array('jquery'),                 '');             add_action('wp_ajax_get_more_posts', array(__CLASS__, 'get_more_posts_async'));             add_action('wp_ajax_nopriv_get_more_posts', array(__CLASS__, 'get_more_posts_async'));                  // other initialization         }              public static function get_more_posts_async() {             // Process AJAX         }     }      The issue I'm having is that the AJAX response is always 0. This appears to indicate that the callback to the action could not be found by wordpress. Now, I barely understand AJAX, let alone the subtleties of how wordpress handles it, but I know the `KeywordPage` script works just fine and `get_more_posts_async()` processes and responds to the AJAX call appropriately because if I place the function and the `add_action()` calls in `functions.php` it all works as intended. What I can't figure out is why when the actions are in the constructor does wordpress not seem able to call the appropriate callback? I don't want to pollute the global namespace with out-of-context functions and actions by just placing this stuff in `functions.php`. Even though I already know it works, I want to make the theme as maintainable as I can. Thanks in advance for your input, your help, and your guidance.


title: How do I show posts from another wordpress installation?

text: I have looked around and I cannot seem to find an answer to this question. There are similar questions/answers but none I have seen managed to answer this question, so I am sorry in advanced if I have missed this question if it has already been asked. My Question is, is it possible to pull posts from a Category from another Wordpress Installation using a different database in the same server? For example. My main site is a Media site with various posts. The second site is one of our journalists website/blog on the same server, different database and different installation. We would like to copy/pull his posts from "Example Category" and show that post in our wordpress pages. Using the same theme as the main and it does not redirect to the second wordpress installation. So pretty much copies the post over automatically into the Main Website. Does having Wordpress MultiSite make things a lot easier or should we stick with single installations? We will have more than 10+ wordpress blogs in the future. Thank You


title: WordPress Multisite Multiple child theme

text: I have a mulisite setup and I am using one theme for multiple sites in it and each site have a custom layout and design. So for that I need to create a child-theme. But I don't know how to create multiple child theme for each site so I can add customization in each child theme style.css, footer.php, function.php, header.php e.g I am using theme canvas for all sites. then I created canvas-child and customized it for site1 now I need to customize it for other site2 then how I can create one more child theme with current main theme canvas to effect customization on site2.


Hi I want to search meta field for a value in all posts. Code below shows what i want to accomplish (im wp and php beginner and cant manage to make it work by myself). If in meta field "`voted_IP`" theres value `$ip` (current user ip) then echo something, else echo something else. But search in all posts not just current so I cant use `get_post_meta`. I found somewhere that i cant make it work with query but it doesnt work.               <?php     $ip = $_SERVER['REMOTE_ADDR'];     $query = new WP_Query( array(          'meta_key' => 'voted_IP',          'meta_value' => $ip     ) );     if ($query == $ip) {         echo 'one';     } else {         echo 'two';     }     ?>


title: load_textdomain won't load my .mo file

text: I am using Yoast'method to build an html site map. But it needs to be translated. It uses a page template page-sitemap.php that uses a template part               <?php get_template_part('/partials/sitemap');  ?>      In this template part i ...               load_textdomain( 'site-map', TEMPLATEPATH.'/partials/languages' );      The path is right for I list the files of the folder TEMPLATEPATH.'/partials/languages' and it shows my language files. As you see my domain name is 'site-map'. My .mo file is site-map-fr_FR.mo Why can't it be loaded ? Thanks for any clue, nicolas


title: Adding an existing featured image to a post through mysql

text: I want to add an already uploaded featured image to a post by adding records to the wp_postmeta table through MySql. Is that possible, has anyone done this? I'm using WP 3.7.1. Thanks in advance. René


title: How to order the get_categories result

text: I read the documentation of the codex but i can't order the get_categories() result just like parent,childrens. I have these kind of categories' three:               -Events         - Music         - Culture         - Workshop         - Tourism     -Sport         -Football         -Rugby         -Tennis      I want the output to be:               Events, Music      I tried:               echo $product->get_categories();      and the results is the print of Music, Events (child, parent). I also tried putting $args as the argument get_categories():               $args = array(     'type'                     => 'post',     'child_of'                 => 0,     'parent'                   => '',     'orderby'                  => 'name',     'order'                    => 'ASC',     'hide_empty'               => 1,     'hierarchical'             => 1,     'exclude'                  => '',     'include'                  => '',     'number'                   => '',     'taxonomy'                 => 'category',     'pad_counts'               => false     );       How can I order it the way I want?


title: Enqueue Google CDN jQuery in Footer

text: I'm trying to enqueue jQuery from Google's CDN and have it called in the footer rather than the header of my theme. Here's my code:               wp_deregister_script('jquery');     wp_enqueue_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js", false, '1.10.2', true);      I found a couple of potential solutions that don't work for me, they are: 1) Adding the following to my functions.php:               function ds_enqueue_jquery_in_footer( &$scripts ) {          if ( ! is_admin() )         $scripts->add_data( 'jquery', 'group', 1 );     }     add_action( 'wp_default_scripts', 'ds_enqueue_jquery_in_footer' );      2) Calling wp_enqueue_scripts like so (as I'm doing above really):               wp_enqueue_script('jquery','/wp-includes/js/jquery/jquery.js','','',true);      No matter what I've tried, jQuery is called in the header. Any suggestions?


title: Using wp_category_checklist in a widget

text: I'm trying to use wp_category_checklist in a widget to display a list of checkboxes which, when saved, remain ticked. I'm having awful trouble at the moment getting them to save, as as far as I know it isn't saving (the checkboxes remain unticked):- Here's the edited code I have at the moment.               function update($new_instance, $old_instance) {         $instance = $old_instance;         $instance['widget_categories'] = $new_instance['post_category'];     return $instance;     }               function form($instance) {         $instance = wp_parse_args( (array) $instance, $default );         $categories = get_categories();                   $category_array = $instance['widget_categories'];              if (!$category_array)         {             $category_array = array();         }         ?>         <ul class="categorychecklist">         <?php wp_category_checklist(0,0, $category_array,false, NULL , false);?>         </ul>         <?php     }      Any ideas? Please let me know if you need anything else. Thanks :)


title: Sort taxonomy page alphabetically by meta rather than default post date

text: The user starts at a page showing posts of custom post type, "agent". Each post displayed shows a region/custom taxonomy it belongs to and links to a page that shows all posts in the region the user clicked. This is how these posts are currently displayed,               <?php while ( have_posts() ) : the_post(); ?>      Ideally I'd like to to sort these alphabetically by meta_key lname rather than by post date which appears to be the wordpress default. Thanks for any input Edit: Script I use to get all custom post type Agents. Puts one specified post as last post.               <?php          $loop = new WP_Query( array(              'post_type' => 'agents',             'orderby' => 'meta_value',             'meta_key' => 'lname',             'order'=>'ASC',             'meta_query' => array(array( 'key' => 'lname' )),             'post__not_in' => array( '93' ),             'posts_per_page' => -1 ) );         $loop2 = new WP_Query( array(              'post_type' => 'agents',             'post__in' => array( '93' ) ) );     ?>     <?php         if($loop->have_posts() || $loop2->have_posts()) {          if($loop->have_posts()) { while($loop->have_posts()) { $loop->the_post();     ?>


title: Why after a form post back, I get 404?

text: I am creating a contact form page. Perhaps I am doing it wrong? I have something like               <?php     // even when I remove this validation block it fails     if (isset($_POST['name'])) {         // do validation ...      }          get_header();      ?>     ...     <form id="frmContact" action="<?php the_permalink() ?>" method="post">         ...      </form>     ...       I used the same logic in another page and it works ... the URL is correct and if I refresh the page, it works. It just gives 404 on post back


title: Why don't sub-items show up in mobile view?

text: I'm using the Fontana theme (http://demo.athemes.com/fontana/) but I have a problem. On the responsive menu, sub-items aren't showing up in the drop-down list of menu items. Can anyone suggest a fix?


title: Wordpress text filed input only inter value?

text: All Now i am using WordPress, here right now i have a problem How can i valid my text filed input only inter value. Here is my code               <p>       <label for="<?php echo $this->get_field_id('num_post'); ?>">         <?php _e( 'Number of posts to show:' ); ?>         <input id="<?php echo $this->get_field_id( 'num_post' ); ?>" name="<?php echo $this->get_field_name( 'num_post' ); ?>" type="text" value="<?php echo   $instance['num_post']; ?>" size="3" />       </label>     </p>


title: Rewrite permalink for specific posts

text: A client wants certain posts to have a custom permalink structure. Client is running WordPress 2.8.5 and upgrade is not currently an option, so I can't use a custom post type. That being the case, it seems I must use a category to create the custom structure. So, I need the site-wide structure `http://example.com/%post_id%/%postname%/` to turn into `http://example.com/%postname%/` just for posts in the one category. I gather that I need to use `add_rewrite_rule` to change the permalink. But I'm having trouble changing the URL structure at all adding rules to `functions.php`, and I don't understand regex well. Can I filter for a generic structure such as `%post_id%`, or only strings? Can anyone provide some guidance as to how I may accomplish this goal?


title: Subpages List Appearing on Every Page

text:
This code displays the parent page and a list of its subpages, but not the grandparent page. (It is the second red menu in the left sidebar here). There is one problem with this. This code outputs a list of **all pages on the website** if the user is **on a post or archives page** (see here). How do I prevent this from happening? This code is big and clunky, is there an easier solution? Thanks for the help.               <?php //parent variables         $parent = get_post($post->post_parent);         $parent_title = get_the_title($parent);         $grandparent = $parent->post_parent;         $grandparent_title = get_the_title($grandparent);         $current_page_parent = ( $post->post_parent ? $post->post_parent : $post->ID );?>          <?php // is the homepage the granparent? = third level page     if ($grandparent == is_page('0')) {         $children = wp_list_pages("title_li=&include=".$post->post_parent."&echo=0"); // list the parent page         $children .= wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); // append the list of children pages to the same $children variable         if ($children) { ?>
           <?php echo $children; /*print list of pages*/ ?>
         <?php }?>          <?php // is the homepage the parent? = second level page         } elseif ($post->post_parent ==is_page('0')) {           $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');       if ($children) { ?>

<?php echo get_the_title(); ?>
           <?php echo $children; ?>
         <?php         } else {// your else stuff              }     ?>


title: How do you remove display of WooCommerce product category on single product page?

text: On my single product pages, I would like to change the meta data so that the Category button for the product does not display. I can't seem to figure out where this is called. I've looked in various php files. Thank you for your help.


title: Create post using JSON api plugin

text: I am working on a project where the user writes their content on one wordpress blog (as a draft) but wants it published on their own wordpress blogging site. This seems strange but it is the core concept for the business as the writers are collaborative and so that's now what can be changed. I've installed JSON api plugin. (I am totally new at api's and still in the first year of PHP). I'm wondering 1. How you would use the json info from site A to create a post for site B. So far I've conceptualized it as the following.   1. the plugin(on site b) pulls the json info from site a   2. the plugin then takes the json and turns it into an array (attempting to match as much of it to post info)   3. then the plugin inserts the posts into site b's post db (I thought this would make it the fastest as this is something that twitter kindof does except for the data sits on your phone/computer??)    4. The posts function as if they were created on site b (i.e. they follow the rules of the theme on site b).  So far EVERY attempt I've done to google and do it alone has resulted in horrible, horrible failure. (I have not fallen on my sword yet due to my high need of achievement.) The first attempt was:               $response = wp_remote_get('urlhere/?json=get_post&post_id=120');     //$my_post = array($keys as $values);          wp_insert_post($response, $wp_error);      However... no results (I put urlhere to create a more universal response and not just focus on the url of the actual site.               // Create post object     $my_post_test = array(       'post_title'    => "Hi this is a title!" ,       'post_content'  => "This is a test",       'post_status'   => 'publish',       'post_author'   => 1,       //'post_category' => array( 8,39 )     );          // Insert the post into the database     wp_insert_post( $my_post_test, $wp_error );      Second issue: This code produces 4-8 posts with the same title (seems strange?) My questions are: 1. What is the best way to conceptualize the process so it's relatively scalable (i.e. 20-1,000 writers) 2. How would I get JSON api plugin to insert the data into a wordpress post code?


title: Function naming convention

text: While developing more and more customized Wordpress themes, I began adding more custom functions to my theme's functions.php file. While I try to make their names to be self-explanatory, I think this is not enough. Considering that you might not be the only web developer working on a theme, or that there might be somebody else who will be put in charge of continuing the development of said theme, I wonder, how should we name our functions to distinguish them from core WP ones? Edit: Re-worded the question **Q: Are there any patterns that help developers co-working on the projects namespace functions to avoid confusion whether they are native to Wordpress or not?**


title: Ambrosite Next/Previous Post Link Plus or WP next_post_link to cycle through top level category

text: I have installed Ambrosite Next/Previous Post Link Plus and I'm not sure how to configure it to achieve what I'm looking for. I have a post category like below: **Parent category -> Sub category -> Post** If I use the traditional WP next_post links I can use TRUE or FALSE to cycle through either all posts on the site or the posts in the sub category. How can I configure either Ambrosite Next/Previous Post Link Plus or the standard WP links to cycle through the posts that belong to the parent category and not just the sub category?


title: Random text changing to weird icons in both admin & front end

text: Has any body had this sort of problem before. The text mainly in input field descriptions turns to weird icons see image. I have deactivated all plugins and changed themes several times but same happens. However it sometimes starts working and then will just suddenly to the same thing again. In the front end the font family is open sans which will work sometimes and then sometimes it will do the same thing you can see in the image weird icons. But when the icons appear if I turn of the set font family is will work and use the default browser font family. ![enter image description here](http://i.stack.imgur.com/qI8I7.png)


I had been using WordPress for the past three years. I haven't got any errors in the error_log. I think the problem would be cause of the new server my hosting is in. For the last two months i am getting the following errors in error_log The error is... ## Error 1               SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t      INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id      INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id     WHERE tt.taxonomy IN ('category', 'post_tag')      AND tr.object_id IN (297, 288, 282, 279, 277, 273, 271, 269, 255, 252)      ORDER BY t.name ASC      > made by require, wp, WP->main, WP->query_posts, WP_Query->query, > WP_Query->get_posts, update_post_caches, update_object_term_cache, > wp_get_object_terms ## Error 2 > WordPress database error Got error 28 from storage engine for query SELECT > SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN > wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) > INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = > wp_term_taxonomy.term_taxonomy_id) WHERE 1=1 AND wp_term_taxonomy.taxonomy = > 'category' AND wp_term_taxonomy.term_id IN ('7') AND wp_posts.post_type = > 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY > wp_posts.post_date DESC LIMIT 0, 10 made by require, wp, WP->main, > WP->query_posts, WP_Query->query, WP_Query->get_posts ## Error 3 > WordPress database error Got error 28 from storage engine for query SELECT > DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, > comment_author, comment_date_gmt, comment_approved, comment_type, > SUBSTRING(comment_content,1,60) AS com_excerpt FROM wp_comments LEFT OUTER > JOIN wp_posts ON (wp_comments.comment_post_ID = wp_posts.ID) WHERE > comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY > comment_date_gmt DESC LIMIT 5 made by require, require_once, include, > get_footer, locate_template, load_template, require_once, > src_simple_recent_comments **Any idea why these error is thrown?** I cleared the log and browsed the pages and checked for errors but nothing appeared.. these error occurred starting from dec 25 to till date.


title: Can I degrade back to 3.7.1 from 3.8 by just coping old wp files?

text: I just want to downgrade back to 3.7.1 from 3.8 Easiest thing to do is just replace old wp files and overwrite new 3.8 files. Will there be any issues if I do this? Thanks


title: Adding shortcode to the main menu

text:
Is it possible to add shortcode to a main menu? I tried the following but no luck?               add_filter('wp_nav_menu_items','add_nwadcart_widget_to_menu', 10, 2);     function add_nwadcart_widget_to_menu( $items, $args ) {         if( $args->theme_location == 'main-nav' )             return $items.get_shortcode("[nwadcart_widget]");          return $items;     }      I would also like to add it as the last item on the menu and have it wrapped in the following

widegt would go here

      and the ul would be in the last li/list item on the main menu. Thanks,


title: How to WP Query custom multiple custom taxonomies?

text: I am trying to get all posts that belong to two or more taxonomies but I am failing... So here is the pseudo of what I have. taxonomy name = color-categories I have 6 created items under color-categories: red, blue, black, 2000, 3000, 4000 And each post will have 2 of those category combinations like (red,2000) or (blue,4000)...etc But now let's say I want to pull all posts that are in 2000 and red only...how do I go about doing that? This is the code I have thus far but not working:               $args = array(         'post_type'         => 'item',         'post_status'       => 'publish',         'posts_per_page'    => -1,         'tax_query'         => array(             'relation'      => 'AND',             array(                 'taxonomy'  => 'color-categories',                 'field'     => 'slug',                 'terms'     => 'red'             ),             array(                 'taxonomy'  => 'color-categories',                 'field'     => 'slug',                 'terms'     => '2000'             )                        )            );      This results in nothing returned...


title: After wp_insert_post(), date_i18n() and date() outputs are adjusted to GMT

text:
I am having a very peculiar issue on a customer's server (vps). The code below works just fine on my servers. Basically, a specific unix timestamp is formatted correctly and as soon as wp_insert_post() is called, the dates adjust to GMT. For example:               echo "date_i18n of 1366495200: " . date_i18n('Y-m-d H:i', 1366495200 ). '
';     echo "date of 1366495200: " . date('Y-m-d H:i', 1366495200 ). '
';     // Both output >>> 2013-04-21 00:00 , correct based on server settings           $_post = array(                 'post_type' => 'my_cpt',                 'post_title' => 'my title',                 'post_content' => '',                 'post_status' => 'publish'             );          $new_post_ID = wp_insert_post( $_post );          echo "date_i18n of 1366495200: " . date_i18n('Y-m-d H:i', 1366495200 ). '
';     echo "date of 1366495200: " . date('Y-m-d H:i', 1366495200 ). '
';     // new output >>> 2013-04-20 22:00 <<<      Does anyone have any insight?


title: How to upload local changes to a live server without overriding new posts/pages?

text: At the moment my current workflow looks like this. I will take the latest copy of WordPress and its database from the live server and develop it using MAMP on my machine. On my local server I will make my changes. For example, I might add a new custom post type and some custom fields using the Custom Post Type UI and Advanced Custom Fields Plugins. Then I would code a custom post type template. After that I will change the settings in my wp-config.php, upload the whole WordPress directory to the live server (which takes ages) and do a search and replace on the database. What if someone has created new posts and pages on the live website while I've been developing locally? When I upload my local copy it will erase the latest posts and pages. The only solution I have come up with is manually mimicking the settings on the live server with the local settings before uploading the files. This doesn't seem very efficient. Is there another, better way?


title: booking form with availability calendar

text: I need a booking system with availability calendar for my website, something simple with some basic forms. I want to be able to insert for each post a "book now" button with an availability calendar for each post(apartment, house) I've found this plugin It's nice and simple but It doesn't have an availability calendar and online payment support. So, could you recommend me something which can work with my requirements ? Thanks!


title: Media Library won't recognize SOME old files after move

text: First off, I'm on a **Windows 2008** box running **IIS7** with a `web.config` file not `htaccess`. That being said, I've migrated my old Apache(XAMPP) installed WPMS site over to a new IIS7 server successfully with one glitch: my media files are doing some really funky stuff. **// The run down:**   I have my main site and about 200+ subsites. Uploading new files to the `blogs.dir` folder is successful and I'm able to see them on my site just fine afterwards. **// The funk:**   _SOME_ of my old files (PDF and Word documents) on my main site are still linked properly. It seems to be only pre-move image files that are affected. The files are still listed in the media library correctly and I can see the files in the directories themselves, but there is a disconnect between the Library and the directories. _**Caveat:_** I've had to keep my main site's upload folder set to `/wp- content/blogs.dir/1/files/` because my WordPress installation was pre-3.0. This hasn't shown itself to be an issue yet, since I can still see some of the files and I can upload new files. I tried moving it to `/wp-content/uploads/`, but that seemed to give me more of a headache. Here is my web.config file in case someone is able to see some issue within it that's causing the problem. _Any_ help would be **greatly** appreciated!


title: Need help enqueueing webfonts

text: I am attempting to enqueue web fonts that I am loading in via the WebINK font library. (This service is similar to Typekit). This service works by generating a unique CSS link for each unique site. I have successfully enqueued Google WebFonts before, but am struggling with enqueueing WebINK's CSS. I'm thinking the problem has to do with the url. When I try and enqueue my function in my functions.php file, my entire theme breaks. Does anyone notice a weird rogue character that might cause this? Here's my code:               <?php function load_fonts() {         $url = 'http://fnt.webink.com/wfs/webink.css/?project=F2330038D0-5466-4169-867D-EA751332DE4B&fonts=A65E74B3-95D4-8C3A-5583-87B47A9527A2:f=FaktPro-Thin,343BD4E1-D395-6C6D-B14B-41223AE23241:f=MyriadPro-SemiCnIt,E46BFE22-44C1-99D7-2C08-D8826DA7A208:f=FaktPro-BoldItalic,050FBD0F-5D55-410F-DC57-586D49D23CB:f=MyriadPro-Semibold,14B608E7-5D2C-4B50-D4D1-A22D8DDD15C6:f=DecaSerif-BoldItalic,0B53932F-D113-4C4B-B456-D77C9990FD8C:f=MyriadPro-BlackIt,3C16CF08-2801-1E29-3FE1-49842D2DBCB4:f=MyriadPro-BlackSemiExtIt,4450DACC-A2BA-8272-5A58-A6BEE972148B:f=FaktPro-NormalItalic,64E76F68-92AA-FB9F-C7C0-E5EA6D18052A:f=MyriadPro-SemiCn,B404E18C-7A35-1F7C-A1BC-CA3E46910C47:f=FaktPro-ThinItalic,5BD20078-1B4C-4661-F184-D61DFFE3C81A:f=DecaSerif-Bold,39FEB533-C926-4578-87C0-2D25696AA0F9:f=MyriadPro-Cond,8C0A5296-5130-F7B2-72D2-2BF48B1A22CC:f=MyriadPro-LightSemiExt,0797E150-9402-2B85-B059-6803DEAB9AE6:f=MyriadPro-LightCondIt,DBDBD77A-5EE5-6C3D-0419-9F4D382A64D6:f=FaktPro-Black,230870A2-309B-B58A-6167-BE6832E4B9DF:f=MyriadPro-LightSemiExtIt,8C5B073A-F3EB-BF79-99E3-C3C42439FD61:f=MyriadPro-BoldCond,14271B4B-F5A8-EDF2-9A5A-ADBD6595E88F:f=FaktPro-BlackItalic,9128D502-D19E-B9A8-A946-E9923AB2F1D3:f=FaktPro-BlondItalic,32E29AA5-52D1-469A-C546-476768AD2051:f=MyriadPro-BlackCond';         wp_register_style( 'fonts', $url, false, '1.0', 'all' );         wp_enqueue_style( 'fonts' );     }     add_action( 'wp_enqueue_scripts', 'load_fonts' ); ?>      * Slight note...if you try and access the following url, you will get an error. I have changed the project number so that people are unable to use my account. The overall format of the link is the same though. ** The link is a CSS file. @font-face declarations are defined in the CSS file like you would in a normal CSS file. Any thoughts?


title: Media Custom Fields - get a value with PHP

text: How to get a value of a field set with Media Custom Fields (programmatically)?


title: Migrated to Namecheap, now Trouble with Database & wp-config

text: I have been using a free web host while I set up my WP site. Now that it's all done I went and bought hosting from Namecheap. I uploaded the site and WordPress and everything seems to look fine, but I think I may have problems with my WP database. I couldn't figure out a way to import my old sql database which I have saved. So now my wp-config file is connected to my old sql database from the free host. My site still displays normally, but I'm guessing this will cause problems somewhere down the road. After this, I created a new database, user, and password from my Namecheap cPanel. However, with Namecheap there is no option to choose a host and it didn't tell me what the host was. So I took my old wp-config file and updated the database's name, user, and password. I left host a lone and it's still left as my old host before I switched to Namecheap hosting. With this wp- config file uploaded, the site again loads normally. So with either wp-config file the site loads properly, but I don't think it's set up properly. Does anyone know what I should put for host in my wp-config file for Namecheap? Also, will I be fine using my newly created database for Namecheap or do I need to import my old database from the free host? If I do need to import the database, how do I do that? I don't see any obvious options for it in the cPanel?


title: Add option to disable comments on a per posts basis?

text: IN the past I thought there was a chackbox to enable/disable comments when making a new posts? I do not have that option when I make new post's, please help


title: Query Custom Posts - Add To Selection

text: Which I have working, but not correctly. When I add this metabox to my page it messes up the permalink to always display the slug of one of the organization post types. When I remove this metabox the post is named correctly (as the title is). If there a different or better way to query posts outside the loop? What I'm trying to do is query all the organizations in my post type and display them in a selection list for the user to choose from. This is what seems to be messing up my permalink.               function show_custom_meta_box_org() {         global $post;          $org = new WP_Query( array( 'post_type' => 'organizations', 'orderby' => 'menu_order', 'order' => 'ASC' ) );              // Use nonce for verification         echo '<input type="hidden" name="orglist_meta_box_nonce" value="'.wp_create_nonce(basename(__FILE__)).'" />';              // get value of this field if it exists for this post         $meta = get_post_meta($post->ID, '_orglist', true);              ?>         <table class="form-table" id="orgList">             <tr>                 <td>                     <select id="selectorg" name="_orglist">                         <option value="">Select Organization</option>                     <?php while($org->have_posts()) : $org->the_post(); ?>                         <option value="<?php echo $post->post_name; ?>"><?php the_title(); ?></option>                     <?php endwhile; ?>                     </select>                 </td>             </tr>         </table>         <?php     }


title: How to query details of images in gallery that is attached to a post

text: I have several images attached to each post. I need to generate a gallery, but because it's heavily customized I don't want to use a gallery plugin, nor the gallery short code. It's also situated in a DIV that is totally separated from the post content/title etc. so it has to be stand-alone code in PHP, hard- coded. Basically if there's a method to retrieve the list of attachments in a URL format.. and then pull in the proper sizes (filename_80X80.jpg or something along those lines - I know the filenames are manipulated after the thumbnail size). I already have the thumbnail sizes covered using               add_image_size( 'ourwork_full', 589, 315, true );     add_image_size( 'ourwork_thumb', 80, 80, true );      in the funtions.php file of the template. How can I achieve this? Do I need to use custom WP query? Or is there a function/template tag that I am missing?


title: plugin for wp_list_categories with posts

text: Is there a parameter that can be passed to wp_list_categories, to get a certain number of posts from each category? Or a plugin that does something like that? A similar question was in the Wordpress support forum, but it doesn't do exactly what I want.


title: Custom rewrite rules for pages

text: I'm trying to get WordPress to recognize a URL structure like this:               example.com/parent/page/{id}/{first_name}/{last_name}      The basic ideea is that I need to access the `id`, `first_name` and `last_name` in my page and they have to come via the URL. So I have to put rules like:               (/some_page/child_page/)/([0-9]+)/([^/]+)/([^/]+) =>     index.php?pagename=$matches[1]&id;=$matches[2]&fname;=$matches[3]&lname;=$matches[4]      for every page, by using the `page_rewrite_rules` filter. The question is: How to I get the "pagename" for every page? The `/some_page/child_page/` part. I can get the `post_name` but then I miss the parent, grandfather page.


title: Connecting a taxonomy with a post type

text: The setup:   * custom post type of 'attorney'    * custom taxonomy of 'specialty', which is registered against the 'attorney' post type   * custom post type of 'practice-area' For every specialty, there is a matching practice area. However, there are many more practice areas than there are specialties. Ideally, when viewing a practice area (say, Bankruptcy), I'd be able to list attorneys who have Bankruptcy as a specialty. I know I could use the posts2posts plugin, and create a connection between the attorney post type and the practice-area post type. However, that would mean essentially setting an attorney's specialty twice (once as a taxonomy term, and once as a posts2posts connection). Is there a way to somehow make a connection between the a specialty taxonomy term and the relevant practice- area post type? I could simply assume that names and/or slugs will match up, but that's a pretty hacky/fragile solution. I'd ideally like to connect regular 'category' terms to the various 'practice- area' post types as well, to list relevant blog posts on the individual practice area pages (and vice versa). Suggestions?


title: Uploading files in admin panel?

text:
I want to allow my users to upload files in admin panel, but I'm not sure where should I upload these files and how the script should look like?
Please provide link to a file or click "Upload" to upload it from your PC:
     <form>     Link: <input type="text" name ="logo_url">     Upload: <input type="file" name="logo_file">     <input type="Submit" value="Upload">      How should back-end look for that script? I mean the type="file" part :) Oh and of course I have fully working theme option page (so the first input works like a charm).


title: Pages, Categories, and working with someone else's code

text: I have working experience in Wordpress, and I have run into an issue that I can think of solutions for but I am not entirely sure of the best solution. I am working in Wordpress on a site that is several years old, and I am a little confused by the site hierarchy. I ask here because the previous dev isnt available for comment. The site is mostly a static site, with multiple pages of static content. All of this is arrayed in pages. However, the Blog portion of the site is set up as a category. It is the only section set up that way, and the blog posts do not appear on any other pages. Is there a reason that jumps out to anyone as to why someone might do this? Furthermore, I am tasked with redesigning just the blog section of the site (which is why this has come up), what would be the easiest way to make changes to the blog section (the entire page, including the header and footer)? I have set up a categories-slug.php page, but I wanted to make sure that I wasnt missing a better option (such as setting up a new theme, etc...). Thank you!


title: Output dynamic_sidebar into PHP

text: I know                wp_title("",false)      Outputs a title for a page into HTML. How do I do the same for the               dynamic_sidebar();      ?