title: How does Wordpress handle HTML Tables interaction with jQuery

text: I have javascript that gets the width of a table and reduces the css fontsize of text within the table until the table width is less then the width of its parent div. The code bellow shows the principle ONLY. This approach works out side Wordpress. Within Wordpress the fontsize is reduced to 0px and the width of the table width shrinks, but remains wider than the width of its parent. Outside wordpress the browser adjust the table width to fit the text. So how does Wordpress handle HTML Tables different?               function ShrinkTable() {     var FontSize = parseInt($("#tbl").css('font-size').replace('px', ''),10);     var TabWidth = jQuery("#tbl").width();     var DivWidth = jQuery("#narrorColumn");     if (parseInt(DivWidth.css('width').replace('px', ''),10) <= TabWidth) {         jQuery("#tbl").css('font-size', FontSize - 1 + 'px'); /* you can change 4 with any number, the smaller is better but it may require more loop */         //Shrink the font while div width is less than table width         ShrinkTable();       }     }


title: Run wp_kses_decode_entities on atom feed?

text: I would like to convert the htmlentities in only my atom feed to their corresponding characters. Using the below in my functions.php I've gotten close, but obviously the commented out line doesn't work, and the change is applied to all of my feeds. Is there a way to do this using filters/hooks? Thanks.               function decode_feed_entities($content) {         return wp_kses_decode_entities($content);     }     // add_filter('do_feed_atom', 'decode_feed_entities');     add_filter('the_content_feed', 'decode_feed_entities');     add_filter('the_excerpt_rss', 'decode_feed_entities');


title: Use ajax to update_post_meta

text: 2 days ago I asked this then I tried to work on my code to be able to understand how ajax and php work and now I have a new issue that, probably would be easily solved. These are my codes:               <?php     /*     Template Name: Nuovo form     */     ?>     <html>      <head>          <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>          <script src="http://malsup.github.com/jquery.form.js"></script>               <script>              // wait for the DOM to be loaded              $(document).ready(function() {                  // bind 'myForm' and provide a simple callback function                  $('#myForm').ajaxForm(function() {                      alert("Thank you for your comment!");                  });              });          </script>      <?php wp_head();?>     </head>      <body>     <form id="myForm" action="<?php echo get_template_directory_uri();?>/nuovoform/comment.php" method="post">          Name: <input type="text" name="name" />          Comment: <textarea name="comment"></textarea>          <input type="submit" value="Submit Comment" />      </form>     </body>     </html>      Then this is my Comment.php               <?php      // This is comment.php content     $nuovoform = 0;     $nuovocommento = 1;     if ( isset( $_POST['name'] )){     $nuovoform = $_POST['name'];}     if ( isset( $_POST['comment'] )){     $nuovocommento = $_POST['comment'];}     update_post_meta($post->ID,'varcontrollo',$nuovoform);     $controlliamo = get_post_meta($post->ID, 'varcontrollo', true);     ?>      'varcontrollo' is a custom meta field created using Custom Field Template plugin. What I'm trying to do is use the form I created to store the result inside my custom field. If I try to browse to comment.php it says this: > Fatal error: Call to undefined function update_post_meta() in > D:\Locali\xampp\htdocs\wp-content\themes\slotlandia\nuovoform\comment.php on > line 8 Probably i have to 'import' WordPress 'global' variables but I don't know what have I to write. Is there anyone who can help me? Thank you very much.


title: Inconsistent translation on a WP site

text: I have a WP site that I installed with the French translation, as provided by Wordpress France, and which is quite accurate. I wanted to apply an English- only theme, which is not using the PO files, but rather has all text hard- coded in the PHP code. I translated all files, but I noticed that when I display the home page, some of the words remain in English, but whenever I display something other than the home page, those are all in French. Is there something either in Wordpress or the theme files that actually make a distinction between the home page and others to display different pieces of text ?


title: Custom user profile URLs

text: I have created a page "profile" that when visited with get variable of user id like:               http://example.com/profile/?uid=1      Then it will display the profile details of user id `1`. Now I want to rewrite …               http://example.com/profile/?uid=1       … to …               http://example.com/profile/admin       How to accomplish this?


title: Moving Site From Development to Production

text: I have a WordPress site at the root of a bluehost account ( inside public_html ) and there is an add-on domain also residing in a folder named devsite inside public_html. We have spent months developing the content in the devsite to be ready to promote to production. On Saturday, I made a control panel snapshot and downloaded copies of both the current production site as well as the development site. Then I tried the upgrade. The first way I tried was to use a tool called DesktopServer on my Mac to import the devsite. That worked. I then tried to deploy it to the production domain as per instructions but the deployment failed. I restored the site via the snapshot. On Sunday I tried the "WordPress" way of FTPing the files to public_html and exporting the database, fixing the links using "Search & Replace for Wordpress databases" and modifying the WP-Config to point to the new database. None of the pages on the site transferred, the menus didn't transfer, the widgets were not set ... in short, the promotion was a disaster. Today, I tried the DesktopServer method on the Windows 7 machine at work. However, after making the site archive, DesktopServer reports that it is unable to locate the main index.php in the site archive but I checked and it is there. I am out of ideas on how to move this site to production and would appreciate and guidance or help. Thanks, Jon


title: wp_insert_post creating duplicate post with Safari

text:
I have a front end form users use to create custom posts. It works fine with Chrome and FF, but when in Safari two posts are created. The code i'm using is below. I've tried a few conditionals shown in other answers but none worked. How can I prevent wp_insert_post from creating duplicate posts when submitted from Safari? Thanks               if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) &&  $_POST['action'] == "new_post") {          $tags = $_POST['post_tags'];          $new_post = array(         'post_title'    => $title,         'post_content'  => $description,         'post_category' => array($_POST['cat']),         'tags_input'    => array($tags),         'post_status'   => 'publish',etc.         'post_type' => 'website'     );          global $current_user;     get_currentuserinfo();          $user_name = strtolower($current_user->user_login);  //custom caps will default to lowercase anyway     $pid = wp_insert_post($new_post);          update_post_meta($pid, "s2member_ccaps_req", $user_name, true);          wp_redirect( get_permalink($pid) );      exit();      The form                               <form id="new_post" name="new_post" method="post" action="">
Title
                         <input type="text" id="title" value="" tabindex="1" size="20" name="title" />

Category:

<?php wp_dropdown_categories( 'tab_index=3&taxonomy=category' ); ?>

Content
                         <textarea id="description" tabindex="4" name="description" cols="50" rows="6"></textarea>

Tags:                         <input type="text" value="" tabindex="5" size="16" name="post_tags" id="post_tags" />

<input type="submit" value="Publish" tabindex="6" id="submit" name="submit" />
                              <input type="hidden" name="action" value="new_post" />                         <?php wp_nonce_field( 'new-post' ); ?>                     </form>


title: Prevent plug-in scripts on a specific template?

text: I have a plug-in which is interfering with my Google Map Embed in the template I'm using for my about page. Is there a way to prevent that plug-in from hooking in all of it's script files through wp_footer just on that particular template. It adds like 4 js files which aren't necessary for that page/template.


title: Wordpress 3.5 Media Manager - Default view to "Uploaded to this post"

text: I'm trying to figure out how to default the select box above the media gallery in the new media manager so that it shows the images "uploaded to this post" by default. I can't seem to find a way that works properly. Thx folks.


title: Wordpress 3.5 Media Manager - Reorder Selectbox items on Media Library Tab

text: The new media library is awesome but its a bit inefficient. When the page loads, it puts ALL MEDIA ITEMS as the default view. Which causes the page to load a LOT of images. I'd like it to default to "Uploaded to this post". I've tried other solutions, such as changing the default selection Change the default-view of Media Library in 3.5? But this is done via JS and when there's a lot of images on the page, it first starts loading the "ALL MEDIA ITEMS" tab and then switches tabs to "Uploaded to this post" so I think the better way to do this would be to reorder the select box so that "Uploaded to this post" is first and the default. I'm not sure how to go about doing that. Or if its even possible with filters. Would love some feedback from the experts. Thanks!


Is there a hook for user activation (after they click the email confirm)? I am creating a plugin to automatically add them to my email software, but I want them to have to confirm their email first.


title: How to Get All Posts but the Private ones?

text: I am creating a frontend mosaic view where i need to show the most recent posts. So i need to show all published posts to every visitor, but keep the private ones for the logged in users. I know how to add the private posts, but I don't find a way to remove them from the query. (Removing them from the results would work but, then, the number of posts on the page will vary depending on how many recent posts are private: this is not what I want!) (As a workaround, I can refrain from publishing the private posts and showing the private on top of the published for the members...) Any idea?


title: SetCookie simply not working

text: I cannot get a cookie to set properly through WordPress theme. I am putting the following code on the bottom of my `functions.php` page for my theme.               function set_cookie() {     if (isset($_GET['id'])) {         $referrerID = $_GET['id'];             setcookie('referrerid', $referrerID,time()+ 3600 * 24, COOKIEPATH, COOKIE_DOMAIN, false);         }     }     add_action( 'init', 'set_cookie');      I even went as far as using JavaScript to alert if the script reached the function (which it did). Why are my cookies not being set?? (The code works locally - outside of WordPress that is).


title: How to add attachment without uploading?

text: When save post, I made dir in wp_uploads_dir, and copied 2 files and one folder in this dir. Now I want to do the WP_insert_attatchment process to make the 2 files as attachements. How can I do it? Edit: I inset_attatchement by directly using their URL. Now they show up in Media Libray, but I can't see whether the attachment_id is recorded or not. Which table in database can I go to find it?


title: How to get child categories of a given Post

text: how do I get names of child categories of an arbitrary Post? For example i got category slug - 'motorbikes' and I got subcategories for it. So I need to get each posts subcategory name thats inside category with slug motorbikes. Y2ok


title: How to Do Custom Fields to Output a Definition List

text:
So, I'd like to add some custom write panels when you go to write a new post in the WP admin. I'd like it to have a heading for each, and then a text input field where I can write in some text. I would need it to be inserted into the single.php file, and then output as a definition list. So, each custom field heading would be a pre-determined , like "Materials Needed" (without the quotes...), and then whatever I put within the blank text field would spit out as a . Here's an example of what it would need to output as...

Purpose of Activity

To improve the skill to strike an object with a paddle.

Prerequisites

practice of striking skills - focusing on the following cue words:

Flat Paddle

Stiff Wrist (pretend it is in a cast)

Watch the Object

Suggested Grade Levels

K-2

Materials Needed

one paddle for each student, 2-4 folding mats, 50+ balloons

Description of Idea

Use paddles and balloons in self-space prior to this activity. Practice the underhand hit (with the face of the paddle to the ceiling). The class is divided into six teams of "farmers" scattered around the room. Each team will have their own "barn" made of two folding mats standing upright and forming a barn-like structure. Fifty plus (50+) balloons will be scattered on the gym floor. On the "go" signal, students use their paddle to round up the farm animals (balloons) and herd them into their barn. Only one balloon can be taken at a time. Once a student has a balloon, other students are not allowed to touch that particular balloon. The game continues until all balloons are in the barn. Students then return to their starting positions and sit with their paddles at rest.

Variations

Use koosh balls, a shuttlecock, a foam ball, a dead tennis ball

Teaching Suggestions

To apply math skill integration, balloons can be worth various points and students can add the points at the end of each round.

Adaptations for Students with Disabilities

larger/lighter paddle, balloon tied to chair for continuous hitting


title: WordPress HTML editor panel is not showing HTML elements

text: # The problem After typing my post/page in the visual editor, when I switch to the HTML editor, the expected HTML elements do not show. Headings appear but paragraphs and divs do not. A minority of people have suggested that only one editor can be used. # My question   1. Can I not interchange between the visual and HTML tabs when writing a post/page?   2. Why can't I view the HTML elements?


title: how to set category name for a post

text: how to set category name for post: this is my code ,this is not working ,why?                   $post_title = $vname;          $categ='category name';     $post_content = '[newpage link="'.$videos.'"]';           $new_post = array(           'ID' => '',           'post_author' => $user->ID,            'post_category' => $categ,           'post_content' => $post_content,           'post_title' => $post_title,           'post_status' => 'publish',              );     $post_id = wp_insert_post($new_post);


title: Show children (sub-navigation) of active menu item only

text:
So I've searched the net and attempted to code a custom walker class that will do this, but I'm new to WordPress and although similar questions exist none fit exactly what I'm looking for, or suggest CSS, jQuery or a plugin as a solution (which is not really ideal). I currently have the following code:               class description_walker extends Walker_Nav_Menu     {           function start_el(&$output, $item, $depth, $args)           {                global $wp_query;                $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';                     $class_names = $value = '';                     $classes = empty( $item->classes ) ? array() : (array) $item->classes;                     $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );                $class_names = ' class="'. esc_attr( $class_names ) . '"';                            $output .= $indent . '
ID . '"' . $value . $class_names .'>';                          $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';                $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';                $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';                $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';                     $prepend = '';                $append = '';                $description  = ! empty( $item->description ) ? ''.esc_attr( $item->description ).'' : '';                     if($depth != 0)                {                          $description = $append = $prepend = "";                }                      $item_output = $args->before;                 $item_output .= '';                 $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;                 $item_output .= $description.$args->link_after;                 $item_output .= '';                 $item_output .= $args->after;                                  $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );                }     }      **What I'm trying to do is have it so that only the children (sub-menus) of the active navigation are shown, including all of the first level parent items.** For example if you visit http://windows.microsoft.com/en-us/windows/home the "Download & Shop" link has no sub menu options, but once you navigate to that page, a sub-menu is present. Any help would be greatly appreciated! Many Thanks


