title: Re-using single CPT code with get_template_part?

text: Wordpress newbie, here. I've created a custom post type, using CPT UI, named "menus". Later created single instances of that "menus" CPT, directed by a "single-menu" template. So here's my hierarchy for that "menu" CPT: one template "menus" : listing all "menu" posts one template "single-menu" : generating individual posts of the "menu" post type various pages based on the "single-menu" template : for example, a "monday" page Now, i want to retrieve this "monday" single instance of that CPT and re-use its code using get_template_part(). So far, i've been able to call the CPT listing page content ("menus") but unable to call the single instance ruled by the "single-menu" template. Here's my code:               <?php      get_template_part( 'menus');      ?>      The path for the page targeted reads as follow on my browser:               http://localhost/website/menu/monday/      I've tried several combinations but have been unable to call it. New to wordpress as mentioned, used to use a standard php include function in my static prototype. It worked fine, now how i can call this "monday" with the get_template_part()? Any idea as to how this could be done? Pointers welcome too!


title: paginate_links adds strong element

text:
I just faced a strange issue with `paginate_links` in WordPress 3.8.1. The navigation itself works great and as expected. But when going to the last page, it adds `<strong>` tags to the whole markup:               global $wp_query;          $unlikely_number = 99999999;          $args = array('total' => $wp_query->max_num_pages,                   'base' => str_replace($unlikely_number, '%#%', esc_url(get_pagenum_link($unlikely_number))),                   'current' => max(1, get_query_var('paged')),                   'format' => '/page/%#%',                   'prev_text' => 'PREV',                   'next_text' => 'NEXT',                   'type' => 'list',                   'end_size' => 2,                   'mid_size' => 2);          echo paginate_links($args);      Here is the generated HTML with screenshots. ![page name as needed](http://i.stack.imgur.com/xfWtc.png)

1

2

3

NEXT

      ![page navi with strong tag in last page](http://i.stack.imgur.com/CZyjL.png)

PREV

1

2

3

      Does anybody know this issue or could imagine a fix for that?


title: Can I / Should I use WordPress as a CMS for my Flash application

text: I sometimes build applications in Flash for the web that need a fair bit of dynamic data. Would WordPress be a good fit for my CMS solution? can it "talk" to flash? Does it allow output as different formats such as XML, JSON, or AMF?


title: disable wordpress canonical tag meta

text: wordpress core automatically generates canonical tag in **HEAD** section:               <link rel="canonical" href="http://blabla.com" />      how to disable/remove that?


title: Minimize database queries to user tables?

text: I'm trying to come up with a strategic way to collect large amounts of usermeta data _(and output to the screen)_ while keeping database queries low. Some pages, like the home page, single pages, and category pages, load up in less than half a second with 40-60 queries. Other pages that contain large amounts of usermeta load up in 5-6 seconds with 200-220 queries. Is there a "best practice" way to do somehow pull all userdata before the website loads (or the first time a website loads) and then tap into that information (IE, a multidimensional array based on user ID) for all other user-based queries on the site? Would the information save on visit (cached on browser), or would it be necessary to use the transient api? Any thoughts?


title: Hack nav menu to add gettext() to menu items?

text: I'm translating my whole site with gettext and I'm using shortcodes for the content in my pages that in turn call gettext. However shortcodes don't seem to work for menu items I need to figure out a way to translate them. I'm wondering whether there is some way to modify my menu from my functions.php to add it a _("") function somewhere between retrieving the menu items labels from the database and echoing them. Is that possible? if not, how can I translate menu items?


title: I want a widget to appear on only one page

text: I have a rotating images widget I want to display on my homepage. My selected homepage is a static front page I created with several other pages to make my blog look more like a website than a blog, and then I have a separate blog page. The widget does not come with shortcode. Rather it comes with something like code that I have to insert in editor in a place that will make the widget appear where I want the rotating images to appear. What I've figured out with trial and error is that when I insert the code into the page.php I can get it to show up exactly where I want it on my selected home page. The problem is that it also shows up on all the other pages except the blog page. So, what I need to do is to write some additional code telling wordpress to only show the widget on the one page. Any ideas on how to write this code? Here is the code that comes with the widget:               <?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>      Thanks, Jason


title: wp-admin/admin-ajax.php - Slowing My Site down

text: Whenever I do a speed test on my site from Pingdom - the page wp-admin/admin- ajax.php takes the longest to load and therefore it is causing my site to load slowly. As speed is an important factor I would like some advice. This is the site.


title: If custom field doesn't exist, or exists and it's true show title?

text: Im trying to add new feature to the theme and that's show/hide page title,but since i already have about 50 posts i can't go to all of them and save again just to save custom field values. So i tried to make check if custom field doesn't exist, or if exist but not set to false show the title. But im failing at some point. Custom field is metabox with checkbox, when checked it records "1" in database, when unchecked records "0" in database. And of course since im adding it now, 50 posts doesn't have that field in database. Here is my last tryout.               if ( empty(vf_get_meta($post->ID, 'page_options', 'show_title')) || (vf_get_meta($post->ID, 'page_options', 'show_title') == true ))      This should check if meta is empty or if it's true and show page title. But something im not understanding. Isn't return false if it's empty? How do i do it than?


title: Shortcode help: If no image entered take default

text:
I have a shortcode that creates an "opinion box". The user should insert 4 parts   1. the title   2. the images   3. the opinion   4. side of the image in relationship with text i want to check if no image was entered and in such   a case take a default image from /images/ folder...   but to do so without changing the 'paste Img Url'   statement which i need in order to explain to the   user where to put the image if exists. **This is the shortcode:**               function opinionBox( $atts, $content = null ) {         extract( shortcode_atts( array(             'title' => 'yourtitle',             'imgURL' => 'paste Img Url',             'side' => 'left'         ), $atts ) );              return '

                 '. $title .'

                 '. $content .'

         ';     }     add_shortcode( 'opinionbox', 'opinionBox' );


title: How to add homepage Widget?

text: How do I add a 'Homepage' widget to my widget bar in Wordpress 3.3 ??!! **EG:** Dashboard > Widgets > Homepage with same fields as others


title: Moving Some Articles to new site

text: I have a question about moving wordpress sites around. I've read most of the Support Docs about moving a wordpress site. My question is this, what would you guys recommend in regards to moving only certain posts from one site into a totally different domain. My current domain is a tech/blog installation. The past year or so, I've been posting my technical stuff to a different domain, and my current domain is collecting quite a bit of dust. What I'm wanting to do is turn my current domain into a personal blog and move only my technical articles over to the new blog. Obviously, there's probably an easy way to move posts and comments over (i haven't looked into it but i'm pretty sure I can do this pretty easily). The true question is how I would present these posts on the current site once they are moved over to the new domain? Do I keep them on the current domain? Should I redirect users to the new domain automatically on only these posts? Should I remove them from the current site? These type of questions I'm wondering and if you guys have an pointers please let me know.


title: New clone of Wordpress site 301 redirects back to orginal site

text: My new cloned site when accessed by IP in a browser forwards back to the original site via a '301 Moved Permanently'. How do I keep this new site from forwarding back to the old? History: Our dedicated webserver is dying, and I am attempting to get working clones of our wordpress websites working elsewhere before it is dead. I am new at this and wanted to have the security of seeing them running in a new linode VM before I switched the DNS over.   * I set up the VM with Ubuntu Server 12.04, wordpress & LAMP    * I copied over all the webfiles from the dedicated server(DS) to the Virtual Machine(VM)    * I ran mysqldump on the DS and reinstalled the wordpress database on the VM    * I made sure that the DB_user and DB_password in wpconfig.php had permissions to the DB    * I made sure that the Apache virtual host files ( that I copied from the DS) has the IP of new vm.  Then the forwarding began, I have researched and tried the following   * I added both of the following to my wpconfig.php file. I tried it by IP and by an alternate name > define( 'WP_SITEURL', 'http://example.com' );   >  define( 'WP_HOME', 'http://example.com' ); >   * I and others have gone through the code looking for any typical > forwarding code >   * I tried turning off rewriteengine in .htaccess > Apache is working as I can access static files via http://<ip>/image.png, but when I enter the IP in a browser, it pauses for a second and forwards back to the original site on the old DS. I am not convinced that wordpress is working correctly on the new site as it always forwards. We get this **301 Moved Permanently** when accessing it with curl               curl -v http://<ip>/     * About to connect() to <ip> port 80 (#0)     *   Trying <ip>...     * Adding handle: conn: 0x7fb182003a00     * Adding handle: send: 0     * Adding handle: recv: 0     * Curl_addHandleToPipeline: length: 1     * - Conn 0 (0x7fb182003a00) send_pipe: 1, recv_pipe: 0     * Connected to <ip> (<ip>) port 80 (#0)               GET / HTTP/1.1     User-Agent: curl/7.30.0     Host: <ip>     Accept: */*          < HTTP/1.1 301 Moved Permanently     < Date: Thu, 27 Feb 2014 13:34:33 GMT     * Server Apache/2.2.22 (Ubuntu) is not blacklisted     < Server: Apache/2.2.22 (Ubuntu)     < X-Powered-By: PHP/5.3.10-1ubuntu3.9     < X-Pingback: http://<orginal_domain_name>.org/xmlrpc.php     < Location: http://<orginal_domain_name>.org/     < Vary: Accept-Encoding     < Content-Length: 0     < Content-Type: text/html; charset=UTF-8     <      * Connection #0 to host <ip> left intact      How do I keep this new site from forwarding back to the old?


title: Facebook Like Button in Jetpack

text: I'd like to have a Facebook Like Button (not a Facebook share, which is available) through Jetpack. There is a "Add a new service" and I've tried various parts of code from all over but always gets an "An error occurred creating your new sharing service - please check you gave valid details." Anyone knows howe to do this?


title: How does Wordpress handle MySQL row lock errors?

text: If there is a WordPress plugin which updates rows in a custom table, but that update encounters a row lock, what happens? E.g. two users simultaneously fire an update on TABLE1, one setting AGE=1 and the other setting AGE=2:   * Will there be a row lock at all?   * Will MySQL handle this "gracefully" and one of the 2 updates simply be "lost"?   * Does Wordpress handle it gracefully?   * Do I need to take care of it in the plugin? The data is not very important, as in I dont need to track every change. But I do need to handle any errors that might arise.


title: Dynamic href link to Contact Page

text: I need a `<a href="Something Like <?get_contact_page>">Contact Page</a>` Code that always links to the Contact page, no matter what is it's ID There's a page template for contact page. Is it possible to do this? I'll gladly provide any further information you need :) Thanks!!


title: What archive plugin works with W3 total cache?

text: All plugins I've tried makes the page go blank. I tried so far:   * Smart Archives Reloaded    * Clean Archives Reloaded    * Better Extended Live Archives Thanks. Tal


title: Custom post type for 'staff' versus using wordpress user profiles?

text: A scenario I keep coming across is where an organisation might have several staff for whom I want to have some sort of listing and a single profile page with biographical information. Typically I would create a custom post type for staff and maybe a custom taxonomy if needed. But now I'm wondering if it might not be optimal to use the built-in "user" post type in Wordpress. I realise I can customise the user profile fields, display user listings, single profiles etc Custom taxonomies are possible too I believe. Is there a best practice here? I have a case now where all staff are also writing blog posts under their own name and so have a user account anyway and it crossed my mind that maybe I'm better off just fleshing out their user profiles and working with author.php instead of using the custom post type of 'staff'. For now I've been going with the CPT and using Posts 2 Posts plugin to associate their "staff" post with their "user" account and thereby create listings of their blog posts on their single staff page. Any thoughts on how best to implement this in wordpress is appreciated.


title: Customizing lost password email

text: I need to change the default email text that will be sent to recover the password. I have already changed the mail of activation in multisite:               // Start changing email body     function myprefix_change_activation_email_body ($old_body, $domain, $path, $title, $user, $user_email, $key, $meta) {         $my_message .= "\n\nhello {$user} ,welcome to {$domain} !\n\n";              // ... other stuff         return $my_message;     }     add_filter('wpmu_signup_blog_notification_email', 'myprefix_change_activation_email_body', 10, 8);     // End changing email body          // Start changing email subject     function myprefix_change_activation_email_subject ($old_subject, $domain, $path, $title, $user, $user_email, $key, $meta) {         $my_subject = "my subject";         return $my_subject;     }     add_filter('wpmu_signup_blog_notification_subject', 'myprefix_change_activation_email_subject', 10, 8);


title: redirect loop to page, can't find origin, can't remove

text: I have a new client who did "something, I can't remember what" to her blog. Now when you visit the home page, it redirects to a page she created and deleted, "/road-maps/". I have no idea why it started doing this, or how she got it to do this. She has no FTP access and did something solely in the Wordpress back office. I located the deleted page in the trash and deleted it permanently but it still redirects. I disabled every plugin and it still redirects to there. I exported the database and looked for instances of "road- maps" anywhere inside it and found only two places - the temporary redirect that I put in place to a static page while I try and fix the problem, and the references to the page in the site tracking logs. Nothing else. I looked in .htaccess and it looks fine, no mention of "road-maps". I SSHed into the site and did a global search for "road-maps" and found nothing. I'm at my wit's end. Where could this redirect possibly be coming from? And how do I remove it? Thanks so much.


title: Changing themes on locally hosted webpages

text: I recently turned my Raspberry Pi into a web server, and now I installed Wordpress on it. Everything is going excellently, but when I went to change the theme from default, I found I need my hostname, FTP username, and FTP password. I didn't see this as a major problem, so since I host my webpage on my 'Pi I put in "localhost" and my MySQL username/password for the server I set up. It popped up an error saying it failed to connect to the FTP server. Since I am still fairly new to Wordpress and webhosting, could someone please tell me what I _should_ have used?


title: Post Content, Special Characters and Filters

text: I added a hook to `the_content`.               add_filter('the_content', 'edit_the_content');     function edit_the_content($content){         return $content;     }      Pretty simple right? However, when it output `$content` from within my `edit_the_content()` callback it seems like WordPress converts some, but not all characters into special characters. **Example:** it's = `it’s` but then an anchor tag, remains untouched and not converted. Is there some sort of filter which runs on `the_content` which only converts some characters to special characters, but not all?


title: Loop get_theme_mod

text: I've got a bunch of customizer settings set up Rather than calling individual get_theme_mod statements for each setting individually, is there a way to simplify it to loop thru them without having to explicitly write each one individually? The complete file is also setup on Gist for review               <?php               /** Adds the Customize page to the WordPress admin area */     function litho_customizer_menu() {         add_theme_page( 'Customize', 'Customize', 'edit_theme_options', 'customize.php' );     }     add_action( 'admin_menu', 'litho_customizer_menu' );          /** Adds the individual sections, settings, and controls to the theme customizer */     function litho_customizer( $wp_customize ) {         class Example_Customize_Textarea_Control extends WP_Customize_Control {             public $type = 'textarea';                  public function render_content() { ?>                                      <?php echo esc_html( $this->label ); ?>                     <textarea rows="5" style="width:100%;" <?php $this->link(); ?>><?php echo esc_textarea( $this->value() ); ?></textarea>                              <?php }         }              $wp_customize->add_section( 'site_settings', array(                 'title' => 'Framework Settings',                 'description' => 'Adjust settings',                 'priority' => 35,         ));               /* <?php echo $sidebar_position; ?> */                        $wp_customize->add_setting( 'site-subtitle', array( 'default' => 'Default subtitle text','sanitize_callback' => 'litho_sanitize_text', ) );         $wp_customize->add_control('site-subtitle', array(                 'label' => 'Copyright text',                 'section' => 'site_settings',                 'type' => 'text'         ));              $wp_customize->add_setting( 'litho_copyright_textbox',array( 'default' => 'Default copyright text','sanitize_callback' => 'litho_sanitize_text', ) );         $wp_customize->add_control( 'litho_copyright_textbox',array(                 'label' => 'Copyright text',                 'section' => 'site_settings',                 'type' => 'text'         ));                  $wp_customize->add_setting( 'litho_hide_copyright',array('sanitize_callback' => 'litho_sanitize_checkbox',) );             $wp_customize->add_control( 'litho_hide_copyright',array(                     'type' => 'checkbox',                     'label' => 'Hide copyright text',                     'section' => 'site_settings'             ));                  $wp_customize->add_setting( 'litho_logo_placement', array( 'default' => 'left','sanitize_callback' => 'litho_sanitize_logo_placement', ) );             $wp_customize->add_control( 'litho_logo_placement',array(                     'type' => 'radio',                     'label' => 'Logo placement',                     'section' => 'site_settings',                     'choices' => array( 'left' => 'Left','right' => 'Right','center' => 'Center')             ));              $wp_customize->add_setting( 'litho_powered_by', array( 'default' => 'wordpress','sanitize_callback' => 'litho_sanitize_powered_by', ) );         $wp_customize->add_control( 'litho_powered_by',array(                 'type' => 'select',                 'label' => 'This site is powered by:',                 'section' => 'site_settings',                 'choices' => array( 'wordpress' => 'WordPress','nuclear-energy' => 'Nuclear Energy')         ));              $wp_customize->add_setting( 'page-setting', array( 'sanitize_callback' => 'litho_sanitize_integer', ) );         $wp_customize->add_control( 'page-setting',array(                 'type' => 'dropdown-pages',                 'label' => 'Choose a page:',                 'section' => 'site_settings'         ));              $wp_customize->add_setting( 'color-setting', array( 'default' => '#000000','sanitize_callback' => 'sanitize_hex_color', ) );         $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'color-setting',array(                 'label' => 'Color Setting',                 'section' => 'site_settings',                 'settings' => 'color-setting'         )));              $wp_customize->add_setting( 'file-upload' );         $wp_customize->add_control( new WP_Customize_Upload_Control( $wp_customize, 'file-upload',array(                 'label' => 'File Upload',                 'section' => 'site_settings',                 'settings' => 'file-upload'         )));              $wp_customize->add_setting( 'img-upload' );         $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'img-upload',array(                 'label' => 'Image Upload',                 'section' => 'site_settings',                 'settings' => 'img-upload'         )));              $wp_customize->add_setting( 'textarea' );         $wp_customize->add_control( new Example_Customize_Textarea_Control( $wp_customize, 'textarea',array(                 'label' => 'Textarea',                 'section' => 'site_settings',                 'settings' => 'textarea'         )));              $wp_customize->add_setting( 'font-color', array( 'default' => '#444444', 'sanitize_callback' => 'sanitize_hex_color', ));         $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'font-color',array(                 'label' => 'Font Color',                 'section' => 'colors',                 'settings' => 'font-color'         )));              $wp_customize->add_setting( 'featured-background',array( 'default' => '#ffffff','sanitize_callback' => 'sanitize_hex_color','transport' => 'postMessage', ));         $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,'featured-background',array(                 'label' => 'Featured Background',                 'section' => 'colors',                 'settings' => 'featured-background'         )));              /* AJAX function for live preview */         if ( $wp_customize->is_preview() && ! is_admin() ) {             add_action( 'wp_footer', 'litho_customize_preview', 21);         }              function litho_customize_preview() {             wp_enqueue_script( 'litho-customize-js', get_template_directory_uri().'/core/js/customize.js',array());         }         add_action( 'wp_enqueue_scripts', 'litho_customize_preview' );              $wp_customize->get_setting('blogname')->transport='postMessage';     }     add_action( 'customize_register', 'litho_customizer' );          function litho_header_alignment() {         $litho_position = get_theme_mod( 'litho_logo_placement' );         if( $litho_position != '' ) {             switch ( $litho_position ) {                 case 'left':                     break;                 case 'right':                     echo '';                     break;                 case 'center':                     echo '';                     break;             }         }     }     add_action ( 'wp_head','litho_header_alignment' );          /* The force_balance_tags() function ensures that no tags are left unclosed, while the wp_kses_post() ensures that only safe tags make it into the database (the same tags that are allowed in a standard WordPress post */     function litho_sanitize_text( $input ) {         return wp_kses_post( force_balance_tags( $input ) );     }     function litho_sanitize_checkbox( $input ) {         if ( $input == 1 ) {             return 1;         } else {             return '';         }     }     function litho_sanitize_logo_placement( $input ) {         $valid = array(             'left' => 'Left',             'right' => 'Right',             'center' => 'Center',         );              if ( array_key_exists( $input, $valid ) ) {             return $input;         } else {             return '';         }     }          function litho_sanitize_powered_by( $input ) {         $valid = array(             'wordpress' => 'WordPress',             'nuclear-energy' => 'Nuclear Energy',         );              if ( array_key_exists( $input, $valid ) ) {             return $input;         } else {             return '';         }     }     function litho_sanitize_integer( $input ) {         if( is_numeric( $input ) ) {             return intval( $input );         }     }


title: How do I wrap 3rd party jquery scripts so that they work in wordpress?

text: I'm trying to include a jQuery autocomplete script in the header.php file of my theme. The script, outside of wordpress, works great using this structure (which is the same as the jQuery autocomplete demo):               <script>       $(function() {          .....       });       </script>      I've tried wrapping it like this:                <script>     jQuery().ready(function($) {                 $(function() {                      });             });                </script>      The original script works fine. Outside of wordpress I have no problem. It's when I try to add it to the header.php file that nothing works. Even other autocomplete scripts on the site stop working. Also, I've added the following to my functions.php file:               function add_qa_scripts(){       wp_enqueue_script( 'jquery-ui-autocomplete' );     }     add_action('wp_enqueue_scripts', 'add_qa_scripts');      I can see the scripts included in the footer of my theme. But, no matter what, I can't get the autocomplete to function. What am I doing wrong? EDIT: As I'm not sure of the structural questions in the comments, here is the page for reference - the category tags should be auto completing: http://bluepresley.com/qa/tag-search/


title: Bizarre issue with custom RSS template

text: I'm trying to create a custom RSS feed template for a site my company manages, and I've encountered a very confusing bug I'd like some input on. First off, as background context, after a lot of Googling, this is the method I've chosen to create the RSS template. (If there's a better approach, I'm all ears):   1. Copy /wp-includes/feed-rss2.php into my theme folder    2. Specify that file as a page template, and modify as desired   3. From the Wordpress backend, create a new page that uses the above template  From there, you get an XML feed that's formatted for RSS. That process seems to work fine, even if it's a bit kludgy. Now, here's the issue I'm having. The XML outputted looks something like this:               <?xml version="1.0" encoding="UTF-8"?>      <rss version="2.0"         xmlns:content="http://purl.org/rss/1.0/modules/content/"         xmlns:wfw="http://wellformedweb.org/CommentAPI/"         xmlns:dc="http://purl.org/dc/elements/1.1/"         xmlns:atom="http://www.w3.org/2005/Atom"         xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"         xmlns:slash="http://purl.org/rss/1.0/modules/slash/"         >           <channel>          <title>New Grocery Coupons & Online Coupons Added Daily</title>          <atom:link href="http://couponkim.dev/weekly-deals-rss/" rel="self" type="application/rss+xml" />          <link>http://couponkim.dev</link>          <description>Coupon Kim has online coupons, printable coupons, and coupon code section for Moms like me trying to save money!</description>          <lastBuildDate>Mon, 18 Apr 2011 14:51:44 +0000</lastBuildDate>          <language>en</language>          <sy:updatePeriod>hourly</sy:updatePeriod>          <sy:updateFrequency>1</sy:updateFrequency>          <generator>http://wordpress.org/?v=3.1</generator>              <item>              <title>coupon-code</title>              <link>http://couponkim.dev/soap-com-coupons/coupon-code-159/</link>              <comments>http://couponkim.dev/soap-com-coupons/coupon-code-159/#comments</comments>              <pubDate>Mon, 18 Apr 2011 13:46:18 +0000</pubDate>                ...      (I've truncated the output for the sake of relevancy.) When I try to view the above in a Google Chrome, I get the following error message:               error on line 12 at column 30: xmlParseEntityRef: no name      My assumption here is that the ampersand is causing problems, though honestly, that's still a guess at this point. OK. So this is where it starts to get weird. I went into the PHP template, and embeded that title inside of a CDATA tag. Strangely, I didn't see that change reflected in the output when I refreshed the page. Trying something simpler, I just killed all of the PHP in the template inside of the title tags, and replaced it with static text like "This is a Test." When I refreshed the page, I _still_ didn't see any change in the output. At that point, I suspected that some cache somewhere must be working against me. I disabled the W3 Total Cache plugin, cleared my browser's cache (I'm using Chrome), and restarted Apache for the hell of it. I reloaded the page again, but saw no change. Now, as an experiment, I changed the `<title></title>` tags to read `<test></test>` and reloaded. This time, I _did_ see the change. So at this point, I thought, OK, cool, I'm finally breaking through the cache. I changed the line back to: `<title>This is a Test</title>`, but saw outputted `<title>New Grocery Coupons & Online Coupons Added Daily</title>`. So that's where I am. I've got literally no clue what the problem could be at this point. Here's one more weird thing to know, though. When I changed the `<title>` tags to `<test>`, and _did_ see the change made on line 12, the _next_ title tags (at channel->item->title at line 22) changed to read `<title>New Grocery Coupons & Online Coupons Added Daily</title>` \- ie, the troublesome output from line 12! My best guess is that there is some Wordpress filter that I don't know about that's operating on this output, but I'm really stumped at this point. Any light you guys could shed on this problem would be very much appreciated! Thanks in advance.


title: Use Regular Expression to get tag from permalink url during wp_rewrite in generate_rewrite_rules

text: I'm messing with wp_rewrite and have spent the past few hours trying to figure regular expressions out again (i seem to have forgotten.) This is probably extremely easy for someone. Basically I'd like to match an alpha expression and stop at teh first occurance of a forward slash. Here's what i'm doing: I have a url http://www.mydomain.com/basename/uniquename/page/2/ I want to get uniquename out with the following               'basename/(.*)/page/([0-9]{4})/?$' => 'index.php?post_type=basename&uniquenametaxonomy='.$wp_rewrite->preg_index(1).'&paged='.$wp_rewrite->preg_index(2),      obviously (.*) matches /page/ as well as uniquename and provides me with a query string looking like ?post_type=basname&uniquenametaxonomy=uniquename%2Fpage%2F2 I'd like it to be ?post_type=basname&uniquenametaxonomy=uniquename&paged=2 I know it has to be extremely easy, I'd like to match uniquename and stop at the first occurance of a forward slash.


title: query_posts() on key's value, or key's existence

text: I recently started using simple fields on a project to differentiate between types of posts. All posts from now on will have one of four possible meta values associated with this (Story, Article, Video or Cartoon). None of these types of posts have unique attributes or values, so I've decided not to go the custom post type route this time. I'm aware how to query for posts with a certain meta value, but this only works on posts that already have that meta key associated with them - not for posts that were created before the simple fields plugin was installled, and put into use. I'm curious how I would query for all posts that either lack the meta key "fizzbuzz" or have the key but it's associated with a value of "foobar". Is there a way to query for all posts that lack a key altogether?


title: What's the best way to echo out a filter variable?

text: I have a plugin filter that isn't working for me:               add_filter( 'gform_notification_email_3', 'route_notification', 10, 2 );     function route_notification($email_to, $entry) {         global $post;         $email_to = get_the_author_email();         return $email_to;     }      I think the $email_to variable isn't being set properly, but how do I echo this variable out to check it?


title: Plugin won't activate, fatal error (widget class not found)

text: I've been putting together a simple WordPress plugin that employs a sidebar widget and shortcode. One user has reported the following error when trying to activate the plugin on their local WP installation: > Plugin could not be activated because it triggered a fatal error. > > Fatal error: Class 'Example_Widget' not found in > /Applications/MAMP/htdocs/wordpress/wp- > content/plugins/exampleplugin/exampleplugin.php on line 30 Here's the code in `exampleplugin.php`, beginning with line 29:               $example_plugin = new Example_Plugin;     $example_widget = new Example_Widget;          class Example_Plugin {         ...     }      I'm fairly new to OOP in PHP, and can't figure out what's causing a fatal error for this user. The plugin works fine for me, making this all the more mysterious.


title: How to create a fixed header and scrolling content area

text: I've bee experimenting with a site I'm working on. My client wants the header with its nav and logo intact, so visitors always have the ability to access the navbar while scrolling to read the page content. I have added `fixed` to my wrapper `div` and that keeps the background static, but in this design the background is also part of the header. My page is http://axiomwest.com/client-services/ How can I achieve a fixed header area and allow scrolling only in the main content area?


title: Check for success of $wpdb->update() correctly

text: My code is               if( $wpdb->update($tableName,array('opt_value'=>$cInfo),array('opt_name'=>'showWeatherWidget')))         //show success message     else         // show failure message      This is not correct, `$wpdb->update()` returns false if it doesn't change any data, but there were no errors. Can someone tell me the proper way to display a success message that a field was updated?


title: Something strange with ajax

text: function __construct(){             $ajax = add_action('wp_ajax_my_action', array($this, 'ajax_respone'));             var_dump($ajax);             var_dump($ajax == '1234');             die();         }              public function ajax_respone(){             $whatever = intval( $_POST['whatever'] );             return $whatever;         }      It prints: > bool(true)   > bool(true) How it is possible that `'1234'` or just `1234` is equal to true? Helps only `===` Also just noticed that the `die()` in next code doesn't work               function __construct(){         add_action('wp_ajax_my_action', array($this, 'ajax_respone'));     }          public function ajax_respone(){         $whatever = intval( $_POST['whatever'] );         var_dump($whatever);         die();     }      This means that the function will not start or it starts only when requested?


title: Creating a custom feed for categories that includes the first post's featured image

text: I'm needing a little help getting this figured out. I have a query that's not quite working right now, but I need it to create a custom feed that includes category information and then includes the featured image from the first post in that category. Anyone have thoughts on how to get that running?               /**      * Custom Feed for Category Listing      */         function outputXMLFeed()         {             echo '<?xml version="1.0"?>';             echo '<items>';             $args=array(               'orderby' => 'name',               'order' => 'ASC'             );             $categories=get_categories($args);             $posts = get_posts(array('category' => $category->term_id));             foreach($categories as $category) {                  echo '<item>';                 echo '<catID>' . $category->term_id . '</catID>';                 echo '<catname>' . $category->name . '</catname>';                 echo '<postcount>' . $category->category_count . '</postcount>';                 echo '<slug>' . $category->slug . '</slug>';                 echo '<featured>' . [VARIABLE HERE] . '</featured>';                 echo '</item>';             }             echo '</items>';         }         add_action('init', 'add_my_feed');              function add_my_feed(  ) {           add_feed("myFeed", "outputXMLFeed");         }


title: Getting $user_id for the_author_meta outside the loop in multisite

text: So I am currently running a multisite install where the super admin creates all new sites. One of the templates we're using has a blog page for a loan officer. I am extending the user profile so the new user can input critical data that needs to be displayed on their page. There is only one user per site, in addition to the Super Admin that is automatically added when a site is created. What I have come to find, is that you need to specify the user ID if you want to use the function               the_author_meta();      outside of the loop. Here's my problem. I can't put an ID in the template, because each new loan officer will use this same theme template. So how can I make these fields dynamic? Below is an image of the profile section for the LO to help visually. Another example is that Andy Johnson will be the user of the blog with a role of author. The next site we create will be for Jack Smith. And his blog will need to reflect the relevant information that is put in his profile page. EDIT: I tried using get_current_user() as well but with no luck of fetching a specific user. It just pulls the Super Admin. I keep finding snippets that say they should work, but everything seems to output the Super Admin. EDIT: It seems as though getting the $user_id from the global post results in the Super Admin as well. Does anyway know if I should be using the WP_Users_Query? http://codex.wordpress.org/Class_Reference/WP_User_Query http://www.diigo.com/item/image/27x2l/02oy


title: How can I create a page as a draft from my plugin?

text: I am developing a plugin for a WordPress install so lower users can submit a new page or page revision so an Editor can approve it. I would like to do this by creating this post as a draft, then notifying an Editor via email... Is this possible? Thanks in advanced.


title: PAGE Specific Email Notifications

text: Is there a plugin, or a way that I can set a PAGE that has comments enabled to send an email notification to my subscribers? I don't want to enable email notification for all my pages that allow comments, but just certain pages. By activating email notification for a specific page, whenever I post a comment on that page I would like all my subscribers to receive a notification that includes the actual text of the comment. Can this be done? Thanks.


title: Expiring Unique URLs

text: So this other day I was trying to get a new functionality to work for a client's website. Unique download URLs for each time a new visitor clicks on a specific button in Wordpress How would the whole thing work: Let's say I have a button on the left widget area of my website that says "Download Ebook Now". -I need each visitor to be redirected to a unique URL ( that will expire after x amount of time) -On the separate page , the download link will be provided as normal Do you happen to know if there is a plugin or script out there that could handle such a task or another solution to go about implementing this? Thanks!


title: How can I customize the upload error message in Wordpress?

text: After following the guide for How can I prevent uploading bmp image? to remove bmp (and in my case tiff images) from being uploaded, I tested and it is working, but noticed users are now getting the error message:               Sorry, this file type is not permitted for security reasons.      ![screenshot-with- shadow.png](http://img813.imageshack.us/img813/4526/screenshotwithshadow.png) That looks to be in the `wp-admin/includes/file.php` folder:               if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )             return $upload_error_handler( $file, __( 'Sorry, this file type is not permitted for security reasons.' ));      and also further down:               if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )             return call_user_func($upload_error_handler, $file, __( 'Sorry, this file type is not permitted for security reasons.' ));      How can I hook into this so that I can change the message to something a little more friendly?


title: Wordpress on localhost still points to the live site

text: I have tried copying my wordpress site to my PC for editing offline using WAMP. I followed the following tutorial word for word. How to create a local copy of a wordpress site I have placed my files in C:\wamp\www\wordpress I saw somewhere about adding the following to the wp-config.php but it still points to my website.               define('WP_HOME','http://localhost/wordpress');     define('WP_SITEURL','http://localhost/wordpress');      I am 100% sure that wp_options table in my database only references `http://localhost/wordpress` so where is it getting my live site address from? UPDATE 1: I just noticed the following in the bottom of my wp-config.php               /**      * For developers: WordPress debugging mode.      *      * Change this to true to enable the display of notices during development.      * It is strongly recommended that plugin and theme developers use WP_DEBUG      * in their development environments.      */      define('WP_DEBUG', false);           define('WP_ALLOW_MULTISITE', true);      define( 'MULTISITE', true );      define( 'SUBDOMAIN_INSTALL', false );      $base = '/';      define( 'DOMAIN_CURRENT_SITE', 'www.mywebsite.co.uk' );      define( 'PATH_CURRENT_SITE', '/' );      define( 'SITE_ID_CURRENT_SITE', 1 );      define( 'BLOG_ID_CURRENT_SITE', 1 );           /* That's all, stop editing! Happy blogging. */           /** Absolute path to the WordPress directory. */      if ( !defined('ABSPATH') )     define('ABSPATH', dirname(__FILE__) . '/');           /** Sets up WordPress vars and included files. */         require_once(ABSPATH . 'wp-settings.php');      where it says               define( 'DOMAIN_CURRENT_SITE', 'www.mywebsite.co.uk' );      (obviously changed my address for posting) if I change it too               define( 'DOMAIN_CURRENT_SITE', 'localhost/wordpress' );      I get a redirect loop. Is this related or am I changing something I don't need to and the issue is else where? UPDATE 2: does it having anything to do with the fact that on my website the wordpress files are in the `www` folder and on the local they are in the `www/wordpress` folder?


title: A single category with a specific permalink structure differing from the standard set for the rest of the site

text: I'm interested to know if there's a method to specify a specific link structure for only a single category. Currently I have my install set to **/2012/12/post-title**. However there is a single category I would like to set to **/category-name/post-id/**. Part of this is that I don't plan to title any of these posts, but I also would like to make it simple to block this section from being crawled using the _robots.txt_ file. _Possible caveat, I'm using Nginx rather than Apache, so rewrite rules if needed will differ._ Thanks


title: Custom $_GET vars in wordpress entry with permalink

text: Hello I have something like this in the url: http://myblog.com/category/subcategory/postname/?var=true Using it on functions.php:               function add_query_vars($vars) {        $vars[] = "var";        return $vars;     }     add_filter('query_vars', 'add_query_vars');      But I need it: http://myblog.com/category/subcategory/postname/true How can get it?


title: add_theme_page is not working

text: Newbie in wordpress coding. please tell how to create theme option pages.               function my_plugin_menu() {              add_theme_page('Theme Options', 'Theme Options', 'edit_theme_options', 'theme-option-slug' , 'settings_page');      }          function settings_page()     {         echo "aa";       }


title: Passing variable as permalink URL

text: I've been trying to adapt the rewrite functions described here with little success:   * Passing variables through permalink structure   * WordPress permalinks and custom $_GET Variables The structure of the URL I'd like to achieve is /academics/faculty/profile/faculty-member Where /academics is the blog, faculty is the page, and profile is the child page of profile. If you use this: /academics/faculty/profile?fid=faculty-member It displays the faculty profile, no problem. What I want is to assign fid as a rewrite that cleans up the variable from the URL and leaves only the faculty member. I've rewritten the function so that the add_rewrite_rule looks like this:               // Register the variables that will be used as parameters on the url     function add_my_var($public_query_vars) {         $public_query_vars[] = 'fid';         return $public_query_vars;     }     add_filter('query_vars', 'add_my_var');          // Build the rewrite rules, for the extra parameter     function do_rewrite() {         add_rewrite_rule('(faculty/profile)/[/]?([^/]*)$', 'index.php?pagename=profile&fid=$matches[1]','top');     }     add_action('init', 'do_rewrite');          // The parameter is now accessible     get_query_var('fid') ;      I thought I was following the directions accurately, and I've flushed the permalink structure, but when I try to use the new URL it just reverts to /academics/faculty/profile and spits nothing out, even when I add:               $profile2 =     get_query_var('fid') ;      to the page template. Is my rewrite accurate? Any idea why it would work in the prior examples but not here?


title: Why this filter hook is not working when passing parameters?

text: Supposing I have this function which I hooked into my_get_users function:               function define_users($group) {          //Query database for users belonging to a group     global $wpdb;          $users= $wpdb->get_results("SELECT user_id from $wpdb->usermeta WHERE meta_key='groupname' AND meta_value=$group",ARRAY_N);          return $users;          }          add_filter('my_get_users','define_users',10,1);      This is my_get_users function where the apply_filters are found:               function my_get_users($group) {          //Define users as array     $users=array();                    $users = apply_filters('my_get_users', $users, $group);                   return $users;          }      I am sure there is data in the database but the $users variable is returning as an empty array. Any ideas what's wrong? Thanks for your help.


title: Page Title repeating in Wordpress

text: I am a newbie in WordPress and our website page titles are repeating. That is the first problem. The second problem appears to be that there is a space missing between the repetition. I have attached a diagram to demonstrate this issue. In the attached diagram note that at the top left of Chrome our blog's name is "Snowball Blog". Instead of a space after that, there is no space, and then We have the subtitle of the blog (in this case Hosting). After the word hosting this then appears ">> Snowball Blog". This happens on all pages, for example, "Snowball BlogMeet the Team >> Snowball Blog". I am not that familiar with coding so I would probably need simple instructions! :-) Here is a link to the hosting page of our Blog: Hosting page on our blog [I wanted to post a link to the image I captured but my reputation is still too low! Please visit the URL above to see an example of the problem!]


title: Changing H1 to Normal Links

text:
After following this tutorial -- Showing all the posts in one page? \-- I was able to show all post links in one tag page. Example: http://blogote.com/tag/facebook/ Now I have several H1/H2 headers in those tag pages -- more than 100s. How can I convert these H1 titles into normal titles? Here's the code:               $title = the_title( '
post_type ) . '-title entry-title">', '
', false );      I have changed H1 to Strong tag, but is it possible to remove/refine the code further? I tried removing rel=bookmark and other elements but my efforts were unsuccessful (errors were shown after uploading the file). I also want the fonts to be normal, small in size. Appreciate your help! Thanks...


title: Dynamic-Image-Resize Plugin does not output anything

text: I'm having trouble using the "Dynamic-Image-Resize" plugin by "Kaiser Franz Josef". In my template I'm adding following code:               $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full");     $image_path = $imgsrc[0];          dynamic_image_resize( array(         'src'     => $image_path             ,'width'   => 60         ,'height'  => 100         ,'classes' => 'thumb'     ) );      It just outputs nothing, neither it give any error. I have made sure that the image path is correct. How can I find out where is the problem? If I var_dump the output of the above function, I get following:               object(oxoDynamicImageResize)#507 (1) { ["atts"]=> array(4) { ["src"]=> string(55) "http://localhost:81/wp/wp-content/uploads/2013/02/1.jpg" ["width"]=> int(60) ["height"]=> int(100) ["classes"]=> string(5) "thumb" } }       I will highly appreciate any help.


title: how to call the category of the post

text: I jus want to create a gallery which shows either all or certain number of posts in that category under each post and i found a working code               <?php     $displayposts = new WP_Query();       //get posts from your news category       $displayposts->query('cat=5');     while ($displayposts->have_posts()) : $displayposts->the_post();     ?>     <?php the_content('read more...'); ?>     <?php edit_post_link('edit', '', ''); ?>     <?php endwhile; ?>      in the above code i want to enter the specific category instead of **cat=5**


title: Load Next WordPress Posts With AJAX?

text: I found an amazing plugin that loads the next posts with Ajax. http://www.problogdesign.com/wordpress/load-next-wordpress-posts-with-ajax However it doesn't work with custom post types. The code looks fairly simple. Any idea how to edit the code to use custom post types? Thanks


title: HTML tags in Wordpress image caption

text: I'm developing a client website with Wordpress (3.3) but have found that the image caption feature strips out any HTML tags. The resulting caption is plain text which makes proper image crediting difficult. Also being a client website, WYSIWYG editing is required. For example if my shortcode is:               [caption caption="This is my example caption"]                    [/caption]      The tags are stripped from the caption attribute like so:               [caption caption="This is my example caption"]                    [/caption]      The tags I'd most like to preserve are `<em>`, `<sup>`, `<sub>`, `<span>` and `<a>`. I haven't found any existing plugins to fix this except for links. Any ideas on how to go about this and which functions to override?


title: how to add previous and next link for the posts?

text: i would like to know how to link the next and previous post of the current post with in that category..i tried lotta plugins put nothing worked out and I am a noob in WP so kindly help me


title: How do I convert a page's title to lower case?

text: On my test case, the page' title is "Privacy". The straightforward approach               strtolower(the_title())      also returns "Privacy" -- still with a capital P. I also tried               mb_strtolower(the_title())      and               mb_strtolower(the_title(), 'utf8')      with similar results. Not sure if it matters, but my wp-config.php has               define('WPLANG', '');     define('DB_CHARSET', 'utf8');


title: Tabs and Category Widget

text: I need some help with tabs in Wordpress. I tried several tab plugins for Wordpress, but none did what I wont. I tried Quick tabs, Hybrid tabs and SidebarTabs. I want sidebar to be like this: http://www4.slikomat.com/11/0116/q7a-tabs.png In fact these are basic tabs, with possibility to put content in it. Another question is about displaying news from some category in widget on sidebar. I want to display it with thumbnail and title with link to that news. I want it to be like on this picture : http://www4.slikomat.com/11/0116/lpr-kat.png So can you recommend some plugin for that.


title: how to show the most viewed, random and recent posts in the home?

text: I would like to make my home page in such a way it shows the most viewed, random and recent posts by thre differents part by limitin the number of posts......give me at least some hints or idea to try it. Thank you in advance


title: How to sort posts by the average of comment meta values

text: Here's the situation- I've customized the comment submission whereby users can provide a rating, and this gets stored as a meta value in the commentmeta table. I can query to return the average value and display in the post. No problem so far. What I want to do now is sort posts by this average rating. My code to get the average rating is:               function average_rating() {     global $wpdb;     $post_id = get_the_ID();     $ratings = $wpdb->get_results("              SELECT $wpdb->commentmeta.meta_value         FROM $wpdb->commentmeta         INNER JOIN $wpdb->comments on $wpdb->comments.comment_id=$wpdb->commentmeta.comment_id         WHERE $wpdb->commentmeta.meta_key='rating'          AND $wpdb->comments.comment_post_id=$post_id          AND $wpdb->comments.comment_approved =1              ");     $counter = 0;     $average_rating = 0;         if ($ratings) {         foreach ($ratings as $rating) {             $average_rating = $average_rating + $rating->meta_value;             $counter++;         }          //round the average to the nearast 1/2 point         return (round(($average_rating/$counter)*2,0)/2);       } else {         //no ratings         return 'no rating';     }     }      I'm thinking I need to start storing the average value as a post meta field otherwise I'd have to loop through queries within queries with multiple joins, which seems to be a really bad idea. I'm hoping someone with a fresh set of eyes can help me think through architecting this.


title: Change Output for Images in Content

text:
I want to wrap some html (divs and classes) around the tag (to create the appearance of photo corners by way of an image sprite). Basically, I want to re-write all tags added by WP in the content by way of some code in my functions file from this:                     to this:

      I want this done _after_ the page has been added/edited by me or anyone else adding content. I tried using wp_get_attachment_image with the function below, and it added the html ONLY when adding the image the first time into the edit content screen. Plus, when the image itself is dragged around inside the edit box, or possibly removed, remnants of the html are messed up.                   function image_corners( $html, $id, $alt, $title ){         $html = '

';         return $html;         }     add_filter('wp_get_attachment_image','image_corners',10,4);      It seems like every option I look at with a filter or a hook only adds it during the add-image step in the edit screen. Am I mistaken on this? I'd be fine with a jquery option to change the html on/after page load, but I'm not quite sure how to write that, and not sure if that is necessary? Any help is appreciated!


title: All font sizes change when manually typing 2011 into url and going to archive page

text: I am developing a site on MAMP and everything is going fine except that I thought I would check how all the default archive pages look. I typed 2011 at the end of the base url and it retrieved a yearly archive as expected. The problem is that the font sizes of every element change to a smaller size. I understand that there are different headings in the archives, but this problem affects the main nave menu, normal li items ... everything. Has anyone had this happen to them? Thank you.


title: How to use the Tag description as the title attribute?

text:
I'm trying to use tags to create a list of cross references for each post and want the tag description to show next to the tag and/or as the title attribute for the hyperlink so the description shows when a visitor holds the cursor over the link. Using the TwentyTen theme I have located the code in functions.php and amended it as below:               function twentyten_posted_in() {         // Retrieves tag list of current post, separated by commas.         $tag_list = get_the_tag_list( $before = '

' , $sep = ' here'.'

' , $after = '
' );         if ( $tag_list ) {             $posted_in = __( 'Cross Reference %2$s. ', 'twentyten' );         }                    // Prints the string, replacing the placeholders.         printf(             $posted_in,             get_the_category_list( ',  ' ),             $tag_list,                     get_permalink(),             the_title_attribute( 'echo=0' )         );     }     endif;      As you can see I've changed the heading to say Cross Reference and by adding breaks I have a list of tags rather than a paragraph. I've identified where I want the Tag Description to go with the word "here". I thought it would be as simple as adding tag_description() but that didn't work. If I put a number in the brackets, e.g. tag_description(5) it displays the tag description in the correct place, but of course all the tags have the wrong description. Help! Thanks Ian.


title: Dashboard RSS Widget Overhaul

text: I want to give add an order digit on to the dashboard feed like in the image below: http://i.stack.imgur.com/kK0GJ.png I edited default-widgets.php - function wp_widget_rss_output () but it's still not showing any changes. PS: I'm using WPMUDEV Dashboard Feeds plugin. This plugin changes the widget_options so that I can show my own RSS feed and not the default Wordpress ones!


title: Approve comment hook?

text: I'm looking to send out emails to subscribers when a comment has been approved. The two actions in the Codex are: **1.**               add_action('comment_post', 'callback', $priority, $accepted_args);      Where the arguments are `comment_ID` and `approval status` (0 or 1). **2.**               add_action('edit_comment', 'callback', $priority, $accepted_args);      With argument `comment_ID` By default comments are not approved when they are posted so I think I would be editing them when I approve them but it's unclear in the Codex. Which option should I use when I approve a comment?


title: Custom Post Type Query W/Category Dropdown

text: I'm having a bit of trouble getting a custom post type query working coming from two drop downs. Let me show you what I'm using: **The Form:**               <?php require($_SERVER['DOCUMENT_ROOT'] . '/wp-load.php'); ?>     <form method="post" id="searchform" action="http://www.findabuilder247.com/directory">          <?php $args = array(        'show_option_none'   => 'Select a Tradesman',          'name'                => 'catagory',        'post_type' => 'profiles',        'hide_empty' => '1'     ); ?>           <?php wp_dropdown_categories( $args ); ?>          <?php $args = array(        'show_option_none'   => 'Select Area',          'name'                => 'area',        'show_count' => '1',        'taxonomy' => 'areas',        'orderby' => 'name',        'post_type' => 'profiles',        'hide_empty' => '1'     ); ?>           <?php wp_dropdown_categories( $args ); ?>          <input type="submit" value="" class="searchbutton4"  />     </form>      I'm then generating the query (or at least attempting to) with:               <?php            if($_POST){               $query = $_POST;               $cats = array();                foreach($query as $key => $param) {                    if($param != -1) {                      array_push($cats, $param);                    }                }                // print_r($cats);  // This prints the array, so I know it's working               query_posts(array( 'category__and' => $cats ));           } ?>      I'm using a custom loop to call the query in initially and I'm hoping to use this as a search function.                <?php $loop = new WP_Query( array( 'post_type' => 'profiles', 'posts_per_page' => 10, 'order'=> 'ASC', 'orderby' => 'title' ) ); ?>         <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>             ...         <?php endwhile; ?>      Any help would be much much appreciated. I'm pulling my hair out at this! **UPDATE** James Kemp is an absolute master! The following code is working perfectly for me:               <?php $loop = new WP_Query( array( 'post_type' => 'profiles', 'posts_per_page' => 10, 'order'=> 'ASC', 'orderby' => 'title' ) ); ?>         <?php                if($_POST){                   $query = $_POST;                   $cats = array();                   foreach($query as $key => $param) {                       if($param != -1) {                         array_push($cats, $param);                       }                   }                   $args=array(                'category__in' => $cats,                'post_type' => 'profiles',                'posts_per_page' => 10,                'order'=> 'ASC',                'orderby' => 'title'                );              $loop= null;              $loop = new WP_Query($args);               } ?>               <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>                  …                  <?php endwhile; ?>


title: [Plugin leenk.me]modify get_the_title

text: I use a plugin called leenk.me to post messages to Facebook based on my posts. One of the custom fields is %TITLE%, which posts the title of my post and the link to my post.               if ( false === $post_title )         $post_title = get_the_title( $post_id );      The way I currently have my WP set up, my excerpt is a link. I want to modify the get_the_title function so that instead of getting the title and link (ID) to my post, it gets the title and the link to the excerpt.               function get_the_title( $post = 0 ) {       $post = get_post( $post );            $title = isset( $post->post_title ) ? $post->post_title : '';       $id = isset( $post->ID) ? $post->ID : 0;            if ( ! is_admin() ) {         if ( ! empty( $post->post_password ) ) {             $protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ) );             $title = sprintf( $protected_title_format, $title );         } else if ( isset( $post->post_status ) && 'private' == $post->post_status ) {             $private_title_format = apply_filters( 'private_title_format', __( 'Private: %s' ) );             $title = sprintf( $private_title_format, $title );         }       }            return apply_filters( 'the_title', $title, $id );     }


title: Cannot Access Console

text: http://bigpicturepartnering.com I can log into the site. When I try to access the WP console I get the following error: PHP Fatal error: Call to undefined function is_site_admin() in D:\websites\bigpicturepartnering\wp- content\plugins\wordpress-related-posts\related-posts.php on line 81 How can I get into the console to disable the plugin?


title: add_menu_page does not render the expected result

text: I'm trying to accomplish the simple task of adding a new page to the admin area but it seems that I just cannot wrap my mind around this simple function. Via codex, this is how I'm trying to add the page:               public function __construct(){         add_action('admin_menu', array( &$this, 'register_menu_page'));     }          public function register_menu_page () {         $hookname = add_menu_page (                 'My Slider',                 'My Slider',                 'manage_options',                 'my_slider',                 My_Slider::render_admin_menu()             );     }      When pressing the newly added button named `My Slider` I would expect the `My_Slider::render_admin_menu()` to be called and populate the right side of the page with some HTML (while keeping the left menu intact). However this is what I'm getting: ![text that always appears](http://i.stack.imgur.com/psI1n.jpg) First of all, you can see that the rendering function is always called (I'm currently on the Dashboard page) and it is weirdly inserted on the top of the page. Second of all, when the button is pressed, wordpress is trying to access `http://localhost/wordpress/wp-admin/my_slider`. What am I missing? Thank you!


title: wp_localize_script is not adding a global variable for javascript

text: So I've read a few tutorials on ajax and the codex documentation on it and I think I understand now how it is supposed to work, however it appears that wp_localize_script is not doing anything at all. According to what I've read in the codex and on various forums, the wp_localize_script should allow me to create a global object that an external javascript file can reference. But when I inspect the DOM in chrome it isn't there. My code is below               class Admin_Page extends Admin_Console {     static $add_script;                         public static function init() {         add_shortcode('CLADMIN', array(__CLASS__, 'handle_shortcode'));              add_action('init', array(__CLASS__, 'register_script'));         add_action('wp_footer', array(__CLASS__, 'print_script'));         // add_action( 'wp_ajax_getData', 'data_response' );     }                              static function data_response() {     //do stuff          }               public function register_script() {              wp_enqueue_script('masterJS','/wp-content/plugins/AdminQuizConsole/js/master.js',     array('jquery','jquery-ui-core','jquery-effects-core'), true);         wp_register_style( 'master', '/wp-content/plugins/AdminQuizConsole/css/master.css'     );     }          static function print_script() {         if ( ! self::$add_script )             return;                   wp_enqueue_style('master');         wp_localize_script('masterJS', 'AjaxRequest', array( 'ajaxurl' => admin_url('admin-ajax.php') ) );          }     }               Admin_Page::init();      Now unless I'm mistaken according to what I see here the localize should be being called after the enqueue and therefore should add something like this to the DOM               /* <![CDATA[ */     var MyAjax = {     ajaxRequest: "http://example.com/wordpress/wp-admin/admin-ajax.php"     };     /* ]]> */       But that does not appear to be happening. Can someone please explain to me is there something I'm missing? # EDIT Got the above question working but admin-page now returns with a zero               public static function init() {         add_shortcode('CLADMIN', array(__CLASS__, 'handle_shortcode'));              add_action('wp_enqueue_scripts', array(__CLASS__, 'register_script'));         // add_action('wp_footer', array(__CLASS__, 'print_script'));          add_action( 'wp_ajax_nopriv_get_data', 'data_response' );     }          public function data_response() {              global $wpdb;         $user_id=null;              $user_id = $user_id = $user_id ? $user_id : get_current_user_id();         $practiceKey = 'user_practice';              //Get Practice         $sql = $wpdb->prepare( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = %d AND meta_key = %s", $user_id, $practiceKey );         $sql3 = $wpdb->prepare( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = %d AND meta_key = %s", $user_id, 'user_practice_level' );         $practice = $wpdb->get_var( $sql );         $usr_level = $wpdb->get_var( $sql3 );         $db_name = $wpdb->prefix . 'plugin_slickquiz_scores';         if($usr_level == 0){             $get_data = $wpdb->prepare( "SELECT quiz_id,score,createdDate FROM $db_name WHERE usr = $user_id" );             $results = $wpdb->get_results($get_data,ARRAY_A);             $result_array = array();                  foreach ( $results as $value )             {                 $result_array[] = $value;             }         } elseif ($usr_level == 1) {             $get_data = $wpdb->prepare( "SELECT * FROM $db_name WHERE usr_practice = %s",$practice );             $results = $wpdb->get_results($get_data,ARRAY_A);                  foreach ( $results as $value )             {                 $result_array[] = $value;             }         } else {             $result_array[] = (1);              }                        $data_encode = json_encode($result_array);              header( "Content-Type: application/json" );         echo $data_encode;         die();          }              function get_level() {                  $.post(AjaxRequest.ajaxurl, {action : "get_data"})                 .done(function( json ){                     console.log(json);                 })                      .fail(function( jqxhr, textStatus, error){                     var err = textStatus + ', ' + error;                     console.log( 'Request Failed: ' + err);                 });                   }      The action name and the call back function seem to match up and it's being sent over post in case I wanted/needed to change the no_priv option. I'm sure it's just something I'm missing but I've tested my output by taking the query out of the callback function and echoing it straight onto the page and it does return valid JSON so I'm not sure what I'm missing now.


title: What are WordPress installation percentages by version?

text: I'm in the process of developing a plugin, and I'd like to figure out which versions of WordPress to support. But to get a good idea I'd need to know what percentages of old Wordpress versions make up the install base. Does such information exist? Alternatively if such information doesn't exist, does anyone have a suggested version I should support my plugin back to?


title: Creating an option for writing a post without an author attribution for a group blog on Wordpress

text: I'm developing a group blog on wordpress (first time working with it) and the client has requested that a 'None' option be added where an item can be posted without a "by" attribution. So basically there would be one article / excerpt template for attributed author's posts and another for the none option where the byline would just be the date posted without the "by [author name]." Is this possible with wordpress? Thanks!


title: Post Type only showing for "Admin" under "Appearance" > "Menus"

text: I have created a custom taxonomy as described on the Codex. I have "public" set to true, which show_in_nav_menus is supposed to inherit from, and have also explicitly added the show_in_nav_menus variable and set it to true. However, it only shows up for the user with the username "Admin". None of the other users can see it under Appearance > Menus, even ones marked as being an "Administrator". Here's my exact code:               function create_con_casino_reviews() {         register_post_type( 'con_casino_reviews',             array(                 'labels' => array(                     'name' => __( 'Casino Reviews' , 'continuum'),                     'singular_name' => __( 'Casino Review' , 'continuum'),                     'add_new' => __('Add new review', 'continuum'),                     'edit_item' => __('Edit review', 'continuum'),                     'new_item' => __('New review', 'continuum'),                     'view_item' => __('View review', 'continuum'),                     'search_items' => __('Search reviews', 'continuum'),                     'not_found' => __('No reviews found', 'continuum'),                     'not_found_in_trash' => __('No reviews found in Trash', 'continuum')                 ),                 'public' => true,                 'menu_position' => 25,                 'menu_icon' => get_stylesheet_directory_uri() . '/images/review-casino.png',                 'rewrite' => array('slug' => 'casino-review'),                 'supports' => array('title','editor','author','thumbnail','excerpt','trackbacks','custom-fields','comments','revisions'),                 'taxonomies' => array('category', 'post_tag'),                 'show_in_nav_menus' => true             )         );     }     add_action( 'init', 'create_con_casino_reviews' );      If I change:               register_post_type( 'con_casino_reviews',      to be:               register_post_type( 'con_casino_reviewss',      It works just fine.


title: How to output content based on same custom taxonomy?

text:
I have been trying to output content of all post-types (Posts, Pages and CPTs) based on a term of a custom taxonomy that they **must** share (meaning if they don't share that particular term, the output should not include that post- type). Here is what I have so far:               $term_list = wp_get_post_terms($post->ID, 'persons', array('fields' => 'names')); // persons is the custom taxonomy         $args = array(             'post_type' => array( 'post', 'page', 'profile', 'letter' ), // profile and letter are CPTs                 'tax_query' => array(                     array(                     'taxonomy' => 'persons',                     'field' => 'slug',                     'terms' => $term_list                     )                 ),             'post__not_in'=>array($post->ID)         );          $related_content = new WP_Query( $args );          if ( $related_content->have_posts() ) {         echo __('Related Content (profiles, pages, articles, letters):', 'teselle');         echo '
';         while ($related_content->have_posts()) {              $related_content->the_post();                  echo '
' . get_the_title() . '
';              } // endwhile         echo '
';     } // endif          wp_reset_query(); wp_reset_postdata();      The problem with the above code is that it outputs too much. If I fill in the exact slug of the term I need, for example `'terms' => 'the- exact-slug'`, it works perfect, but I really need it to be a variable. Can someone point out what my mistake is in the above code? Thanks!


title: This webpage has a redirect loop issue with SSL page

text: I'm having an issue with the code below. As of right now, my domain is http://www.mydomain.com. When I try to click on the register link, I get an error saying:               --This webpage has a redirect loop--          $link2 = '' . esc_attr(__('Register')) . '';      The register page is an SSL page so it uses the HTTPS protocol. Can someone please help me?


title: Help with listing current users submitted custom post type in template file

text:
I have the following code to list the member's post that they created. However it is listing all posts. Anyone know how to fix it? Thank you!                   <?php          if ( is_user_logged_in() ) {       global $current_user;       get_currentuserinfo();       echo 'User ID: ' . $current_user->ID . "\n";       $args=array(         'member' => $current_user->ID,         'post_type' => 'listing',         'post_status' => 'publish, private',         'posts_per_page' => '10'       );       $my_query = null;       $my_query = new WP_Query($args);       if( $my_query->have_posts() ) {         echo 'Your Posts';         while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
           <?php         endwhile;       }       wp_reset_query();  // Restore global post data stomped by the_post().     }     ?>


title: Add row to custom database Table and delete all rows older than 1 day

text: I'm editing a view counter plugin so that it logs the IP of every user that viewed a post. This is to prevent them from refreshing the page and thus creating artificial views. The part I'm having trouble with is adding rows to the database table, and afterwards removing any rows that are older than an hour. I'm sure I'm doing something wrong but I can't figure out what. The Wordpress documentation on this is very confusing to me. **This is my database creation function**               ### Create Database for IP Logging     function postviews_create_table () {         global $wpdb;              $table_name = $wpdb->prefix . "postviews_ips";          $sql = "CREATE TABLE $table_name (         postid MEDIUMINT NOT NULL,         ip VARCHAR(15) NOT NULL,         time DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL     );";          require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );     dbDelta( $sql );     }      **And this is the function that's supposed to add new rows and delete old ones.**               ### Add user IP to Database & Delete Entries Older Than 1 Day     function postviews_add_ip () {         global $post;             $id = $post->ID;             $ip = $_SERVER['REMOTE_ADDR'];             $time = date("Y-m-d H:i:s");              $wpdb->insert(              'wp_postviews_ips',              array(                  'postid' => $id,                 'ip' => $ip,                 'time' => $time             )             array(                 '%d',                 '%s',                  '%d'             )          );              $sql = "DELETE FROM wp_postviews_ips WHERE time_created < (NOW() - INTERVAL 1 DAY)";              $wpdb->query($sql);     }


title: Simple fields plugin WordPress show repeatable file field

text: I have install the plugin Simple fields for WordPress, create an repeatable field for file. Upload an amount of images to an portfolio item. Now I will show these images on the page. I use currently the following code:                       $file_id = simple_fields_value('image_repeater');             $image_info = wp_get_attachment_image_src($file_id, "full");             $image_url = $image_info[0];                  echo "<img src='$image_url' class='imagebox' />";      This will show only the first image that I have uploaded. Now I want to show also the other images, but I don't know how. Hope somebody can help me out! Thank you!


title: Custom post type archive with taxonomy

text: Hmm OK, I'll try to be as clear as possible. I have a CPT named "custom_type" with the args (one of many) rewrite('slug' => 'space') and has_archive => 'spaces'. My first question. When calling mydomain.com/spaces it changes the title of the page in the browser window, however, it gets me only my index- page. Question number two. Is there any simple way to add the "archive-page" to my nav-menu or will i have to use absolute links? in my archive-spaces.php:               <?php     $paged = get_query_var('paged') ? get_query_var('page') : 1;             $loop = new WP_Query( array(                                           'post_type' => 'custom_type',     'slug' => 'space',                                                     'posts_per_page' => 3,                                                 'paged'=>$paged                                                        )                                                                      );?>                                                                        and in my custom-post-type.php               'rewrite'   => array( 'slug' => 'space', 'with_front' => false ),     'has_archive' => 'spaces',


title: Not able to override pluggable function with a mu_plugin

text: I'm trying to modify the email that's sent to users when they are invited to join my multisite network. Understanding I can only use the pluggable function, how do I override the default email with a must use plugin? Right now it's not allowing me to override and shows the default text. Here's my current code:               if ( !function_exists('wp_new_user_notification') ) {         function wp_new_user_notification( $user_id, $plaintext_pass = '' ) {             $user = new WP_User($user_id);                  $user_login = stripslashes($user->user_login);             $user_email = stripslashes($user->user_email);             $siteUrl = get_site_url().'/login';             $email_subject = "Welcome to Dewsly ".$user_login;                  $message  = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n";             $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";             $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";                  @wp_mail(get_option('admin_email'), $email_subject, $message);                  if ( empty($plaintext_pass) )                 return;                  ob_start();                  ?>             <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">             <html xmlns="http://www.w3.org/1999/xhtml">                 <head>                     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />                 </head>                 <body style="background:#e5f6fb">                      </body>             </html>                  <?php                  $message = ob_get_contents();             ob_end_clean();                  wp_mail($user_email, $email_subject, $message);              }     }


title: Wordpress live, custom text box validation, how to?

text: I am teaching British Sign Language on my website, on the alphabet section I have an image of 'signs' that spell out a word. Below I would like a text box that requires the user to input the correct word and for the text box to validate live and appear with a tick next to it. Much like the functionality of the 'Homepage Example' seen here where you have to enter the word 'hello': http://livevalidation.com/examples#exampleStyles[1] Does anyone know how I would implement this on a Wordpress Site, or is there a plugin that allows custom or 'this type' of validation? I have been searching and reading for hours and only being a novice at programming I am unable to find a solution. I am trying to keep my site clean and easy to use. I know a quiz or something similar would work, but it's too many clicks, too bloated etc. I just want a quick text box that turns green or a tick appears when the correct answer is entered. I am also aware that plugins such as Gravity Forms & Contact Form 7 do validate but only dates & email addresses etc. Any help is greatly appreciated!


title: How to display a widget on a page with no theme?

text: I would like only a widget to appear on a page, is this possible? As in if I created a page, I am wondering if I can make a page just display the widgets contents with no headers, sidebars, just blank. Essentially if there was no widget added it would be a blank page. Is this possible?


title: Footnotes in custom fields

text: I am using Jquery Hover Footnotes plugin that allows adding footnotes and dynamically displays them on hover-over. In other words, I use `{{FOOTNOTE_NUMBER}}`, Then I embrace the actual footnote text with double brackets `[[FOOTNOTE_NUMBER]] Footnote text [[FOOTNOTE_NUMBER]]`. the plugin will find these "shortcodes" and auto place a box onhover on a footnote. For more information about this plugin thanks to visit http://wordpress.org/extend/plugins/jquery-hover-footnotes/ An example here: http://restoredisrael.org/blog/961/footnote-plugin-test-page/ I am in addition using custom fields , and I get their content by using:               echo get_post_meta($post_id, $key, $single);      The problem is that this plugin is only applied to the content (returned by `the_content()`). While looking at the plugin code, I found:               add_filter('the_content', 'jqFootnotes', 1, 1);      So I tried adding this filter also for the meta values:               add_filter('get_post_meta', 'jqFootnotes', 1, 1);     add_filter('key_name', 'jqFootnotes', 1, 1);       BUT IN VAIN. What should I do so that the plugin will be applied also on footnotes inside my custom fields?


title: How to display custom taxonomy

text: I have created `city` taxonomy in back end and i have added mumbai,pune,nashik city in `city` taxonomy like bellow snipe. My problem is that when i click the city for example `mumbai` i want display the all product in the `mumbai` city which i have set from the product tab means that product is in `mumbai` city category. I have tried with bellow code but not getting any thing. Custom Taxonomies display Template file used to render the Archive Index page for a Custom Taxonomy               taxonomy-{taxonomy}-{term}.php      As regrading above code i have changed my file name to `taxonomy-city- city.php` but its not working.tell me if have any body idea about this issue. Site Link:- Click Here and Click on select your city button 1) Taxonomy city:- ![taxonmycity](http://i.stack.imgur.com/r1PDz.png) 2) Added cities in Taxonomy `city` ![city](http://i.stack.imgur.com/5SRNz.png) 3) Taxonomy terms details ![terms](http://i.stack.imgur.com/TDTh6.png)


title: Enumerating shortcode attributes in JavaScript

text: I'm working on a plugin which uses a shortcode to call a JQuery function, and it requires three aspects to work:   1. The JQuery code + its own code, to be included on the pages it will be used on   2. The HTML element it will work on requires an "id" attribute, in order to reference it   3. A reference/initialization in a `$(document).ready(function())` block I've already implemented 1 and 2; 1 by using `wp_register_script` and, if the shortcode appears, `wp_print_scripts` to print it; and 2 by making "id" an attribute of my shortcode, which also gets returned, e.g. `[myshortcode id="foo"]` returns `id="foo"`. The problem is 3. The initialization is of the form:               $(document).ready(function()          {              $("#id").func( {attributes} );           }       );      I've considered using `wp_localize_script` over a variable for the ID; however, I do not know how many times the shortcode will appear on a given page, and it seems sloppy to register an arbitrary number of otherwise- identical scripts and just hope that the number won't be surpassed. This seems like it's probably pretty common, but I haven't been able to find anything related by searching. Any ideas? Thanks!


title: wp_nav_menu - show children of current menu item only?

text: I am trying to create a menu structure with a simple concept:   1. A horizontal, 1-level deep main menu   2. A vertical submenu, that contains children of the current main menu item (2 levels deep) Of course, the submenu should be shown in the following cases:   1. Viewing the main menu item   2. Viewing a direct child of the main menu item   3. Viewing a descendant of the main menu item (3rd level) Since I want to keep the menu clean, I need to show the 3rd level for the currently active 2nd level menu item only. Basically, I want to achieve the same thing as described in this topic: How to show only parents subpages of current page item in vertical menu? \- **BUT, using wp_nav_menu()** I would be happy to use filters or custom walkers if somebody could point me to a right direction. The important thing here to notice is that since wp_nav_menu can contain also custom links or category links, the solution should work for all of those cases.


title: Creating Search Engine Friendly URL's with Word Press

text: I own a website barrelandblade.com which was developed by a non SEO enlightened developer. I recently had the FV All in One SEO Pack installed as my site does not show up in the search engines at all. I understand my URLs should be representative of my page content but do not know how to go about it. Is there a way to do this that I can do or have someone setup so my site can get ranked?


title: qtranslate arabic shortcode?

text: Hello I used qtranslate in my site. Four language selections. English Russian Turkish Arabic But not work arabic. executed this url; site.com/ar does not work. Shows an error. Error code ; Warning: Cannot modify header information - headers already sent by (output started at /home/useruser/public_html/www.site.com/blog/wp- content/themes/tema/index.php:1) in /home/useruser/public_html/www.site.com/blog/wp-content/themes/tema/header.php on line 1


title: Access CSS Classes specified in Menu options

text: Is there a way to access CSS styles specified in the Menu CSS options in the code? I would like to access the names of the css classes (as shown here) in my php page. How would I do it?


title: Adding an external stylesheet to a plugin

text: I apologize in advance if this question has been asked before. I've created a plugin, and I'm trying to add an external stylesheet, but it's not working. Am I suppose to compress the plugin file and the stylesheet, and upload them then add a link to the stylesheet in the theme's php file?


title: Get post featured image id with $wpdb

text: I'm not a sql expert, but with some help and copying from queries I've found on the web I got this working one that gets the 20 closest places (custom post type) to a specific latitude and longitude ($lat and $long). How can I edit this query to have also the post thumbnail ID in it? I want to do this to reduce the number of queries in my pages, so I think that looking for the value directly with this query instead of using get_post_thumbnail_id() each time I will save some, right?               SELECT $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->terms.name,         wpcflat.meta_value AS latitude, wpcflong.meta_value AS longitude,          6371 * 2 * ASIN ( SQRT (POWER(SIN(($lat - wpcflat.meta_value)*pi()/180 / 2),2) + COS($lat * pi()/180) * COS(wpcflat.meta_value *pi()/180) * POWER(SIN(($long - wpcflong.meta_value) *pi()/180 / 2), 2) ) ) AS distance     FROM $wpdb->posts         LEFT JOIN $wpdb->postmeta AS wpcflong ON ($wpdb->posts.ID = wpcflong.post_id)         LEFT JOIN $wpdb->postmeta AS wpcflat ON ($wpdb->posts.ID = wpcflat.post_id)         LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)         LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)         LEFT JOIN $wpdb->terms ON ($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id)     WHERE $wpdb->posts.ID NOT IN ($post->ID)     AND wpcflat.meta_key = 'wpcf-latitude'     AND wpcflong.meta_key = 'wpcf-longitude'     AND $wpdb->posts.post_status = 'publish'      AND $wpdb->posts.post_type = 'places'     AND $wpdb->term_taxonomy.taxonomy = 'countries'     ORDER BY DISTANCE     LIMIT 20      Thanks a lot in advance to everyone!


title: How do I create multiple post types in same menu section in WP-admin?

text: I am building a custom menu section (a new item with subitems in the main menu section on the left side) in the WordPress Administration of my website. The section shall include a main post type, and for this you should be able to link category and country. It would be possible to use taxonomies, but taxonomy only supports multiple choices. Therefore, I want to be able to create new post types for category and country instead of taxonomies. But it won't work out if I want it to be under the same menu section? Please help.


title: Best structure / rewrite rules to achieve the following url

text: I have been trying to achieve the following url structure in Wordpress and maintain a level of reusability in the admin area. It is for a client preview area and needs to reflect multiple versions of different file types. So the desired URL structure would be: http://preview.mysite.com/client-name/wireframes/v1/homepage/ /client-name/ is a dashboard view showing links to /wireframes/ as well as /mockups/ or anything else that is a design phase. /v1/ relates to the version number of /homepage/ The easiest way is to use pages and sub pages but there must be a better way. More of a CMS way. Maybe there isn't. Perhaps Wordpress is the wrong choice for this.


title: Video tutorials in Dashboard

text: I want to insert a few video tutorials in the wordpress dashboard, instead of creating a pdf manual for a client, as i think they are easier for this client, how would I go about that? I am thinking of having like 4 videos in the dashboard. Where would be the best place to host them as well, in order to keep them private?


title: Custom page template in warp7 (Yootheme template)

text:
I am trying to add my custom page template to wordpress. I have created a page-portfolio.php to the folder > \wp-content\themes\yoo_master2_wp\layouts My php file has following content:               <?php     /*     Template Name: My Portfolio     */     // get warp         $warp = Warp::getInstance();              // load main template file         echo $warp['template']->render('template');          if (have_posts()) : ?>         <?php while (have_posts()) : the_post(); ?>
                  <?php if (has_post_thumbnail()) : ?>                 <?php                 $width = get_option('thumbnail_size_w'); //get the width of the thumbnail setting                 $height = get_option('thumbnail_size_h'); //get the height of the thumbnail setting                 ?>                 <?php the_post_thumbnail(array($width, $height), array('class' => '')); ?>             <?php endif; ?>
<?php the_title(); ?>
                  <?php the_content(''); ?>                  <?php edit_post_link(__('Edit this post.', 'warp'), '
 ','
'); ?>
              <?php endwhile; ?>     <?php endif; ?>          <?php comments_template(); ?>      Here is the tutorial, how it should work (last part). According to this tutorial I should do the following:               <?php     /*     Template Name: My Portfolio     */     <?php get_header(); ?>          Put your content here...          <?php get_footer(); ?>      But like this I get only a blank page. The code above is copied from the page.php in layouts and with the code from this post But I get following error message: > Fatal error: Class 'Warp' not found in C:\xampp\htdocs\wordpress\wp- > content\themes\yoo_master2_wp\layouts\page-portfolio.php on line 6 So, does anyone know the correct way to do in warp7? The documentation did not help


title: Custom post types - show specific posts

text: This is the url: HOUSE 1 I have custom post type "Properties".For each new property, I can select "Property Type", "Property Status", "Property Location" taxomony. This page is using its own template, so I was wondering - can I modify the query for that template to show other properties from one "Property Location", that would match the current Location? For example, if I open any "House 1" ("House 1" is Property Location) property, I don't want the page to show posts with ""House 2" Property Location, but posts from the current Location only. I tried few combinations using http://generatewp.com/wp_query/ , but can't figure this out. I am sure, though, that it's a simple thing to change.


title: Body classes in child theme

text: In the theme twentyfouteen, the `full-width` class is defined with the following code               if ( ( ! is_active_sidebar( 'sidebar-2' ) )     || is_page_template( 'page-templates/full-width.php' )      || is_page_template( 'page-templates/contributors.php' )      || is_attachment() ) {      $classes[] = 'full-width';      }      from this function               function twentyfourteen_body_classes( $classes ) {     if ( is_multi_author() ) {         $classes[] = 'group-blog';     }          if ( get_header_image() ) {         $classes[] = 'header-image';     } else {         $classes[] = 'masthead-fixed';     }          if ( is_archive() || is_search() || is_home() ) {         $classes[] = 'list-view';     }          if ( ( ! is_active_sidebar( 'sidebar-2' ) )         || is_page_template( 'page-templates/full-width.php' )         || is_page_template( 'page-templates/contributors.php' )         || is_attachment() ) {         $classes[] = 'full-width';     }          if ( is_active_sidebar( 'sidebar-3' ) ) {         $classes[] = 'footer-widgets';     }          if ( is_singular() && ! is_front_page() ) {         $classes[] = 'singular';     }          if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) {         $classes[] = 'slider';     } elseif ( is_front_page() ) {         $classes[] = 'grid';     }          return $classes;     }     add_filter( 'body_class', 'twentyfourteen_body_classes' );      I'm adding a selection of sidebars to the sidebar-content.php file. These sidebars must also have the same body class as `sidebar-2`. Is it correct for me to just use a different fuction name as to that of the twentyfourteen theme and to still hook on the `body_class`, keep the same class name (full-width), and change the above code in a child theme to               if ( ( ! is_active_sidebar( 'sidebar-2' ) &&  ! is_active_sidebar( $sidebar_option ) )      || is_page_template( 'page-templates/full-width.php' )      || is_page_template( 'page-templates/contributors.php' )     || is_attachment() ) {      $classes[] = 'full-width';      }      I'm getting a lot of stuff that tells me how to ad a new body class and removing one, but nothing on how to change an existing body class of a parent theme in a child theme or if it is even possible


title: Getting error of unexpected output during activation

text: I have seen one plugin named lordlinus business hours When I am trying to install it, I am getting error : > The plugin generated 2 characters of unexpected output during activation. If > you notice “headers already sent” messages, problems with syndication feeds > or other issues, try deactivating or removing this plugin. How can I resolve this error?