title: Email Obfuscation: Is antispambot() Acceptable?

text: I've been looking into Email Obfuscation and trying to get away from obfuscation plugins when I ran across this code snippet[1]:               function remove_plaintext_email($emailAddress) {         $emailRegEx = '/([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4})/i';         return preg_replace_callback($emailRegEx, "encodeEmail", $emailAddress);     }     function encodeEmail($result) {         return antispambot($result[1]);     }     add_filter( 'the_content', 'remove_plaintext_email', 20 );     add_filter( 'widget_text', 'remove_plaintext_email', 20 );      For me, this pretty much replaces any obfuscation plugin out there in a few lines of code which is always good. My concern is the way `antispambot()` tries to hide the email via converting it to HTML Entities. My question is, is that enough to stop spambots from grabbing the email? This function has been around for so long I just wanted to make sure it was still valid to use or if there was a better way to hide emails from spambots. [1] Source


title: Recommended Books on WordPress for Management and non-Developers?

text: I've had a few non-technical clients have a tough time with WordPress' admin UI. One of them asked me today if there were any books that could help someone like him - someone who is only concerned with writing content. All of the WordPress books I've seen are either targeted toward developers, or have a lot of technical content. What may work best for him is a book that explains terms such as _"categories"_ , _"pages vs posts"_ , _"widgets"_ , etc. _On a side note, it would seem to me that as tools like WordPress get adopted by a larger audience - including non-web-savvy people - there's a great opportunity for a set of guides aimed specifically at content creators and not developers._ Do you know of any books that can help a non-technical, non-web-savvy person write, edit & manage the content of their WordPress-powered site?


title: if specfic language content is empty then hide language flag by qTranslate

text: My site has 2 more language but one language content is empty or one of my page's content is empty for specific one language. So i want to hide or don't show language flag in my wordpress site. Is it possible? if possible the how can i implement this.


title: Best practices for localizing WordPress content?

text: A client asked for a blog that will have localized content (i.e. en.blogname.com for English content, fr.blogname.com for French content, etc). Being new to building such a blog, we recently discovered WPML and qTranslate, which look perfect for our needs. Do you have any best / recommended practices for setting up a multilingual blog? At this point, we don't envision the need to have the WordPress software translated, but if you've found that to be a good idea, we would love to know. The authors will all be multilingual (English + one other language), but it's conceivable that non-English speakers may be hired later.


title: Blog template PHP

text: Here's the WP wordpress website: http://www.joaoalexandre.com/wordpressteste/ And here's the Blog section: http://www.joaoalexandre.com/wordpressteste/artigos/ How can I show a regular simple blog with posts and maybe categories and get rid of the extra garbage it currently has (slider, "Services" etc)? I suppose the answer lies in creating a new template for this "Artigos" page (which is the blog)?


title: Localization Problem: Doesn't Display Translated Words

text:
I'm trying to localize my plugin and with a plugin called CodeStyling Localization, I succeeded to create a .po file. However, the words used in my plugin remain in English although the default language is set to Japanese as defined in wp-configdefine('WPLANG', 'ja'); Other localized plugins are properly translated including, Yet Another Related Posts Plugin and WP Multibyte Patch. This is a sample plugin I wrote to test plugin localization. I kept it as simple as possible. **wp-content\plugins\localizationsample\localizationsample.php**               <?php     /*           Plugin Name: Localization Sample Plugin         Version: 1.1         Author: Teno     */          // Localization     add_action('init', 'localizationsample_init');     function localizationsample_init() {         $loaded = load_plugin_textdomain('localizationsample', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/');     }           // Add Admin Menu      add_action('admin_menu','localizationsample_menu');     function localizationsample_menu() {          add_options_page(             'Localization Sample Plugin',                'Localization Sample Plugin',                    'manage_options',                    __FILE__,                            'localizationsample_adminpanel'         );     }     function localizationsample_adminpanel() {         echo '

';         echo '
' . __('hi!', 'localizationsample') . '
';    // "hi!" should be translated.         echo '

';     }     ?>      **wp-content\plugins\localizationsample\lang\LSample-ja_JP.po**               msgid ""     msgstr ""     "Project-Id-Version: Localization Sample Plugin v1.0\n"     "Report-Msgid-Bugs-To: \n"     "POT-Creation-Date: 2012-08-17 20:23+0900\n"     "PO-Revision-Date: 2012-08-17 11:27:39+0000\n"     "Last-Translator: \n"     "Language-Team: \n"     "MIME-Version: 1.0\n"     "Content-Type: text/plain; charset=UTF-8\n"     "Content-Transfer-Encoding: 8bit\n"     "Plural-Forms: nplurals=2; plural=n != 1;\n"     "X-Poedit-Language: \n"     "X-Poedit-Country: \n"     "X-Poedit-SourceCharset: UTF-8\n"     "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"     "X-Poedit-Basepath: .\n"     "X-Poedit-Bookmarks: \n"     "X-Poedit-SearchPath-0: Z:/xampp/htdocs/wptest/wp-content/plugins/localizationsample\n"     "X-Textdomain-Support: yes"          #: localizationsample.php:28     #@ LSample     msgid "hi!"     msgstr "やあ！"      Both files are saved as UTF-8 without BOM. What am I doing wrong? *updated the code but the issue still persists.


title: How to force Media manager to overwrite files of same name?

text: I have a widget that works with my theme that expects images named in a certain way, slide1.png, slide2.png, etc... However, when the user uploads their own images, named slide1.png, slide2.png, etc to the media library, rather than updating the images with the new ones, WordPress changes the names of the replacement images to slide11.png, slide22.png, etc Can I set a filter in theme options that tells WP to overwrite existing images without changing the filenames?


title: Website not listed under Sites (in a Network environment)

text: I have a Wordpress network installed, and the first website I created is not listed under the Sites entry in the top horizontal menu. The second website I created is, along with the parent website. If I go to Network > Sites, the first website is listed, and I can use the website fine, provided I type in the URL directly into the address bar. Do you know the best method to add the site back into the Sites menu entry at top?


title: wp_update_user not updating