title: Should I use multisite?

text: In a nutshell, I'm starting to offer my clients a budget website service. I have developed 5 easy to use WordPress themes. Each theme ships with the following:   * Homepage - Static image or image carousel and intro copy.   * About - Static image and about copy.   * Blog   * Contact - Google map and contact form.   * Widgets (Twitter feed, for example) **My question** I would like the sign up process to be fully automated. I would also like the ability to update new versions of WordPress quickly and add new themes. Would you recommend WordPress Multisite for this purpose? If I get hundreds of sites running off 1 database, will I run into problems? I have ultimate cloud hosting with TSO HOST, so space and demand shouldn't be a problem. I'd much rather have everything in one place rather than multiple installs. I'd really appreciate your feedback and experience. I don't want to jump into using multisite if it's the wrong solution. Thanks! S


title: Jquery/Ajax+taxonomy filter?

text: I need to create a filter it doesn't really matter wether it's JS/Jquery or Ajax I just think Jquery/Js would be easiest. Either way this is my situation. I have a few custom taxonomies and custom post types. Of course the posts in the cpt's have their own categories some similar to others and they come from the custom taxonomies. I also have a list of all the categories along with checkboxes in front of them and a list of post names. Now what has to happen is that you'd click a checkbox and make it filter according to what category you clicked and which category the post names have. I unfortunately can't link it but I have screenshots of how it looks like currently, so far i've been able to filter all post names that have a custom taxonomy so not according to which although I do not know how to appoint to jquery which taxonomy belongs to which post name. I personally thought something like `.data` but i'm not sure. Screenshots of the structure(2 in 1): http://imgur.com/xThGRXu,O5zhiqY Jquery:               $('li').click(function() {         if( $(this).is(':checked')) {             $("#list").hide();         } else {             $("#list").show();         }     });


title: Scheduling posts to update once per day with wp_cron

text: I have a function that hooks into save_post that changes the value of a custom taxonomy term based on today's date. That's working fine. When I update a post, the taxonomy term is updated correctly. But I want this update to happen automatically, once a day, without having to manually update the posts myself. I read up on wp_cron and created the below code which is basically an attempt to, once a day, query for a certain set of posts and then simply run them through wp_update_post() which should trigger the function mentioned above that changes the term value of the taxonomy. But it doesn't seem to be working. Also, I don't really know how to test wp_cron without just waiting for a day and seeing what happens. I have a console installed so I can see upcoming scheduled events, and the below event is definetely scheduled, it just doesn't seem to be having any effect. Can anyone offer some advice on where I might have gone wrong?                   //Schedule active events to update_post every day         if( !wp_next_scheduled( 'event_status_refresh' ) ) {              wp_schedule_event( time(), 'daily', 'event_status_refresh' );           }       //When the event fires, we call the function to update the posts         add_action( 'event_status_refresh', 'update_event_status' );           //The function to update the posts     function update_event_status() {         global $post;              $active = array(          'post_type'=>'event',         'posts_per_page'=>'-1',         'tax_query'=>array(             array(                 'taxonomy'=>'event_status',                 'field'=>'slug',                 'terms'=>array(                     'playing_now',                     'opening_soon'                 )             )         ),     );     $query   = new WP_Query($active);     if ($query->have_posts()) {         while ($query->have_posts()) {             $query->the_post();                      $update = array(                 'ID' => get_the_ID(),                 );                      // Update the post into the database                 wp_update_post( $update );         }     }     wp_reset_postdata();          }


title: Graphics and Formatting Not Loading in WordPress on IIS

text: We have IIS 7.5 and we've installed WordPress (v3.3.1) through the Microsoft Web Platform installer (http://www.microsoft.com/web/wordpress). All works fine when we load WP locally (e.g. http://localhost/mywordpresssite), the graphics load fine. But when I enter the IP address or hostname accessing the site from a machine other than locally, none of the graphics or formatting appear. Is there some configuration I have to set to get this working? I've noticed that all the graphics etc. are hard-wired to 'localhost', which explains why I'm losing the images when accessing from a remote machine. e.g.               http://localhost/mywordpresssite/wp-content/themes/twentyeleven/images/headers/lanterns.jpg      Help!!


title: Help with IF has focus then... statment

text:
in a sidebar I have:
 [shortcode]
      It outputs a title that when hovered on drops down to show a menu. When hovering on the title a background color shows up and disappears when the mouse moves down to the menu items. I need for the background color to remain as long as the menu has focus, I need something like:               If #my_id has focus then .my_link {background:red;}      I have looked and the only thing that looked promising was (not really sure how to use this) JQuery:js_focus               $(document).ready(function() {                 $('input').blur(function(){                 $('input').removeClass("focus");           })              .focus(function() {                                  $(this).addClass("focus")           });          });      CSS:               .focus {         background:red;         }      In functions.php:               function load_scripts() {        wp_enqueue_script('jquery');        wp_enqueue_script('my_javascript_file', 'http://example.com/wp-content/themes/Child-Theme/js_focus.js', array('jquery'));     }         add_action('init', 'load_scripts');      Then in style.css:               .focus .my_link {background:red;}      Is this a good approach?, if so (not working at the moment) I only want focus on the menu to give the background color. If not a good approach any other ideas all are welcomed and appreciated Thanks Tim


title: Use only selected regular categories for a Custom post form

text: There's a way to use only some of regular categories for a Custom post form? Until now i was able to use ALL categories of the regular post type. But i want only a few of them to the custom post... For example, i have 10 categories , and for the custom post type, i want to use only 4. (or a parent category with all their childs?)


