Cant get front end form to post to wordpress

Long time lurker, first time poster, and big time PHP noob. Apologies if my question is a little vague, but i have the code below and I know im doing some sort of schoolboy error but it just wont send the form contents to a post. The basic out line is one form, you submit a url, then another form appears with meta data in it, then that form gets submitted to a wordpress post. Its this last bit thats not working, it just pushes you back to the first form and doesnt post the data. Any help at all would be appreciated.                   <?php     /*     Template Name: page-url     */     ?>                    <?php get_header(); ?>          <?php get_template_part('includes/breadcrumbs'); ?>

                         <?php     /* if the "submit" variable does not exist, the form has not been submitted - display initial page */     if (!isset($_POST['submit'])) {               ?>                   <form action="" method="post">         Enter your url: <input name="formuserurl">         <input type="submit" name="submit" value="Go">                   </form>               <?php         }     else {     /* if the "submit" variable exists, the form has been submitted - look for and process form data */               function file_get_contents_curl($url)     {         $ch = curl_init();                   curl_setopt($ch, CURLOPT_HEADER, 0);         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);         curl_setopt($ch, CURLOPT_URL, $url);         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);                   $data = curl_exec($ch);         curl_close($ch);                   return $data;     }               $enteredurl = $_POST['formuserurl'];     $html = file_get_contents_curl($enteredurl);               //parsing begins here:     $doc = new DOMDocument();     @$doc->loadHTML($html);     $nodes = $doc->getElementsByTagName('title');               //get and display what you need:     $title = $nodes->item(0)->nodeValue;               $metas = $doc->getElementsByTagName('meta');               for ($i = 0; $i < $metas->length; $i++)     {         $meta = $metas->item($i);         if($meta->getAttribute('name') == 'description')             $description = $meta->getAttribute('content');         if($meta->getAttribute('name') == 'keywords')             $keywords = $meta->getAttribute('content');     }               ?>               <form action="" method="post">     Url: <input name="_url2" value="<?php echo $enteredurl; ?>" id="">
     Title: <input name="_title" value="<?php echo $title; ?>" id="">
     Tags: <input name="_tags" value="<?php echo $keywords; ?>" id="">
     Description: <textarea name="_description" cols="" rows="" value="" id=""><?php echo $description; ?></textarea>
     Category: <?php wp_dropdown_categories('tab_index=10&taxonomy=category&hide_empty=0'  ); ?>
     <input type="submit" name="submitpost" value="Go">                    <?php wp_nonce_field( 'new-post' ); ?>               </form>     <?php     }     ?>                         <?php     /* This is to post the form content to wordpress*/          if (!isset($_POST['submitpost'])) {              }     else {     /* This is to post the form content to worpdress*/               if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) &&  $_POST['action'] == "new_post") {              // Do some minor form validation to make sure there is content         if (isset ($_POST['_title'])) {             $title =  $_POST['_title'];         } else {             echo 'Please enter the wine name';         }         if (isset ($_POST['_description'])) {             $description = $_POST['_description'];         } else {             echo 'Please enter some notes';         }              $tags = $_POST['_tags'];              // ADD THE FORM INPUT TO $new_post ARRAY         $new_post = array(         'post_title'    =>  $title,         'post_content'  =>  $description,         'post_category' =>  array($_POST['_categories']),  // Usable for custom taxonomies too         'tags_input'    =>  array($tags),         'post_status'   =>  'publish',           // Choose: publish, preview, future, draft, etc.         'post_type' =>  'post'  //'post',page' or use a custom post type if you want to         );              //SAVE THE POST         $pid = wp_insert_post($new_post);                       //SET OUR TAGS UP PROPERLY         wp_set_post_tags($pid, $_POST['_tags']);              //REDIRECT TO THE NEW POST ON SAVE         $link = get_permalink( $pid );         wp_redirect( $link );          } // END THE IF STATEMENT THAT STARTED THE WHOLE FORM          //POST THE POST YO     do_action('wp_insert_post', 'wp_insert_post');          }                         ?>

               <?php get_sidebar(); ?>     <?php get_footer(); ?>

          <?php get_footer(); ?>


jQuery | JJ Carousel Plugin - Can’t set speed

I am trying to use NextGen Gallery with the JJ Carousel plugin. The scrolling works now, but I can’t setup the speed of the carousel. JJ wrote: > animation: The speed of the scroll animation as string in jQuery terms > ("slow" or "fast") or milliseconds as integer (See jQuery Documentation). If > set to 0, animation is turned off. (sc: animation="setting") But anything I set in there will not work, no difference between 'fast' and '5000'. http://wordpress.org/extend/plugins/nextgen-gallery/ http://wordpress.org/extend/plugins/jj-nextgen-jquery-carousel/


Search form with Category and Sub Category

How to create WP Search Form with Category and Sub category   for illustration a search form (for search title Book=title post)   With condition By Keyword, By All Category and Sub Category selected   Where, Sub Category (CD, PDF, EPub,...)   I Look Around for a Week but unsuccessful,   Help me , Please ... => For My Client blog for CMS Ebook **I Have modified my form like This :**               <?php $media = array(      'hierarchical'       => 1,      'parent'             => get_cat_id('Media'),      'show_option_none'   => ('All Media'),      'hide_empty'   => 0  );      ?>          <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">       <div>         <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />         <?php wp_dropdown_categories('show_option_none=All Category'); ?>         <?php wp_dropdown_categories($media); ?>         <input type="submit" id="searchsubmit" value="search" />       </div>     </form>         **How to Create Function or modified form again ? Without Plugin...**   For a detailed answer I am very grateful !!!


Better way to show Description and image Captions

I am using this code to display "Featured Image" Captions/Descriptions, also i will show my div with Captions/Descriptions only if they exist. Because my PHP skills are not best   My question is : **_Is there a better (Wordpressy way) for achieving this?_**   Thank you.               <?php     $get_desc = esc_html(get_post(get_post_thumbnail_id())->post_content);     $get_caption = esc_html(get_post(get_post_thumbnail_id())->post_excerpt);     $merge = $get_caption . '
' . $get_desc;                     the_post_thumbnail();          if(!empty( $get_caption ) && empty( $get_desc )){//If caption is not empty show the div                     echo '
' . $get_caption . '
';                                         }          else if(!empty( $get_desc ) && !empty( $get_caption )){ //If both caption and description are not empty show the div                     echo '
' . $merge . '
';                     }          else if(empty( $get_caption ) && !empty( $get_desc )){//If description is not empty show the div                     echo '
' .  $get_desc . '
';                     }                     ?>


Plugin for Google Apps "Short Links" service?

I have a Google Apps–enabled WordPress site and a subdomain where Google Short Links runs. I've been toying with the idea of shortening my own links, but I haven't been able to find a WordPress plugin that hooks into the Short Links API to automatically add new posts as they're published (and maybe old posts too). Does a plugin exist to do this? Ideally it would also add a `<link rel="shortlink">` tag to each page, but I could extend it with code from other plugins to do that. It should store the shortlink somewhere in the database, of course, so other plugins can access the link for tasks like posting to Twitter, Facebook, and so forth.


Listing Child Pages in a Certain Order?

I'm trying to show child-pages in a certain order, in a list. This is my code to output the pages as a list               $parent = $wp_query->post->ID;     wp_list_pages("title_li=&child_of=$parent&echo=1&sort_column=post_title" );      Now I want to show the first four of the pages in a particular order               -Summary     -Info     -Groups     -Entries     -Other Page     -Another Page      In other words, Summary, Info, Groups, Entries should be shown in that order (providing they exist), and other pages below. How would I achieve that? I've noticed there are parameters to include and exclude pages using wp_list_pages. These parameters take page ID numbers as variables , so I perhaps the pseudo- code is               - make a array of the IDs of child pages which include Summary, Info, Groups, Entries in their titles, and order these correctly     - make a array of the IDs of child pages which don't include the 4 pages     - join these arrays together     - print out the html of the array of page IDs


Print all content of a paged post

is it possible to print a complete post that has a number of pages? I'm working on a website that the client would like users to be able to print an article. The problem I have right now is when an article has a number of pages, by using WordPress's `<!--nextpage-->`. Say an article has the content split into 3 pages. Is there a way when printing the page to have all the content from those 3 pages displayed? Thanks in advance for any help.


Help me SELECT thumbnail from SQL and use

//MySQL Username     $user = "myuser";     //MySQL Password     $pass = "mypass";     //MySQL Database Name     $database = "mydb";     //Number of posts you want to have appear     $numOfPosts = 7;          //Setup connection     $mysqli = new mysqli("localhost", $user, $pass, $database);     $mysqli->query("SET NAMES 'utf8' COLLATE 'utf8_unicode_ci'");     /* check connection */     if (mysqli_connect_errno()) {     printf("Connect failed: %s\n", mysqli_connect_error());     exit();     }          $limit = $numOfPosts;     $sql = "SELECT * FROM wp_posts WHERE post_type = 'post' AND post_status IN ( 'draft', 'publish', 'future', 'pending', 'private','attachment' ) ORDER BY post_date DESC LIMIT $limit";     $result = $mysqli->query($sql);     while ($row = $result->fetch_object()) {       echo '
';         echo '
guid.'" title="'.$row->post_title.'"target="_blank">'.$row->post_title.'
';       echo '
';          }


Link or button to open the media manager from frontend

I am trying to figure out if there is a way to add a link or button that will open the media manager/library on the front end of the site? I don't need to select images for insert or to select images as featured, I simply want to allow my users to upload and edit their media within the library without having to go the backend to do so. Is this possible? I've Googled quite a bit and can't seem to find anyone else who's trying to do this so I turned here.


Possible to preset a widget's contents via a plugin script?

This plugin is a simple demo test to see if I can dynamically populate a pre- existing widget area with text. In this case, my theme has created the widget area "home-header-widget" and I'm trying to populate it with the contents of 'text' below. I'm stuck at the line...               $sidebars_widgets[$sidebar_id] = "widget_text-".$id;      In that I'm not certain how to obtain a reference to the dynamically created text widget object in order to preset its contents and place it inside my 'home-header-widget'...               <?php     /*     Plugin Name: Widget Test     */     function cb_activate_widgettest(){          $sidebar_id = 'home-header-widget';     $sidebars_widgets = get_option('sidebars_widgets');     $id = count($opts)+1;     $sidebars_widgets[$sidebar_id] = array("text-".$id);          $ops = get_option('widget_text');     // find an $id that works...     $ops[$id] = array(       'title' => 'foo hoo',       'text' => 'bar mitz', // content?     );     update_option('widget_text', $ops);      update_option('sidebars_widgets', $sidebars_widgets);          }          register_activation_hook(__FILE__, 'cb_activate_widgettest');     ?>


What does l10n.js do in WordPress 3.1? And how do I remove it?

I just installed WP 3.1 Beta 2 on my test server. I noticed that it ships with a new `l10n.js` file that gets automatically inserted into the header. I did a bit of digging and it has something to do with localization. I'm guessing that many people don't use this, so I'm wondering how I could remove it? If it's important not to remove it, please let me know as well.


Syndicated Posts when Updated Lose <p> HTML tags

When I have a syndicated post and then make an update to the syndicated copy (not original) it shows up in my blog as one long run-on paragraph. Nothing happens to the Visual or HTML data in that post, but once I click "Update" wordpress doesn't auto generate the necessary paragraph tags for the post. Is this a configuration problem or a bug with wordpress?


How do I remove Pages from search?

I don't need to search for pages in my site and only want to search posts, is there a way to do it? Thanks


How to Prevent WordPress from Automatically Applying Inline Styles to Post Images?

I am wondering how to prevent WordPress from applying in-line styles to image enclosing div's in posts.               <div class="img size-medium wp-image-3267 alignright" style="width:190px;">      **Edit:** The post is generated in the theme file by using `the_content()`. That width declaration is causing my post to display a horizontal scrollbar under the content. The weird thing is, the horizontal scroll bar only appears if the image is set to align right. Aligning the image to the left doesn't cause the scroll bars to appear. I am able to remove the scrollbar by setting the .post overflow from 'auto' to 'hidden'. Does anyone know how WordPress applyies the inline style? Or how to override it? For now, I've set .post overflow to be hidden, but I'm worried that down the line, that might bite me. Thanks


What's the ideal way to profile WordPress memory usage?

We're running a WordPress multisite instance on two Rackspace Cloud servers, one web and one database, with 30 or so sites currently. I've put Nginx in front for static assets and Apache handles all dynamic requests. I've also configured Memcached for the database and APC op code caching for PHP. W3 Total Cache is enabled by default across all of the sites we have. It's wicked fast with one issue: Apache processes regularly weigh in between 80 and 120 MB. The web server has 2 GB of memory, meaning I get 15 or so processes until things go on the fritz. The processes obviously shouldn't be that large but I'm perplexed as to why they are. What's a good strategy for identifying what's going on? Thanks in advance! **Update 10/2/10:** For those wondering, the resolution of the memory issue problem was disabling PHP xdebug (was inadvertently enabled on configuration and caused random memory usage spikes).


wp nav menu - highlighting current page not working properly

I'm trying to highlight the current page in the wp nav menu. I've read through the codex and found .current-menu-item, which I'm using in my CSS.. However it's not working. What am I missing? css               #header nav {         float: left;         padding-left: 25px;         padding-top: 12px;     }          #header nav ul li {         display: inline;     }          #header nav ul li a {         color: #333333;         font-family: amatic;         font-size: 150%;         padding-right: 25px;     }          #header nav ul li a:hover {         color: #c6e000;     }          #header nav ul li a:last-child {         padding-right: none;     }          #header nav .current-menu-item {         color: #c6e000;     }      html/php               <div id="header">          <nav>         <?php wp_nav_menu( array('menu' => 'nav' )); ?>          </nav><!-- end nav -->     </div><!-- end header -->      live site


Delete duplicate custom field with specific vaule

I'm trying to delete specific custom fields that have been duplicated, however i only want to delete the fields with the value 0 in them. I currently have this code that will delete the duplicate this will remove one duplicate field "blogger_blog", i'd like it to remove "blogger_blog=0" so that field with 0 is deleted.               delete from wp_postmeta     where meta_id in (            select *            from (                    select meta_id                    from wp_postmeta a                    where a.meta_key = 'blogger_blog'                    and meta_id not in (                            select min(meta_id)                            from wp_postmeta b                            where b.post_id = a.post_id                            and b.meta_key = 'blogger_blog'                    )            ) as x     );


Display posts of specific category term

I'm using this code to first display each category term as headlines and then display a post which is assigned each category term under the headline. If I create a custom taxonomy it works as intended, but if I attempt to use the default category taxonomy, the headlines display as intended, but under each headline, it displays every article without regard to the assigned term. I don't understand why would it work for my custom taxonomy but not for the default category taxonomy.               <?php $args = array (         'orderby'    => 'name',         'order'      => 'ASC',         'hide_empty' => true,     );          $terms = get_terms( 'category', $args );     foreach ( $terms as $term ) {         echo $term->name;              $post_args = array (             'category' => $term->name,             'posts_per_page'   => '1',             'no_found_rows' => true         );              $query = new WP_Query( $post_args );              while ( $query->have_posts() ) {             $query->the_post(); ?>                  <?php the_title(); ?>             <?php the_excerpt(); ?>              <?php }     }      If I change it to use my custom taxonomy named 'article_subjects' in this example, everything works as intended.               <?php $args = array (         'orderby'    => 'name',         'order'      => 'ASC',         'hide_empty' => true,     );          $terms = get_terms( 'article_subjects', $args );     foreach ( $terms as $term ) {         echo $term->name;              $post_args = array (             'article_subjects' => $term->name,             'posts_per_page'   => '1',             'no_found_rows' => true         );              $query = new WP_Query( $post_args );              while ( $query->have_posts() ) {             $query->the_post(); ?>                  <?php the_title(); ?>             <?php the_excerpt(); ?>              <?php }     }      And just in case it's pertinant, here is the code I used to generate the custom taxonomy.               function article_subjects() {     $labels = array(         'name'                       => _x( 'Subjects', 'Taxonomy General Name', 'dc' ),         'singular_name'              => _x( 'Subject', 'Taxonomy Singular Name', 'dc' ),         'menu_name'                  => __( 'Subjects', 'dc' ),         'all_items'                  => __( 'All Items', 'dc' ),         'parent_item'                => __( 'Parent Item', 'dc' ),         'parent_item_colon'          => __( 'Parent Item:', 'dc' ),         'new_item_name'              => __( 'New Subject', 'dc' ),         'add_new_item'               => __( 'Add New Item', 'dc' ),         'edit_item'                  => __( 'Edit Item', 'dc' ),         'update_item'                => __( 'Update Item', 'dc' ),         'separate_items_with_commas' => __( 'Separate items with commas', 'dc' ),         'search_items'               => __( 'Search Items', 'dc' ),         'add_or_remove_items'        => __( 'Add or remove items', 'dc' ),         'choose_from_most_used'      => __( 'Choose from the most used items', 'dc' ),         'not_found'                  => __( 'Not Found', 'dc' ),     );     $args = array(         'labels'                     => $labels,         'hierarchical'               => false,         'public'                     => true,         'show_ui'                    => true,         'show_admin_column'          => true,         'show_in_nav_menus'          => true,         'show_tagcloud'              => true,         'has_archive'                => true,         'can_export'                 => true          );     register_taxonomy( 'article_subjects', array( 'post' ), $args );     }     add_action( 'init', 'article_subjects', 0 );


Creating custom input fields on the admin side

I'm pretty new to wordpress (been using wordpress for a week now) and took over a site from a colleague of mine . He partially created a plugin to input "Specials" onto the site. At the moment, the fields that it shows is "Title", and "Body" with a featured image. This is what the code looks like:               public function create_specials_type()     {         register_post_type('specials',             array(                 'labels' => array(                     'name' => __('Specials'),                     'singular_name' => __('Specials')                 ),                 'public' => true,                 'has_archive' => true,                 'supports' => array(                     'title',                     'editor',                     'thumbnail',                     'revisions'                 ),                 'show_ui' => true,                 'show_in_menu' => true             )         );              add_theme_support('post-thumbnails',             array(                 'specials'             )         );     }      I want to modify this so that it shows a page (on the admin side) that looks like this: Special Name (input) Description (textarea) Items (textarea) Cost (input) Image (image) I'm using WP 3.9.2 with a custom theme. Can anyone assist me with writing this plugin or at least provide a link to a good resource that will help me do this?


Remove specific buttons from wp_editor()

I know there are similar topics with accepted answers but I can't find what I'm looking for. I want to keep only basic buttons in `wp_editor()`. I'm using this in an option page to make writing more comfortable. The problem is the theme adds a huge amount of quicktags I do not want on this specific page. How can I achieve this. So far I've looked into `wp-includes/wp-class-editor.php` but the following line does not remove unecessary buttons :               'quicktags' => array('buttons' => 'link,ins,img,close')      :/ Any help would be much appreciated. EDIT: I've tried to modify function given in similar topic with this :               function wpa_47010( $qtInit ) {     global $my_plugin_page;         $screen = get_current_screen();           if( $screen->id == $my_plugin_page )                $qtInit['buttons'] = 'link,img,close';     return $qtInit;     }     add_filter('quicktags_settings', 'wpa_47010');      But it does not work !


WordPress loads whole jQuery UI library

My wordpress loads whole jQuery UI library               <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.core.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.widget.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.position.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.mouse.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.sortable.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.menu.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.resizable.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.draggable.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.button.min.js?ver=1.9.2'></script>     <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/ui/jquery.ui.dialog.min.js?ver=1.9.2'></script>      Is this normal? I didn't noticed the same behavior earlier.


Advanced Custom Fields Get value from Checkbox Within Repeater

I can't figure out how in the world to get the value of a checkbox entered in a repeater field. There is only one choice. Basically if the user ticks the checkbox it should output a class. In the code example I don't have the value in the class yet because I am just trying to get it to print something! arg.               <?php if( have_rows( 'milestone_module' ) ) : ?>
              <?php                   while( have_rows( 'milestone_module' ) ) : the_row();              // Vars             $milestone_module_date = get_sub_field( 'milestone_module_date' );             $milestone_module_copy = get_sub_field( 'milestone_module_copy' );             $field = get_field_object('milestone_long_date');             $value = get_field('milestone_long_date');             $label = $field['choices'][ $value ];         ?>
             <?php if( $milestone_module_date ) : ?>                                      <?php echo $label; ?>                     <?php echo $milestone_module_date; ?>                              <?php endif; ?>                  <?php if( $milestone_module_copy ) : ?>
                     <?php echo $milestone_module_copy; ?>
             <?php endif; ?>
              <?php endwhile; wp_reset_postdata(); ?>
          <?php endif; ?>


How does one change the posts database table of a site?

I am currently in the process of developing a mobile site to accompany a site that I have been operating for a while. I came up with the idea to use multisite to create a second site with a m.domain.com prefix, but the problem is that my sites currently draw posts from different sources (the mobile site currently displays no posts due to the fact that it is pulling posts from a separate table). My question is whether it is possible to change some setting in the code to allow them to use the same database for posts and comments, and what I would need to change to do this (I can imagine it is in some PHP document somewhere in the project, but google has failed to give me anything solid). Thank you.


Menu is not styled properly and footer as well

![enter image description here](http://i.stack.imgur.com/XNov3.png) Here I want to remove bullets that is before the menu. Here is my wordpress code for that menu :

             <?php wp_nav_menu( array( 'theme_location' => 'header' ) ); ?>

      here is my CSS:               .templatemo_menu {     list-style-type: none;     margin: 10px;     margin-top: 0px;     padding: 0px;     width: 195px;     }     .templatemo_menu li a{         background: #F4F4F4 url(images/button_default.gif) no-repeat;         font-size: 13px;         font-weight: bold;         color: #0066CC;         display: block;         width: auto;         margin-bottom: 2px;         padding: 5px;         padding-left: 12px;         text-decoration: none;       }      * html .templatemo_menu li a{            width: 190px;       }       .templatemo_menu li a:visited, .templatemo_menu li a:active{           color: #0066CC;       }       .templatemo_menu li a:hover{           background: #EEEEEE url(images/button_active.gif) no-repeat;           color: #FF3333;       }      index.php:                <?php get_header(); ?>

                 Free CSS Website Layout
                  This   free CSS  template is provided by xyz.com. Feel free to download, modify and use this layout for your websites. It would be helpful if you put a kind of credit link back to xyz.com website. Thank you.

                  Proin vel libero id erat venenatis accumsan. Nunc blandit orci sit amet risus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque dolor nulla, congue vitae, fringilla in, varius a, orci. Mauris convallis.

             <?php if ( have_posts() ) { while ( have_posts() ) { ?>

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

                         <?php the_post(); the_content();?>
Post Date: <?php the_time('F jS, Y');?> By <?php the_author_posts_link(); ?><?php _e( ' Posted in' ); ?> <?php the_category( ', ' ); ?>· Tags: CSS · Web Design · Full Story

             <?php }  } // end if ?>

                     New Flash Player

                                          Nam sit amet justo vel libero tincidunt dignissim. Fusce ac orci sit amet velit ultrices condimentum. Integer imperdiet  odio ac eros. Ut id massa. Nullam nunc. Vivamus sagittis varius lorem.                     Quisque in diam a justo condimentum molestie.

Post Date: 24-10-2020 · Tags: Flash · ActionScripts · Full Story

     <?php get_sidebar();get_footer();   ?>      Header.php:               <!DOCTYPE html>               <title><?php wp_title('|', true, 'right'); ?></title>     <link href="<?php bloginfo('stylesheet_url');?>" rel="stylesheet" type="text/css" />     <?php wp_head(); ?>

 Website Templates · Flash Templates · Company · Contact

<?php bloginfo('name'); ?>

<?php bloginfo('description'); ?>

      sidebar.php:

                 <?php wp_nav_menu( array( 'theme_location' => 'header' ) ); ?>

                 Quick Contact
                 Tel: 002-040-0240
                 Fax: 001-050-0480
                 Email: info[at]templatemo.com

                 About this website
             Curabitur velit tellus, placerat et, dapibus varius,  aliquet quis, purus. Lorem ipsum dolor sit amet, consectetuer  adipiscing elit.

             Special Thanks
             Website Link One
             Blog Link Two
             Template Link Three
             Text Link Four
             Free Templates

<?php dynamic_sidebar('Right Hand Sidebar'); ?>
      Here is my footer.php code:
         Copyright © 2048 Your Company Name · Website Templates by xyz.com
     <?php wp_footer(); ?>

           Screen shot: ![enter image description here](http://i.stack.imgur.com/uSkq4.png)


PHP echoes value without the use of echo

I'm building a table with items in it. What I don't understand is the following: When I type `<td> <?php custom_get_terms('landschapspakket');?> </td>`, it echoes the value of `custom_get_terms('landschapspakket')`. What I want to do is use some conditional logic over it to see which value it has, and then echo it. Instead it outputs it even before I type echo. Has it got something to do with the loop? How can I avoid this?

                     Landschapspakket	                     Be nr.	                     Gebiedscode	                     Gebruiksrecht	                     Grond	                     Aantal
                      <?php $query = new WP_Query(array('post_type' => $current_posttype, 'posts_per_page' =>'-1', 'post_status' => array('publish', 'pending', 'draft', 'private'/* , 'trash' */) ) ); ?>                      <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
                     <?php custom_get_terms('landschapspakket');?>	                     <?php custom_get_terms('beheerseenheidnummer');?>	                     <?php custom_get_terms('gebiedscode');?>	                     <?php custom_get_terms('gebruiksrecht');?>	                     <?php custom_get_terms('grond');?>	                     <?php custom_get_terms('stuks');?>	                          <?php $edit_post = add_query_arg('post', get_the_ID(), get_permalink(429 + $_POST['_wp_http_referer'])); ?>                                                   <a href="<?php echo $edit_post; ?>">Bewerk                              <?php if( !(get_post_status() == 'trash') ) : ?>                                  <a onclick="return confirm('Weet je zeker dat je <?php echo get_the_title() ?> wilt verwijderen?')"href="<?php echo get_delete_post_link( get_the_ID() ); ?>">Verwijder                              <?php endif; ?>
                  <?php endwhile; endif; ?>
      If the problem is in the function `custom_get_terms()`, I'll include the code:               function custom_get_terms($taxonomy) {              // Get terms for post          $terms = get_the_terms( $post->ID , $taxonomy );               // Loop over each item since it's an array          if ( $terms != null ){                 foreach( $terms as $term ) {                      // Print the name method from $term which is an OBJECT                      if ( $term->name != null ) {                          print $term->name ;                          // Get rid of the other data stored in the object, since it's not needed                      } else {                      }                   unset($term);                 }          }     }


WP_Query: query posts by ids from array?

I did quite a bit of research but can't figure why this wouldn't work for me?               echo print_r($rel); // Array ( [0] => 63 [1] => 87 )          $args = array(         'post_type' => array( 'post' ),         'orderby' => 'ASC',         'post_in' => $rel     );          $loop = new WP_Query( $args );      I don't get any posts returned? Any ideas how to only get the posts with the ids in the array?


Managing scheduled tasks

I want users of my plugin to be able to define whether a task operates daily, twice daily, hourly or not at all as per the standard WP set-up. I'm storing these as 'daily', 'twicedaily', 'hourly' or '' in the option obr_scheduled_interval. The problem is that the task that I want 'obr_grab' runs every time there's a page visit rather than every time there's a page visit after the selected time period. These are the relevant bits of code from the class.               function __construct(){         register_activation_hook(__FILE__, array(&$this, 'obr_activate_scheduled_task'));         add_action('obr_scheduled_task', array(&$this, 'obr_activate_scheduled_task'));         add_shortcode('obr_grab', array(&$this, 'obr_grab'));         register_deactivation_hook(__FILE__, array(&$this, 'obr_deactivate_scheduled_task'));     }          function obr_activate_scheduled_task() {         // function to activate the scheduled task (if there is one);         if (wp_next_scheduled('obr_scheduled_task')){             wp_clear_scheduled_hook('obr_scheduled_task');         }         $interval = get_option('obr_scheduled_interval');         if (strlen($interval) > 0){             wp_schedule_event(time(), $interval, 'obr_scheduled_task');         }     }          function obr_scheduled_task(){         // if called we need to use the grab function         $this->obr_grab();     }          function obr_deactivate_scheduled_task(){         // clear the schedule on deactivation         wp_clear_scheduled_hook('obr_scheduled_task');     }             I've looked at core control but there are only two standard jobs there: wp_scheduled_auto_draft_delete and wp_scheduled_delete All help much appreciated!


Is there a way for a plugin to add an attribute to the <html> tag of a theme?

I'm currently working on an appcache plugin for WordPress. One thing that it should do is add a manifest reference in the `<html>` tag of the site. It has to resemble something like this: `<html manifest="manifest.appcache">` Is there any way of doing this programmatically within a plugin? My current idea would be to identify the `<html` part of a theme's header file and inject the manifest using something like `str_replace()`. However, I can't see a way of filtering the output of the `get_header()` function either via the `get_header()` action or `load_template()` function. If anyone has any ideas I'd appreciate help.


How to add a piece of code in function

On the function below, after `echo '</span>';`, I want to add this a piece of code:                <a href="<?php $key="link"; echo get_post_meta($post->ID, $key, true); ?>" target="_blank">Images Source      But I dunno how to do it, any suggestions on how to do this?               //echo '
';             echo in_array( 'date',$meta_info ) ? sprintf( '' . apply_filters('yt_icon_date_time', '') . ' %1$s',                 $time_string             ) : '';             if( in_array( 'comments',$meta_info ) ){                 echo '' . apply_filters('yt_icon_comment', '') . ' ';                     comments_popup_link( __( '0 Comments', 'theme' ), __( '1 Comment', 'theme' ), __( '% Comments', 'theme' ));                 echo '';             }                        //echo '
';


How to login a user with wp_set_auth_cookie on a specific blog within a multisite environment

How can you leverage wp_set_auth_cookie to programmatically login a user on a specific blog in a multisite environment? wp_set_auth_cookie doesn't allow you to set the target blog to authenticate the user under. I have a multisite/buddypress setup where activations happen on the primary domain. I want to then automatically authenticate that user not for the main site, but for one his site that was created on registration.


Exclude posts from certain category breaks custom pagination

I want to show only posts from certain categories so that I exclude them in my `WP_Query()` query. Doing this my custom pagination is not working correctly. Clicking on each one of the number in the pagination itself still shows the same posts. My Custom pagination:               function glean_numeric_posts_nav() {            if( is_singular() )         return;            global $wp_query;            /** Stop execution if there's only 1 page */       if( $wp_query->max_num_pages <= 1 )         return;            $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1;       $max   = intval( $wp_query->max_num_pages );            /** Add current page to the array */       if ( $paged >= 1 )         $links[] = $paged;            /** Add the pages around the current page to the array */       if ( $paged >= 3 ) {         $links[] = $paged - 1;         $links[] = $paged - 2;       }            if ( ( $paged + 2 ) <= $max ) {         $links[] = $paged + 2;         $links[] = $paged + 1;       }            echo '
' . "\n";            /** Previous Post Link */       if ( get_previous_posts_link() )         printf( '
%s
' . "\n", get_previous_posts_link('«') );            /** Link to first page, plus ellipses if necessary */       if ( ! in_array( 1, $links ) ) {         $class = 1 == $paged ? ' class="active"' : '';              printf( '
%s
' . "\n", $class, esc_url( get_pagenum_link( 1 ) ), '1' );              if ( ! in_array( 2, $links ) )           echo '
…
';       }            /** Link to current page, plus 2 pages in either direction if necessary */       sort( $links );       foreach ( (array) $links as $link ) {         $class = $paged == $link ? ' class="active"' : '';         printf( '
%s
' . "\n", $class, esc_url( get_pagenum_link( $link ) ), $link );       }            /** Link to last page, plus ellipses if necessary */       if ( ! in_array( $max, $links ) ) {         if ( ! in_array( $max - 1, $links ) )           echo '
…
' . "\n";              $class = $paged == $max ? ' class="active"' : '';         printf( '
%s
' . "\n", $class, esc_url( get_pagenum_link( $max ) ), $max );       }            /** Next Post Link */       if ( get_next_posts_link() )         printf( '
%s
' . "\n", get_next_posts_link('»') );            echo '
' . "\n";          }      And in my blog page, I filter those posts by using               $the_query = new WP_Query('cat=-10');      And then loop them. And next after the loop, I call the `glean_numeric_posts_nav()` function.


How to Find a Gallery's ID

Can you please let me know how to find out a galley's ID? and Can we use this ID in CSS styling? if not how we can stylize two different galleries in diffident style?(to be honest I am not sure this is possible or not but I hope!)


Divide post content in three columns

Is it possible to split `the_content()` into three equal size columns? I have tried to achive that by getting this code which I found here                               <?php     $content = get_the_content();     $strings = wordwrap($content, (word_count())/3, "
"); //Put a {BREAK} every 500 characters     $chunks = explode("
", $strings); //Put each segment separated by {BREAK} into an array field          //Printing each chunk in a div     foreach($chunks as $chunk_content) {         echo "
";         echo $chunk_content;         echo "
";     }     ?>      and this is the code in my function.php               function word_count() {     $content = get_post_field( 'post_content', $post->ID );     $word_count = str_word_count( strip_tags( $content ) );     return $word_count;     }      This creates pieces but there is more than three and therefor the text is still readable horizontally across the columns...... I don't now why it shouldn't work?? Hope someone could take a look!


wordpress local host web login not working after port configuration

I installed the word press on my vm and configure my port 8000. Now, when I am trying to login into wordpress using                 http://localhost:8000/wordpress/       on browser , the link is getting changing into                 http://localhost/wordpress/       and displaying "Problem loading page : Unable to connect". I have checked xampp and I am able to access it                 http://localhost:8000/xampp


Build a list of partners with Link, Logo and text

I want to build a list of partners. At the moment, I have tried with the "links" function, the problem is that I can't use html tags on the description field. Therefore I'm looking for another solution. Anyone has a suggestion?


Search form as list item in menu?

What is the best way to do this:               <?php wp_nav_menu( array('menu'=>'Primary',                               'container'=>'',                              'items_wrap'=>'
%3$s
'.get_search_form().'

') ); ?>


500 Internal Error after Moving Wordpress

I've just moved my Wordpress site from localhost to a live Server. What I did that worked:   * In the live server I've created a DB+user.   * Exported (quick mode) my localhost database to .sql format   * Imported my .sql to live server's phpmyadmin in the right DB.   * Changed "site" and "home" to live server's URL from `wp_options` table.   * Uploaded all my content using FileZilla   * Changed `wp-config.php` with the new DB parameters Blank page, it gives me **500 Internal Error**. I've set `WP_DEBUG` to "true" in `wp-config.php`, but can't see no traces. Is there anything I could do to debug what happens? * * * **EDIT:** I was really close, however it took me a lot of time and I decided to try using WP Duplicator plug-in, and it worked.


Loop not showing up on page template

I have a page template and on the page I have a loop such as:               query_posts('post_type=post&posts_per_page=5&paged='.get_query_var('paged'));      if(have_posts()){         while(have_posts()){             the_post();             the_title();         }     }      The problem is that no posts are coming back when there should be about 5 or 6. Is there something wrong?


Which action for triggering cron "wp"or "init"?

Which one do you recommend using within a plugin and why?               add_action( 'wp', 'trigger_me' );     function trigger_me() {              if ( !wp_next_scheduled( 'my_plugin_cron' ) ) {             wp_schedule_event(time(), 'hourly', 'my_plugin_cron');         }          }      **OR**               add_action( 'init', 'trigger_me' );     function trigger_me() {              if ( !wp_next_scheduled( 'my_plugin_cron' ) ) {             wp_schedule_event(time(), 'hourly', 'my_plugin_cron');         }          }      What are the advantages/disadvantages of "wp" over "init" when registering/triggering cron function within a plugin?


How can I prevent '500 internal server error' because of a long install process?

In one of my plugins, I need to insert about 1000 terms into a custom taxonomy while installing a plugin. I see it's sometimes causing `500 internal server error`. How can I split that work or prevent it from giving an error?


Custom post type as a category, for another custom post type

I have custom post type called 'Porjects', and I have second custom post type called 'Clients'. Now, I want to 'Clients' be category for 'Projects'. How can I do this? Clients is custom post type not taxonomy.


How to load wordpress environment without loading the template?

Basically I want to use wordpress functions for example `wp_create_user()` or `wp_update_user()` outside of wordpress (outside of wordpress directory). I tried with all the below code snippets to load the wordpress environment, I am able to use the functions correctly in both the cases but the problem is that this also loads the wordpress template which I do not want. **First Method:**               <?php     define('WP_USE_THEMES', false);     require ('../blog/wp-load.php');     ?>      **Second Method:**               <?php     define('WP_USE_THEMES', false);     require ('../blog/wp-blog-header.php');     ?>      **Directory Structure:**               /blog       |       |_ Wordpress installed here     /admin       |       |_ admin.php (I want to use wp functions here)      Note: I am using **Writr theme** in my wordpress blog.


Getting Details Of Uploaded Image

I'm using Wordpress' upload system (as explained here) on my plugin's admin page. I can upload an image and get this image's URL. But i need attachment ID, image caption etc. How can i reach them? I have an `<form>` . It has 3 `<input>`s .               <input type="text" value="" /> //This input will be filled, after user upload an image and click to `Insert to post` button. I can do it.     <input type="button" value="Click for upload image" />     <input type="hidden" value="" name="ID" /> //Attachment ID will come here automagically (with JavaScript, maybe?). I don't know how can i get it.


Why might a comment turn red on approval?

Weird question here, but I'm hoping somebody is familiar with the issue. When an admin clicked on the "approve" link under a comment on the comment moderation screen, the entire comment row turned red. The comment did publish --but the "approve" link was still appearing in the list of actions links (when it should have changed to "unapprove"). After refreshing the comments moderation page, everything went back to normal. Not exactly an important issue. But I need to be able to explain why it happened, and I can't reproduce it (though I believe it happened--she sent me a screenshot). Any thoughts? Anybody seen this before? Is this maybe a common UI convention in WP when AJAX calls fail?


How to change the URL of a clickable banner?

As we all know, the twenty-eleven theme comes with a random banner feature which, if the site visitor clicks it, takes him to the home page. So there could be quite a few different images for the banner, but they all take you to the same URL when you click them. What I would like to have is that _each_ banner image will have its _own_ URL. How do I accomplish this?


When I try to send mail... it showing - > Fatal error: Call to undefined function get_option() in > /home/junkie/public_html/sub_demo/wp- > content/themes/scroller/includes/contact-form.php on line 9 My code=> contact-form.php               <?php     if($_POST)     {         //check if its an ajax request, exit if not         if(!isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {             die();         }               $to_Email       = "tanvir.focus@gmail.com"; //Replace with recipient email address         $subject        = 'Ah!! My email from Somebody out there...'; //Subject line for emails              //check $_POST vars are set, exit if any missing         if(!isset($_POST["userName"]) || !isset($_POST["userEmail"]) || !isset($_POST["userPhone"]) || !isset($_POST["userMessage"]))         {             die();         }              //Sanitize input data using PHP filter_var().         $user_Name        = filter_var($_POST["userName"], FILTER_SANITIZE_STRING);         $user_Email       = filter_var($_POST["userEmail"], FILTER_SANITIZE_EMAIL);         $user_Phone       = filter_var($_POST["userPhone"], FILTER_SANITIZE_STRING);         $user_Message     = filter_var($_POST["userMessage"], FILTER_SANITIZE_STRING);              //additional php validation         if(strlen($user_Name)<4) // If length is less than 4 it will throw an HTTP error.         {             header('HTTP/1.1 500 Name is too short or empty!');             exit();         }         if(!filter_var($user_Email, FILTER_VALIDATE_EMAIL)) //email validation         {             header('HTTP/1.1 500 Please enter a valid email!');             exit();         }         if(!is_numeric($user_Phone)) //check entered data is numbers         {             header('HTTP/1.1 500 Only numbers allowed in phone field');             exit();         }         if(strlen($user_Message)<5) //check emtpy message         {             header('HTTP/1.1 500 Too short message! Please enter something.');             exit();         }              //proceed with PHP email.         $headers = 'From: '.$user_Email.'' . "rn" .         'Reply-To: '.$user_Email.'' . "rn" .         'X-Mailer: PHP/' . phpversion();              @$sentMail = mail($to_Email, $subject, $user_Message .'  -'.$user_Name, $headers);              if(!$sentMail)         {             header('HTTP/1.1 500 Could not send mail! Sorry..');             exit();         }else{             echo 'Hi '.$user_Name .', Thank you for your email! ';             echo 'Your email has already arrived in my Inbox, all I need to do is Check it.';         }     }     ?>


URLs of plugin resources?

I am trying to add in a script and css file for my plugin into the admin header. Is there a function similar to `get_bloginfo('url')` that I could use to reference the files correctly without having to hard code url's?


How to disable Wp-PageNavi at the top of the page

By default, the Wp-PageNavi plugin creates 2 pagination links, from the second page onwards - one at the top, and another at the bottom of the page. How can I disable the pagination at the top, keeping only the pagination at the bottom?


On the category page, get the category object

Right, hopefully a nice and simple one... I'm on a category page with the id of 4, I want to get the category object back so I can interogate a few values. I've had a good old look in the WP codex with little success, remember I don't want to get the categories from a post, I want the category object from the current category. Many thanks, Ben :-)


What SQL Query to do a simple find and replace

Whenever I create a new website I first create a staging site on a subdomain like "stage.domain-name.com". After everything works correctly I export the database, open it in notepad++ and do a find/replace for "subdomain.domain-name.com" and replace it with "domain-name.com"... finally I import it into a new database for the live site. My question is... what SQL query would I need to run if I just wanted to do this simple find/replace on the entire database using phpmyadmin? -CH


Custom blog setting directs blog to index page

In WordPress, I've changed the general settings for my web site to use a static page, pointing the Front page to a custom page called 'Home' which inherits from a template page called tpl-home.php and I set the Blog to a custom page, called 'Blog' which inherits from my default blog.php page. However, when I browse to Blog, it shows up the blog posts, but within the index.php page? I've googled this, as it's a common bug that developers run into, but none of the recommended solutions work. How do I know it's the index page if it shows the blog posts? I echo 'Index' in the index.php page :D.


Post type no single page

I have created a post type and I am trying to create a single page for that post type, I am creating a php file called `single-job.php` and it is using the `index.php` as a template. Below is my function for creating the post type:               add_action( 'init', 'register_cpt_job' );     function register_cpt_job() {              $labels = array(              'name' => _x( 'Job posts', 'job' ),             'singular_name' => _x( 'Job post', 'job' ),             'add_new' => _x( 'Add New', 'job' ),             'add_new_item' => _x( 'Add New Job post', 'job' ),             'edit_item' => _x( 'Edit Job post', 'job' ),             'new_item' => _x( 'New Job post', 'job' ),             'view_item' => _x( 'View Job post', 'job' ),             'search_items' => _x( 'Search Job posts', 'job' ),             'not_found' => _x( 'No job posts found', 'job' ),             'not_found_in_trash' => _x( 'No job posts found in Trash', 'job' ),             'parent_item_colon' => _x( 'Parent Job post:', 'job' ),             'menu_name' => _x( 'Job posts', 'job' ),         );              $args = array(              'labels' => $labels,             'hierarchical' => true,                  'supports' => array( 'title', 'editor' ),             'taxonomies' => array( 'category' ),             'public' => true,             'show_ui' => true,             'show_in_menu' => true,                       'show_in_nav_menus' => true,             'publicly_queryable' => true,             'exclude_from_search' => false,             'has_archive' => true,             'query_var' => true,             'can_export' => true,             'rewrite' => true,             'capability_type' => 'post'         );              register_post_type( 'job', $args );     }


Variable not being returned from Ajax Javascript (though javascript receives it)

I'm receiving the variable to JavaScript, but not getting it back in PHP, and I think Its not being coded correctly in the JavaScript:               function glitch_player_display(mix_name) {       alert(mix_name);       throb.start();       jQuery.ajax({         type: 'POST',         url: ajaxglitch_playerajax.ajaxurl,         data: {           action: 'ajaxglitch_player_ajaxhandler',           mix_name: mix_name         },         success: function(data, textStatus, XMLHttpRequest) {           throb.stop();           var showglitchplayer = '#showglitchplayer';           jQuery(showglitchplayer).html('');           jQuery(showglitchplayer).append(data);         },         error: function(MLHttpRequest, textStatus, errorThrown) {           alert(errorThrown);         }       });     }      This is the PHP:               add_action( 'wp_ajax_nopriv_ajaxglitch_player_ajaxhandler', 'ajaxglitch_player_ajaxhandler' );     add_action( 'wp_ajax_ajaxglitch_player_ajaxhandler', 'ajaxglitch_player_ajaxhandler' );          function ajaxglitch_player_ajaxhandler($arguments){       var_dump($arguments);     }      returns empty. Thanks and have a great one.


WP_Query hit max joins... How else can I build a search function that uses custom fields?

I'm trying to search a custom post type of "Properties", while doing so I'm also searching the custom fields using multiple (anywhere from 5-30) meta_queries. The problem is Wordpress or MySQL is throwing an error saying I hit the limit of the amount of JOIN statements that can be used. The error: [The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay] Since I'm using WP_Query is it even possible to set those options? Any other ways I can get around this? Here are an example of my query $args: Here is my $args that I'm passing to WP_Query:                Array     (     [numberposts] => -1     [post_type] => properties     [status] => publish     [tax_query] => Array         (             [relation] => AND             [0] => Array                 (                     [taxonomy] => markets                     [field] => id                     [terms] => Array                         (                             [0] => 27                             [1] => 157                         )                      )              )          [meta_query] => Array         (             [relation] => AND             [0] => Array                 (                     [key] => sleeps                     [value] => 3                     [type] => NUMERIC                     [compare] => >=                 )                  [1] => Array                 (                     [key] => minimum_rate_0_rate                     [value] => Array                         (                             [0] => 999                             [1] => 2750                         )                          [type] => NUMERIC                     [compare] => BETWEEN                 )                  [2] => Array                 (                     [key] => management                     [value] => Array                         (                             [0] => Professionally Managed                             [1] => Privately Owned                         )                          [type] => CHAR                     [compare] => LIKE                 )                  [3] => Array                 (                     [key] => property_type                     [value] => Array                         (                             [0] => Home                             [1] => Condo                         )                          [type] => CHAR                     [compare] => LIKE                 )                  [4] => Array                 (                     [key] => number_of_bedrooms                     [value] => Array                         (                             [0] => 1                             [1] => 15                         )                          [type] => NUMERIC                     [compare] => BETWEEN                 )                  [5] => Array                 (                     [key] => total_number_of_baths                     [value] => Array                         (                             [0] => 1                             [1] => 10                         )                          [type] => NUMERIC                     [compare] => BETWEEN                 )                  [6] => Array                 (                     [key] => pet_policy                     [value] => cat dog                     [type] => CHAR                     [compare] => LIKE                 )                  [7] => Array                 (                     [key] => pools_hot_tubs_and_saunas                     [value] => Array                         (                             [0] => Hot Tub                         )                          [type] => CHAR                     [compare] => LIKE                 )                  [8] => Array                 (                     [key] => appliances_and_furniture                     [value] => Washer                     [type] => CHAR                     [compare] => LIKE                 )                  [9] => Array                 (                     [key] => phone_and_internet                     [value] => Internet                     [type] => CHAR                     [compare] => LIKE                 )              )      )


How to show related posts by category or custom post type?

I'm looking for the best way to go about creating, probably, custom post type where you can filter in the categories related to that custom post type in the sidebar. Here is the website I'm working on. Originally the student and donor profiles should be some type of post or category that can dynamically be updated when a new profile is created. So Health & Science, Student Success and Creative community have their own set of specific profiles. So lets say John Doe is a new student profile for Student Success I can tag him to feed through that page alone and when viewing his individual post I'm having trouble displaying the categories or profiles that are related, in this case Student Success. So when viewing John Doe's profile the other profiles under student success should be listed on the sidebar. I noticed wordpress shares the single.php template file so the sidebar I have for the single.php file is being used for the profiles which we don't want. Overall, if you run through Health & Science, Student Success and Creative community I'm looking for a set up like that but instead of a 4 step process that the client has to do when uploading a new profile I am looking for just a one step process. My current set up is you add the new profile as a page then go to the menus area in the dashboard and add the new profile to the menu. My current page template code.


Media is not getting uploaded on specific site using wordpress xml-rpc

I am using WordPress XML-RPC to create post from one WordPress site to another WordPress site. Following is my code, my code is using these two functions.                   function rtp_xml_rpc_create_post_thumbnail($attachment_id, $post_id = '') {              $myFile = get_attached_file($attachment_id);         $fh = fopen($myFile, 'rb');         $fs = filesize($myFile);         $file = fread($fh, $fs);         fclose($fh);              $data = array(             'name' => basename(get_attached_file($attachment_id)), //$attachment->post_title,             'type' => get_post_mime_type($attachment_id),             'bits' => new IXR_Base64($file), // get_attached_file( $attachment_id)             'overwrite' => true         );              if ($post_id) {             $data['post_id'] = $post_id;         }              return $this->create_attachment($data);     }                   /* Create remote attachment */          function create_attachment($data, $encoding = 'UTF-8') {              if (is_array($data)) {             $xmlrpc = $this->XMLRPCURL;             $client = new IXR_Client($xmlrpc);             $client->debug = true;             $params = $data;             ob_start();             $res = $client->query('wp.uploadFile', 0, $this->UserName, $this->PassWord, $params);             ob_end_clean();                  $status = $client->getResponse();             return $status;         }         return false;     }      When I am using same code to create post on other sites, it seems to work appropriately and post is getting created and media is also getting uploaded. But when I am trying on the actual site where I want to upload the media and create the post, problem is occurring. Post is getting created but media is not uploading. When I see on target site, I noticed that featured image has been assigned to post but image seems to be broken. I think there should be some issue on target site, please let me know if anyone has idea of what the actual problem is. Thank in advance for any help.


How to update my own theme?

I've created my own theme and I updated like following.   1. Zip my local theme.   2. Upload the zip file to wordpress themes directory in server.   3. Set wordpress theme to default(twentythirteen).   4. login to server and `cd` to wordpress themes directory.   5. `rm -rf mytheme; unzip mytheme.zip`   6. Change theme to "mytheme" again. I think this is little complicated. Is there way that I can do it more easily? Especially I want to omit "change theme setting" parts ("3" and "6"). Removing and Unzip take only per second at most. I don't care if my site shows error page in that short time.


Woocommerce "There was a problem connecting to the payment gateway."

I have recently completed a server transfer and am having troubles with the eWay payments on the site. When I checkout with PayPal it's all honky-dory however when I select Credit Card (eWay) I get the following error:               Connection error:: "There was a problem connecting to the payment gateway."      I have tried a google search but I am unable to find any form of help aside from "Contact the developer" Has anybody experienced this and come up with a solution? All the settings and files are the same as the old server and the HTTPS is configured correctly.


Validating custom fields before post save

After much unsuccessful searching, I'm hoping someone here can help me out. I am using Advanced Customs Fields (I assume most people are familiar) to create a post from the front end. I want to validate a field, and make sure there is a value before I save anything to the database. I have this function, but the two meta values I'm checking always return false (possibly because the meta values haven't been saved yet?) and I can't figure out how to check them before saving the post. Any tips appreciated. Thanks.               //Create new Custom Design post from frontend     function my_pre_save_post( $post_id )     {     // check if this is to be a new post     if( $post_id != 'new' )     {         return $post_id;     }     if (get_post_meta($post_id, 'upload_image', true) || get_post_meta($post_id, 'submit_link', true)) {              // Create a new post         global $current_user;           get_currentuserinfo();                $title = $current_user->user_email.'-'.get_date();              $post = array(             'post_status'  => 'publish' ,             'post_title'  => $title,             'post_type'  => 'custom-designs' ,         );                // insert the post         $post_id = wp_insert_post( $post );               // update $_POST['return']         $_POST['return'] = add_query_arg( array('post_id' => $post_id, 'submitted' => 'true', 'custom-error' => false), $_POST['return'] );                  // return the new ID         return $post_id;     } else {         wp_redirect(add_query_arg(array('custom-error' => 'true'), $_POST['return']));          exit;     }     }      add_filter('acf/pre_save_post' , 'my_pre_save_post' );


Multiple posts categorized by day?

I would like to set up my home page so that multiple post uploads (with no limit to the number of posts which can be uploaded) can be categorized by the day. These post uploads will mostly be videos, although some may be text posts. Here's an example of what I mean. Can this be done using archives?


woocommerce show products by custom field on non-shop page

I have added some custom fields to my products in woocommerce. I would like to use those same custom fields in a function that outputs product data based on custom field info. I first need to access my product data from another page other than 'shop' as this is going to part of a customer interaction piece of the site. For example, if I wanted to output all products that have value "tweed" in custom field "fabric", how would I do that from a page that isn't the main product page. Here is a piece of the code that I've tried. But woocommerce_page_title isn't outputting.               <?php $key_1 = get_post_meta($post->ID, 'fabric', true);            if($key_1 == 'tweed') {          echo 'check out the following products:';          echo do_shortcode('[woocommerce_page_title]');       } else {}      ?>


How can I Direct custom post type to template

For example: I have a custom post type named mycustom. in mycustom i have taxsonomy called "type". I want all the types, belonging to mycustom, will appear in the Template category-mycustom. Also, all the posts belong to mycustom appear in the Template single-mycustom


Items By Group added to custom post type

Ok, not real sure how to explain this. But i have an existing custom post type with some custom fields that is working fine for detailed information about an event. what i am trying to do now is to add items from a pre-existing table to a certain category for this event. like, event1 has details event one has three categories associated with it - FOOD, MUSIC, CRAFTS i have a table that holds say vendors in it (add, edit delete already working). i need to add a ajax type area to the admin side of the custom post type to be able to add any vendor to one of the categories. so if i went to the event custom post type and wanted to add McDonalds to the food category for this weekends event, i would just use a select box and add it. I could also add Ozzy Osbourne to the Music category for this event. I could also add Wendys to the FOOD category. hopefully this makes since. thanks in advance for any assistance.


Auto add pages to primary menu with functions.php

Is it possible to have new pages automatically added to the primary menu via functions.php? This particular theme will be deployed on a special version of multisite, so the checkbox which is available via admin isn't an option. I can't seem to find anything in codex or on here.


Automatic updates of plugins and themes outside of wordpress.org

I'm finding it surprisingly difficult to find any info on standardized ways of updating a "private" plugin that does not exist in the wordpress.org repositories. I've seen -- and bought -- plenty of premium plugins that often have updates available via the WordPress admin, so it's obviously possible. Is there a "WordPress" way of doing this? I feel like there should be an API to handle this, and would expect at least some tutorials on how to do this, but I'm having trouble finding something useful. I'm very much interested to bake this functionality into a plugin that I'm developing. I'm not interested in third-party plugins that do this for me, because I don't want the dependency. What are the current options for non-dot-org plugins and themes to be updated via admin?


Why doesn't my WordPress page show the most recent post?

I was wondering if someone could help me with the following. My news page on my WordPress website doesn't show the most recent blog post, which I want it to do. The code I have is:
                          <?php                     $i = 1;                     if(have_posts() ) : while(have_posts() ) : the_post();                         $thumb = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );                     ?>                     <article <?php post_class(); ?>>

                                 <?php                                  if(has_post_thumbnail() ) {                                      if($i <= 0) {                                         $extra = 'big';                                         $width = 800;                                         $height = 300;                                     }                                     else {                                         $extra = 'small';                                         $width = 500;                                         $height = 400;                                     }                                     ?>                                     <figure class='<?php echo $extra;?>-figure'>                                         <a href="<?php the_permalink();?>">                                             <img src="<?php echo aq_resize($thumb, $width, $height, true); ?>" alt="<?php the_title();?>" />
                                 <?php } ?>                                 <div class='text <?php echo $extra;?>-figure'>
                                         <a href="<?php the_permalink();?>"><?php the_title();?>
                                                                              <?php                                          _e('posted by', 'Teo'); echo ' ';                                          the_author_posts_link(); echo ' ';                                         ?>
                                         <?php global $more; $more = 0; the_content('');?>

                                         <a href="<?php the_permalink();?>" class='btn btn-primary btn-large pull-right learn-more'><?php _e('Read More', 'Teo');?>

                     <?php endwhile;                      echo '
';                     get_template_part('includes/pagination');                      endif; wp_reset_query(); ?>
      If anyone can help or point me in the right direction, it would be greatly appreciated! :-)


filter "inactive" categories from wp_list_categories?

I'd like to add a checkbox to the category editor screen to allow the category to be "deactivated" (perhaps while the site owner works on the category content and posts). Once I've done this, what are my options for excluding the category's that are set to "inactive"? One way I'm thinking I can do this is to just run a filter on wp_list_categories and in the exlude= list, I'd just insert a utility function that returns all cat_ids where inactive is checked true. Are there other ways to do this?


go backto post screen default option

I have a problem with showing Post>all post button.when I click on all post its not loading showing error 503/500 internal server error.I know the problem is for long list of post (100 post in each page). I want to go back to default screen option setting (20 post) per page. I cant do it from wp admin dashboard be cause time out problem. How do I do that? Any help will be appreciated?


Post thats in Two Categories, only want to display name for one

In my Wordpress site I've created, I'm having issues hiding or not displaying one of the category titles I set up. I'll try to explain better.    **Wordpress Admin Side** I have a post that is in two categories, a "`Work`" & "`Front_Page`"    **Main Page / index.php** On my main index page, I have 3 features below the header image. One of those features is a "Featured Project". This is how I'm starting the loop...    **Single Project Page** Now on this page, the visual layout is Category Name   Which is called `<h2 class="single_category"><?=$cat[0]->name;?></h2>` Project Title   Large Header Image   Project Desription   **THE PROBLEM!!!** For whichever post I put in "`Front_Page`", it displays that in the Category Name. I want it to default to the main category. Is there a way to basically say "if post is in "`front_page`" category, don't display "`front_page`" category as name?


Wordpress plugin: admin-ajax.php not passing data to custom function

n this basic plugin skeleton, I am trying to get the data sent by ajax to wordpress admin-ajax.php to be processed by a custom function. It looks like the data send from the form does not reach my ea_ajax_handler() function. It seems to arrive to admin-ajax.php (the form data is collected by jQuery, then I get a 200 response for the post request to admin-ajax.php), but it looks like it not forwarded to ea_ajax_handler(). Here are my files: easyA.php:               /** Enqueue scripts */     add_action('wp_enqueue_scripts', 'ea_scripts');          function ea_scripts()     {         wp_enqueue_script('jquery');         // easyA script in the footer         wp_register_script('easyA', plugins_url('js/easyA.js', __FILE__), array('jquery'), '', true);         wp_enqueue_script('easyA'); // wondering if it's really needed or if the previous line is enough...         wp_localize_script('easyA', 'easyAVars', array('ajaxUrl' => admin_url('admin-ajax.php')));     }          /** Shortcode to display form in pages / posts */     add_shortcode('easyA','ea_display_form');          function ea_display_form()     {         echo '             <form id="eaForm">                 <input type="text" name="username" />                 <input type="submit" value="Submit" />             </form>             ';     }          /** Event handling */     add_action('wp_ajax_ea_ajax_handler', 'ea_ajax_handler');     add_action('wp_ajax_nopriv_ea_ajax_handler', 'ea_ajax_handler');          function ea_ajax_handler()      {         $json = array(             'success' => false,             'result'  => 0         );              if (isset($_POST['username'])) {             $result = 'Hi, ' . $_POST['username'] . '!';                  $json['success'] = true;             $json['result'] = $result;         }              echo json_encode($json);         wp_die();     }      easyA.js:               jQuery(document).ready(function($) {         $('#eaForm').on('submit', function() {             var that = $(this),                 contents = that.serialize();                  console.log('contents: ' + contents); // debugging             jQuery.ajax({                 url: easyAVars.ajaxUrl,                 dataType: 'json',                 type: 'post',                 data: contents,                 action: 'ea_ajax_handler', // function in easyA.php that will be triggered                 success: function(data) {                     console.log(data);                 }             });                  return false;         });     });


Categories not working - 404 Not found error

I have a community blog at thelazy.info . All things are working except the category. When you click on any category it gives 404 Not found error. I tried searching out myself but couldn't come up with a plausible relation. Can anybody guess how can I go with this error.               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # BEGIN WPSuperCache     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     AddDefaultCharset UTF-8     RewriteCond %{REQUEST_URI} !^.*[^/]$     RewriteCond %{REQUEST_URI} !^.*//.*$     RewriteCond %{REQUEST_METHOD} !POST     RewriteCond %{QUERY_STRING} !.*=.*     RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$     RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]     RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]     RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]     RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]     RewriteCond %{HTTP:Accept-Encoding} gzip     RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f     RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz" [L]          RewriteCond %{REQUEST_URI} !^.*[^/]$     RewriteCond %{REQUEST_URI} !^.*//.*$     RewriteCond %{REQUEST_METHOD} !POST     RewriteCond %{QUERY_STRING} !.*=.*     RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$     RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]     RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]     RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]     RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]     RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f     RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html" [L]     </IfModule>          # END WPSuperCache          # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>


301 Redirect /author/username/ to /profile/username/

I have changed the `/author/` slug to `/profile/` by adding the following code in the file `functions.php`:               function new_author_base() {     global $wp_rewrite;     $author_slug = 'profile';     $wp_rewrite->author_base = $author_slug;     }     add_action('init', 'new_author_base');      Since Google is crawling my author pages now I need to redirect the old `/author/` urls to the new `/profile/` ones in the `.htaccess`... Any ideas?


Flickr plugin that will display photos from multiple group pools?

Does anyone know of a WordPress plugin that will pull in photos from multiple flickr group pools, and display random thumbnails in the sidebar? There are a ton of flickr plugins, and I just can't seem to find one that'll support multiple group pools. Something that will accept multiple rss feeds and display pictures from all of them would also be acceptable. Thanks!


I'm looking for some good references (manuals)

I started a blog recently. Currently I'm using a free theme and some plugins that are working well enough for now. And, my overall goal is to produce content and not become a WordPress developer, etc. In the meantime, I do need to upgrade my technical skills. I have one goal of customizing my current theme within 1 -3 months and potentially developing a custom theme in 6 - 8 months. I am looking for recommendations on books, ebooks, or websites to help me with the following:   * CSS - beginning to intermediate level   * PHP - beginning - I'm not interested in becoming a coder, but want to be able to tweak, troubleshoot and understand better.   * XHTML - beginning to intermediate level - 10 years ago I did HTML coding, but then moved into management. Obviously there is a huge amount of info on this via Google, etc. I'm hoping for some practical suggestions from the experts in order to avoid dead ends. thanks. -wdypdx22


Building useful features into your theme

My site has a theme which I created myself, and while it works, I often have to tweak the theme or use plugins to modify the appearance or behaviour. I've been looking at ways to modify my theme so that there's less jumping around to make changes. Ideas include some basic SEO, gallery functionality, fields for analytics and feedburner, and widgets. What features do you consider useful to build into a theme to reduce modifying it later or having to use plugins?


Omitted Content After Post-Publish Insertion

I have a string that contains $thehtml but whenever I insert it manually into a custom post it appears that wordpress alters/strips down the html.... I've already tested/outputted $thehtml string in a separate file and its fine.. but wordpress seems to edit/strip the html I insert.... I am inserting via....               $post_information = array(     'post_content' => $thehtml,     );     wp_insert_post( $post_information );      Example of $thehtml
INFORMATION REQUIRED IN PROXY STATEMENT
      **After Insertion**.... When I look at HTML in wordpress:
INFORMATION REQUIRED IN PROXY STATEMENT


GPL and plugins

The Plugin developer center says "Your plugin must be GPLv2 Compatible.". But I found that the Topsy plugin is under GPLv3. http://www.gnu.org/licenses/rms- why-gplv3.html states that GPLv2 and GPLv3 are incompatible. So should this be allowed? I want to use some code from the Topsy plugin. Then, should I release my plugin under GPLv2 or GPLv3 ??


Cant' Display Custom Post Type Title Base on Tax Terms

Trying to list all Custom Post Type titles based on filtered Custom Taxonomy Terms I am getting the list of all post titles instead of getting the list of Queried post. Here is the code I am using:               <?php $loop = new WP_Query(         array(              'post_type' => 'photos',              'technique' => 'zevar',              'post_child' => 0,              'posts_per_page' => 10         )      ); ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>     <?php the_title(); ?>      <?php endwhile; ?>      As you can see I have a Custom Post Type called "photos" and Custom Taxonomy registered as "technique". Under Taxonomy "technique" I have some terms which one of them is "zevar". Can you please let me know what I am doing wrong here?


Exclude posts with taxonomy term from appearing on home page query

I am really confused about this one, I am usually pretty good at working out basic queries but I can't seem to work this one out. Please see below my index.php query. Now it is not your basic query because I have a special drop down menu to filter posts on the home page. I have a taxonomy set up called **Site Position** , and my term is called **Home Page Exclude**. This taxonomy is assigned to my posts. In an array slug style, I use this in my WP_querys.. `'position' => 'home- page-position',` But the term I wish to exclude, as a slug is called `home-page-exclude`    My question is, from this slightly more complex query below.. how can I exclude all posts with this term??               <?php                  if ($_REQUEST['sort'] == 'oldest')                      $order = "&orderby=date&order=ASC";                  else if ($_REQUEST['sort'] == 'views')                      $order = "&meta_key=views&orderby=meta_value_num&order=DESC";                  else                      $order = "&orderby=date&order=DESC";              ?>              <form method="post" id="order">                  <?php $url = get_bloginfo('url');?>             <select name="sort" onchange='location.href="<?php echo $url ?>?sort="+this.value'>                 <option value="newest" <?php if (isset($_REQUEST['sort']) && $_REQUEST['sort'] == 'newest' ){ ?> selected="selected" <?php } ?> >Sort by Newest</option> <!-- default -->                 <option value="oldest" <?php if (isset($_REQUEST['sort']) && $_REQUEST['sort'] == 'oldest' ){ ?> selected="selected" <?php } ?> >Sort by Oldest</option>                 <option value="views" <?php if (isset($_REQUEST['sort']) && $_REQUEST['sort'] == 'views' ){ ?> selected="selected" <?php } ?> >Sort by Most Viewed</option>             </select>              </form>                    <?php wp_reset_query(); $posts = query_posts($query_string . $order); ?>          <?php if (have_posts()) : ?>          <?php while (have_posts()) : the_post(); ?>            This is what I have tried but doesn't work.               <?php                  $tax_query = array (                 array(                     'taxonomy' => 'position',                     'terms' => 'home-page-exclude',                     'field' => 'slug',                     'operator' => 'NOT IN'                 )             );                  if ($_REQUEST['sort'] == 'oldest')                      $order = "&orderby=date&order=ASC";                  else if ($_REQUEST['sort'] == 'views')                      $order = "&meta_key=views&orderby=meta_value_num&order=DESC";                  else                      $order = "&orderby=date&order=DESC";              ?>              <form method="post" id="order">                  <?php $url = get_bloginfo('url');?>             <select name="sort" onchange='location.href="<?php echo $url ?>?sort="+this.value'>                 <option value="newest" <?php if(isset($_REQUEST['sort']) && $_REQUEST['sort'] == 'newest' ){ ?> selected="selected" <?php } ?> >Sort by Newest</option> <!-- default -->                 <option value="oldest" <?php if(isset($_REQUEST['sort']) && $_REQUEST['sort'] == 'oldest' ){ ?> selected="selected" <?php } ?> >Sort by Oldest</option>                 <option value="views" <?php if(isset($_REQUEST['sort']) && $_REQUEST['sort'] == 'views' ){ ?> selected="selected" <?php } ?> >Sort by Most Viewed</option>             </select>              </form>          </div>          <?php wp_reset_query(); $posts = query_posts( $query_string . $order . $tax_query ); ?>          <?php if (have_posts()) : ?>          <?php while (have_posts()) : the_post(); ?>         Any ideas would be very awesome thanks.


Uninstalling IntenseDebate

I have been using the IntenseDebate Comments plugin, but am unhappy with it and would like to uninstall. Supposedly due to the data synchronization feature, it shouldn't be a problem to just disable and remove it, but of course there's nothing on their support site about how to uninstall... Does anyone with experience removing it have survival tips for me? Also, what will I _lose_ in the process of uninstalling (e.g. Gravatar icons)?


How to get WP to run plugin code triggered by an external site hook?

I have written a plugin to sync data from a WP blog to an external website. Changes to made to the external site also sync back to the WP blog. Right now the external website executes a POST request to a file called hook.php which lives inside my plugin folder. However, due to security issues, I would rather have the call go through the WP system instead of directly to a file in the plugin folder. How can I make this happen ? thanks.


Is there a way to import terms into Wordpress?

I'm tired of typing in lists of counries in my "Countries" taxonomies. What's a good way to bulk import a long list of terms into Wordpress ?


Any advice on customising this twitter feed?

I'm really having trouble locating the documentation for the Recent Tweets widget anywhere. It's not a plugin and appears to be native. All I want to do is to be able to move the `tweet_time` underneath the `tweet_text`. If you take a look at the website, you'll be able to see the time of the tweet is on top of the actual tweet text, and I want to reverse the order.


Using window.onload with Ubermenu

I am using a plugin to place this code on specific pages. But it is not firing correctly. Has anyone had experience working with Ubermenu, WP and jQuery? Do I have to call jQuery into my `<script></script>` or should I scrap all this and go with through conditional tags? Like this               <?php     $page = array( 42, 'page id', 'Page Title' );          if ( is_page($page) || is_single($post) ) {     ?>     <script type="text/javascript">     window.onload=function(){$('#menu-item-156').mouseover(function(){     $(this).find('ul').slideDown();     });          $('#menu-item-156').trigger('mouseover');};     </script>     <?php  }  ?>


HTML added to editor when deleting shortcodes in Chrome browser

Example:               [shortcode1][/shortcode1]     [shortcode2][/shortcode2]      In the above example, using the google chrome web browser, while in visual mode in the post editor, highlight shortcode 1 by **_triple-clicking_** and click the delete key to remove it (remove the entire shortcode 1 element, open and close tags). Now, click over to the "Text" view of the editor. The resulting html is:               [shortcode2][/shortcode2]      I should also mention that I have an editor-style.css file which contains the following css rules:               @charset 'utf-8';     html .mceContentBody{max-width: 550px;}     body     {         color: #555;         font-family:'Calibri', Helvetica, Arial, sans-serif;         text-rendering: optimizeLegibility;         vertical-align: baseline;         font-size:14px;         line-height:1.5em;     }      I believe the editor is picking up the line-height:1.5em from the editor- style.css , but why? _Update: I'm using Google Chrome Version 26.0.1410.65_


How can I add a custom script to footer of login page?

I need to add this:               <script>     jQuery(window).load(function() {     jQuery('.janrainContent').css('border','0px');jQuery('.janrainContent').css('width','252px');jQuery('#janrainAuthReturnExperience').css('width','252px');     });     </script>      Right before the closing tag of the Wordpress login page's `</body>` tag.   How do you do it? Would I use a combination of `login_enqueue_scripts` and `wp_enqueue_scripts` and set `$in_footer` to true? I'm not entirely sure how I would do that either...


Show results for multiple page-types

First of all sorry for my earlier post, it was just too confusing, and I asked 3 questions in 1... Okay the code below gets be all the pages with the page type               page_library_html_content.php      now I would like to add to this code and have it show all the pages with page type               page_library_css_content.php      too. So I will get all the pages with these two page types. **Code**               <?php     $product_pages_args = array(         'meta_key' => '_wp_page_template',         'meta_value' => 'page_library_html_content.php',         'hierarchical' => '0',     );     $product_pages = get_pages( $product_pages_args );     ?>          <?php     foreach ( $product_pages as $product_page ) {         $author_id =  get_post_field('post_author', $product_page->ID );         $author_details = get_user_by( 'id', $author_id );         $author_name = $author_details->first_name . ' ' . $author_details->last_name;                echo '

';         echo '
ID ) . '">' . $product_page->post_title  . '
';         echo '
' . get_post_field('post_content', $product_page->ID ) . '
';          echo '
Tutorial Instructor:  ' . $author_name . '
';         echo '
' . get_avatar( $author_id , 32 ) . '

';;          }     ?>


Remove header text option from the backend

I want to remove the _header text_ option from WordPress backend, under the _Appearance->Header page_ at the bottom. ![Screen Dump](http://i.gyazo.com/0ab128502a675c3f7eee13db0cfedefe.png) Is there any hook or filter to remove this option from the backend? Thanks!


Display an authors post on a single page only when they are logged in

I am having trouble finding a solution or the correct tutorial on how to get this done, I have been looking for weeks and still no outcome. What I am trying to accomplish is display all post on the front end (single.php) of an author (Author A) who is logged on. When Author A logs off all the posts on single.php will be removed leaving a message (you must be logged in to view this page). Then when Author B logs on all of Authors B post will be displayed on single.php. Each post is being generate by a custom post type called projects, which have the ability to assign an author. I am trying to accomplish this without a plugin. Any help would be appreciated.


Page template with custom query instead of archive-xxx.php?

I have created a custom post type and I would like to list the posts. I have choosen a page template with a custom query instead of archive-xy.php to list the posts because the user would like to edit the content on the page. The custom query works, but if I create a page with slug XY and I open the page, the template is not working, I only see the the default layout (index.php). I've renamed it to for example to xy-2 and it works. Is it possible to disable the domain.com/xy, because it's using the blog layout? (because no archive-xy.php).


Term Checklist Walker - Disable Parent Categories

Currently I have a structure where the top level categories are acting like landing pages, so they should have no posts directly assigned to them. What I would like to do is disable the top level terms and only allow the user to check sub-terms (children). I've found a walker which transforms checkboxes to radio buttons here but I don't quite understand it enough to only change the top level parent, it keeps cascading. Was hoping somebody could break down what is going on in this walker with the main question being "How do I disable top level terms in the admin panel term metabox"               /**      * Use radio inputs instead of checkboxes for term checklists in specified taxonomies.      * http://wordpress.stackexchange.com/questions/139269/wordpress-taxonomy-radio-buttons      *      * @param   array   $args      * @return  array      */     function wpse_139269_term_radio_checklist( $args ) {         if ( ! empty( $args['taxonomy'] ) && ($args['taxonomy'] === 'product_cat') ) {             if ( empty( $args['walker'] ) || is_a( $args['walker'], 'Walker' ) ) {                 if ( ! class_exists( 'WPSE_139269_Walker_Category_Radio_Checklist' ) ) {                     class WPSE_139269_Walker_Category_Radio_Checklist extends Walker_Category_Checklist {                         function walk( $elements, $max_depth, $args = array() ) {                             $output = parent::walk( $elements, $max_depth, $args );                                  foreach($elements as $element){                                 if($element->parent == 0){                                     $output = str_replace(                                         array( 'type="checkbox"', "type='checkbox'" ),                                         array( 'type="checkbox"', "type='checkbox' disabled='disabled'" ),                                         $output                                     );                                 }                             }                                  return $output;                         }                     }                 }                      $args['walker'] = new WPSE_139269_Walker_Category_Radio_Checklist;             }         }              return $args;     }     add_filter( 'wp_terms_checklist_args', 'wpse_139269_term_radio_checklist' );      elements holds all the terms in an array so I use that to test whether that element has a parent in my foreach then I try to replace some output and append my disabled flag (much like the linked question turns checkboxes into radio buttons).


Is there a method or plugin that will allow posts to be sortable by Facebook likes?

I'm just wondering if anyone knows of a method or plugin that I can implement that will keep track of Facebook likes within Wordpress posts, and allow me to show posts in order of "most liked"?