text:
In desperation I am asking for help in this forum too - if someone (ANYONE!) could take a look a this post and see if they could help I'd be eternally grateful http://wordpress.org/support/topic/wp_update_user-not-updating?replies=11 Basically - I am updating a user's role and capabilities via script but the changes only come in to effect (ie the user can see specific menu items) when I go into that user and hit "save" Thanks in anticipation!! Chris **UPDATE:** Maybe this helps solve it? **This is the WP_User object I have echoed out on screen when logged in as the newly changed user** :               WP_User Object ( [data] => stdClass Object ( [ID] => 130 [user_login] => test [user_pass] => $P$BuHO1ABLCNQ716tktgyes4jqqkfVxG. [user_nicename] => test [user_email] => email@gmail.com [user_url] => [user_registered] => 2012-07-19 12:07:52 [user_activation_key] => [user_status] => 0 [display_name] => test ) [ID] => 130 [caps] => Array ( [editor] => 1 ) [cap_key] => wp_capabilities [roles] => Array ( [0] => editor ) [allcaps] => Array ( [upload_files] => 1 [unfiltered_html] => 1 [edit_posts] => 1 [edit_published_posts] => 1 [publish_posts] => 1 [edit_pages] => 1 [read] => 1 [level_7] => 1 [level_6] => 1 [level_5] => 1 [level_4] => 1 [level_3] => 1 [level_2] => 1 [level_1] => 1 [level_0] => 1 [edit_published_pages] => 1 [publish_pages] => 1 [manage_options] => 1 [view_menu] => 1 [editor] => 1 ) [filter] => )      **This is how the menu item is being created in my plugin file (which should display to the user):**               add_menu_page('Welcome', 'Welcome','edit_posts', 'welcome', 'welcome_page', get_bloginfo('template_url').'/images/icon.png', 0);      **This is the function / page that the menu item returns:**               function welcome_page()      {         global $currrent_user;     if(!current_user_can('edit_posts'))     {              print '

Your account has been restricted, most likely due to an unpaid subscription.
';     }     else     {         include 'welcome-page.php';     }      }      As you can see - the user only needs edit_posts capability to view the menu item and for the function to return the welcome page. The user indeed has this capability, but cant do either of these things - unless i click "save" as admin in the user-edit page?? **Edit 2** **The following are all the different approaches I have taken to change the user role - if it helps!**               //using this currently     $user = new WP_User($unpaid->uid);//$unpaid->uid is the users ID     $user->set_role('editor');     if(!$user->has_cap('edit_posts'))     {     $user->add_cap('edit_posts');     }     wp_cache_delete($unpaid->uid, 'users');          //another attempt     $uID = $unpaid->uid;     wp_insert_user(array('ID'=>$uID,'role'=>'editor'));       **UPDATE AGAIN!** I have just tried this and again, the db is updated, even shows 'editor' in the admin panel, but the user still cant see the appropriate menu items unless I click "update" on their profile!               $new = new WP_User($current_user->ID);     $new->set_role('editor');          wp_cache_delete( $new->ID, 'users' );     wp_cache_delete( $new->user_login, 'userlogins' );     wp_cache_delete( $new->user_email, 'useremail' );     wp_cache_delete( $new->user_nicename, 'userslugs' );     do_action('profile_update');      Any thoughts?


title: Loop with slider (slider not loading)

text:
In my slider.php I have a loop that calls for a custom post type. That custom post type has a meta box for a slide url (link/title/etc). I can see the loop and everything else is working because in the source code it shows the corrent url from the meta box. But it will NOT load the slider. But lets say I drop a direct path to an image OUTSIDE the loop, the slider will work/load, and it will load the dynamic image from the metabox(as the second slide). It seems, and I know this is wrong, but its almost as if the image from the metabox is being loaded after the script for the slides. So it will not see that an image exists and will not execute the js code for slides. My head has the correct js function. My meta box and post type are wokring and saving. My home template which has include 'slider.php'. (below)

                <?php include 'slider.php'; ?>

       My slider.php which has                    <?php $args = array( 'post_type' => 'home_slider', 'posts_per_page' => 10 ); ?>     <?php $loop = new WP_Query( $args ); ?>
       <?php // query the "slider" custom post type and import its posts into the slider ?>       <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>            <?php $slide_img_src = smc_get_the_slide_img_source(); ?>              <img src="<?php echo $slide_img_src; ?>" class="max-image" width="" height="" alt="Slide 1">            <?php endwhile; ?>
           The slide.js file (the functions for slides) is also loading (obviously), and is being en-queued in the footer. Im racking my brain, and php is NOT my strong point. I feel like I just cant figure it out, or what to even search for. Thanks in advanced. Edit - If you need to see any more code, let me know. I dont know what else could be causing the problem.


title: the_post_thumbnail call removing li in code

text:
Need some help here. I've been working on a widget to display a list of featured posts (custom post type) and want to display the featured image for each post so I was using the_post_thumbnail call with a custom thumbnail size included as the parameter and for some strange reason, the call is removing some of the HTML that is in my echo'd string output from the widget. Below is the line that I am calling:               echo '
'. the_post_thumbnail('talent-featured-thumb') .'
';      This is the HTML that is rendered:

      Any help?


title: Show category name, and last 5 post titles below category name?

text: Is there a function that will let me display a category title and the last 5 post titles from that category just below it? Is there a loop which can do this and list post titles of that category in an un ordered list with the category title just above outside the loop?


title: Get ID of the page where shortcode is included

text: I have a page with a shortcode that uses get_the_ID(). The shortcode displays custom fields from the current page. When I include that page within another page, get_the_ID() returns the ID of the second page, not the original page where the shortcode is. My question is: inside the shortcode, is there a way to get the ID of the page where the shortcode is included?


title: How to bypass 404 for certain pages/posts?

text: I have a site with urls like so: `site.com/folder/page-name` It is moving to another site built in wordpress and I am trying to recreate the page to ensure incoming links continue to work as normal. The posts are organised into different custom post types, but essentially they will display from the same page, so I have created a new page called `old_content.php` and I want to use this to display content from incoming links. I have created the page in wordpress using `old_content.php` as the template. When I load `site.com/folder/`, I can correctly see my `old_content.php` file. In `old_content.php`, I will `wp_query` the data for the page using the third url segment, e.g. `site.com/folder/my-page-name`. As soon as I add `my-page- name`, it 404's. How do I stop it from 404'ing so I can query the db and display the content?


title: Getting jQuery AJAX to work in Wordpress (getting -1)

text:
I am trying to figure out how to use jQuery `$.ajax()` for a project. I setup this test using what I learned from TutsPlus.com. Everything seems to be working correctly except I am getting a `-1` returned. So I get an alert with `Success: -1` and `#test-div1` is populated with `-1`, instead of `Hello Everyone!`. **My HTML:**               <input type="hidden" name="GreetingAll" id="GreetingAll" value="Hello Everyone!" />       <input class="btn" type="submit" id="PleasePushMe" />

      **In functions.php:**               function add_myjavascript(){         wp_enqueue_script( 'ajax-implementation.js', get_stylesheet_directory_uri() . "/scripts/ajax-implementation.js", array( 'jquery' ) );       }            add_action( 'init', 'add_myjavascript' );          function MyAjaxFunction(){         //get the data from ajax() call          $GreetingAll = $_POST['GreetingAll'];          $results = "
".$GreetingAll."
";         // Return the String          die($results);       }       // creating Ajax call for WordPress       add_action( 'wp_ajax_nopriv_MyAjaxFunction', 'MyAjaxFunction' );       add_action( 'wp_ajax_MyAjaxFunction', 'MyAjaxFunction' );       **ajax-implementation.js:**               jQuery(document).ready(function() {                var GreetingAll = jQuery("#GreetingAll").val();                jQuery("#PleasePushMe").click(function(){            jQuery.ajax({                   type: 'POST',                   url: '/wp-admin/admin-ajax.php',                   data: {                       action: 'MyAjaxFunction',                       GreetingAll: GreetingAll,                   },                   success: function(data, textStatus, XMLHttpRequest){                       alert('Success: ' + data);                     jQuery("#test-div1").html('');                       jQuery("#test-div1").append(data);                   },                   error: function(MLHttpRequest, textStatus, errorThrown){                       alert(errorThrown);                   }               });         });          });      My only modification is changing `get_bloginfo('template_directory')` to `get_stylesheet_directory_uri()`, because I am using a child theme. Any thoughts on how I can get this working? Thanks!


title: Styling Custom Meta Boxes?

text:
I've built a basic meta box and have this in my functions.php. The current code:               add_action( 'admin_print_styles-post-new.php', 'portfolio_admin_style', 11 );     add_action( 'admin_print_styles-post.php', 'portfolio_admin_style', 11 );          function portfolio_admin_style() {         global $post_type;         if( 'portfolio' == $post_type )             wp_enqueue_style( 'portfolio-admin-style', get_stylesheet_directory_uri() . '/styles/portfolio-admin.css' );     }               add_action('init', 'create_portfolio');         function create_portfolio() {             $portfolio_args = array(                 'label' => __('Portfolio'),                 'singular_label' => __('Portfolio'),                 'public' => true,                 'show_ui' => true,                 'capability_type' => 'post',                 'hierarchical' => false,                 'rewrite' => true,                 'supports' => array('title', 'editor', 'thumbnail')             );             register_post_type('portfolio',$portfolio_args);         }          // Input fields     add_action("admin_init", "add_portfolio");         add_action('save_post', 'update_website_url');         function add_portfolio(){             add_meta_box("portfolio_details", "Portfolio Options", "portfolio_options", "portfolio", "normal", "low");         }         function portfolio_options(){             global $post;             $custom = get_post_custom($post->ID);             $website_url = $custom["website_url"][0];             $port_excerpt = $custom["port_excerpt"][0];     ?>
             Website URL:<input name="website_url" value="<?php echo $website_url; ?>" />             Excerpt:<input name="port_excerpt" value="<?php echo $port_excerpt; ?>" />
        <?php         }         function update_website_url(){             global $post;             update_post_meta($post->ID, "website_url", $_POST["website_url"]);             update_post_meta($post->ID, "port_excerpt", $_POST["port_excerpt"]);         }          add_filter("manage_edit-portfolio_columns", "portfolio_edit_columns");     add_action("manage_posts_custom_column",  "portfolio_columns_display");          function portfolio_edit_columns($portfolio_columns){         $portfolio_columns = array(             "cb" => "<input type=\"checkbox\" />",             "title" => "Project Title",             "description" => "Description",         );         return $portfolio_columns;     }          function portfolio_columns_display($portfolio_columns){         switch ($portfolio_columns)         {             case "description":                 the_excerpt();                 break;                       }     }      The problem is the stylesheet isn't changing the custom meta box's styling! I have the stylesheet being called from the correct directory in the code. If it matters, this is being used with custom post templates.


title: How to add post featured image to RSS item tag?

text: **I am able to add a post featured image to the RSS feed like so:**               function insertThumbnailRSS($content) {         global $post;         if(has_post_thumbnail($post->ID)){             $content = ''.get_the_post_thumbnail($post->ID, 'thumbnail', array('alt' => get_the_title(), 'title' => get_the_title(), 'style' => 'float:right;')).''.$content;         }         return $content;     }     add_filter('the_excerpt_rss', 'insertThumbnailRSS');     add_filter('the_content_feed', 'insertThumbnailRSS');      However, upon examining the XML generated for the RSS feed, I noticed it sticks the featured image into the XML description item tag. How can I insert post featured image into it's own RSS feed item tag of let's say "image", rather than just inserting it in with the post's content?


title: Weird string offset errors when displaying post attachments

text:
I'm trying to create a gallery page that takes image attachments from a certain category and displays them. It works but I have a problem it seems where I'm trying to exclude certain attachment types from the returned attachment images. I am also using the WCK plugin to create some custom fields for the blog posts for images of differing sizes to be displayed in different locations. On the home page there is a more square one, on the blog page there is a skinny one, and on the actual post page there is a slightly bigger skinny version of the image. Here is how I'm calling the attachments, and there you will see how I am trying to exclude those images.               // WP_Query arguments         $args = array (             'post_type'               => 'post',             'pagination'             => false,             'posts_per_page'     => '99',             'category_name' => 'family'         );              // The Query         $query = new WP_Query( $args );              // The Loop         if ( $query->have_posts() ) {             while ( $query->have_posts() ) {                 $query->the_post();                      $thumb_ID = get_post_thumbnail_id( $post->ID );                 $blogimages = get_post_meta( get_the_ID(), 'blogimages', true );                  if ( $images = get_children(array(                         'post_parent' => $post->ID,                         'post_type' => 'attachment',                         'post_mime_type' => 'image',                         'exclude' => [$thumb_ID,$blogimages[0]['blog-image-inside'],$blogimages[0]['blog-image-front'],$blogimages[0]['blog-image-main']],                     ))) :                      foreach( $images as $image ) :                          echo '
';                         echo 'ID).'" rel="nivo">';                         echo wp_get_attachment_image($image->ID, 'full');                         echo '';                         echo '
';                         endforeach;             else: // No images                 //This post has no attached images             endif;             }         }         // Restore original Post Data         wp_reset_postdata();      I believe the problem is that those images are not set on those blog posts, so It is having an issue, perhaps because they are set as undefined? How can I fix this so that if the image is not uploaded it will exclude it and if it is uploaded it will still be excluded. The errors I'm getting by the way look like this over and over I assume for as many times as it's grabed a blog post and attempted to grab it's attachments               Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/karmen-noel/wp-content/themes/karmen_noel/page-galleries-family.php on line 50          Warning: Illegal string offset 'blog-image-inside' in /Applications/MAMP/htdocs/karmen-noel/wp-content/themes/karmen_noel/page-galleries-family.php on line 50          Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/karmen-noel/wp-content/themes/karmen_noel/page-galleries-family.php on line 50          Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/karmen-noel/wp-content/themes/karmen_noel/page-galleries-family.php on line 50          Warning: Illegal string offset 'blog-image-front' in /Applications/MAMP/htdocs/karmen-noel/wp-content/themes/karmen_noel/page-galleries-family.php on line 50          Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/karmen-noel/wp-content/themes/karmen_noel/page-galleries-family.php on line 50          Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/karmen-noel/wp-content/themes/karmen_noel/page-galleries-family.php on line 50          Warning: Illegal string offset 'blog-image-main' in /Applications/MAMP/htdocs/karmen-noel/wp-content/themes/karmen_noel/page-galleries-family.php on line 50          Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/karmen-noel/wp-content/themes/karmen_noel/page-galleries-family.php on line 50


title: Survey pop-up plugin

text: I'm trying to pop-up a feedback form when users visit our website. I would only want this to appear once, and I would like it to simply go away (and never return!) if the user chooses to close the window. The form I have in mind has 8 questions; a few multiple-choice, a few rating and a few full-text answers. I imagined this to be done in a lightbox (or similar) window. Does such a plugin currently exist?


title: Images not showing on mobile browser?

text: When viewing my site on mobile Chrome/Safari, the images on the home page aren't showing up, and I can't figure out why. Does anyone have a clue why that might be? The site is trastaging.gopagoda.com I've tried it on a few different phones/browsers. They load, and then become empty containers. Any ideas or suggestions are appreciated.


title: Query for multiple post types does not work

text: I'd like my frontpage to display a list of my lastest blog posts merged with my latest "Products" custom post type posts. From the documentation i gather this should work:               query_posts( array('post_type' => array('post', 'product') ) );     while (have_posts()) : the_post();        the_title();        the_excerpt();     endwhile;      But that turns a weird list, made of pages ! Note that I've put it outside the loop. What am i doing wrong?


title: Information about Wordpress 4

text: Sorry if this is off-topic. Are there any details on when WP 4 will be released? Is it true it will be a fundamental re-write using considerable Ajax? I am really interested in the following issue which is reported as included in 4.0 https://core.trac.wordpress.org/ticket/14134 Thank you


title: How to determin which admin screen/sub screen I'm currently viewing

text:
**Edit:** The Q narrowed down to the following: > "How would I retrieve the screen IDs of all admin UI screens at one time?" * * * **Edit:** I added a bunch of more plugin globals. * * * **Q** is the following: Check **which AdminUI submenu page/screen you're viewing** and check this **against some global var or some internal function**.               // This helps you inspecting the data - just drop it in some functions.php file of a theme     function wpse_inspect_admin_screen_data()     {         echo '
';             echo '
global $menu
';             print_r( $GLOBALS['menu'] );             echo '
';                  echo '
global $submenu
';             print_r( $GLOBALS['submenu'] );             echo '
';                  echo '
global $self
';             print_r( $GLOBALS['self'] );             echo '
';                  echo '
global $parent_file
';             print_r( $GLOBALS['parent_file'] );             echo '
';                  echo '
global $submenu_file
';             print_r( $GLOBALS['submenu_file'] );             echo '
';                  echo '
global $plugin_page
';             print_r( $GLOBALS['plugin_page'] );             echo '
';                  echo '
global $admin_page_hooks
';             print_r( $GLOBALS['admin_page_hooks'] );             echo '
';                  echo '
global $_parent_pages
';             print_r( $GLOBALS['_parent_pages'] );             echo '
';                  echo '
global $_registered_pages
';             print_r( $GLOBALS['_registered_pages'] );             echo '
';                  echo '
global $title
';             print_r( $GLOBALS['title'] );             echo '
';                  echo '
global $_wp_real_parent_file
';             print_r( $GLOBALS['_wp_real_parent_file'] );             echo '
';                  echo '
global $_wp_menu_nopriv
';             print_r( $GLOBALS['_wp_menu_nopriv'] );             echo '
';                  echo '
global $_wp_submenu_nopriv
';             print_r( $GLOBALS['_wp_submenu_nopriv'] );             echo '
';                  // built by set_current_screen() in /core_root/wp-admin/includes/template.php line 2085 (wp 3.2.x)             echo '
global $current_screen
';             print_r( $GLOBALS['current_screen'] );         echo '
';     }     add_action( 'shutdown', 'wpse_inspect_admin_screen_data', 9999 );      I already have an Array containing the slug and Label from both the parent and sub menu item. Here you can see an exemplary part of the array I built from `global $menu, $submenu;` and that I need to check against:               Array     (         [Appearance] => Array             (                 [0] => Array                     (                         [label] => Themes                         [slug] => themes.php                         [parent_label] => Appearance                         [parent_file] => themes.php                     )                 [1] => Array                     (                         [label] => Widgets                         [slug] => widgets.php                         [parent_label] => Appearance                         [parent_file] => themes.php                     )                 [2] => Array                     (                         [label] => Editor                         [slug] => theme-editor.php                         [parent_label] => Appearance                         [parent_file] => themes.php                     )             )         [Pages] => Array             (                 [0] => Array                     (                         [label] => All Pages                         [slug] => edit.php?post_type=page                         [parent_label] => Pages                         [parent_file] => edit.php?post_type=page                     )                 [1] => Array                     (                         [label] => Add New                         [slug] => post-new.php?post_type=page                         [parent_label] => Pages                         [parent_file] => edit.php?post_type=page                     )             )     )      * * * **Note:** The Q is _not_ the loop. Only what _exactly_ I can use to check which menu item _and_ subitem I'm currently watching.


title: how to proceed for a "new!" label on menu_nav?

text: I'm developing in Wordpress and would like to assign the label "new!" to specific custom-post-type's (not necessarily all post-types) if they contain new posts in the last 30 days. I found this code sample but do not understand. I don't understand how to specify which post-types to assign, and how to output the label within the loop.               $args = array( 'numberposts' => '1' );     $recent_post = wp_get_recent_posts( $args );     if (strtotime($recent_post[0]['post_date']) > strtotime('-7 days')) {         $class = "new!";     }      I found that if I change $class = "new!"; to something like 'echo: new', a text is displayed on the top of the page but I don't find how to integrate to wp_menu_nav


title: How to properly secure my Wordpress installation?

text: I'm currently on my own server (fredericpilon.com) with my own website. Wordpress being kind of a big shot of CMS, it may be targeted by hacks. Any tips and tricks on how to properly secure my Wordpress installation from said hackers and evil-doers?


title: My WordPress site SSL is in red crossed color and can't load at first time?

text: I enabled ssl connection on my wordpress website. From Admin panel -> settings -> and changed both URL from http to https. Then added               define('FORCE_SSL_ADMIN', TRUE);               if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')                 $_SERVER['HTTPS']='on';      to my wp-config.php file. But it's about 4 days any now while try to load it first page is give the error about unknown certificate. Then must click on continue anyway to load it, after the loading my HTTPS is in the red color with the crossed. Please help me how can I fix it I think my WordPress site need a certificate.ctr file that I must create it and upload in the wordpress root, but I don't know how to do it?


title: Pagination for two different post types on a same (category) page

text: First of all, I have searched the web as well as this site to get an answer, but couldn't find any. In theory, this would do what I want to do: How to fix pagination for custom loops? but I couldn't make it to work. The code I am presenting below has implemented the instructions of this post. I have the following issue: I have modified the category page (category.php) to include a loop of a custom post type (let's call them "events") above the default "posts" loop. Everything works fine, apart from the pagination. In particular, even though I can get it to count based on my custom query, the issue is that when I click on "Newer/Older Events" both the events and the posts start to offset. What I want to do instead is for the "Newer/Older Events" to affect only the custom loop and not the posts. I suspect my problem is related to the url, since after clicking "newer events", the url looks like this `http://localhost/category/THECATEGORY/page/2/` which probably automatically triggers pagination of the wp_query too. Perhaps if I could make it to be something like `/?eventpage=X` and `/?postpage=X` according to which pagination you change it would work, but unfortunately I don't know how. Any help will be greatly appreciated :)               <?php          $stand_args = array(                   'post_type' => 'event',                           ...                       my arguments                           ...             );               $stand_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;              ?>              <?php $the_stand_query = new WP_Query( $stand_args ); ?>              <?php $temp_query = $wp_query;         $wp_query   = NULL;         $wp_query   = $the_stand_query;         ?>              <?php if( $the_stand_query->have_posts() ): ?>              <?php while ( $the_stand_query->have_posts() ) : $the_stand_query->the_post(); ?>                 ---------------------- THE LOOP OUTPUT ------------                    <?php endwhile; ?>              <?php endif; ?>                       wp_reset_postdata();                    previous_posts_link( 'Older Events' );          next_posts_link( 'Newer Events', $the_stand_query->max_num_pages );                           ?>                     <?php              $wp_query = NULL;             $wp_query = $temp_query;              ?>                   <?php wp_reset_query();        thank you in advance


title: Can I stop authors from changing the font in their post?

text: I want the site to have a consistent look and feel so want to prevent authors from changing font, font color or font size. Is there a way to either override their choices, or remove the option? Cheers


title: How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?

text:
Actually i have created a custom post type and fetch the data from "Advanced Custom Fields" plugin after then connect to a custom search-form to search only the post data.It works good. But now i want to search post data from field name (label) or any other related keyword. This is code that works when i search post name but does not work when search field name and other related key word.               <?php      echo 'this is search=';      echo $s;     $args = array(         'post_type'=> 'beauty_salon',        's' =>$s,         'the_field'=>$treatments     );     query_posts($args);     ?>     <?php if ( have_posts() ) : ?>

                     <?php while ( have_posts() ) : the_post(); ?>
     <a href="<?php the_permalink(); ?>" >
<?php  the_title(); ?>
     <?php $attachment_id = get_field('beauty_salon_image_1');     $size = 'custom_archive_thumbnail';  //(thumbnail, medium, large, full or custom size)     $image = wp_get_attachment_image_src( $attachment_id, $size );     $attachment = get_post( get_field('beauty_salon_image_1') );     $alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);     ?>     <a href="<?php the_permalink(); ?>" ><img src="<?php echo $image[0]; ?>" alt="<?php echo $alt; ?>"/>

Treatments:<?php echo the_field('treatments') ?>

Bookings 1:<?php echo the_field('bookings_1'); ?>

Bookings 2:<?php echo the_field('bookings_2'); ?>

Address:<?php echo the_field('address'); ?>

     <?php endwhile; ?>

     <?php else : ?>     <?php get_template_part( 'content', 'none' ); ?>               <?php endif; ?>                      //one template above      And i used code for search form given below.     <form id="searchform-ajax" action="<?php bloginfo('home'); ?>/" method="get">     <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s"  class="txt" />     <input type="hidden" name="post_type" value="beauty_salon"  />     <input id="searchsubmit" class="ser-icon" type="submit" value="Search" />     </form>


title: Removing the FeedBurner redirect

text: When I set up my blog i was using the default RSS feed which worked fine. Then I switched it to using FeedBurner using the FeedSmith plugin which also worked without issue. Now though I want to go back to the default WordPress feed instead. I've removed WordSmith but www.mydomain.com/feed/ still gets redirected to FeedBurner and I can't find a way to stop it. It's not mentioned in my .htaccess file and the database rewrite_rules only changes that URL to use index.php?feed=rss2 which is the bit that redirects to FeedBurner. I can use feed=rss or atom to get the wordPress generated feeds but I want the defautl one to use it as well. I've poked around a little in the source to try and trace it but to no avail so far. Does anyone know where this unwanted redirect might be hiding itself? As a temporary workaround I'll set the rewrite_rules to redirect it to the RSS 1 feed but would rather it went to the RSS 2 one.


title: Order search results by category

text: I'm using this code to order my search results by post type and title, but I would like to order by category too. How can I do it?               add_filter('posts_orderby','my_sort_custom',10,2);     function my_sort_custom( $orderby, $query ){         global $wpdb;         if(!is_admin() && is_search())              $orderby =  $wpdb->prefix."posts.post_type ASC, {$wpdb->prefix}posts.post_title DESC";              return  $orderby;     }


title: Widget malfunction in Reponsive theme

text: Hi – I would like to put an existing RV Flagpicker (displays international flags with links) Widget into the TOP widget on our Responsive site. Just changed to this theme yesterday. When I drag the Flagpicker widget into the Top Widget field and look at the page, I get this message: function WP_Widget::widget() must be over-ridden in a sub-class. when create new Widget I am working in a the child theme provided by Cyberchimps. Still trying to figure out how best to edit, within Styles.css or Functions, or both? If you can point me to the basics of customizing within the child site that would be very nice. Can I edit PHP in the child site, within the WordPress editor? I know this is more than one question. I appreciate your help!


title: Sample code for validating custom metabox?

text: I've found very little on this site or in Google searches for examples of validating metabox custom fields. If anyone wants to give examples, here are some cases that would be useful 1) Date entered as 05/02/2011 is valid date format   2) Number entered in text box is numeric and between 100 and 500   3) Text in text box is > 25 chars long My question is not so much the code to validate the fields but where to put the validation code? Use Javascript or PHP? If it hooks on save-post, techniques for dealing with failed validation - Update the post? Don't update the post? - how do you stop it from updating? Best way to notify the user of the problems. All suggestions are appreciated. Sample code is more helpful than just a description of a technique. ( This would be a very good topic for someone to write an article on. ) Thank you


title: Changing post status

text: Refering to Post status because it's not allowed to do a question on a answer ?!   Original post is from _Bubka Gob_ and the answer came from _Chris O_ .   I have add their code to functions.php:                 add_action('post_submitbox_misc_actions', 'send_for_correction_button');     function send_for_correction_button()     {         //global $post;         echo '                      ';     }     add_filter( 'wp_insert_post_data' , 'my_filter_handler' , '99', 2 );     function my_filter_handler( $data , $postarr )     {         if ($postarr['save'] == 'Send for correction')             $data['post_status'] = 'on-correction';              return $data;     }      Because I have following plugin installed: CMS Tree page View I can see the page which is "marked" as on-correction. But as soon this plugin is deactivate the page isn't showing up anymore when I click All Pages.(In back-end/Admin)   Does anyone have a clue/hint or solution? Thanks in advance for time and effort. _(looking forward to a responce because we would love to use this nice solution for the reason that we also have multiple authors.), Sorry if I am wrong and duplicate now because lack of knowledge for the how to respond on excisting answers on stackexchange.com.   _


title: Change post date in menu to post title

text: I'd like to have my posts displayed in the menu as a name, not as the date they're published. Is that possible? Regards Peter


title: Migrated wordpress site give "Undefined variable: php" warnings

text: I have just migrated my wordpress site from my laptop to my desktop. I get server error 500 when I try /localhost/wordpress/wp-admin. So I turned on WP_DEBUG and now I get a series of               Notice: Undefined variable: skype_mu_dir in /var/www/wordpress/wp-content/plugins/skype-online-status/skype-status.php on line 42      Notice: Undefined variable: skype_mu_dir in /var/www/wordpress/wp-content/plugins/skype-online-status/skype-status.php on line 43      Notice: Undefined variable: user in /var/www/wordpress/wp-content/plugins/wp-symposium/symposium_hooks_filters.php on line 553      Notice: Undefined variable: user in /var/www/wordpress/wp-content/plugins/wp-symposium/symposium_hooks_filters.php on line 555      Notice: Undefined variable: uid in /var/www/wordpress/wp-content/plugins/wp-symposium/symposium_hooks_filters.php on line 600      Notice: Undefined variable: uid in /var/www/wordpress/wp-content/plugins/wp-symposium/symposium_hooks_filters.php on line 602      Notice: Undefined variable: cache_needs_updating in /var/www/wordpress/wp-content/plugins/s2member/includes/classes/cache.inc.php on line 97      Notice: Undefined index: level-1_label in /var/www/wordpress/wp-content/plugins/s2member/includes/classes/constants.inc.php on line 287      Notice: Undefined index: contact_me_data in /var/www/wordpress/wp-content/plugins/contactme/contactmedotcom.php on line 34      Fatal error: Class 'Memcache' not found in /var/www/wordpress/wp-content/plugins/flexicache/FlexiCache/Store/Memcache.php on line 63      A ls -l on /var/www shows               drwxr-xr-x  7 www-data www-data 4096 2012-06-13 21:35 wordpress      A ls -l on /var/www/wordpress shows               drwxr-xr-x 11 www-data www-data  4096 2012-06-13 19:24 wp-admin      A ps -ef | grep apache2 reports               prompt:/var/www/wordpress$ sudo ps -ef | grep apache2     root     14040     1  0 19:23 ?        00:00:00 /usr/sbin/apache2 -k start     www-data 14043 14040  0 19:23 ?        00:00:00 /usr/sbin/apache2 -k start     www-data 14044 14040  0 19:23 ?        00:00:01 /usr/sbin/apache2 -k start     www-data 14045 14040  0 19:23 ?        00:00:00 /usr/sbin/apache2 -k start     www-data 14046 14040  0 19:23 ?        00:00:00 /usr/sbin/apache2 -k start     www-data 14047 14040  0 19:23 ?        00:00:00 /usr/sbin/apache2 -k start     www-data 14048 14040  0 19:24 ?        00:00:00 /usr/sbin/apache2 -k start     www-data 14056 14040  0 19:24 ?        00:00:00 /usr/sbin/apache2 -k start      I wonder what I am missing. I am sure its something really small.


title: Disqus plugin outputs script as literal text

text:
After installing the Disqus plugin, their JavaScript code started popping up as plain text on my site in several places. My hypothesis is that it pops up at the end of any loop involving `the_post()`. This is one of them. ![Screenshot of the glitch](http://i.imgur.com/0CTn0ls.png) Here's a snippet from my `front-page.php`:               foreach ($terms as $term) {         $query = new WP_Query(array(             'post_type' => 'portfolio',             'skill' => $term->slug,             'orderby' => 'meta_value',             'meta_key' => 'pf_startyear',             'nopaging' => true,             'order' => 'DESC',             'posts_per_page' => 4         ));     ?>

<?= $term->name ?>

     <?php         if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();     ?>
                         <a href="<?= get_term_link($term->slug, "skill") . "#" . $post->post_name ?>"><img src="<?= wp_get_attachment_url(get_post_meta($post->ID, "pf_img", true)) ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>" class="pfItem" />
<?= get_post_meta($post->ID, "pf_pitch", true) ?>

     <?php         endwhile;         endif;     ?>

     <?php     }     ?>      This is how it renders: ![Output tree](http://i.imgur.com/5fs3n7n.png) Why is this happening and how can I prevent this script from breaking my site layout?


title: Show posts in a list separated by day

text: I want to display posts on index page within a links-list, with only the titles, till now i did the job, but now i want to have space between titles and be separated by day. Please check wimp.com and see how the titles are separated. Right now my code is something like this               <?php query_posts($query_string.'&cat=-3');           while (have_posts()) : the_post(); ?>                     <?php the_time('M j') ?>     -     <a class="title" href="<?php the_permalink() ?>"><?php the_title(); ?>      Thanks.


title: Custom Post Type Navigation on Custom Field

text:
I'm working on a Custom Post Type sorted on a Custom Field. No problem when I list out the posts. But when I go to the single post page for one of these, I want the Prev and Next navigation links to take us to the prev/next posts in the sort order dictated by the Custom Field. By default, WP orders them by post date. Code for sorting list:                   // shortcodes         // lor_list of letters: Lists all letters of reference in a table format         add_shortcode('lor_list', 'aaaConsultant_shortcode_lor_list');              function aaaConsultant_shortcode_lor_list() {             global $wp_query;                  $oWP = new wp_query(array(                 'post_type' => 'letters_of_ref'                 , 'orderby' => 'meta_value'                 , 'meta_key' => 'aaaConsultant_dateofletter'             ));                  $out = '
' . "\n";             if (!$oWP->found_posts) {                 $out .= '
d\'Oh! We don\'t have any Letters of Reference yet.
' . "\n";             } else {                 while ($oWP->have_posts()) {                     $oWP->the_post();                     $out .= '' . get_the_title( $oWP->post->ID ) . '' . "
\n";                 }             }             $out .= '
 ' . "\n";                  wp_reset_postdata();             return $out;         }      How do I do that? Thanks for your help.


title: Allow Duplicate Email Address for Different Users

text: I need to be able to have different users share the same email address. (Running a site where parents will be creating accounts for their children who may not have their own email address, so the parent will need to use his or hers for each of the children's accounts.) I have seen other suggestions, some include edited core (which I don't want to do), but nothing seems to work. Does anyone have any ideas on how to bypass the email_exists check on user creation? Thanks in advance. P.S. Since I don't have the rep, I can't comment on the other post to ask if the OP found a solution.


title: Multiple URL from Custom post name

text: I would like to do something special for a website in Wordpress. I have a "custom post type" whose data are all "post custom fields" except the name of the post. I need to create multiple urls for each of the "post custom fields" of the same post, and shows custom post field value. For example The custom post type is custompostA This custom post type has the following "custom post fields": customfieldA, customfieldB I add a new post whose title is "Example1" Based on this, I want two different urls www.domain.com/custompostA/Example1/customfieldA www.domain.com/custompostA/Example1/customfieldB The first URL will display the customfieldA value and the second URL will display customfieldB value I hope I have been clear since my exposure. Thank you very much Javier


title: Recurring scheduled task help

text: I'm trying to set up a scheduled task in my Wordpress installation which will (eventually) run a script to send an email once a day with a load of data in. However I can't seem to get a scheduled task to fire at all. I am testing it with a 2 minute interval to see if I can get it working. What I have so far is below, and is at the bottom of my `functions.php` file. Any idea where I'm going wrong?               add_filter('cron_schedules','my_cron_definer');     function my_cron_definer($schedules){         $schedules['twomin'] = array(             'interval'=> 120,             'display'=>  __('Once Every 2 Minutes')         );         return $schedules;     }          add_action('my_periodic_action','my_periodic_function');     function my_periodic_function(){         mail('email@address.co.uk','Test!', 'Test Message');     }     wp_schedule_event(time(), 'twomin', 'my_periodic_action');      I'm aware my Wordpress site needs to be getting it's pages visited for the function to run, so I have been clicking around on the site hoping to trigger my function but no luck! **Note:** I have swapped my real email address out!


title: How can I call a PHP function inside a hardcoded shortcode?

text: Maybe I'm doing this the long way but I need to make something like this:               <?php echo do_shortcode('[mu-events months="11" startmonth="today" orderby="time" orderas="ASC" sites="?> <?php get_current_site();?> <?php"]'); ?>     <?php echo do_shortcode('[mu-events months="11" startmonth="today" orderby="time" orderas="ASC" sites="11"]'); ?>      I guess I simply don't know if a function can be inserted inside a shortcode, but in this case it seems like it just has the incorrect syntax. Appreciate any pointing in the right direction!   Thanks **NOTE** There is a different between CURRENT_SITE and current BLOG_ID, see my note below


title: Custom Menus and taxonomies

text: OK I just started using WordPress not very good and I have a menu problem I can REALLY use some help please. I am working on a website and it has multiple locations, and not all the locations sell the same products. All the locations are pages with a parent structure. > Ohio -Contact Us -About us -Products etc... > > West Virginia -Contact Us -About us -Products etc... > > Pennsylvania -Contact Us -About us -Products etc... I got the hang of custom page templates and adding a custom menu to them (so all my Ohio pages use a custom Ohio template i made and included a custom Ohio menu). I am using posts to create the product information pages and display them using:               *post_type="post" taxonomy="category" posts_per_page="10" tax_term=*      which seems to work out nice on a general product page, (especially since i would like to only create the product pages once sine there are a lot of them) but i cant figure out how to add a custom menu based on the parent pages they came from. So if they come from my custom Ohio page and click on the link to a product post, there is not menu since that product might also be in West Virginia but not in Pennsylvania, so i cant use a standard menu. Any way to get the parent info from where they just came from or something? Any thoughts? I am really new at WordPress coding so please be gentle


title: Refine/Filter WP_Query Posts with jQuery or Ajax

text:
I know this has been asked many many times, but I literally searched for an answer for more than 5 hours without finding anything that drives me in the right direction. What I'm trying to achieve is something similar to this http://car- insurance.findthebest.com/ where you select terms on the left hand side and these terms are added (in this case they are showed on top of results) with the X next to them to remove those terms from the query. I have seen many many examples of filtering plugins but most of them are based on the SEARCH and I don't want to have a search. My example: Custom Post Type = jobs Custom Taxonomies = Country, Type, Job Area (like engineers, designers, programmers, etc) Simple Query getting all the jobs (simplified)                   <?php             $jobs = new WP_Query('post_type=jobs&posts_per_page=10');             while ($jobs -> have_posts()) : $jobs->the_post();          ?>
<?php the_title(); ?>
         <?php the_excerpt(); ?>              <?php endwhile; ?>      Anyone that could point me to a tutorial, a plugin, something in the right direction?


title: Private Posts/Pages & Search

text: I have a site up where there is one private page and one private post. When logged is as admin, i can view both of these, and they even appear in the search. However, when logged in as an editor, I can still see the posts, but they don't appear in the search. I found this a bit strange, was wondering if anyone has experienced this or knows how to make the private pages and posts appear in the search when logged in as an editor?


title: Custom Post Type Posts Not Showing Up in Admin

text: I am using this theme called IronBand. It has a few custom post types, and one of them is called "Gig." I created some custom posts under that Custom Post Type. Later, I wanted to changed the name of the Custom Post Type to "Show," so I fiddled with some php files. It seemed like it was too complicated to change everything accordingly, so I replaced the php files I fiddled with to the original php files. Now in the admin panel of "Gig," it says "No Gigs Found" Even if above the post list it says there are 17 published posts. How could I make the published posts show up again?


title: How to add custom post type archive page links to nav menu?

text: I cannot figure this out. There seems to be no checkbox or anything similar in function to add the newly created custom post type archive page into the menu. Also the link must be active, if you are on the page. This probably isn't possible, but is there some plugin for it? For the love of me, I cannot find it :( I only found this plugin called Custom Post Type Archives in Nav Menus, that doesn't really do anything, but add custom link to the menu..with the full site-url. It doesn't go active or isn't very dynamic. I thought that, probably the easiest way would be to override `wp_nav_menu()` and add my links manually and then use `$_GET` information to control the "currently active link".


title: Add Google Map Stylers to PHP

text:
I would just like to add the following Google Map stylers to my WP maps, but a little lost on where to include in the .twig Here are the stylers:               [      {     "stylers": [       { "saturation": -100 },       { "gamma": 0.96 }        ]       }     ]      And my map .twig:               {% if wp.get_post_meta(post.ID, '_property_latitude').0 and wp.get_post_meta(post.ID, '_property_longitude').0%}
{{ wp.__('Map', 'aviators') }}

                {% endif %} Help?


title: Set a WordPress website's language without affecting the back-end

text: I have a WordPress website. What I want to do is leave the back-end of the website in English, but in the meantime I want the front-end of it to be in Chinese. (So that it translates every text generated with plugins by script). Thank you in advance for your answers.


title: Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu

text: I currently developing a wordpress plugin that is using two custom post types. What I want to know here: is it possible to add a custom post type menu as another custom post type's sub menu?


title: Link each category to last post

text: I would like that each category link to the last post of each category.   * category 1 ----> link to the last post of category 1    * category 2 ----> link to the last post of category 2    * category 3 ----> link to the last post of category 3 How can I do it?


title: Insert Captcha Code info Any Form (Created of Plugin)

text: I am looking for best option on Captcha. Plugin's don't seem to be the answer because this is a custom form for the theme I am using. Unfortunately, they don't offer any spam protection. The form is heavily styled so I do not want to start from scratch. I do have access to the contact form code and can plug one right in. I can't imagine I am the only one with this issue. Doing a Google search hasn't been very insightful as well. Is my best option to find a plugin or add custom code? if so - can I do some kind of Javascript only protection? I'd rather not integrate it with PHP unless I have to...


title: Custom query shows custom post types in trash

text: I have a custom wordpress query like so:               $query = new WP_Query(array('post_status' => 'future || publish', 'post_type' => 'kalender', 'order' => 'ASC'));      But the problem is that the items shown on the pages also include the items that are in the trash? I don't understand why because according to the `post_status` only published & future posts should be shown? The item in the trash is a post in the future though? Maybe that's why it's shown but how can I exclude that one?


title: Cannot find webarh/malware redirect infection that only shows on Chrome

text: Several months ago my site (powered by WordPress) got hit by that webarh malware infection that set up a bunch of .htaccess redirects to its domain. Restoration of a good site backup nixed the problem, but apparently not entirely. Specifically, whenever I use Chrome, I log into my website's admin panel, and either edit an existing post or add a new post, as soon as the page finishes rendering I'm immediately kicked out to Chrome's warning page about my site containing content from this malware site. I've done a MySQL search of all post_content and comment_content, as well as ran a grep through all the PHP/JS/CSS files I can find, in addition to searching for any remaining rogue .htaccess or index.php files, to no avail. As I mentioned, it happens the moment the post.php or post-new.php finishes rendering and just before any existing text shows up in the box. This leads me to believe it's a plugin that's somehow associated with the text editor that's infected, but I'm not really sure where to look. Also, Firefox issues no warnings at all and allows me to edit as usual. Only Chrome does this (and has been ever since restoring the site). Any thoughts would be appreciated! **Edit:** In the interest of full disclosure, this is my site: www.magsolweb.net . Again, everything seems to be fine, except when adding a new post or editing an existing one.


title: How to query_posts using meta_query to orderby meta_key AND have a secondary sort by date?

text: I've been troubleshooting an issue over the past few days and keep going in circles. Could really use a fresh pair of eyes to help me answer this question... So I'm working with a wordpress site where posts have a few custom fields relevant to the query I need to run: "post-expired" and "my-sort-order". When I run my query_posts I want the results to be posts where the "post-expired" is NOT "yes" (this part works in my code). I also want the results sorted by the DESC number value of "my-sort-order" (works as well) AND if there's a tie on "my-sort-order" I would like a secondary sort by date with the most recent posts first. The secondary sort by date is where I'm having trouble. Here is the code I have right now:               <?php                    $args = array(         'paged' => $paged,         'meta_query'=> array(             array(                 'key'=>'post-expired',                 'value'=> 'yes',                 'compare' => '!='             )         ),         'meta_key'=>'my-sort-order',         'orderby'=>'meta_value_num',          'order'=>'DESC'     );          $args = array_merge( $args , $wp_query->query );          query_posts( $args );     ?>      Using the code above I correctly get back the non-expired posts and they're sorted by my-sort-order descending (i.e. 100 shows up before 99, etc). But if both posts have the same sort order value there is some type of secondary sort happening I can't seem to control (and can't figure out what it is actually being sorted on). My first idea to solve this was to only add values to "my-sort-order" if I wanted to set a specific sort order for that post. I thought if the value for this field was left blank for the rest of the posts, they would simply be returned in the default sort by DESC date (after the posts with a set sort order). However, what actually happened was any posts that didn't have a sort order value set were NOT returned at all... Next, I tried adding multiple values in the orderby field like this:               ('orderby'=>'meta_value_num date')      That completely blew up both sort orders I was going for and returned the posts in an unexpected way. I was under the impression that multiple orderby values were allowed, but for some reason it's not working here. At this point I'm not sure how to make either of these potential solutions work. Does anyone know how I can either 1) Sort posts by the "my-sort-order" field first, then have the remaining posts with no value in that field returned with the default date sort; or 2) Figure out how to control the secondary orderby sort so any posts that have a tie on "my-sort-order" will be sorted by date (newest first)?


title: How can I remove filters from custom post types?

text: I created a custom post type which I'll use as landing page for PPC. Now on that custom post type I would like to remove all the filters which are adding the social media buttons for example. I tried already with the following code but that did also remove the shortcode filter which I would like to keep on that custom post type. Here's the code I used:                   function landingpage_remove_plugin_filters() {              global $wp_filter;         global $wp;         if ($wp->query_vars["post_type"] == 'landingpage') {         remove_all_filters('the_content', 'plugin_filters');         }         }                 add_action('wp','landingpage_remove_plugin_filters');      Does anyone know what I need to change in order to keep the shortcode filters on that custom post type? Thanks a lot for your efforts. Daniel


title: __FILE__ in WordPress plugins

text: I'm using Sidebar Generator in all my themes. The plugin works perfectly normal from "plugins" directory, but I want to embed it somehow to my themes, so it won't display on Installed Plugins list. I've just copied sidebar_generator.php (the whole code is luckily in one file) to mytheme/plugins and included it in functions.php               require_once (MY_PLUGINS . '/sidebar_generator.php');        Now, it worked for all other plugins, but not for this one! This way when I click on "Sidebars" it refreshes the actual page instead of loading plugin's admin_page. Any ideas why is it happening and how to make it working? I believe the problem lays here:               add_submenu_page('themes.php', 'Sidebars', 'Sidebars', 'manage_options', __FILE__, array('sidebar_generator','admin_page'));      Chaning **FILE** to something else helps, but I'm not sure how to point this submenu link at the actual plugins admin page.


title: Pagination problem with multiple loops on the same page

text: I'm using 4 custom loops to display 3 posts on each one and every loop has its own pagination which works fine once the page loads up, the problem is that when I click on the 2nd page of the first loop it does show me the next 3 posts of that loop but it does the same for the other 3 loops, so if one of these loops has only 2 posts it won't show any if I click on the 2nd page of any of the other. Is there a way to page the pagination aware of what the loop is and only scroll through that loop? Thanks in advance!


title: WordPress menu with custom taxonomy

text: I'm looking for a scalable, best-practice way to do the following: I need a menu to have a link to the homepage, a standard page, and a variable number of custom post type archives. Each archive must also have one standard sub-page and a category page with all the posts with a specific custom taxonomy. So the menu would look like this:                Home      About      Artist 1 Archive           About Artist 1           Custom Taxonomy      Artist 2 Archive           About Artist 2           Custom Taxonomy      And so on for all other artists. Currently, I'm using WordPress's built-in archives for the custom post types, so they're not showing up in my menu--but I'm not adverse to just using a custom url (e.g., /artist-1/). What I'm having difficulty with is how to create the archives for the custom taxonomy. Is there a way I can set up a page template and somehow use `get_query_var()` to get the post type? Or is there a more natural way to do this? Finally, I also have to redirect the URL; the custom taxonomy's category will be `yes`, but I need to change it to be accessed at `portfolio`. Thanks very much for your help.


title: How translate it? Intensedebate

text: http://www.part.lt/img/4490330b04db19a9043999a460246e39489.JPG (IMG) Look at yellow background. How translate it, to Lithuanian lang? Thanks! I using IntenseDebate comments system.


title: Multi post thumbnails doesn't return anything

text: I am using the multi post thumbnails plugin. I have a custom post type "artist" who has a logo. In the loop I want to echo out the following:               $logo = MultiPostThumbnails::get_post_thumbnail_id('artist', 'Logo', $post->ID);     echo $logo;      Nothing gets returned - I used a `var_dump` on $logo to check, it is just an empty string. `$post->ID` returns the right id, and the parameters `artist` and `Logo` should be correct, too. What am I doing wrong here?


title: Show div based on custom meta value

text: I've search all over for a solution to this but can't seem to find anything that does exactly what I want it to. Basically what I want to do is display a particular div within a post based on the value of a specific custom field. For example; If the value of the "featured" custom field is "1" then I want to be able to show a div within single.php for that particular post But if the value of the "featured" custom field is anything other than 1 then I don't want anything to appear. Does that makes sense?


title: Orbit Slider and Events Manager Plug-in JavaScript

text: I have this slider(orbit slider http://foundation.zurb.com/docs/orbit.php ) and a wordpress plugin(event manager http://wp-events-plugin.com/ ) that loads all this jQuery-ui stuff(               /**        * Enqueing public scripts and styles        */       function public_enqueue() {         //Scripts         wp_enqueue_script('events-manager', plugins_url('includes/js/events-manager.js',__FILE__), array('jquery', 'jquery-ui-core','jquery-ui-widget','jquery-ui-position','jquery-ui-sortable','jquery-ui-datepicker','jquery-ui-autocomplete','jquery-ui-dialog')); //jQuery will load as dependency         //Styles         wp_enqueue_style('events-manager', plugins_url('includes/css/events_manager.css',__FILE__)); //main css       }            /**        * Localize the script vars that require PHP intervention, removing the need for inline JS.        */       function localize_script(){         global $em_localized_js;         $locale_code = substr ( get_locale(), 0, 2 );         //Localize         $em_localized_js = array(           'ajaxurl' => admin_url('admin-ajax.php'),           'locationajaxurl' => admin_url('admin-ajax.php?action=locations_search'),           'firstDay' => get_option('start_of_week'),           'locale' => $locale_code,           'dateFormat' => get_option('dbem_date_format_js'),           'ui_css' => plugins_url('includes/css/ui-lightness.css', __FILE__),           'show24hours' => get_option('dbem_time_24h'),           'is_ssl' => is_ssl(),         );      ) on the very top of every page on the site(               <link rel='stylesheet' id='events-manager-css'  href='http://at.theplural.com/wp-content/plugins/events-manager/includes/css/events_manager.css?ver=3.4.2' type='text/css' media='all' />     <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.core.min.js?ver=1.8.20'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.widget.min.js?ver=1.8.20'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.position.min.js?ver=1.8.20'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.mouse.min.js?ver=1.8.20'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.sortable.min.js?ver=1.8.20'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js?ver=1.8.20'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js?ver=1.8.20'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.resizable.min.js?ver=1.8.20'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.draggable.min.js?ver=1.8.20'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.button.min.js?ver=1.8.20'></script>     <script type='text/javascript' src='http://at.theplural.com/wp-includes/js/jquery/ui/jquery.ui.dialog.min.js?ver=1.8.20'></script>      ) . I'm basically trying to block that javascript from loading on the front page, or ideally, loading on only the specific page it's needed on -> page('events'). I tried my best to 'dequeue' the js, but it's not working


title: BBPress private topics by default

text: I'm using the BBPress plugin for WordPress and also the Members plugin. Does anyone know of an easy way to make Topics for members only by default? I know the Gravity Forms forum does this but I do not see an obvious way to go about it. Thanks for the help!


title: custom permalink/shortlink with base62 encoded post ID

text: I want my post-links to look like /%post_id62%_%postname%/ where %post_id62% is the post ID in base62 encoding (e.g. http://example.com/y9Rlf_test/) and my shortlinks to consist of /%post_id62% only (e.g. http://example.com/y9Rlf). This is what i've got so far (in my `functions.php`) which obviously doesn't work:               add_action( 'init', 'yoyo_init' );     function yoyo_init() {       add_rewrite_tag( '%post_id62%', '([A-Za-z0-9]+)' );     }          add_action('generate_rewrite_rules','yoyo_generate_rewrite_rules');     function yoyo_generate_rewrite_rules($yoyo_rewrite) {       global $wp_rewrite;       $new_rules['/([0-9A-Za-z]+)/?$'] = 'index.php?p=' .         base622dec($wp_rewrite->preg_index(1));  // DOESNT WORK OF COURSE (executed only once when rewrite_rules are generated)       $wp_rewrite->rules = array_merge($new_rules, $wp_rewrite->rules);     }          add_filter( 'post_link', 'yoyo_post_link', 10, 2 );     function yoyo_post_link( $permalink, $post ) {       if ( false !== strpos( $permalink, '%post_id62%' ) ) {         $post_id62 = dec2base62( $post->ID );         $permalink = str_replace( '%post_id62%', $post_id62, $permalink );       }       return $permalink;     }          add_filter('pre_get_shortlink', 'yoyo_custom_shortlink', 10, 4);     function yoyo_custom_shortlink($false, $post_id, $context, $allow_slugs) {       global $wp_query;       if($post_id or ($context == 'query' and $post_id = $wp_query->get_queried_object_id())) {         return home_url('/' . dec2base62($post_id));       }       return false;     }          function dec2base62($number) {       $digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';  $string = '';  while($number > 0) { $string = $digits[$number % 62] . $string;  $number = floor($number / 62); }       return $string;     }     function base622dec($string) {       $digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';  $number = 0;  while(strlen($string) and ($number *= 62 or strlen($string))) { $number += strpos($digits, $string[0]);  $string  = substr($string, 1); }       return $number;     }      Any idea how to tackle the problem? Bonus points for avoiding the -N slug suffix when there's another post with the same title created (which might be avoided actually when setting the link structure to "/%post_id62%_%postname%/" but in order to have the shortlink functionality it should be "/%post_id62%" I guess; cf. Turn off %postname% auto-incrementing?)! Thanks!


title: WYSIWYG eating up first p in td

text: Basically going mad on this one. Been googling about for quite some time now to find an answer. Most hits are on year old posts. I tried to alter how TinyMCE initiates with "remove_linebreaks" set to false in functions.php. The thing is altering text, at least this little group of three paragraphs in two td-cells in a table.   1. At first I alter the HTML to my liking and save. (This error occurs with or without the MCE Table Buttons plugin, so you need not worry about me having forgot to turn that off.) _New user can't post image so description is:_ two equal sized td-cells with three paragraphs each, with some internal line breaks as well.   1. Everything is at first all fine. But when I do some, or no, edits and save again this screen meets me. The first paragraph in each td-cell is joined with the second paragraph. This mating removes the seperating spaces all together. _New user can't post image so description is:_ Same cells and sizes, just that the first paragraph and the second merged, removing all separating spaces between them (end of p1 is on the same line as start of old p2). Paragraph 3 is unaffected.   1. When I save a third time the first paragraph again mates with the second (thus only one paragraph exists in both cells). Ofc this looks very ugly, and this is very hard to explain to the client (they do have zero html-understanding). _New user can't post image so description is:_ Now all paragraphs has become one, with end of old p2 being on the same line as the start of old p3.   1. After the save on step 3 in admin this is shown on the frontend. This means that the html must get broken on hitting save, or while loading it into the editor AND on the page. * _New user can't post image so description is:_ It looks exactly as in the admin. Been digging around some in autop, but that's beyond my php-skills. Anybody else known to this -- as it looks -- very common problem? I use Wordpress 3.3, haven't tested in any other version. Any suggestions?


title: How wp_ajax_nopriv since Wordpress 3.1

text: I have a question. When I was on Wordpress 3.0, my ajax function worked. It return good things when I'm log in and log out. add_action('wp_ajax_my_action', 'my_action_callback'); add_action('wp_ajax_nopriv_my_action', 'my_action_callback'); Now since Wordpress 3.1, I saw **wp_ajax_nopriv_my_action** _is deprecated_. So, for a visitor, my ajax function doesn't work. What is the alternative ajax function for Wordpress 3.1 ? Please


title: What code do you use to generate the text to go into the HTML title tag?

text: The question title says it all. Myself I just stick with the default code from one of the packaged templates that comes with WordPress out of the box:               <title><?php         /*          * Print the <title> tag based on what is being viewed.          */         global $page, $paged;              wp_title( '|', true, 'right' );              // Add the blog name.         bloginfo( 'name' );              // Add the blog description for the home/front page.         $site_description = get_bloginfo( 'description', 'display' );         if ( $site_description && ( is_home() || is_front_page() ) )             echo " | $site_description";              // Add a page number if necessary:         if ( $paged >= 2 || $page >= 2 )             echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );              ?></title>      Do any of you use different code for this?


title: Style every second widget?

text: I need to apply a certain style to every second widget in my sidebar, and I'm reluctant to use :nth-child due to cross-browser compatibility issues. Is there a bit of PHP that will allow me to apply a class to every other widget?


title: How to List Events by Year and Month Using Advanced Custom Fields?

text: I have a custom post type "Kalender_item" with a custom Date Field (YYMMDD). I want to list all the posts on a page sorted by Year and Month. For example:   * November 2012 (all events that occure in November 2012)    * December 2012 (all events that occure in December 2012)  And so on... I have succeeded in ordering them like so               $kalenderItems=query_posts('post_type=kalender_item&post_status=publish&meta_key=kalender_item_datum&orderby=meta_value');      This gives me all my posts in the correct order. Now I want to group them by Month Year and display the Month Year as a title for each group. How to group my results by year and month?


title: how to get nav menu list through menu name in wordpress

text: How to get nav menu list through menu name in WordPress I'm using this code by this code but showing all pages not working with custom nav menu name               <?php wp_page_menu('sort_column=ID&sort_order=desc;'); ?>


title: phpMyAdmin error #1062 - Duplicate entry '1' for key 'PRIMARY'

text: I'm new to PHP! I'm trying to import an SQL file using phpMyAdmin through a GoDaddy cPanel(please don't make fun of me) Here's a full readout               -- -- Dumping data for table `wp_commentmeta` -- INSERT INTO `wp_commentmeta` (`meta_id`, `comment_id`, `meta_key`, `meta_value`) VALUES (1, 3, 'rating', '5'), (37, 39, 'rating', '5'), (35, 37, 'is_customer_note', '0'), (4, 6, 'is_customer_note', '0'), (5, 7, 'is_customer_note', '0'), (6, 8, 'is_customer_note', '0'), (7, 9, 'is_customer_note', '0'), (8, 10, 'is_customer_note', '0'), (9, 11, 'is_customer_note', '0'), (10, 12, 'is_customer_note', '0'), (11, 13, 'is_customer_note', '0'), (34, 36, 'is_customer_note', '0'), (13, 15, 'is_customer_note', '0'), (14, 16, 'is_customer_note', '0'), (15, 17, 'is_customer_note', '0'), (16, 18, 'is_customer_note', '0'), (17, 19, 'is_customer_note', '0'), (18, 20, 'is_customer_note', '0'), (19, 21, 'is_customer_note', '0'), (45, 44, 'rating', '4'), (46, 45, 'rating', '4'), (22, 24, 'is_customer_note', '0'), (23, 25, 'is_customer_note', '0'), (24, 26, 'is_customer_note', '0'), (25, 27, 'is_customer_note', '0'), (26, 28, 'is_customer_note', '0'), (2[...]      I'm pretty inexperienced in PHP and I'm probably going to need this broken down like I'm a little baby, just a precaution


title: How to empty debug.log when file size is above xyMB?

text: Sometimes I forget to empty my debug.log file (or that it exists) and after trying to get around a bug, I find it having simply too much content to open it in ex. the basic Windows Text Editor. Part of my wp-config.php file:               error_reporting( E_ALL );     define( 'WP_DEBUG',         true );     define( 'SAVEQUERIES',      true );     define( 'WP_DEBUG_LOG',     true ); // file: /core_root/wp-content/debug.log     define( 'WP_DEBUG_DISPLAY', true );      **Question:** Is there a way to do this via Wordpress, or do I have to do it with basic php functions?


title: Making custom post type visible for only logged in users

text: I'm making a custom post type which is intended to be viewed by logged in users only, I've created a single-{postType}.php to override the default rendering and has included a logincheck in the top which redirects to the login page and back, after login. I've not enabled archive for my post type, so I imagine I don't have to override the custom archive page in addition. And this seems to work as intended, and easy maintainable without any plugins or whatnot. But is this enough to make sure the posts won't be visible for unauthorized users? What possible viewmodes/url-paths does a custom post type have? Afaik, I have to make the post publicly_queryable = TRUE, as I want it to be visible on the front end, although, only for logged in users. I'm not sure if there is some trickery I can do with the settings for the custom post type, or specific queries I may use in the single-{postType}.php to fetch non public queryable posts?


title: How would I go about creating a user ranked post popularity page?

text: I currently run a music blog using Wordpress as my CMS and i'm looking to redesign the site in the very near future. Part of my plan for the redesign is to try and integrate a user ranking system for each blog post. Ideally registered users would be able to upvote or downvote songs (posts), with the results being shown on a separate, dedicated page where viewers could show the most popular tracks from the last day/week/month/year/all-time. The best analogy would be a hybrid between Reddit and Hypem (or even Stack's system) but hopefully with much less technical proficiency needed for its development. Are there any plug-ins that may be able to help me develop such an idea? If not could people suggest how I should go about coding it myself? I don't mind taking on such a project but I would love to know how to get started so I'm not wasting time unnecessarily. Thanks.


title: Theme Options Panels, What are some good examples from Frameworks or Premium Themes?

text: I really like https://github.com/devinsays/options-framework-plugin Does anyone know any other good implementations of an options panel from a Framework or from another premium Theme? I think its a major factor in deciding whether to use a theme. I'd like to get a good list of whats being done out there. Wordpress StackExchange Community, what are your thoughts in general this?


title: Custom Query for Taxonomy

text: What is the correct wpdb custom query for this:               taxonomy=pa_main-genre&post_type=product&orderby=name&order=asc      Basically i am trying to do is,list all the terms for pa_main-genre. Thank you very much


title: Unicode characters are saved in a funny way in the DB

text: I have a custom website in which I am using `wp_insert_post()` to manually create posts that have a title which has characters thare are non-English Unicode letters (Arabic to be more specific). The URL that gets created by `wp_insert_post()` is something similar to the following: http://example.dev/%d8%b1%d9%88%d8%b3%d9%8a%d8%a7-%d8%a7%d9%84%d8%b9%d9%85%d9%84-%d8%b9%d9%84%d9%89-%d8%a7%d8%a8%d8%aa%d9%83%d8%a7%d8%b1-%d9%84%d9%82%d8%a7%d8%ad-%d9%81%d8%b9%d8%a7%d9%84-%d8%b6%d8%af-%d9%85%d8%b1/ (note that I have permalinks enabled) Now, how do I prevent the above link from being saved as show? How do I ensure the Unicode characters are used instead of the %-and-number combination for each letter?


title: minimum code requirements for new template

text: I am trying to create a very light-weight wordpress template which loads the minimum code overhead from the wordpress stack. I would like to have my template recognize that its part of wordpress, so for example it knows when you are logged in as displays the logged in status. Also it detects when you are admin so it shows the admin bar. What are the minimum function calls required to achieve this?


title: Redirect to custom variable

text: I am currently working on a redirect function. At the moment users must be logged in to view any page of the site. If a user goes to an URL directly, for example: `www.mysite.com/?p=3467373`, it will redirect them to a custom login page which will be something like this: `www.mysite.com/login`. Once they have logged in I would like the user to be redirected to the page they originally tried to access. At the moment I have this:               if (!is_user_logged_in() && is_single()){              $_SESSION['HolUrl'] = $_GET["p"];         header('Location: http://www.mysite.com/login/?'.$_SESSION['HolUrl']);            }      This works fine and passes over the variable `p`. The part I am having problems with is the login redirect. I have this set up in my `functions.php` but for some reason it doesn't grab the variable `p`:               function my_login_redirect( $redirect_to, $request, $user ){              global $user;         if( isset( $user->roles ) && is_array( $user->roles ) ) {             //check for admins             if( in_array( "administrator", $user->roles ) ) {                 // redirect them to the default place                 return home_url().'/wp-admin';             } else {                 return home_url().'/?p='.$_GET['p'];             }         }         else {             return $redirect_to;         }     }     add_filter("login_redirect", "my_login_redirect", 10, 3);      Can anyone see any problems with the above?


title: Create a form with media Library on frontend

text: I have created a form for my custom post-type. There is a problem with uploading images. I don't know how to use media library. because media library has a good option which users can place images whereever you want. I have found that a good sample page for it. please see the 2nd picture. http://0.s3.envato.com/files/64830849/Screenshots/08_bf-easyadmin.jpg http://1.s3.envato.com/files/64830849/Screenshots/11_bf-easyadmin-additem.jpg <\------ This is what I need. If you have any experience or links, tutorial, please let me know. Thanks,


title: Get custom_user meta value and add entry

text: I created a custom user meat value and want to add a new key/value to this array. But somehow I can't get it to work correctly, I always get a new array in side the array so that I always have e new dimension. But I want to keep just one dimension and add the new key/value pair. I know this is nothing complicated but somehow I can't get it to work. I would appreciate any help. my entry script:               $invoice_meta = get_user_meta( $_GET['id'], 'invoices');     $random = substr(number_format(time() * rand(),0,'',''),0,5);     if(empty($invoice_meta)) {         $invoice_array = array();         $invoice_array[date('d.m.Y').'_'.$random] = $pdf_save_path.$pdf_name;         add_user_meta( $_GET['id'], 'invoices', $invoice_array);     } else {         $invoice_array = $invoice_meta;         $invoice_array[date('d.m.Y').'_'.$random] = $pdf_save_path.$pdf_name;         update_user_meta( $_GET['id'], 'invoices', $invoice_array );     }      The first entry var_dump looks like this:               array(1) {       [0]=>       array(1) {         ["07.05.2013_51584"]=>         string(69) "user-data/26/rechnung/tierportal-d_07-05-2013_587543369Y48693K_26.pdf"       }     }      after second one it looks like this:               array(1) {       [0]=>       array(2) {         [0]=>         array(1) {           ["07.05.2013_51584"]=>           string(69) "user-data/26/rechnung/tierportal-d_07-05-2013_5875448693K_26.pdf"         }         ["07.05.2013_37016"]=>         string(69) "user-data/26/rechnung/tierportal-d_07-05-2013_58754348693K_26.pdf"       }     }      But I want to look it like this               array(1) {       [0]=>       array(2) {         ["07.05.2013_51584"]=>         string(69) "user-data/26/rechnung/tierportal-d_07-05-2013_587543369Y48693K_26.pdf",         ["07.05.2013_51534"]=>         string(69) "user-data/26/rechnung/tierportal-d_07-05-2013_587543367Y48693K_26.pdf"       }     }


title: Sort posts by each day in the loop

text:
I want to sort the posts in the loop by each day's posts. Since I have added filter to get posts from only last week, therefore there will not be repeating days (eg. There will be wednesday only once). For example: **Wednesday:** post 1, post 2. **Thursday:** post 1 post 2 How can I do that in the posts loop? I have simple loop to get the posts:               while (have_posts()): the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php     endwhile;


title: Is there a list of all possible WordPress URL's?

text: I'm looking for a way to find out how my WordPress site handles various incoming requests, some of which I have not written templates for. For example, there are a number of archive views (year, author, etc.) that I'm currently not using, but I still want to have control over what is displayed if a user (or attacker…) would "guess" such a URL. I can think of a few of them, but would ideally want a complete list I could go through, testing each URL against my site and evaluate the result. Is there such a list available?


title: Page permalink conflict with Date

text: I need to access a page which is name 2011. The trouble is that WP thinks that I am trying to read the 2011 posts of my blog. The only way I can make it work for the moment, is to change the permalink of my 2011 page to be mypage-2011. Is there anyway I can make/force WP to use 2011 as permalink for the page 2011, so it can be viewed via www.site.com/2011 thx s


title: Custom Nav Walker menu - Display children count

text:
I have a custom walker menu.( See the code below) I would like to have my nav menu like this               ----------------------------------     Home | link1 | link2 | link3 (5)     ----------------------------------      Where `5` is the children count of link3. Can someone help me to implement this? Here is my current custom nav walker code.               <?php     /**      * Cleaner walker for wp_nav_menu()      *      * Walker_Nav_Menu (WordPress default) example output:      *
Home
      *
Sample Page</l      *      * Roots_Nav_Walker example output:      *
Home
      *
Sample Page
      */     class Roots_Nav_Walker extends Walker_Nav_Menu {       function check_current($classes) {         return preg_match('/(current[-_])|active|dropdown/', $classes);       }            function start_lvl(&$output, $depth = 0, $args = array()) {         $output .= "\n
\n";       }            function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {         $item_html = '';         parent::start_el($item_html, $item, $depth, $args);              if ($item->is_dropdown && ($depth === 0)) {           $item_html = str_replace('<a', '<a class="dropdown-toggle" data-toggle="dropdown" data-target="#"', $item_html);           $item_html = str_replace('', ' ', $item_html);         }         elseif (stristr($item_html, 'li class="divider')) {           $item_html = preg_replace('/]*>.*?<\/a>/iU', '', $item_html);         }         elseif (stristr($item_html, 'li class="nav-header')) {           $item_html = preg_replace('/]*>(.*)<\/a>/iU', '$1', $item_html);         }              $output .= $item_html;       }            function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) {         $element->is_dropdown = !empty($children_elements[$element->ID]);              if ($element->is_dropdown) {           if ($depth === 0) {             $element->classes[] = 'dropdown';           } elseif ($depth === 1) {             $element->classes[] = 'dropdown-submenu';           }         }              parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);       }     }          /**      * Remove the id="" on nav menu items      * Return 'menu-slug' for nav menu classes      */     function roots_nav_menu_css_class($classes, $item) {       $slug = sanitize_title($item->title);       $classes = preg_replace('/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'active', $classes);       $classes = preg_replace('/^((menu|page)[-_\w+]+)+/', '', $classes);            $classes[] = 'menu-' . $slug;            $classes = array_unique($classes);            return array_filter($classes, 'is_element_empty');     }     add_filter('nav_menu_css_class', 'roots_nav_menu_css_class', 10, 2);     add_filter('nav_menu_item_id', '__return_null');          /**      * Clean up wp_nav_menu_args      *      * Remove the container      * Use Roots_Nav_Walker() by default      */     function roots_nav_menu_args($args = '') {       $roots_nav_menu_args['container'] = false;            if (!$args['items_wrap']) {         $roots_nav_menu_args['items_wrap'] = '
%3$s
';       }            if (current_theme_supports('bootstrap-top-navbar')) {         $roots_nav_menu_args['depth'] = 3;       }            if (!$args['walker']) {         $roots_nav_menu_args['walker'] = new Roots_Nav_Walker();       }            return array_merge($args, $roots_nav_menu_args);     }     add_filter('wp_nav_menu_args', 'roots_nav_menu_args');