title: Permission functions within wordpress

text: I'm currently developing a website and am exploring all possible options to restrict file viewing. I'm trying to find a way where I can load php files like my theme-options.php and cpt.php without them been displayed in the admin panel even to admin users e.g appearance > editor. I'm leaning towards the answer having more to do with file permissions then any actually functions calling specific files and then providing restricted access to all users. 1.How can I restrict access to these files yet load them at the same time? Thanks


title: Wordpress custom permalinks, pages are now 404

text: I've set my permalinks to a custom structure:               /%menutype%/%postname%/      This works all right for my custom taxonomy (menutype) and anything that's an archive. Now however, simple pages won't work, i.e.               index.php?page_id=32 -> 404!      or               /about/ ->404      Here are my custom rewrite rules, 'menu' is my custom post, and 'menutype' is my custom taxonomy:               function custom_rewrite( $wp_rewrite ) {         $feed_rules = array(             'menu/[a-z]+/(.+)' => 'index.php?menu=' . $wp_rewrite->preg_index(1),             'menu/([^/]+)(/[0-9]+)?/?$' => 'index.php?menutype=' . $wp_rewrite->preg_index(1),             '/(.+)/' => 'index.php?page_id=' . $wp_rewrite->preg_index(1),         );              $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;     }     // refresh/flush permalinks in the dashboard if this is changed in any way     add_filter( 'generate_rewrite_rules', 'custom_rewrite' );


title: How to call a specific value within the functions.php file?

text: _Hi all, I'm a newb here, but hoping someone might have the answer to my question._ Within my functions.php file, I have this code:               //Contractor Page meta box details     $contractorpage_meta_box=array();     $contractorpage_meta_box[]=array(         'id'=>'contractor-page-meta-box',         'title'=>'Contractor Page Details',         'page'=>'contractor-page',         'context'=>'normal',         'priority'=>'high',         'fields'=>array(                 array(                     'id'=>"header_link_heading1",                     'label'=>"First Header Link Heading",                     'name'=>"header_link_heading1",                     'type'=>"text"                 ),                 array(                     'id'=>"header_link_text1",                     'label'=>"First Header Link Text",                     'name'=>"header_link_text1",                     'type'=>"text"                 ),                 array(                     'id'=>"header_link_url1",                     'label'=>"First Header Link Url",                     'name'=>"header_link_url1",                     'type'=>"text"                 ),                 array(                     'id'=>"header_link_heading2",                     'label'=>"Second Header Link Heading",                     'name'=>"header_link_heading2",                     'type'=>"text"                 ),                 array(                     'id'=>"header_link_text2",                     'label'=>"Second Header Link Text",                     'name'=>"header_link_text2",                     'type'=>"text"                 ),array(                     'id'=>"header_link_url2",                     'label'=>"Second Header Link Url",                     'name'=>"header_link_url2",                     'type'=>"text"                 ),array(                     'id'=>"page_heading",                     'label'=>"Page Heading",                     'name'=>"page_heading",                     'type'=>"text"                 ),array(                     'id'=>"page_sub_heading",                     'label'=>"Page Sub Heading",                     'name'=>"page_sub_heading",                     'type'=>"text"                 ),array(                     'id'=>"first_intro_text",                     'label'=>"First Intro Text",                     'name'=>"first_intro_text",                     'type'=>"text"                 ),array(                     'id'=>"second_intro_text",                     'label'=>"Second Intro Text",                     'name'=>"second_intro_text",                     'type'=>"text"                 ),array(                     'id'=>"video_link",                     'label'=>"Video link",                     'name'=>"video_link",                     'type'=>"text"                 ),array(                     'id'=>"main_content_heading",                     'label'=>"Main Content Heading",                     'name'=>"main_content_heading",                     'type'=>"text"                  ),array(                     'id'=>"main_content_text",                     'label'=>"Main Content",                     'name'=>"main_content_text",                     'type'=>"wysiwyg"                 ),array(                     'id'=>"bottom_heading",                     'label'=>"Bottom Heading",                     'name'=>"bottom_heading",                     'type'=>"text"                 ),array(                     'id'=>"bottom_content",                     'label'=>"Bottom Content",                     'name'=>"bottom_content",                     'type'=>"text"                 ),array(                     'id'=>"bottom_link_text",                     'label'=>"Bottom Link Text",                     'name'=>"bottom_link_text",                     'type'=>"text"                 ),array(                     'id'=>"bottom_link_url",                     'label'=>"Bottom Link Url",                     'name'=>"bottom_link_url",                     'type'=>"text"                 ),array(                     'id'=>"right_first_line",                     'label'=>"First Line Right Column",                     'name'=>"right_first_line",                     'type'=>"text"                 ),array(                     'id'=>"right_last_line",                     'label'=>"Last Line Right Column",                     'name'=>"right_last_line",                     'type'=>"text"                 )             )     );      I also have this code:               // Embed YouTube videos with "youtube" shortcode          function youtube($atts) {         extract(shortcode_atts(array(             "value" => '',             "width" => '475',             "height" => '350',             "name"=> 'movie',             "allowFullScreen" => 'true',             "allowScriptAccess"=>'always',         ), $atts));         return '<object style="height: '.$height.'px; width: '.$width.'px"><param name="'.$name.'" value="'.$value.'"><param name="allowFullScreen" value="'.$allowFullScreen.'"></param><param name="allowScriptAccess" value="'.$allowScriptAccess.'"></param><embed src="'.$value.'" type="application/x-shockwave-flash" allowfullscreen="'.$allowFullScreen.'" allowScriptAccess="'.$allowScriptAccess.'" width="'.$width.'" height="'.$height.'"></embed></object>';     }     add_shortcode("youtube", "youtube");      I'm trying to place the "video_link" from the first code into "value" from the second code (where it says "WHAT-TO-PUT-HERE". Any help would be greatly appreciated.


title: Debug mode shows Strict Standards

text: When I set `WP_DEBUG` to `true` in `wp-config.php`, I get to see all the strict standards and deprecated messages. I've set the `error_reporting` in my `php.ini`, `ini_set()` and `error_reporting()` to `E_ERROR | E_WARNING | E_PARSE`. But I still get to see the strict standards messages. I know the messages can be useful, but they appear in some of the plugins I am using and I am not interested in seeing them. How do I disable them?


title: Twig+Wordpress how to use array arguments inside a function?

text: I already asked this on stack overflow but then I found this place. I've searched but didn't find any answer to this. I'm using a theme that was developed using the Twig template system. I don't know anything about Twig and I don't have the time to learn it. In wordpress we can use `get_terms()` to get all the terms from a taxonomy but we can "filter" the terms we want to receive using an array of arguments that is the second parameter to the function. That being said, I have a line in a twig file that goes like this:               {% for distrito in wp.get_terms('Distritos') %}       `distrito` is my variable and `Distritos` is my taxonomy name. This works, it calls all of the terms, but I want to use the array arguments so that I can get only the root elements since my taxonomy is hierarchical. I understand that I must have somewhere the place where `wp.get_terms` is defined but I can't find it and I've been around this for 2 days now.


title: Checking post content for a shortcode, but content is being returned as empty

text: Alright so I am trying to check for a shortcode in the post content so that I can enqueue scripts as necessary. I have this:                   if( plugin_has_shortcode() ) {             // Load CSS             wp_enqueue_style( 'plugin-css', 'plugin.css', array(), null );         }      And here is my `plugin_has_shortcode` function:                   function plugin_has_shortcode() {             global $post;                  if ( strpos( $post->post_content, '[shortcode' ) ) {                 return true;             }                   return false;         }      This works most of the time. The issue I am having is that when I add the shortcode to the top of the editor `[shortcode]` and no other content before it then `$post->post_content` comes back as an empty string and makes my check return false. The other weird thing is that if I add any content above the shortcode - even just adding a ` ` above it - will make it work as intended. Has anyone else encountered this? Is it a bug? Is there a way to fix it? Any and all input much appreciated!


title: Custom user fields validation on registration

text:
I am using the 'wpestate' theme for my website but I would like to add some custom fields for my user registration. So I tried the following code to extend it: The probelem: When I try to register a new account it seems the page is doing only a page refresh that's it. It's no problem that it is not working with AJAX currently but a normal registration would be nice. This is the logic to validate a few fields.. But I think it never goes in there.               ////////////////////////////////////////////////////////////////////////////////     /// Ajax  Register function     ////////////////////////////////////////////////////////////////////////////////        add_action( 'wp_ajax_nopriv_ajax_register_form', 'ajax_register_form' );       // add_action( 'wp_ajax_ajax_register_form', 'ajax_register_form' );          function ajax_register_form(){                  //check_ajax_referer( 'register_ajax_nonce','security-register');                  $user_email  =   trim( $_POST['user_email_register'] ) ;                  ///echo $user_email;             $user_name   =   trim( $_POST['user_email_register'] ) ;             $firstname   =   trim( $_POST['first_name'] ) ;             $lastname   =   trim( $_POST['last_name'] ) ;             $street   =   trim( $_POST['rpr_street'] ) ;             $number  =   trim( $_POST['rpr_number'] ) ;             $city   =   trim( $_POST['rpr_city'] ) ;             $country   =   trim( $_POST['rpr_country'] ) ;             $phone   =   trim( $_POST['rpr_phone'] ) ;              if ($user_email=='' || $lastname == '' || $firstname =='' || $street == '' || $number == '' || $city == '' || $city == '' || $country == '' || $phone == ''){                 print __('All fields are required.', 'wpestate');                 exit();             }                       if(filter_var($user_email,FILTER_VALIDATE_EMAIL) === false) {                  print __('The email doesn\'t look right !','wpestate');                 exit();             }                  $domain = substr(strrchr($user_email, "@"), 1);             if( !checkdnsrr ($domain) ){                 print __('The email\'s domain doesn\'t look right.','wpestate');                 exit();             }                       $user_id     =   email_exists( $user_email );             if ($user_id){                 print __('Username already exists.  Please choose a new one.','wpestate');                 exit();              }                            if ( !$user_id and email_exists($user_email) == false ) {                                $random_password = wp_generate_password( $length=12, $include_standard_special_chars=false );                      $user_id  = wp_create_user( $user_email, $random_password, $user_email );                       if ( is_wp_error($user_id) ){                         print_r($user_id);                  }else{                        print __('Your account is waiting for approval, you will receive a mail once your account is approved by Sophima.','wpestate');                        wpestate_update_profile($user_id);                        wpestate_wp_new_user_notification( $user_id, $random_password ) ;                        if('yes' ==  esc_html ( get_option('wp_estate_user_agent','') )){                         wpestate_register_as_user($user_name,$user_id);                        }                  }                  } else {                print __('Email already exists.  Please choose a new one.','wpestate');             }                       die();           }      This is the part where I generate the form fields:               ///////////////////////////////////////////////////////////////////////////////////////////     // register form  function     ///////////////////////////////////////////////////////////////////////////////////////////               /**      * @param $attributes      * @param null $content      * @return string      *      *
     '.__('Username','wpestate').'     <input type="text" name="user_login_register" id="user_login_register" class="input" value="" size="20" />
           */     function register_form_function($attributes, $content = null) {                    $return_string='          <form action="" method="POST">

                             '.__('Firstname','wpestate').'                             <input type="text" name="first_name" id="first_name" class="input" value="" size="20" />

                             '.__('Lastname','wpestate').'                             <input type="text" name="last_name" id="last_name" class="input" value="" size="20" />

                             '.__('Email','wpestate').'                             <input type="text" name="user_email_register" id="user_email_register" class="input" value="" size="20" />

                             '.__('Street','wpestate').'                             <input type="text" name="rpr_street" id="rpr_street" class="input" value="" size="20" />

                             '.__('Number','wpestate').'                             <input type="text" name="rpr_number" id="rpr_number" class="input" value="" size="20" />

                             '.__('City','wpestate').'                             <input type="text" name="rpr_city" id="rpr_city" class="input" value="" size="20" />

                             '.__('Country','wpestate').'                             <input type="text" name="rpr_country" id="rpr_country" class="input" value="" size="20" />

                             '.__('Phone number','wpestate').'                             <input type="text" name="rpr_phone_number" id="rpr_phone_number" class="input" value="" size="20" />

'.__('A password will be e-mailed to you','wpestate').'
                          '. wp_nonce_field( 'register_ajax_nonce', 'security-register' ).'
<input type="submit" name="wp-submit" id="wp-submit-register" class="btn vernil small" value="'.__('Register','wpestate').'" />

               </form>              ';          return  $return_string;     }      Thanks a lot! For every assistance.


title: Custom WP theme not showing shortcodes

text:
I'm building a custom theme and am trying to use the Nivo Slider wordpress plug in. I have a widget area under my nav bar and for some reason only the shortcode shows, not the slider. I have read that I need to have "the_content();" in there, but it still doesn't work. Can anyone give me pointers? Here is my index.php. By the way I know other widgets work in this area. I've also tried another slideshow plug in that uses shortcode. It didn't work either.               <?php get_header(); ?>

              <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
              <div class="post" id="post-<?php the_ID(); ?>">

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

<?php the_time('l, F jS, Y')?>

     <?php the_content(); ?>                               <a  class="btn btn-info btn-xs" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read More
         <?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
     <?php endif; ?>

          <?php include("sidebar.php"); ?>

               <?php get_footer(); ?>


title: How can I add an image field to BuddyPress Extended Profile Fields?

text: I'm working with the BuddyPress extended profile component and would like to add image fields to the WordPress user profile. Is there code that I can add to my theme's functions.php so it inserts the "Image" option into the plugin? I have searched the BuddyPress and WordPress Codex forums and haven't come across code for intercepting the plugin's operation without editing core files.


title: Wp_editor visual tab issue, using qTranslate extended

text: I have a multi-language website (using mQtranslate) with custom pages on my web, which is being created by another (second) wp_editor() call. So, as I have a multilanguage site, I had to add language tabs to my custom wp_editor - for that I used qTranslate extended. At this moment everything is ok - language tabs are added succesfully, everything works. But when I try to open "Visual" tab in my custom wp_editor, all content dissappears. Is there any tricks or known issues I have missed? How to get it work when using "qTranslate extended" plugin? Any suggestions? P.S. Please don't suggest to use main wp_editor. It is critical necessary to use second one.


title: Accessing value from associative array

text: Here's my code:                       $args = array(                 'child_of' => $CurrentPage                 );             $children = get_pages( $args );             foreach ($children as $child) {                 foreach ($child as $key => $value) {                 echo $key['post_title'];                 }             };      And output:               IpppppppcppptpppppgmppcfIpppppppcppptpppppgmppcf      The output appears to be the first character of the $key, repeated over both children. ID , post_author , post_date , post_date_gmt , post_content , post_title , etc.


title: function WP_Widget::widget() must be over-ridden in a sub-class. when create new Widget

text: Show: function WP_Widget::widget() must be over-ridden in a sub-class. in website. How to fix it?


title: Dump contents of a variable inside a filter/hook callback that runs during save post

text: I just need to debug an array which comes into addfilter function like this:               add_filter('pll_copy_post_metas', 'copy_post_metas');     function copy_post_metas($metas) {         var_dump($metas);         return $metas;     }      How can I do that to just check what is the value of $metas? This filter runs in admin when saving a post.


title: Viewing output when the "The plugin generated x characters of unexpected output during activation" error is triggered

text: I'm working on a plugin and having some difficulties getting a new table created. I get the "The plugin generated x characters of unexpected output during activation" error. Is there a way of viewing the actual error? I believe that a redirect is involved in this process, hence the reason I don't see the actual error output. I have all error reporting and logging on, but still I get nothing.


title: GlotPress - WordPress integration

text: http://translate.wordpress.org/projects using same header & footer with wordpress.org main site and their login system works together too.. How can i do that? (P.S: Any other GlotPress & WordPress integrations tips are welcome too :) )


title: making php value numeric

text: I used some of this code from this page on Stack Overflow: Using wp_query is it possible to orderby taxonomy? It's about the function to be able to sort a query by a taxonomy value. Although it works perfectly, I would want to go one step further. The value I retrieve from the taxonomy term is a number. If I sort by that number, however, it gives this order: 1 10 11 2 21 22 and so on. I want it to be sorted 'normally', 1 2 3 5 9 11 15 21 22 etc. According to google I should add 0 to the value to make it a numeric value, but I don't know where to put it in this code. Somewhere, it should say value + 0. Any idea where I should put it? It's about this code:               function orderby_tax_clauses( $clauses, $wp_query ) {         global $wpdb;         $taxonomies = get_taxonomies();         foreach ($taxonomies as $taxonomy) {             if ( isset( $wp_query->query['orderby'] ) && $taxonomy == $wp_query->query['orderby'] ) {                 $clauses['join'] .=<<<SQL     LEFT OUTER JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.ID={$wpdb->term_relationships}.object_id     LEFT OUTER JOIN {$wpdb->term_taxonomy} USING (term_taxonomy_id)     LEFT OUTER JOIN {$wpdb->terms} USING (term_id)     SQL;                 $clauses['where'] .= " AND (taxonomy = '{$taxonomy}' OR taxonomy IS NULL)";                 $clauses['groupby'] = "object_id";                 $clauses['orderby'] = "GROUP_CONCAT({$wpdb->terms}.name ORDER BY name ASC) ";                 $clauses['orderby'] .= ( 'DESC' == strtoupper( $wp_query->get('order') ) ) ? 'ASC' : 'DESC';             }         }         return $clauses;     }              add_filter('posts_clauses', 'orderby_tax_clauses', 10, 2 );


title: Custom post type single page (single-{CPT-name}) 404 when slug includes hyphens

text: I have a CPT called "author". After an hour searching why I get a 404 visiting single pages of this CPT (managed by template "single-author.php") I realize that _some_ do work: those whose slug doesn't include an hyphen ! So for author "Voltaire", my_site.com/author/voltaire/ works. However for "Alexandre Dumas", my_site.com/author/alexandre-dumas/ gives a 404. If I change this slug from "alexandre-dumas" into "alexandredumas" without hyphen, it works. I need to use hyphens in my author slugs (otherwise I'd need to ask my client to manually edit the slug of every single author she creates or created), how to do that? My CPT declaration:               function my_custom_post_author() {         $labels = array(             'name'               => _x( 'Book Authors', 'post type general name' ),             'singular_name'      => _x( 'Book Author', 'post type singular name' ),             'add_new'            => _x( 'Add New', 'book author' ),             'add_new_item'       => __( 'Add New Book Author' ),             'edit_item'          => __( 'Edit Book Author' ),             'new_item'           => __( 'New Book Author' ),             'all_items'          => __( 'All Book Author' ),             'view_item'          => __( 'View Book Author' ),             'search_items'       => __( 'Search Book Author' ),             'not_found'          => __( 'No book authors found' ),             'not_found_in_trash' => __( 'No book authors found in the Trash' ),              'parent_item_colon'  => '',             'menu_name'          => 'Book Authors'         );         $args = array(             'labels'        => $labels,             'description'   => 'Holds our authors specific data',             'public'        => true,             'menu_position' => 4,             'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments', 'custom-fields'),             'rewrite' => array( 'slug' => 'book-author','with_front' => FALSE),             'has_archive'   => true,         );         register_post_type( 'book-author', $args );          }     add_action( 'init', 'my_custom_post_author' );          function my_updated_messages_author( $messages ) {         global $post, $post_ID;         $messages['book-author'] = array(             0 => '',              1 => sprintf( __('Book Author updated. View book author'), esc_url( get_permalink($post_ID) ) ),             2 => __('Custom field updated.'),             3 => __('Custom field deleted.'),             4 => __('Book author updated.'),             5 => isset($_GET['revision']) ? sprintf( __('Book author restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,             6 => sprintf( __('Book author published. View book author'), esc_url( get_permalink($post_ID) ) ),             7 => __('Book author saved.'),             8 => sprintf( __('Book author submitted. Preview book author'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),             9 => sprintf( __('Book author scheduled for: %1$s. Preview book author'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),             10 => sprintf( __('Book author draft updated. Preview book author'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),         );         return $messages;     }     add_filter( 'post_updated_messages', 'my_updated_messages_author' );


title: How to add class to parent a tag with a sub menu

text: I have been trying to add a class to the parent a tag of a sub menu using a custom walker. The current walker I am using adds the class to the parent `<li>`, does anybody know how to adjust this to add the class to the parent `<a>` tag instead. **Here is the existing walker I am using:**               class My_Walker_Nav_Menu extends Walker_Nav_Menu{       public function display_element($el, &$children, $max_depth, $depth = 0, $args, &$output){         $id = $this->db_fields['id'];                  if(isset($children[$el->$id]))           $el->classes[] = 'toggle-sub-nav closed';                  parent::display_element($el, $children, $max_depth, $depth, $args, $output);       }     }      **Here is the code that is output:** ![screen shot of current code output](http://i.stack.imgur.com/0aNtq.png) **Here is the code that I am aiming for:** ![Screen shot of desired code output with class applied to the a tag](http://i.stack.imgur.com/olDTn.png)


title: how to add product subscription field in woocommerce plugin

text: i've a site in which a product is available for subscription and plans are 1 month, 3 month, 6 month, 12 month and price is vary according to plan. notify the user before 2 day of expiring of subscription


title: Add A Print Post Button Within The Admin

text: I am looking to create a button within the post or a custom post type admin portion of my WordPress site, that would act similar to a "View Post" button, except it would take the admin user to a custom print template version of the post. I have included a screenshot to help illustrate the solution I am looking for. (This is photoshopped, and in no way in my current system. Hopefully that is where some community guidance can come in. ) I should clarify as well. I am actually looking to "Print off" as in physical ink printer, the post in the end (but I am hoping that I can take care of that information with the custom template) Thanks for any help! **Research So Far:** I have done a great deal of googleing as it were. Right now, I am attempting to just develop a solution wherein I lauch to a custom template using the WP Print Friendly plugin. This would only work from the front end, adding a few extra clicks for my client. Ideally, a button from the admin would just launch the post within a custom template. ![enter image description here](http://i.stack.imgur.com/hMtW9.png)


title: Wordpress Media Manager - limit to specific mime type

text: I am working on a CPT in which I need to add some meta fields with which user can attach media. There is a condition to attach any one mime-type attachment to single post. I created a two meta fields, 1) attachment type and 2) attachment. In Attachment Type user can select attachment types, like document, pdf, audio, video or image. And, in second field user can select media from media manager. Now, I am facing issue that some time user is selecting different type of media than select attachment type. Like, he is selected the attachment type Video and attached the Image or Audio file with post. How can I limit the Media Manager to specific mime-type? Like if user is selected the Audio then Media Manager will only display the audio files only. Or, if the user is selected the Image then display the images only in Media Manager.


title: wp_editor responsive?

text: I am calling `<?php wp_editor( '' , 'movie_description-'.$num, array('textarea_name' => 'url[]', 'raw' => true ));?>` but I want it to be responsive so that it doesn't overflow outside of the container. The parent container has a set width, but the content area extends outside of that and the tinymce buttons are not visible. Is there a simple way to make the editor responsive?


title: Pagination broken on is_front_page()

text:
I'm trying to display the first image attachment from each post on the front page of the site. This code below works on other pages, however pagination does not work on `is_front_page()`. First page to show 1-20 thumbnails, clicking next would bring you to page 2 showing 21-40 thumbnails, etc. I've reset my permalinks, and have no errors in PHP log. Any ideas?               function homepage_grid() {     global $wpdb, $post;       ?>

                     <?php                     $limit = 20;                     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                     query_posts('showposts=' . $limit . '&paged=' . $paged . '&orderby=date&order=DESC');                     ?>                              <?php while (have_posts()) : the_post();                             $attachment = array_values( get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'numberposts'  => 1 ) ) );                              var_dump($attachment);                             ?>
<a href="<?php the_permalink() ?>" title="<?php the_title('', ''); ?>"><?php if( $attachment ) echo 'ID) . '" />'; ?>
                         <?php endwhile; ?>

                         <?php post_navigation(); ?>

     <?php }          function post_navigation() {         global $wp_query;              if ($wp_query->is_home || $wp_query->is_archive || $wp_query->is_search) {             if ($wp_query->max_num_pages > 1) {                 $previous = 'Previous Entries';                 $next = 'Next Entries';                 echo "\t\t\t
\n";                      if ($wp_query->query_vars['paged'] <= 1) {                     echo "\t\t\t\t
";                     next_posts_link($previous);                     echo "
\n";                 }                 elseif ($wp_query->query_vars['paged'] < $wp_query->max_num_pages) {                     echo "\t\t\t\t
";                     next_posts_link($previous);                     echo "
\n";                          echo "\t\t\t\t
";                     previous_posts_link($next);                     echo "
\n";                 }                 elseif ($wp_query->query_vars['paged'] >= $wp_query->max_num_pages) {                     echo "\t\t\t\t
";                     previous_posts_link($next);                     echo "
\n";                 }                      echo "\t\t\t
\n\n";             }         }     }


title: Show posted on date only for posts in a certain category

text: I am using a lot of custom post types throught my site and don't want to show a "posted on" date on them. I only want date to be shown for the post in "Featured" category. I've made some changes in loop: swapped   `<?php twentyten_posted_on(); ?>` with `<?php if($category->name == 'Featured'){twentyten_posted_on();} ?>` Now the date is gone everywhere, including the posts within "Featured" category as well... What am I doing wrong?


title: Custom Field add markup to line breaks

text: I am looking for a solution to add markup to a custom field with multiple lines. Much like wpautop, but with customization. I'm not quite sure to approach this with a custom function or something built into WordPress. Custom Field text would be:               Line 1     Line 2     Line 3      Code output would add markup:               Line 1     Line 2     Line 3


title: Enabling Sessions in WordPress 3.0

text: Im using a wfcart in my WordPress site but for some reason on certain pages WordPress drops the session I'm wondering if there is a way to enable sessions in WordPress 3?


title: How to generate video out of images via Wordpress plugin

text: I am working on Wordpress plugin which can generate video from sequence of images. I read here that we can use FFMpeg and Imagemagick (or imagick) to implement this trick. But, FFMpeg is hardly supported on shared hosting. So, this option is ruled out. I started working on Imagemagick. But, I was informed here that both of the above options cannot be used for Wordpress. So, is there any feasible option for developing a video file out of images for Wordpress??? I am storing sequence of images in /images folder and want to develop and video out of these images. I appreciate any help.


title: Remove Metabox from Menus screen

text: Been digging into WP files for a bit and think I just might be missing something. The end-goal is to remove the `Theme Locations` metabox from the Menus screen if someone doesn't have a certain capability `manage_options`. I know, a little odd for usability, but there's only one menu and we're trying to make this harder to screw up ;) Looking at `/wp-admin/nav-menu.php` around line `383` I see `wp_nav_menu_setup()` so I tried to add the following as a filter, but with no luck so far:               function roots_remove_nav_menu_metaboxes() {     // Remove Theme Locations from users without the 'manage_options' capability         if (current_user_can('manage_options') == false) {             remove_meta_box('wp_nav_menu_locations_meta_box', 'nav-menus', 'side');     // theme locations         }     }     add_action('wp_nav_menu_setup', 'roots_remove_nav_menu_metaboxes',9999);      Any help would be really appreciated. Thanks!


title: Drag & drop HTML5 file upload into the media library?

text: Has anyone seen a drag&drop plugin for files into the media library for WP? Would be very interested with such a plugin. **Edit** - Seems like Google will sponsor this project on GSoC 2011


Any post install tips after installing Wordpress 3.0.1? which would be useful for any wordpress installation , where we will use wordpress as a CMS for a website. and blog page will not as a home page.


title: Update Wordpress Theme System

text: i'm creating a premium Wordpress theme and i was wondering if there's a wordpress plugin or system that allows for easy upgrades of future theme updates for possible clients. Something like the internal system that Wordpress uses for its open source themes. Thank you :)


title: How to change home or site url using action hooks or filter?

text: I want to change url dynamically, so is there any way to change url? I know other methods like from admin, directly from database or _wp-config_. but i want to change it from either hooks or filter. I have tried some code for core files, but didn't work. my code for _link-template.php_ page in wp-includes is like this                  $useragent=$_SERVER['HTTP_USER_AGENT'];         if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g     |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4))){     $url = "http://m.colleges.com";     }else {$url = "http://colleges.com"; }     return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );     }      Please provide some help thank you.


title: Is it a good idea to init ajax functions only while 'DOING_AJAX'

text: I wonder if it is a good solution to add (a lot) ajax `add_action()` only if `DOING_AJAX`is defined. Normally my setup is something like this:               add_action('init', 'my_ajax_init');          function my_ajax_init(){         add_action('wp_ajax_mymail_method_1', 'my_ajax_method_1');         add_action('wp_ajax_mymail_method_2', 'my_ajax_method_2');         add_action('wp_ajax_mymail_method_3', 'my_ajax_method_3');         add_action('wp_ajax_mymail_method_4', 'my_ajax_method_4');         ....     }      I could prevent this actions on a "normal" page view with this:               if(defined('DOING_AJAX') && DOING_AJAX){       add_action('init', 'my_ajax_init');       }      Would this help in terms of performance?


title: Incomplete attachment page

text: I am using the twenty-thirteen theme and my attachment page chops off the footer & image. Have a look at my screenshot. You can see that it shows the title but it doesn't show the image and the footer is missing. Also the admin bar is missing too. What I do notice it takes roughtly 10 seconds to load any attachment pages. I have around 400k images in my media library. Anyone know what the problem is?![enter image description here](http://i.stack.imgur.com/EsX6S.jpg) mysql error log:               140318  2:05:58  InnoDB: ERROR: the age of the last checkpoint is 9440466,     InnoDB: which exceeds the log group capacity 9433498.     InnoDB: If you are using big BLOB or TEXT rows, you must set the     InnoDB: combined size of log files at least 10 times bigger than the     InnoDB: largest such row.


title: Paginate template name

text: I want to make pagination for posts. I am using `posts_nav_link()` in my `archive.php` to make links to previous/next posts and first ten posts are shown well. However when I click on newer posts link, the url changes to `.../page/2`, but it leads me to `index.php` I realize that I am missing a template file, but I don't know which one. I tried adding `paged.php`, but it still opens `index.php` Any ideas?


title: Allow all attributes in $allowedposttags tags

text: I would like to use `$allowedposttags` to allow extra HTML tags during entry submission. Can I allow all attributes for a specific tag using `$allowedposttags`? For example, the code below will allow iFrame tags and the src, height, and width attributes in the iFrame tags:               $allowedposttags['iframe'] = array(         'src' => array(),         'height' => array(),         'width' => array()     );      How can I allow all attributes in this example, not just src, height, and width?


title: Displaying All Parent Pages as Featured Images

text:
Here is a look at my current code to display all "children" pages of current post_parent (Also would be helpful to know how to display custom parent pages as well...)               <?php     $args = array(         'post_parent' => $post->ID,         'post_type' => 'page',         'orderby' => 'menu_order',         'order'=>'ASC',     );     $my_query = new WP_Query($args);     if($my_query->have_posts()) :         while($my_query->have_posts()) :              $my_query->the_post();           // your stuff goes in this bit.          if ( has_post_thumbnail() ) :               $imgdata = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' );              $imgwidth = $imgdata[1]; // thumbnail's width              $imgheight = $imgdata[2]; // thumbnail's height       ?>        <div class="child element isotope-item" style="width:<?php echo $imgwidth;?>;height:<?php echo $imgheight;?>;">         <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >           <?php echo the_post_thumbnail(large); ?>           <?php echo the_title_attribute();?>
       <?php         endif;         // end your stuff.         endwhile;     else :         // Do the no posts found message      endif;     ?>


title: Pulling sub-site content into specific pages

text:
I'm working on a school website. The design calls for a collection of largely static pages, but for each class to have a blog which will be updated every few days. I know nothing about WordPress or PHP (thought I have development experience on other platforms) but I got the static bits of the site, based on a custom theme, up without too many problems. I set up a page for each class blog but I really wanted the authors to use the blogging engine rather than just continually updating a page. To enable this I switched on multi-site, based on URL, and set up some blogs in the sub-site for each class. However I'm now stuck on how to make the standard index.php I created for the static pages display blog content instead for certain sections of the site. I'd also like to add a right-hand widget that will display the most recent three entries from blogs, regardless of what class their from. Ideally I also need to add a date to the page title for blogs, but not for the static pages on the site. Anyone help? EDIT: Index.php code as requested
          <?php if (have_posts()) : while (have_posts()) : the_post();?>
<?php the_title();?>

          <?php the_content(); ?>
          <?php endwhile; endif; ?>          <?php edit_post_link('Edit this entry.', '
', '
'); ?>


title: Order custom posts by taxonomy?

text:
I have the following custom post types: books, documents, examples, guidebooks, onlineaids. They were generated by the following code:               /*-----------------------------------------------------------------------------------*/     /* CPT - Books */     /*-----------------------------------------------------------------------------------*/     function jeo_cpt_books() {         $labels = array(             'name'               => _x( 'Books', 'post type general name' ),             'singular_name'      => _x( 'Book', 'post type singular name' ),             'add_new'            => _x( 'Add New', 'book' ),             'add_new_item'       => __( 'Add New Book' ),             'edit_item'          => __( 'Edit Book' ),             'new_item'           => __( 'New Book' ),             'all_items'          => __( 'All Books' ),             'view_item'          => __( 'View Books' ),             'search_items'       => __( 'Search Books' ),             'not_found'          => __( 'No books found' ),             'not_found_in_trash' => __( 'No books found in the Trash' ),              'parent_item_colon'  => '',             'menu_name'          => 'Books'         );         $args = array(             'labels'        => $labels,             'description'   => 'Holds our books and book specific data',             'public'        => true,             'menu_position' => 5,             'menu_icon'      => get_bloginfo('template_directory') . '/images/icons/icon-book.png',  // Icon Path             'taxonomies'     => array('post_tag'), // Adds tags to cpt             'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),             'has_archive'   => true,         );         register_post_type( 'books', $args );        }     add_action( 'init', 'jeo_cpt_books' );          /* CPT - Books - Taxonomies */          function jeo_cpt_book_tax() {         $labels = array(             'name'              => _x( 'Book Categories', 'taxonomy general name' ),             'singular_name'     => _x( 'Book Category', 'taxonomy singular name' ),             'search_items'      => __( 'Search Book Categories' ),             'all_items'         => __( 'All Book Categories' ),             'parent_item'       => __( 'Parent Book Category' ),             'parent_item_colon' => __( 'Parent Book Category:' ),             'edit_item'         => __( 'Edit Book Category' ),              'update_item'       => __( 'Update Book Category' ),             'add_new_item'      => __( 'Add New Book Category' ),             'new_item_name'     => __( 'New Book Category' ),             'menu_name'         => __( 'Book Categories' ),         );         $args = array(             'labels' => $labels,             'hierarchical' => true,         );         register_taxonomy( 'book_category', 'books', $args );     }     add_action( 'init', 'jeo_cpt_book_tax', 0 );      (and so on)... I am trying to loop through each CPT on a page-template for a different page and display them per "category" (which is a taxonomy). The following is the code I'm trying to use, with not much luck:               <?php $args = array(     'post_type'     =>  'books',     'book_category'     =>  get_the_term_list( $post->ID, 'guidebook_category' ),     'posts_per_page'    =>  -1,     'order'             =>  'ASC',     'orderby'           =>  'ID'     );     $the_query = new WP_Query( $args );                if ( $the_query->have_posts() ) : ?>
Books:
         <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
                 <?php the_excerpt(); ?>

         <?php endwhile; endif; ?>         Back to the top         <?php wp_reset_postdata(); ?>      The above code seems to grab everything from the right CPT, but I want display ONLY the posts that are in the category called "Step2: Prepare" or "Step3: Find". Help is greatly appreciated.


title: Whats the Mysql Query to Find each display_name stored in wp_postmeta.meta_value, grouped by username?

text: I created a custom content type that contains some fieds tos store user names (display name), thru a meta.key that is called 'opr'. Now i want a mysql query to find all custom posts`s date (wp_posts.post_date) that each user was "stored" and the number of instances) i`d like to have something like:                   USER (display_name)                     DATES (post_date)           COUNT instances         David guetta                              12/11/2014                         1         Marcus pont                            11/10/2013, 03/02/2013                2      and so on.. Any help would be great!


title: Using global $post v/s $GLOBALS['post']

text: It's probably more of a PHP question, but I would like to know if there are any differences in using               global $post;     echo $post->ID;      when compared to               echo $GLOBALS['post']->ID;      to access the ID of a post in WordPress. This answer on SO suggests that the first method is quicker to process, while the second method is quicker to write. I also noticed that the first method is often mentioned in the Codex while the second method is mentioned on `the_content` filter  page. Is this only a matter of preference? Or does it come to performance and security too? Thanks


title: what could cause the htaccess file to be modified?

text: One of the wordpress sites that I created recently went down with a _500 internal server error_. After hours of mind boggling and checking error logs, I found out that the `htaccess` files present in the user directory had been modified, with an `ss` added to the end of the file which caused the error. After changing and uploading the file, the site got back up. I wanted to know what could have caused this? It is hosted on a godaddy server, and the permission for the file is 604. was the server hacked or did wordpress somehow write this into the file. Thanks.


title: forward domain name to particular page?

text: I;ve got a doman alias setup for one of my Wordpress sites and i'm trying to forward that particular domain to a page. The 2 domains are - www.alias.com www.actual.com When people use the _www.alias.com_ domain i want them to be forwarded to _www.alias.com/content/_ I've tried several things with the htaccess file but i think Worpdress may be ignoring the redirects or i've got it completely wrong! ie               Redirect 301 www.alias.com http://www.alias.com/content/          # and     RewriteCond %{HTTP_HOST} ^www.alias.com     RewriteRule (.*)$ http://www.alias.com/content/ [R=301,L]      best, Dc


title: Form Security: nonce vs. jQuery

text: I am trying to create a methodology for submitting forms on my WordPress site. In the past, I have used WordPress nonces in order to secure form submission, but I like the idea of using jQuery to sanitize and act on a form submission. My question: If I am using jQuery to submit a form (i.e. there would be no POST data and no page reload), doesn't that mean that I will not have to use nonces at all? Is there any security risk/downside to doing it this way?


title: Setting the uploads directory

text: So I want to change my uploads directory. I'm able to change it using:               add_filter( 'pre_option_upload_url_path', 'wpse_77960_upload_url' );     function wpse_77960_upload_url() {       return 'http://subdomain.example.com/files';     }      or               update_option('upload_url_path', '/wp-content/uploads');      _source_ or something along the lines of: `register_setting( 'media', 'upload_url_path', 'esc_url' );` Is there a preferred way of doing this when it comes to overall speed? I tried using `define( 'UPLOADS', 'http://absolute/path/to/dir' );`, but it kept prepending the site-url to all the uploads.


title: Save custom value to main content of post

text: I create a meta custom input to make a page builder. So i can drop & drag element to build content for post. And when i save post, i want it will save directly to post content. So i think i will change the $_POST and hook it to save_post action. `$_POST['content'] = $_POST['page-builder-content'];` I have try but it does not work. Any advises ? Code:               function stPageBuilder() {         $screens = array('post', 'page');              foreach ($screens as $screen)          {             add_meta_box(                 'st-post-class',            // Unique ID                 esc_html__( 'Page Builder', page-builder' ),        // Title                 'stPageBuilderCallBack',        // Callback function                 $screen,                    // Admin page (or post type)                 'advanced',                 // Context                 'default'                   // Priority             );         }     }          function stPageBuilderCallBack($post, $box) {         wp_nonce_field( basename( __FILE__ ), 'st-page-builder-nonce' );         // here is html layout for drag & drop feature     }          function stPageBuilderSave($postID)      {         if ('page' == $POST['post_type']) {             if (!current_user_can('edit_page', $postID)) return;         } else {             if (!current_user_can('edit_post', $postID)) return;         }              if (!isset($_POST['st-page-builder-nonce']) || !wp_verify_nonce($_POST['st-page-builder-nonce'], basename(__FILE__))) return;              $_POST['content'] = $_POST['st-page-builder-content'];          }          function staddPageBuilder() {         add_action( 'add_meta_boxes', 'stPageBuilder' );             add_action( 'save_post', 'stPageBuilderSave' );     }          staddPageBuilder();


title: "Trying to get property of non-object" error when using custom taxonomies

text: I am encountering a weird error when working with custom taxonomies. I am trying to get the name of categories of a custom taxonomy:               $terms = get_terms('taxonomy_name');          foreach ($terms as $term) {              $option = $term->name;         echo $option;       }      I'm not using the code into a template file, like page.php. I use it in functions.php but after the function which created the taxonomy. The code works fine if the taxonomy is a standard one like "category"(which displays regular post categories) but it's not working with custom ones. I already tried to use ` $option = $term['name'];` but with no luck. The error I get on this one is "Undefined index: name". Any answer will be much appreciated! Thank you! Madalin


title: How to remove a metabox from menu editor page?

text: I am not sure if it is much different for any page but I am wondering how to remove a metabox from the appearance>menu page without having to go into the wordpress core files and remove it. Is there something I can do to override it so it doesn't appear both on the page and on the screen options menu?


title: How can I show many posts an author has per week?

text: I've searched around and have had no luck or success in finding a way to show how many posts an author has made in a certain period of time (e.g. - a week) Any ideas on how one would approach this? I just want to display the total number of posts an author has made in a given time period.


title: How to order users alphabetically by their last name?

text:
I use the following shortcode and function to display members of some departments:               add_shortcode( 'list_of_members', 'members_listing' );     /* usage: [list_of_members department = 'psychology'] */          function members_listing( $department ) {              $members = get_users( array( 'meta_key' => 'department', 'meta_value' => $department ) );               echo '
';         foreach ( $members as $member ) {             echo '
' . $member->first_name . ' ' . $member->last_name . '
';         }         echo '
';     }      I'd like to order the users alphabetically by `last_name`. How can I do this? I was inspired by this question/answer, but I do not understand it completely.


title: Ajax and autocomplete

text: I got a set of meta boxes on a custom post type. Two of them are simple input/text-type fields, that should have autocompleted input:   * A) Another Custom Post Type   * B) Users Now I have the problem that I need to somehow trigger the autocomplete event. So far I have this pretty simple definition:               jQuery( document ).ready( function ($)             {                 $( '#some_id' ).autocomplete(                 {                      minLength: 2                     ,source:    "<?php print 'SOME_STRING'; ?>"                 } );             } );      which gives me the following answer in the console, when I enter "zz": > GET http:// localhost/wordpress/wp-admin/SOME_STRING?term=zz 404 (Not Found) Point is that I need to run a query (as you can see above) and need to **root the request** for the `source` option/argument from autocomplete **somehow to a php callback**. I hope someone can explain me how I'd get around this. Thanks (and merry christmas in case you read this :) !


title: Drupal 6 to Wordpress migration - media attachments

text: Migrating was simple with a few SQL queries that I found on a blog. But I was unable to find a way to importing images as media attachments on the Wordpress site. Any help is really appreciated.


title: Change the search URL

text: How can I change the search URL from /?s=my-word to **/busca/?s=my-word** ? I know how to change to /busca/my-word, but I really need the "s" parameter. Thanks.


title: htaccess strip url

text: I have my permalink set to `%postname%/%location%/%course%` I want this permalink `%location%/%course%/%postname%` but due to this I get 404 on every page but not on posts, I decided to put this permalink `%postname%/%location%/%course%/%postname%` but I need to strip the starting postname, in such a way I ll get no 404 pages and google will also index my site with this permalink `/%location%/%course%/%postname%` without any 404 how to do this???? This is my code, for displaying custom taxonomies on permalinks               add_filter('post_link', 'location_permalink', 10, 3);     add_filter('post_type_link', 'location_permalink', 10, 3);                   function location_permalink($permalink, $post_id, $leavename) {             if (strpos($permalink, '%location%') === FALSE) return $permalink;                      // Get post                 $post = get_post($post_id);                 if (!$post) return $permalink;                      // Get taxonomy terms                 $terms = wp_get_object_terms($post->ID, 'location');                     if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0])) $taxonomy_slug = $terms[0]->slug;                 else $taxonomy_slug = 'location';                  return str_replace('%location%', $taxonomy_slug, $permalink);         }


title: <video> tags disappear on pages (but not on posts!)

text:
I'm creating my first theme. If I add the following content to a post, the video displays fine on the site:
<video width="320" height="240" controls="controls">     <source src="http://domain.com/videos/whatever.ogv" type="video/ogg" />     Install      Firefox or      Chrome to watch the video.</video>

go back
      However, if I add **the same content** to a page, this is what I get when viewing the source:
Instal Firefox or Chrome to watch the video. go back Read more
      It doesn't matter if it's a new post / page or if I change content of an existing one. I'm running WP 3.6 pt-br, I have disabled all the plugins and the issue persists. If I use other themes (twenty thirteen, twenty ten, etc) everything works fine. My functions.php file is empty.


title: Multiple loop with pagination in same page

text:
In my home page i have two `<section>` in which i perform two different loops on different post categories. Here the code:

                 <?php                     $pagedArticles = ( get_query_var('page') ? get_query_var('page') : 1 );                     $articles = array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 3, 'cat' => 3,'paged' => $pagedArticles );                     query_posts($articles); $i=0; while (have_posts()) : the_post(); $i++;                 ?>                        <?php endwhile; global $wp_query;                 $big = 999999999; // need an unlikely integer                 echo paginate_links( array('base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),'format' => '?paged=%#%','current' => max( 1, get_query_var('paged') ),'total' => $wp_query->max_num_pages) );                  wp_reset_query(); ?>

                 <?php                     $pagedNews = ( get_query_var('page') ? get_query_var('page') : 1 );                     $news = array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 4, 'cat' => 4, 'paged' => $pagedNews );                     query_posts($news); $i=0; while (have_posts()) : the_post(); $i++;                 ?>                                            <?php endwhile; global $wp_query;                 $big = 999999999; // need an unlikely integer                 echo paginate_links( array('base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),'format' => '?paged=%#%','current' => max( 1, get_query_var('paged') ),'total' => $wp_query->max_num_pages) );                  wp_reset_query(); ?>

      The problem i face is that if i try to see older posts of `'.loop-article'`, pagination works on `'.loop-news'` too. I think it depends on the same url that paginator creates for both loops:               www.mysite.com/page/2/      But i am not sure of this...is it possible to fix this?


title: Sponsor links in the side menu, can those be removed or replaced with other links?

text: I recently installed the theme "Box Office," created by Web2Feel. The sponsor links at the side menu, can those be removed or replaced with other links? And how do I change this?


title: What is the $current_screen global variable?

text: What does it mean by a screen? I've had a look in the codex and don't understand (I'm a newbie). Thanks.


title: exclude custom post type from running a function

text:
I have the following code in my functions.php file to display post shortlink in my posts (I prefer not to edit theme files if possible)...               function add_post_content($content) {         if ( is_single() ) {             $content .= '
Shortlink: ' .wp_get_shortlink(); '
';              } elseif ( 'portfolio' == get_post_type() ) {             $content .= '

';          }         return $content;     }     add_filter('the_content', 'add_post_content');      The wp_get_shortlink function doesn't work with custom post types (I understand). I have 1 custom post type and so I am trying to stop it running on that post type but is does - just displays 'Shortlink: ' (because the function doesn't work it doesn't actually display anything else). Can anyone help me with either a way to display the custom post shortlink or edit my code to stop it showing the words 'Shortlink: '? As an aside, would it be possible to edit the code so that the shortlink is displayed in a form textbox? I tried but couldn't get it working. Many thanks. I've left what I have active. You'll see the output at the bottom of the pages. The second link is is the custom post type... http://skipology.com/iphoneography-feature-puddles-featured-by-eyeem/ http://skipology.com/project/iphoneography-exhibition-hip-2b-square/


title: Detect type of post status transition

text: I have a function on my site that it supposed to run when a new post is published (email push notification), with the exception of the same article updated (i.e `publish_to_publish` transition, I don't want to send unnecessary push notifications) I know that I can use the {old_status} to {new_status} action hooks, but this means that I have to specify all the transitions to `publish` (`new_to_publish`, `draft_to_publish`, etc.). My question is:   1. Can I use instead the `publish_post` hook and detect if it was `publish_to_publish` so I can explicitly negate it? something like:              function send_email() {      if ($transition == 'publish_to_publish') return;       //(else) send email     }       add_action('publish_post', 'send_email', 10, 1);        2. If not, how do I tie multiple hooks to the same action? Do I just list them like so:              add_action('new_to_publish', 'send_mail', 10, 1);     add_action('future_to_publish', 'send_mail', 10, 1);     add_action('draft_to_publish', 'send_mail', 10, 1);      Or is there a more elegant way - like passing an array?


title: Hide content after going to page 2 of archive, show content when back at first page

text:
I want to hide the content below when the user uses pagination to move from the initial page of the archive (page 1). Is there some way of detecting whether or not the current page is page 1? Content below needs to reappear if the user returns to page 1.

Filter Products

              <?php dynamic_sidebar( 'secondary-widget-area' ); ?>


title: Vanilla Forums as a replacement for WordPress comments?

text: I really like the way Vanilla Forums is integrating with WordPress however I am wondering if it is possible to take it one step further? What i'd like to be able to do is to replace WordPress comments with a Vanilla Forum thread. That way, the conversation can continue and work more in the fashion of a forum thread, as opposed to a point in time comment. Can this be done?


title: Is there any way to stylize articles one by one?

text:
I'm new in wordpress thing and im trying to edit my posts. my problem is: I'm editing posts in `index.php` ---------index.php----------               <?php get_header();?>

<a href="<?php the_permalink() ?>"><?php the_title(); ?>
              <?php the_content(); ?>
                    <?php endwhile; else: ?>
Ups...

... pedimos desculpa mas nenhum post foi encontrado!
          <?php endif; ?>
<?php posts_nav_link(); ?>
      ---------end---------- I have 3 posts inline and they all have the same style except the middle one which I would like to be a little different.


title: Determine if only one image attached to a post/page

text: I'm looking to determine how many images are attached to a post, specifically if there is only one. Basically if there are multiple images I want to display my slideshow script, if there is only one I want to display that image, and not load the slideshow. I saw this on a similar post which determines if any images are attached:               $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image') );          if ( $attachments ) {          // do conditional stuff here           }      Can I use something similar to determine if there is only one image? Thanks!


title: Hide and show menu subpages

text:
I am sorry if this is not clear, but I am using translated wordpress so I am translating some names back. I have pages in menu and when I click on some item it goes to that page. But I need f. e. page Item which has subpages SubItem1 and SubItem2. So in menu there would be shown Item, then I click on Item it does not link to a page, but rather shows the following:   * Item      * SubItem1     * SubItem2 From there, if I click on SubItem I'll get to some page. I can set abovepage but it doesn't anything. Is there any hack, trick for this? Or maybe some plugin? I know little jQuery so it might help too. And what about that with Archive? First show 2011 and 2012 then if I click on some year that gets months for that year and after that I get archive for exact month/year. Thanks, hope it's clear what I want :) **Edit** This is in my sidebar:

Stránky

         <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>

      This is what is created in html when page is render:

Stranky

Uvod

Historie

Technika soucasna
         .         .         .


title: Authors List page : how to exclude posts from certain category

text: I have a magazine wordpress site in which I have designed a separate page to show all the authors with their nice_names (with URI) and no. of posts. the code is like this:               $current = (intval(get_query_var('paged'))) ? intval(get_query_var('paged')) : 1;          $rows = $wpdb->get_results("SELECT ID, display_name from $wpdb->users      WHERE ID NOT IN (1)     ORDER BY display_name");     $author_ids = $wpdb->get_results($query);     global $wp_rewrite;          for ($i=$start;$i < $end ;++$i ) {        $row = $rows[$i];      $curauth = get_userdata($row->ID);      $user_link = get_author_posts_url($curauth->ID);      $post_count = get_usernumposts($curauth->ID);     ?>      To show the number of posts each author has, I want to show like this:   * showing number of all posts but excluding a certain category (ID=60)   * showing number of posts in a single category (ID=60) How do I have to modify the above code?


title: Export WordPress from one domain to another domain

text: From one domain (foo.com), select export as WXR and import to (bar.com), also I manually uploaded wp-contents to the new location. Everything is working, except the the images in the blog post still using the old domain.   1. How to solve it?   2. I have tried to upload into wp.com and they can auto update the images' location, but this does not work for self-hosted wordpress? Thanks.


title: get custom post type

text:
I am using this code to get custom posts in rows.               <?php query_posts('posts_per_page=72&cat=' . $cat . '&order=ASC');     $columns = 5;     $increment = 0;     ?>
         <?php if(have_posts()) : while(have_posts()) : the_post(); ?>             <?php if($increment % $columns == 0){ // if increment is divisable by columns (ie 3/3 = 0))?>
                                      <div class="post" id="<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="<?php _e("bookmark", "solostream"); ?>"     title="<?php _e("Permanent Link to", "solostream"); ?> <?php the_title(); ?>"><?php the_post_thumbnail( 'homepage-thumb' ); ?>
     <a href="<?php the_permalink(); ?>"><?php the_title(); ?>

                  	                  <?php             }else{             ?>                                      <div class="post" id="<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="<?php _e("bookmark", "solostream"); ?>" title="<?php _e("Permanent Link to", "solostream"); ?> <?php the_title(); ?>"><?php the_post_thumbnail( 'homepage-thumb' ); ?>
                         <a href="<?php the_permalink(); ?>"><?php the_title(); ?>

                  	                             <?php }$increment++; endwhile; endif;?>

      Problem is that it does not give custom posts. I want to use it on category page. How to amend first section so it automatically grabs posts from current category of either posts or custom post type.


title: Associating two custom post types

text: I'm trying to a build a system for a client that involves two posts types: "Clients" and "Media Placements." I need a way to associate Media Placements with a particular Client (essentially treating Clients like a category while retaining full post functionality). Each client needs to have many media placements associated with them, and they need to be easily updated. Also, both clients and media placements need full "Post" capability. Meaning editable with TinyMCE, Queryable, etc. Does anyone have any idea what the best way to go about this would be? Any help would be greatly appreciated! Thank you!


title: Activate Child Theme .mo and .po files

text: I am experiencing some problems while trying to use my dutch .mo and .po files for my child theme. I have added the following line to `wp-config.php`:               define ('WPLANG', 'nl_NL');      After that I have placed the .mo and .po files in: `child-theme/languages/`. Lastly I followed a post here on stack exchange and pasted this code in my child theme's `functions.php`:               add_action('after_setup_theme','wpse_110727_translate_theme');     function wpse_110727_translate_theme() {          load_theme_textdomain( 'textdomain', get_template_directory() . '/languages' );          $locale = get_locale();          $locale_file = get_template_directory() . "/languages/$locale.php";                   if ( is_readable( $locale_file ) ) require_once( $locale_file );      }      After all this, my translation still isn't active on my pages.


title: Query date in wordpress loop

text:
I currently have a custom post type called 'events'. I created this from a tutorial here http://tatiyants.com/how-to-use-wordpress-custom-post-types-to- add-events-to-your-site/. I want to query the date to only show the posts with dates coming up and not ones on the past. `$event_date >= time` However in the tutorial he displays the results using a shortcode. I am trying to convert this to a standard wp loop so I can display it in my index.php. He uses the following within his shortcode function:               add_shortcode( 'events', 'get_events_shortcode' );          function get_events_shortcode($atts){         global $post;              // get shortcode parameter for daterange (can be "current" or "past")         extract( shortcode_atts( array(             'daterange' => 'current',         ), $atts ) );              ob_start();              // prepare to get a list of events sorted by the event date         $args = array(             'post_type' => 'events',             'orderby'   => 'event_date',             'meta_key'  => 'event_date',             'order'     => 'ASC'         );              query_posts( $args );              $events_found = false;              // build up the HTML from the retrieved list of events         if ( have_posts() ) {             while ( have_posts() ) {                 the_post();                 $event_date = get_post_meta($post->ID, 'event_date', true);                      switch ($daterange) {                     case "current":                         if ($event_date >= time() ) {                             echo get_event_container();                             $events_found = true;                         }                         break;                          case "past":                         if ($event_date < time() ) {                             echo get_past_event_summary();                             $events_found = true;                         }                         break;                 }             }         }              wp_reset_query();              if (!$events_found) {             echo "
no events found.
";         }              $output_string = ob_get_contents();         ob_end_clean();              return $output_string;     }      Any help or direction will be greatly appreciated as though I have programmed themes before this is causing me a headache.