title: Custom taxonomy not saving correctly

text: I'm using a custom post type and a custom taxonomy to display a list of properties and its type in a page. It's working fine but for some reason some of my posts' taxonomies aren't getting saved correctly, for example I have 4 categories in my custom taxonomy: storage, home, apartment and other, if I check the home option and save my custom post it shows as storage in my page. I did notice though that when I update my custom post to try to select the correct taxonomy term, after the page refreshes for a split second the incorrect taxonomy is marked as checked then it changes to the "correct" one even though it's not the one getting displayed in the page. It works fine for some posts I'm just having this problem in about 4 out of 20+ custom posts. Here's how I've set up my custom post and taxonomy: http://pastebin.com/tN2q4QxV In my single page I'm using `wp_get_object_terms(get_the_ID(), 'type')` to get the terms and loop trough them. Thanks in advance


title: Create Terms on taxonomy by text field

text: I want to add terms on a my taxonomy dynamically by a text field and button sample taxonomy: place_taxonomy - island_term like: [Textfield] [submit button]


title: Creating a custom menu

text:
I want to create a custom menu in the style below, can this be done? The code in brackets needs to grab the actual page content for each page.
     (page-name)
      How can I use that one small bit of code to create my menu? That code should generate buttons for 5 pages that are in the main tree in the admin.


title: Contact Form 7 - Show additional post content when a user enters their information

text: Is it possible to show a brief snippet of a post until someone submits a form using contact form 7, at which time a more detailed post is displayed automatically? Is it also possible to store a cookie for that user so that if they visit the page again they see the detailed post without having to re-enter their information?


title: Display product SKU on page with Jigoshop

text: I'm using the Jigoshop plugin (everything's going great so far!) and need to display the product SKU on a page, does anyone know how to do this? p.s I would ask on the Jigoshop forum but you have to pay for it.


title: How to approach displaying products with no shopping cart plugin or post type?

text: I want to show products like an eCommerce store with product categories and detail pages, but I have no need for a shopping cart or checkout system. This is just to display the products for informational purposes. I have used custom post types on another project and that worked out fine, but I am wondering if anyone knows of a plugin that would make this fast and easy to customize. Also an import/export feature would be nice for adding lots of products.


title: RSS Feed Behaviour (Inc. Feedburner)

text: I have a self hosted Wordpress site (latest update as of time of posting) that I am using to host a podcast that I am starting. In order to minimise any future hassles should I have to change hosting for any reason, I chose to run the feeds though Feedburner, and get people to subscribe to those also. That way, I can move and repoint if required in the future. I installed a plugin (FD Feedburner) that redirects to my feed burner URL, but I have found that this only works for http://etc.com/feed URLS. When for example Safari detects the feed, if a user clicks the RSS button in Safari rather than one of my links, it opens the Wordpress original feed via feed://etc.com/feed. - Obviously this still works, but it splits my subscribers into 2 pools that makes tracking difficult. What is considered best practice for this sort of thing, is there any way to edit the built in RSS feeds (remove comments Feed etc, stop Safari detecting the RSS feed) and remove the Atom feed option while I am at it? Many thanks, Dan


title: widgetlogic and permalinks

text: I'm trying to use widgetlogic to conditionally display menus on certain pages. Each menu uses a tag like `is_page(array("Page Name", "Page Name 2" ...))`, and works perfectly until I try to change permalinks (whereupon all the menus disappear from their respective pages). Am I doing something wrong? Is there a workaround?


title: Is it possible to use github:gist with Wordpress?

text: I have a wordpress blog i.e. bruno.wordpress.com I would like to use github:gist. I paste my code in gist and get a link like: https://gist.github.com/1323748 Is there a way to show this code in my blog? (rather than just a link to the code.)


title: Wordpress sites translate dynamically generated Homepages

text: So I'm having trouble finding a way to translate the homepage content on a few pages I manage. They can be found here:   1. KorgCanada.com (Theme is Simplecorp, and the support forum offers no help)   2. EriksonMusic.com (Theme is target, and again, absolutely no help) I'm using the **Poplarware Language Switcher** plugin which is an outdated/ no longer maintained plugin for translating pages/ posts etc. It functions by using tags like `[lang_en]` English goes here `[/lang_en][lang_fr]` French here `[/lang_fr]`. And it's working perfectly for all my pages/ posts, EXCEPT for the dynamically generated homepages of both the sites, which is made up of the "Theme options" tabs within the GUI. If I put those tags in the text areas for those, they show up as plain text, and don't actually translate anything. I was hoping somebody could help me regulate this, preferably while using the same plugin, and perhaps just making a page template of the homepage, and hard-coding the French version myself... but I'm totally uncertain about how to go about this. If you have any ideas how I can accomplish this, please lend me a hand, I'm getting very desperate.


title: Translate Navigation Menu & Sidebar Widget Titles

text: Is there any plugin to translate navigation menu & sidebar widget titles ?


title: Admin Top Bar Not Showing On Front End

text: i'm having problem with displaying admin top bar on my site. I googled and got some solution which i tried like   1) Checking wp_footer in footer.php   2) Checkbox ticked in user profile saying show toolbar will viewing site. All done but no success. please can anyone point me in right direction. I'm using Classicraft theme. I'm using wordpress 3.8.3 I have another wordpress installation on same server and can see admin bar their but not on this site. is this theme specific problem ? Thanks in advance.


title: Getting 404 page not found error while trying to access add new plugin / themes

text: I am getting 404 page not found error while trying to add new plugin or view installed plugin in my admin panel. i am using Hueman theme. every time i tried to use some option of admin panel i am getting 404 page not found error. I tried all basic trouble shooting for this issue. I would really appreciate if someone help to solve this issue. this is link on which i am getting 404 page not found error. 1) http://readaddict.com/wp-admin/plugin-install.php


title: Defining the output of a Wordpress Att

text: I have this code where I'm trying to define how those attributes (ptid, ptle, pge ) will behave once the code runs. I would like to be able define them so to get them to execute functions before outputing the result.                   // Add Shortcode     function formatage( $atts , $content = null ) {              // Attributes         extract( shortcode_atts(             array(                 'ptid' => '',                 'ptle' => '',                 ‘page’ => '',             ), $atts )         );              // Code     return X     }     add_shortcode( 'p-fmt', 'formatage' );      p.s. anybody knows any good wiki about shortcodes?


title: Get attachment meta (I need attachment ID, unsure how to find it)

text: I've got the following example code, which creates a custom field and adds to the attachment meta:               function be_attachment_field_credit( $form_fields, $post ) {         $form_fields['be-photographer-name'] = array(             'label' => 'Photographer Name',             'input' => 'text',             'value' => get_post_meta( $post->ID, 'be_photographer_name', true ),             'helps' => 'If provided, photo credit will be displayed',         );              $form_fields['be-photographer-url'] = array(             'label' => 'Photographer URL',             'input' => 'text',             'value' => get_post_meta( $post->ID, 'be_photographer_url', true ),             'helps' => 'Add Photographer URL',         );              return $form_fields;     }          add_filter( 'attachment_fields_to_edit', 'be_attachment_field_credit', 10, 2 );               function be_attachment_field_credit_save( $post, $attachment ) {         if( isset( $attachment['be-photographer-name'] ) )             update_post_meta( $post['ID'], 'be_photographer_name', $attachment['be-photographer-name'] );              if( isset( $attachment['be-photographer-url'] ) )     update_post_meta( $post['ID'], 'be_photographer_url', esc_url( $attachment['be-photographer-url'] ) );              return $post;     }          add_filter( 'attachment_fields_to_save', 'be_attachment_field_credit_save', 10, 2 );      I've tried calling `var_dump(get_post_meta($post->ID));`, but I assume that meta is somewhere else, as whatever input is not there. According to the codex, I can call: `wp_get_attachment_metadata( $attachment_id, $unfiltered );`. However, I have no idea how to get the `$attachment_id`. My eventual goal is to add this meta data to the Advanced Custom Fields Gallery plugin, which adds the attachment meta to the post meta (I believe) — but that's down the road.


title: $count_posts->draft & published

text: Currently our portfolio is stacking up a lot and want to show a few projects less instead of showing all. Still, I'd like to show an indication how many projects we did in total. Currently I have the following code and need to count the drafts & published posts.                       $count_projects = wp_count_posts( 'apps' );             $published_projects = $count_projects->publish;             $total = $published_projects + 11;      How can I count all drafts & published posts together?


title: Wordpress and nginx, download some pages instead of serving them

text: Today i setup wordpress with nginx. The problem, i cant figure out, is that some pages will be served as expected and some other will be served as download. If i download them, the content is the sama as index.php in wordpress root folder. I tried to find some differences between the "normal" pages and the other defective pages, but cant find anyone. The funny thing is, if i give that faulty pages another permalink (e.g. ../funktionen -> ../features, the pages will be served correctly. If switch back to old old permalink, the page will be served as download. Here is my nginx conf:               #redirect     #  http://www.termin2go.com and     #  http://termin2go.com     # to     # https://www.termin2go.com     server {             listen 80;             server_name termin2go.com www.termin2go.com;             rewrite ^(.*) https://www.termin2go.com$1 permanent;     }               # redirect     #   https://termin2go.com     # to     #   https://www.termin2go.com     server {             listen 443 ssl;             server_name termin2go.com;             rewrite ^(.*) https://www.termin2go.com$1 permanent;     }          server {             listen 443 ssl;             server_name www.termin2go.com;             ssl_certificate /etc/ssl/private/www.termin2go.com.crt;             ssl_certificate_key /etc/ssl/private/www.termin2go.com.key;                  access_log  /var/log/nginx/termin2go.com.log;             error_log /var/log/nginx/termin2go.com_error.log;             set $root_path '/var/www/wordpress';             root $root_path;             charset utf-8;             client_max_body_size 7M;                  # DEFAULT INDEX             index index.php;                   # configure prerender for snapshot generation             location / {                     try_files $uri $uri/ /index.php?$args @prerender;             }             location ~ /(\.|wp-config.php|liesmich.html|readme.html) {                     return 444;             }                  # REWRITES             location ~ ^/(\d+)/$ {                     return 301 /?p=$1;             }                  # fix whitespace in url bug             if ($request_uri ~ " ") { return 444; }                  # redirect google bot to prerender for ajax content (AngularJS)             location @prerender {                     proxy_set_header Host $host;                     proxy_set_header X-Real-IP $remote_addr;                     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                     #proxy_intercept_errors on;                          set $prerender 0;                     if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|developers\.google\.com") {                             set $prerender 1;                     }                          if ($args ~ "_escaped_fragment_|prerender=1") {                             set $prerender 1;                     }                          if ($http_user_agent ~ "Prerender") {                             set $prerender 0;                     }                          if ($prerender = 1) {                             rewrite .* /$scheme://$host$request_uri break;                             proxy_pass http://127.0.0.1:4000;                     }                          if ($prerender = 0) {                             rewrite .* /index.php break;                     }             }                          # cache static files one month             location ~* \.(css|cur|js|jpe?g|gif|htc|ico|png|html|xml|otf|ttf|eot|woff|svg)$ {                     expires 31d;                     add_header Pragma "public";                     add_header Cache-Control "public, must-revalidate, proxy-revalidate";             }           # cache static files 30 days             location ~* \.(css|cur|js|jpe?g|gif|htc|ico|png|html|xml|otf|ttf|eot|woff|svg)$ {                     expires 31d;                     add_header Pragma "public";                     add_header Cache-Control "public, must-revalidate, proxy-revalidate";             }                  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000             #             location ~ \.php$ {                     try_files $uri =404;                          fastcgi_split_path_info ^(.+\.php)(/.+)$;                     #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini                          include fastcgi_params;                     fastcgi_index index.php;                     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;                     #fastcgi_intercept_errors on;                     fastcgi_pass unix:/var/run/php5-fpm.sock;             }                  # prevent nginx from serving dotfiles (.htaccess, .svn, .git, etc.)             location ~ /\. {                     deny all;                     access_log off;                     log_not_found off;             }     }


title: How to enable full column width in Genesis layout options

text: We are running Genesis Framework version 1.6 on our site and cannot figure out how to enable the full column width option. Where do you go to enable this layout option?


title: Trouble logging in and/or changing password

text: I have tried to log in to http://www.femalefightpromoter.com/wp-admin using my username afcsarah2 and the password that has been on the account since the beginning. I have not been able to log in and I have tried to reset the password. When I click on the link in my inbox it takes me to a WP page that says "Sorry that key does not appear to be valid" here is the URL it directs me to. http://femalefightpromoter.com/wp- login.php?action=lostpassword&error=invalidkey I am in desperate need of help to log into my blog and have spent countless hours on the phone with godaddy (They are hosting it) Does anyone have any suggestion?


title: Using color picker in plugin, does input attribute order matter?

text:
I'm trying to use the WP color picker in a plugin admin menu and it doesn't seem to be doing anything at all. I'm following the directions here: http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/ This is how it is setup: cbs-admin-menu.php:               add_action( 'admin_enqueue_scripts', 'mw_enqueue_color_picker' );     function mw_enqueue_color_picker( $hook_suffix ) {         // first check that $hook_suffix is appropriate for your admin page         wp_enqueue_style( 'wp-color-picker' );         wp_enqueue_script( 'my-script-handle', ECBS_JS_URL . 'my-script.js', array(     'wp-color-picker' ), false, true );     }      my-script.js:               var $j = jQuery.noConflict();     jQuery(document).ready(function($j){         $j('.my-color-field').wpColorPicker();     });      In the admin menu there is a drop down box where the user picks the name of a template they want to edit. I'm using AJAX .post() to build the edit form and dynamically update a div to display it. This is the code that builds the form fields:               return ecbs_get_label( $ecbs_style_data[ECBS_STYLE_NAME], $ecbs_style_data[ECBS_NICE_NAME] ) .         '<input type = "text" name="' . $ecbs_style_data[ECBS_STYLE_NAME] . '" ' .         'value="' . $ecbs_style_value . '" ' .         (($ecbs_style_data[ECBS_VALUE_TYPE] === 'hex') ? 'class="my-color-field"'  :          'onLoad="this.value=\'' . $ecbs_style_value . '\'" ') .         '> ';       When I look at my source, I can verify that it has the correct `class="my- color-field"` attribute. The weird thing is, the `type="text"` attribute is at the end, even though it is not formatted that way in my code. This is what the outputted HTML looks like:               Background Color<input name="background-color" value="#997766" class="my-color-field" type="text">
      Could the type attribute being at the end cause an issue with this script? I wouldn't think so, but I can't figure out what else might be wrong. When I look at the source, I can verify that my-script.js is linked and the url is correct. * * * Edited to add the code from my other .js file. Maybe something conflicting between them? cbs-edit-options.js               // This script sends the id of the selected template to the php     // function ecbs_populate_admin_template() and then sends the     // formatted response to the ecbs-edit-area div in the admin     // submenu.     var $j = jQuery.noConflict();     $j(document).ready(function() {         $j("select").change(function() {             var str = "";             $j("select option:selected").each(function() {             str = $j("select").val();             try {                 $j.post( ajaxurl, {                     data: { template : str },                     action: 'ecbs_populate_admin_template'                 }, function ( response ) {                     //alert(response);                     $j("#ecbs-edit-area").html( response );                 }                         );             }             catch (err) {                 alert(err);             }             });         })             .change();     });     $j(function() {         $j( document ).tooltip();     });      This script works fine. I did try moving the contents of my-script.js to this file and enqueueing it instead, but that did not make a difference.


title: How to remove parent section from attachment URL?

text: I have buddypress installed. All URL goes under BP's URL structure. If an attachment belongs to a document in a group, the URL is:               http://domain.com/groups/group-name/docs/doc-name/attachment-name      I would like to learn how to change the attachment URL to:               http://domain.com/?attachment_id=123      Thanks!


title: template_redirect action only firing if logged in

text: add_action('template_redirect', 'add_header_redirect', 0, 0);     function add_header_redirect(){         if( is_page(array(8, 'testimonials', 'Testimonials')) ){             $default_testimonial = get_permalink( 19 );             header("Location: $default_testimonial");         }     }      this code is in my functions.php file and ONLY works when I am logged into WP. I want all users who go to /testimonials to be redirected. what's going on?


title: How can I eliminate the inline styles included by default with the Genesis framewrok?

text: I have created a child theme in the Genesis framework. I have created all of my style rules, however, in the markup, Genesis adds a few inline rules by default that I would like to eliminate. The rules look like this:               <style type="text/css" media="screen">         html { margin-top: 28px !important; }         * html body { margin-top: 28px !important; }     </style>     <style type="text/css">         #header { background: url(http://localhost/h.jpg) no-repeat; }     </style>      These inline styles are creating my last remaining problem. I've reviewed the docs and tried to find if there are any hooks or parameters that I can alter, but have not found any. How can i get rid of them across the entire child theme? Many thanks.


title: Where are the images for the theme Twenty Eleven 1.2?

text: In Twenty Eleven 1.2, where would I find the images that appear at the top of the blog -- in what folder? I know one of the images is called 'lanterns.jpg', but I can't find it or the other ones. Here's the site: http://richardclunan.com/ Thanks,


title: Post date vs. event date in Wordpress

text: If I'm creating a WordPress site, what should I do when I have a blog that manages events to keep date events? For instance, in my own case, I'm making a travel blog where some histories have a real date (when I visit some place), but are published in a later date (when I'm at home). I'd like to show the _real_ date but if I set this real date as the post date, the post order is a chaos (I have events that are directly hidden and never showed in the home page, because the date is not among the latest 10 posts). What should I do? Is there any plugin to help with that? Or maybe I can change my theme listing the posts in a different manner, but how?


title: Category Archives: Show posts categorized in parent category only

text: When I view a category page in 2010 theme, it shown posts categorized in:   1. the category visible in url   2. child categories of 1. I want to restrict the results to 1. only. Please help.


title: How to Rename a Template File?

text: If i have pages that point to `somefilename.php` and want to change the filename to `betterfilename.php`, can I leave the template comments unchanged without manually changing all the pages?               /*     Template Name: Some File Name     */


title: How to I make my post title link to a custom field

text: I have a custom field in my posts called `post_bookmark_url` which contains a link. I want the post title that is displayed in the excerpts on my home page to link to the `post_bookmark_url` rather than the permalink of the post. (I am doing this to create a Drudge Report type of aggregator.) How can I make the "post title" in the excerpts on the home page link to a custom field?


title: Best Query for blog posts

text: I am not getting any headway in this one problem I have a separate homepage from the normal blog page. However the site needs a blog so How do I structure a query that will display something like the default wordpress behavior


title: How to get the get the select values created by ACF plugin in wordpress

text: Basically I want to display the select box so admin can select the option while creating or editing a category to display the category in front page with image or not. I use advanced custom plugin to add a select box in categories page.   I created a custom field group of display with               field label  :  Select to display       field name :   select_to_display_       field type :   Select       options :   no,yes        location rules : Taxonomy term add/edit equal to categories. As soon as I create the custom field the values are stored in db of `wp_postmeta` table as               meta_key:field key value     meta_value:a:12:{s:3:"key";s:19:"field_51d53f2ed1236";s:5:"label";s:17:"Select to display";s:4:"name";s:18:"select_to_display_";s:4:"type";s:6:"select";s:12:"instructions";s:0:"";s:8:"required";s:1:"0";s:7:"choices";a:2:{s:2:"NO";s:2:"NO";s:3:"YES";s:3:"YES";}s:13:"default_value";s:0:"";s:10:"allow_null";s:1:"0";s:8:"multiple";s:1:"0";s:17:"conditional_logic";a:3:{s:6:"status";s:1:"0";s:5:"rules";a:1:{i:0;a:3:{s:5:"field";s:19:"field_51d53f2ed1236";s:8:"operator";s:2:"==";s:5:"value";s:2:"NO";}}s:8:"allorany";s:3:"all";}s:8:"order_no";i:0;}       When I go to dashboard->post->categories I can display the select box with options but when I select any option and click on update it is updating. but when in `index.php`               echo  get_field(' select_to_display_'); //nothing is displaying here          $field = get_field_object('field_51d3f9c3f5554');          if($field['choices'] == 'false')          {             echo 'A value is  set';          } else          {              echo 'A value is not set';         }      I'm always getting value is not set. I don't know whether my selected values are saving db or not. I don't have any meta key or values like `wp_acf` in database. But once you select the dropdown as `yes` in category page it is saving even after page refresh the value is `yes`. I'm getting confused whether the value is saving to db or not.


title: Wordpress and plugins update

text: How does a plugin update and wordpress update works? And what will be the its effect if for example I modified the codes of a plugin and then after some time, I will update it with the latest update of wordpress and those plugins?


title: I need a Pop up with description when i click an image

text: i need a pop up with description of an image when i click that image. How can this be done? Is there any plugin in wordpress that can do this?


title: An issue with SEO Ultimate

text: I'm using SEO Ultimate. The 404 monitor module is reporting several 404 errors. The errors are reported for urls that do not exist; 3 of them did exist as drafts but were never published. I checked my xml sitemap, but no luck there. Additionally, the link checker is not showing any broken links. Anyone experienced with SEO Ultimate who can point me in the right direction? thanks.


title: how to remove +new from wp admin area

text: I work on a project in which I want to remove +New link in WordPress admin bar. Actuly i want to replace 'new' to 'ADD Deal'. Is there any function in WP with this we can replace this text or how can I do this.


title: Updating WordPress overwriting customization tweaks - strategies?

text: Twice now I've updated wordpress, only to realise that (facepalm) it overwrites some changes I've made to the custom template - to sidebar or something similar. Obviously I don't HAVE to update, but it's better to for add-ons etc, and I like having the latest products and bug fixes. What are other people's strategies for straightforward updates to wordpress without losing custom modifications to the default template?


title: In what file I should include my code if I want content to come up on top of everything?

text: I added a button and when you press on it new content should come up on top of everything, but if I icnlude my code into header.php it will cover only header, if I include in index.php it will cover only index, so my question is where I should include my code?


title: Bulk post type conversion

text: I have been given a client's wordpress site to update & improve. Biggest problem - I need to take about 200+ posts of a specific category, 'reviews' and convert them all into a custom post type 'reviews'. On top of this I need to move a few custom fields that have been attributed to these posts, so they remain intact once moved. I expect I'll have to write a custom script that will change the mysql direct. But before I get my hands dirty- does anyone have any experience with doing this? Any tips/ gotchas/ scripts out there I can use? Cheers


title: Is it possible to store arrays in a custom field?

text: If I understand correctly, custom fields work like this:               key(string/int) => value(string/int)      Is it possible to define a custom field like this?               key(string/int) => value(array (string/int, string/int))      I want to use such a structure for storing a series of quotations in [quote, source] format, thinking that it would minimize potential input error compared with, say, str_splitting a single value.


title: Add suffix to uploaded images

text: I found this post what handles in a similar way my intention. But I´m not 100% sure how to expand the callback function with my options. So here my suit: I add an function to the functions.php to add some custom imagesizes.                   if ( function_exists( 'add_image_size' ) ) {              add_image_size( 'homepage-thumb1', 900, 9999 );         add_image_size( 'homepage-thumb2', 500, 9999 );         add_image_size( 'homepage-thumb3', 250, 9999 );     }      How can I add a add a specific suffix to this three images like this: For "homepage-thumb1" an -medium.jpeg, for "homepage-thumb2" an -small.jpeg and so on. I know that I can execute an callback function with add_filter. But how can I add an suffix to an image? Kind of behavior like this: if "homepage-thumb1" add suffix "-medium"


title: get_posts always returning the same number of posts = 5

text:
I don't understand why the code below is always displaying the same number of returned post = 5. When I change the `$variable` value to another `post id` of a post with an author with another `author_id`, I always get 5 returned posts, even if the authors have tens of posts. What am I doing wrong?               $variable=328;     $post = get_post($variable);          $author = get_userdata($post->post_author);          $args = array(     'author' => $author->id );           global $post;          $myposts = get_posts( $args );     $count= count($myposts);          echo '
';     print_r($myposts);     echo '
';          echo $count;      Your help is really apprecieted.


title: What is a reasonable get_num_queries() result?

text: What is a reasonable number of results I should expect with get_num_queries()? I know it depends on the theme, and I know that smaller is better, but what is a ballpark figure? 10s? 100s?


title: Set post-thumbnail (with php)?

text: A site I have inherited uses custom fields to set a path for thumbnails. Ideally I'd like to switch this over to use the built in post-thumbnail. Is there a way to procedurally set the post-thumbnail? Thanks


title: Wordpress: How to make a subsubdirectory

text: **I have a multiple word press installations that I am trying to reduce to one.** Here is what it currently looks like:               Installation 1 = www.example.com     Installation 2 = www.example.com/foo     Installation 3 = www.example.com/foo/bar      How do I make it into one installation like this:               www.example.com/foo/bar      Where `/foo` and `/foo/bar` are two different pages. Optionally: How do I do this:               www.example.com/baz/bar      Where `/baz` does not do anything (like a 404) and `/bar` is the actual content. Thanks for the help!


title: how i can change wordpress post views?

text: i use a post view counter code in my website. here show like( 2 views ). i want it show like( 2 বার দেখা হয়েছে ) like bangla language . how i cant do it. i use this code . function.php               function getPostViews($postID){         $count_key = 'post_views_count';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');             return "0 View";         }         return $count.' Views';     }     function setPostViews($postID) {         $count_key = 'post_views_count';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             $count = 0;             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');         }else{             $count++;             update_post_meta($postID, $count_key, $count);         }     }      single.php               <?php               setPostViews(get_the_ID());     ?>      postinfo.php               <?php               echo getPostViews(get_the_ID());     ?>      my website http://techjagot.com


title: Translate a site based on different themes

text: This is my first question on the site. First of all I want to apologize for my bad English. I´m migrating a site to a WordPress theme, and I need a solution to translate the theme to _3 different languages_. I have the post translation on several custom post meta (title in Russian, title in Spanish, and so on). What i need is a simple solution to, based on a link, load a different theme so i can manage what to show on the site and URLs must to be viewed like `/en/` or `/es/`.


title: Does wp_mail work in frontend tempate file?

text: I am creating a function in a template that will send an email using wp_mail function. My question is if it can be used be not logged in users or not. I mean directly from a template file like (it's just an example, in my real example it's much more code):               <?php     /**      * Template Name: Custom Template      *      *      * @package WordPress      * @subpackage Twenty_Twelve      * @since Twenty Twelve 1.0      */          get_header(); ?>          <?php                   $headers = 'From: Tester 1 <testmail@something.com>' . "\r\n";         $subject = 'Subject test' . "\r\n";         $message = 'Just a test stuff.';         wp_mail('testmail@something.com', $subject, $message, $headers );               ?>          <?php get_sidebar(); ?>     <?php get_footer(); ?>      If not, how can I simulate logged in user just for this thing? It's not working for me right now, so I was thinking that I need soem more permission maybe?


title: paginate_links and query vars

text: I have using the Wordpress `paginate_links()` to build a paginator on a custom archive template for a custom post type. My site uses permalinks:               <?php echo paginate_links(array(         'base' => get_pagenum_link(1) . '%_%',         'current' => max(1, get_query_var('paged')),         'format' => 'page/%#%',         'total' => $wp_query->max_num_pages,     )); ?>      This works fine until I try to add query string vars to build a custom search string when the paginator echoes:               .../entries?post_type=entry&s=testpage/1     .../entries?post_type=entry&s=testpage/2      Instead of:               .../entries/page/1?post_type=entry&s=test     .../entries/page/2?post_type=entry&s=test      and so on... How can I get the correctly formatted URLs?


title: How are Dynamic Sidebar Widgets rendered

text: I have been reading through the Wordpress Source, trying to get a better understanding of how dynamic sidebars are rendered. However, I am hitting a sticking point...               894 | do_action( 'dynamic_sidebar', $wp_registered_widgets[$id] );      I can't find where add_action('dynamic_sidebar', ... ) is defined. Without out that part, I am sort of lost in what happens. See the code here: https://github.com/WordPress/WordPress/blob/b7c13e27c255e1fc1f03ab2ab432f1652a0ac212/wp- includes/widgets.php#L894 And to give more context, I am trying to figure out how to grab an array of widgets, and then from there, how would you render each one. I need finer control than `dynamic_sidebar(...);` gives me


title: How do I add a link to the menu that has a charector (?) in it?

text: I'm trying to add a link to a drop-down menu but it gets lopped off every time. THe full address is https://www.ub- tonlinebank.com/onlineserv/HB/Login.cgi?runmode=REGISTRATION but is stops at ? and gives an error when pulled up via WordPress. I tried getting around this by creating a bit.ly link but still get the same problem. How can I link to the whole address? thanks!![enter image description here](http://i.stack.imgur.com/026jh.png)


title: How to copy and paste a picture found on the web to wordpress easily

text: Anyone knows how to do so? What about if you want to edit the pics a little bit before pasting. I am using windows.


title: Plugin used only on some pages - not widget

text: Im using 'Cool FB like' plugin which displays a css fixed facebook logo on the right. When we hover that logo, fan page box is showing up. The problem is that I need to change fanpage on some pages. Do you have any idea how to manage that? I have an idea - I can use one plugin on some pages and another - similar one, on others but this plugin isn't a widget so i can't set where to display plugin up. Maybe You have some other ideas? Cheers


title: changes to templates not showing on server

text: I have done some changes to woocommerce changes to its template in /MyTheme/woocommerce/templates, it shows fine on my localhost but when I upload the woocommerce to my server under my theme it doesn't show the changes and shows the original woocommerce plugin templates. The file structure is same but its not showing. What can be the reason? How to debug it?


title: Reusing the page name class that Wordpress adds to body tag

text: When viewing my blog in the browser, the body tag (on the index page) has the following class:               <body class="home">      On other pages (for this example, a page that pulls in posts that are within the category "project"), the body tag has even more classes:               <body class="archive category category-project category-3">      Both of these are rendered using the following code, contained within the html_header part:               <body <?php body_class(); ?>>      I was wondering whether there was a way in which I could isolate the page descriptive class (1st example - home, 2nd example - category-project) that this command targets and use within the page. Thanks


title: get_option error plugin development

text: Im creating a plugin with the following structure: > >     plugins (folder) >     - myplugin (folder) >      - myplugin_index.php (adminpanel file) >      - myplugin_ajax.php (loading data when user enters a form on the "start > page") >   >     themes (folder) >      - mytheme (folder) >       - template_my_own.php (this file have the form which calls the > myplugin_ajax.php) >   The plugin works just fine from the admin panel point of view. I have added data through the plugin from the admin panel. But when I try to access data through the form in the file `template_my_own.php` I get the following error: > >     PHP Fatal error:  Call to undefined function get_option() >     in /var/www/example.com/wwwroot/wp- > content/plugins/myplugin/myplugin_ajax.php >     on line 14, referer: http://example.com/ >   I have tried the solutions from both this site. None of them work though. My code lookes like this:               <?php     /*     Plugin Name: Myplugin     Plugin URI: http://example.com     */     ?>     <?php         $square = $_POST['square'];              //Get arrays and remove empty array values         $arrayFrom =            array_filter(get_option('from'), 'strlen');         $arrayTo =          array_filter(get_option('to'), 'strlen');         $arrayPrice =   array_filter(get_option('price'), 'strlen');                   //Sort arrays         asort($arrayFrom);         asort($arrayTo);         asort($arrayPrice);                   //Go through values until we find the one         foreach($arrayFrom as $index => $from)         {             if($from < $square && $arrayto[$index] > $square)             {                 echo $from;                 echo '<br>TESTTESTTEST';                 echo $to;             }         }        ?>      How should I solve this and what am I doing wrong?


title: Some custom taxonomy child terms not showing in admin. Caching problem?

text: I have a problem with some custom taxonomy terms. I am using "Types" plugin for creating custom post types and custom taxonomies. I successfully created my postype and hierarchical taxonomy and strated to add content. Everything worked great until I migrated the site from the dev server(Linux) into the live server (Microsoft IIS). Right now when I add a term as a child to another term in the taxonomy, it gets hidden from the custom taxonomy terms admin panel and I have to type it in the admin search in order to find that term. Also, these child terms don't show up in a hierarchical term navigation list on my site front-end. I tried:   * deleting the parent and child term and creating them again. Same thing, as soon as I assign the child term to the parent term, the child term disappears.    * Clearing cache with w3tc   * Optimizing DB with WP-DBManager   * Everything works normally in my outdated development site. I see a few people seem to have similar issue, but I don't see any clear solution. Some help would be appreciated. Thanks!


title: Embed iFrame in WordPress 3.0.1

text: I need to embed an iFrame into a post and it appears that tinyMCE or something is stripping it out when I go from HTML to Visual view while editing a post. I've found instructions for adding valid elements to tinyMCE but it only seems to apply to WordPress 2.8. No such file seems to exist under WordPress 3.0.1 (see Make WordPress WYSIWYG not strip out iframe's) None of the iFrame embedding plugins seem to support WP 3.0.1 either. Thanks for any tips.


title: Types plugin breaking because of server configuration

text: I have tested this on three different hosts, using a number of different versions of both Types and WordPress, and I believe I've narrowed it down to my host (Firehost) setup, which they recently changed a bit. Here are the modules they added (I believe) to Apache: mod_deflate mod_env mod_expires mod_headers mod_mime mod_rewrite mod_setenvif My issue is this: when I attempt to either add or edit a custom post type, I get to the point of pushing "Save Custom Post Type" ... and then I see a white screen, with a url similar to the following (stays the same as before I click the button, but displays a blank white page): http://mydomain.com/wp-admin/admin.php?page=wpcf-edit-type It should be displaying something like this: http://www.mydomain.com/wp-admin/admin.php?page=wpcf-edit-type&wpcf-post- type=news&wpcf-rewrite=1 Has anyone had an issue like this before, or know what might be happening? I don't believe that the issue is within Types, WordPress, or a theme or plugin. I've tested this on more than 10 sites, and every site hosted on Firehost does exactly the same thing (nothing), and every site on Bluehost or GoDaddy hosting (similar sites with the same base theme and plugins, but varying versions of Types and WordPress, going back to just the last version of each), creates the post type correctly. Please help! I'm in the middle of a project that has been shot to hell because I tried deleting and re-adding a post type before I was aware of the extent of the problem. I've now replicated the issue on a clean install with just the Types plugin installed as well.


title: How to do a MySQL dump from production site without using a search and replace script for local development?

text: I performed a MySQL dump of my WordPress production database to be imported into my local development environment. I plan on frequently performing this database dump and import. Is it possible for me to AVOID running a search & replace script or a MySQL query that updates all of the permalinks, site URLs, etc? Could I include something like the following in my wp-config.php to override the above said links:               define('WP_HOME',    'http://localhost.com:8888/example');     define('WP_SITEURL', 'http://localhost:8888/example');      My goal is to make it as EASY as possible to perform routine database dumps from my production site to local.


title: Do widget options need to be escaped widget()?

text: I was wondering if you really need to escape user submitted data (widget option fields) within the widget() and form() functions (from the widget class) ? I don't see a reason to do this, if the data is already escaped in the update() function. Or am I missing something?


title: Multisite setup on IIS with subdomains

text: I have Wordpress 3.4.2 set up on a Windows 2008 R2 server with IIS 7.5. I enabled multisite using subdomains and set up one additional site, call it child.example.com. I can browse to the main site at example.com just fine, but whenever I browse to child.example.com it tries to go to the default web site in IIS, which has ID 1 and currently points to an empty directory. The main Wordpress site is one that was manually added to IIS, and its ID is 3. I created entries in my hosts file on the server for the main site and the child site, and they seem correct (I don't have access to our DNS provider at the moment). In trying to figure this out, I keep coming back to these entries for wp- config.php:               define('SITE_ID_CURRENT_SITE', 1);     define('BLOG_ID_CURRENT_SITE', 1);      These seem to tell Wordpress the ID of the site where it will live. My question is what does that number represent? Does it have any correlation to site IDs in IIS? If I change it from 1 to 3, would that tell Wordpress to use the proper site when accessing its subdomains? EDIT:   It seems that those numbers might refer to the values in the site_id and blog_id fields in the wp_blogs table, specifically for the record associated with the main site. I tried changing them to 3 in wp-config and bouncing IIS, but that had no effect. So now my question becomes, how can I get Wordpress to look to its own IIS site when a request comes in for a sub-site, versus looking at the site designated as the 'default' in IIS?


title: How Do I Add Product Pictures To Search Results Of A Custom Wordpress Theme Using A WooCommerce

text: I made a custom wordpress theme from scratch. I added WooCommerce for the shopping cart and store. When I search products in the store the search results do not show pictures. How do I make the pictures of the products visible in search results?


title: Uploading Media gives error "Missing a temporary folder."

text: After we upgraded to Wordpress 3.0.1 (from Wordpress MU 2.9.2) we began getting an error message whenever we tried to upload media. **"Missing a temporary folder"** Various articles around the web mention the php setting `upload_tmp_dir` needing to be set in `php.ini`. This is not actually a requirement. I know because it is not set in our test environment, and it was not set in our production environment before the deploy. In both cases uploads worked. So what changed? I have _an_ answer, but I'm not sure it's the definitive answer. I'll post mine.


title: Retrieving and Storing Images Linked from Other Domains on Local Server?

text: _( **Moderator's note:** The original title was "Copy and Paste picture in post without linking to original")_ When I copy and paste a picture from another editor window it appears nicely but it links to the original location. Is there a plugin which lets me copy and paste images in a post (like it happens in Windows Live Writer) so that the image gets uploaded to the uploads dir? Or is that impossible in a web environment? Reason: the one thing why I keep returning to Windows Live Writer for initial postings is the image functionality. If I could somehow make this process easier I could write some posts in the WordPress backend instead. **Update:** If it does NOT exist yet, I probably will write a plugin on a hook that fires after a new or update of a post, goes through the_content, finds all image url's that are not the same as the preferred root domain (for multisite) and if not, does a cross-load of the image (as e.g. in the swift theme) and then replaces the url with the newly uploaded image. However... since this is a basic thought someone must already have made this I just cant find it in the plugin directory (yet). **Update 2** : Let me try this one:   * http://blog.milandinic.com/wordpress/plugins/cache-images/ **Update 3** : The above plugin works perfectly even in my WordPress Multisite environment.


title: Removing Metabox for "Slug" without removing functionality

text: Here is an interesting question. I have recently noticed that if you utilize the code               remove_meta_box('slugdiv', 'post', 'normal');       you are actually unable to modify the slug when you click on the url slug under the page title. To clarify, when you use remove_meta_box for the slugdiv, the metabox and the screen options get removed however you are still able to click on the url under the post title to edit it... However, when you go to update/publish the post whatever modification you made does not take. My objective is to remove the same metabox from the post edit screen AND remove it from the screen options page BUT I want to ensure that when you edit the slug under the post title that this still works. Can anyone provide a solution to this problem? Thanks in advance.


title: What is the "Advanced" $context in add_meta_box?

text: In the codex it lists the parameter $context for the add_meta_box as having the following options:   1. normal   2. advanced    3. side  What does "advanced" do? I don't see any difference between it and "normal".


title: Applying roles to an admin sub-menu (eg Appearance -> Menus)

text: Long time lurker, but first time poster. I've searched Google extensively and just can't seem to come up with an answer on this problem. I use Justin Tadlock's excellent 'Members' plugin for roles and permissions on several client installations of WP. I've recently deployed a theme where the client should only have access to the Appearance -> Menus item, but none of the others sub-items in the Appearance menu of the admin. When enabled, the role 'edit_theme_options' enables the user to access 'Themes', 'Widgets', and 'Menus'. How would I go about filtering the submenu so that if the role 'edit_custom_menus' is assigned, the 'Menus' link will show?


title: Change the menu home link to something else

text: I'm using the built in menu system, and I wan't to change the text of the home menu link to something else, like "hjem", and i have tried placing this in the code:               <?php wp_page_menu( array( 'show_home' => 'Hjem', 'sort_column' => 'menu_order' ) ); ?>      But that did nothing but show the menu, with the home menu text "Home". What do I do?


title: How often does the RSS widget get updates?

text: I am asking since I am trying to understand if this widget is causing my server to overuse CPU or memory. But either way - it's interesting to know.


title: Pagination 404 Not Found child page

text: I have a page _Heemtijdinghen_ displaying custom posts (post_type=artikel) paginated. The page is a child page of page _Publicaties_ : `/publicaties/heemtijdinghen/` When navigating to e.g. page 2 a 404 Not Found is thrown: `/publicaties/heemtijdinghen/page/2/ => 404 Not Found` However, pagination does work correctly when I make the child page a parent page: `/heemtijdinghen/page/2/ => OK` I have no clue how to do the rewrite:               add_filter('init', 'plugin_name_add_rewrite_rules');          function plugin_name_add_rewrite_rules() {       add_rewrite_rule('publicaties/heemtijdinghen/(.?.+?)(/[0-9]+)?/?$', 'index.php?post_type=artikel', 'top');       add_rewrite_rule('publicaties/heemtijdinghen/([^/]+)(/[0-9]+)?/?$', 'index.php?post_type=artikel&paged=$matches[1]', 'top');     }      Help would be very much appreciated.


title: When trashing a post, also trash related comments

text: As it is now, when I trash a post, the related comments get deleted at once. Is this standard? Instead I'd like them to be moved to the trash bin, when I trash the post. How can I achieve this? I can't seem to find a solution.


title: Always keep a parameter in URL?

text: Is there any way that WordPress always keeps a custom parameter in every link it generates? Here's what I want to do. I want to create a debug mode by entering `?debug` as a URL parameter; and display some specific information or do some debug only coding if that URL parameter is available. I know what I need to get WP to work with custom URL parameters. I want to know how can I make WP to keep `debug` parameter in all the liks it generates; and this parameter keeps propagating to all the links I click on while navigating the entire site until I remove it.


title: Assign Custom classes to every Excerpt

text:
I have Around 40 **Excerpts on my homepage** (I am using Gantry Framework) and I want to **style each of these Excerpts in a different Manner**. i.e Different Backgrounds, Font color For Every Excerpt. So How can I **add custom Class to each and every excerpt** which is there on my homepage...say in manner Excerpt1 , Excerpt2 .... Excerpt40. **This is what I have explored so far** : These Excerpts Are being called in a file content-blog.php like this!!
       <?php if( $gantry->get( 'blog-content', 'content' ) == 'excerpt' ) : ?>         <?php the_excerpt(); ?>       <?php else : ?>         <?php the_content( false ); ?>          <?php endif; ?>
      So If I do this:
         <?php if( $gantry->get( 'blog-content', 'content' ) == 'excerpt' ) : ?>
             <?php the_excerpt(); ?>
         <?php else : ?>           <?php the_content( false ); ?>         <?php endif; ?>
      A single class i.e `sameexcerpt` will be assigned to each excerpt. But if can somehow use a global variable or static variable. and keep incrementing that variable like this:               <div class="sameExcerpt<php echo ++globalvariable">       <?php the_excerpt(); ?>
       <?php else : ?>       <?php the_content( false ); ?>          <?php endif; ?>
      Then I think I can Assign a different Class to Every Excerpt. Any Help Will Be greatly Appreciated.


title: Adding a class to post title considering the title length

text:
I searched for "title length" in questions but results were all about setting max length and limiting and.. What I want to do is to create an if-statement, to determine if the post title has more than 68 characters or not and if it had, add `smaller` class to it. I wrote the code like this:               <?php         $permaLength = strlen(the_title());     ?>     <h2 class="<?php if ($permaLength > 68) {echo 'smaller';} ?>">         <a href="<?php the_permalink() ?>">             <?php the_title(); ?>
      but it seems that `the_title()` function is not returning the value and instead it's echoing out. Is there an alternative way to fetch the title length?


title: How To Get Posts With A Specific Word

text: How to retrieve posts with a specific word in the loop. For example, I want to retrieve all posts with the title of the profile post (custom post type): http://www.wwefansnation.com/wrestler/dolph-ziggler/ I created profiles in my website, and I want to display all the posts which contains the word "Dolph Ziggler" or the name of the profile.


title: loop through all posts memory error

text: I have few thousands posts and need to list all of them in the admin. When I used WP_Query to get them all at once I got a memory error. Then I split it into several query calls and it worked just fine with 256 MB limit. Here is the code:               $limit = 200;     $offset = 0;     while (TRUE) {         $posts = new WP_Query(array(                 'posts_per_page'        => $limit,                 'offset'                => $offset,                 'post_type'     =>  $post_type,                 'orderby'       =>  'title',                 'order'         =>  'ASC',                 'post_status' => array('publish', 'private', 'draft', 'inherit'),         ));              if (!$posts->have_posts()) break;              while($posts->have_posts())         {                 $posts->the_post();                      # do some echoing with the $post         }              $offset += $limit;     } /*(TRUE)*/      So this works just fine on development server. But when moved to production, it throws memory error `Allowed memory size of 268435456 bytes exhausted (tried to allocate 64 bytes) ...` I tried lowering the `$limit` but it doesn't help (on dev it actually works just fine with `$limit = 500`. What else can I do to force it to release memory?


title: Exclude post formats in custom loop

text:
I'm trying to exclude all post formats but standard from a page template loop that displays 4 latest posts. For some reason I can't get the query to work. This is my page template               global $paged, $wp_query, $wp;     $args = wp_parse_args($wp->matched_query);     if ( !empty ( $args['paged'] ) ) {     $wp_query->set('paged', $args['paged']);     $paged = $args['paged'];     }           $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;      query_posts('cat=0&posts_per_page=4&paged='.$paged); //set your own query here      get_template_part( 'loop', 'portfolio' );           wp_reset_query();      This is the loop               <?php $num_cols = 4; // set the number of columns here          for ( $i=1 ; $i <= $num_cols; $i++ ) :         echo '
';         $counter = $num_cols + 1 - $i; ?>          <?php while (have_posts()) : the_post();         if( $counter%$num_cols == 0 ) :          // begin of core posts output ?>              <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                      POST STUFF         <?php //end of posts output              endif; $counter++;             endwhile;                 rewind_posts();             echo '
'; //closes the column div         endfor; ?>             <?php if (  $wp_query->max_num_pages > 1 || get_query_var('page')) : ?>                 <?php twentytwelve_content_nav( 'nav-below' ); ?>                        <?php endif;             wp_reset_query(); ?>      This is the query I've been trying to get to work with it               $args = array(         'tax_query' => array(             array(                 'taxonomy' => 'post_format',                 'field' => 'slug',                 'terms' => array( 'post-format-aside', 'post-format-image' ),                 'operator' => 'NOT IN'             )         )     );     $query = new WP_Query( $args );


title: Contact Form 7 - Populate Select List With Taxonomy

text: With contact form 7, is it possible to populate a DDL (Selection List) with Custom Taxonomy Values? I want the user to be able to click the category they want to refer to from my Custom Post Type.


title: Pasting images removes class attribute

text: When you paste an image with a `class` attribute in the Wysiwyg editor, the pasted image no longer has this `class` attribute. This makes it harder to copy and paste images that are aligned with the `alignleft` or `alignright` classes. This used to work in WordPress 2.7, but it no longer works in WordPress 2.8 and up. It also works in the "base" version of TinyMCE (tested with 3.2.7 and 3.3.9.3), so it is probably something that is added by WordPress. I tested this in Safari, Firefox 3.6 and Chrome on Mac OS X. This has been mentioned in a Trac ticket but the main item was dismissed as a browser issue - but I think the `class` issue is not. Has anyone else found a way to make this work?


title: esc_url removes white space. Can I change that to using '-'?

text: I'm using esc_url to sanitize my url. The only problem is that "my link" becomes "mylink". I wouldreally like it to become "my-link". Is there a way to change this?


title: Wordpress home page doesn't work, but other pages do. How to rectify?

text: http://blog.sanspace.in/ My blog home page is messed up. None of the plugins or sidebar widgets are working. Only the latest post is showed that too partially. However, other pages and posts (accessing through their URL) seems fine. http://blog.sanspace.in/contact/ [page] http://blog.sanspace.in/hello-world/ [post] I am not sure what exactly the problem is. Could anyone help me with this? Is there anything wrong with the wordpress settings? Else, something needs to be done with my server settings? **update** : I have hosted it with hostso in a shared hosting plan. I did not modify any WP files. My home page is a default WP home which shows the latest post. **update** _ _closed_ _ : The problem was with the json_last_error() method I used in the latest post. Somehow the method is no longer supported by my server it seems. It caused all the problems.


title: How to Get Next or Previous Post in a Specific Tag?

text: I'm trying to create links to the next and previous posts within a specific tag (on the post page itself), but I can't seem to find a plugin or source that does this. I want to be able to something like this, appearing below the post.               get_previous_link("tagname");     get_next_link("tagname");      Anybody know of a way to accomplish this? Otherwise I'll have to write something myself, which is fine, but I figured I wouldn't reinvent the wheel unless I have to.


title: In a loop of custom post type, display first custom taxonomy term

text: I would like to display just the first term from a custom post type custom taxonomy. Inside my loop I've been displaying all the terms using:               <?php echo get_the_term_list( $post->ID, 'traits', 'Physical Traits:', ''); ?>      but I would like to only display the first term. Thanks!


title: query statement containing variable won't execute

text: Very confused why the following code does not work.               function discount_State() {     if(is_page('cart')){     global $wpdb;           $current_user = wp_get_current_user();      $need = $current_user->ID;          $getID = $wpdb->get_var($wpdb->prepare("SELECT meta_value from table where user_id = $need AND meta_key = 'shipping_state'"));          echo $getID;            }     }          add_action('woocommerce_before_cart_table', 'discount_State');      The problem is that when I put the user_id as a variable in the sql statement, the code is not executed. If I input a number for the user_id, the code works. I have tried using gettype to confirm that the $need is a integer. I have assigned $need to a number, ie $need = 12, and the code executes. I can't figure out why the statement won't execute correctly the way it is written. I have tried writing the variable as '$need' and "'.$need.'" with no success. Any help is greatly appreciated!


title: jquery & ajax sending data to php

text: In my jquery script I have;               jQuery.ajax(             ajaxurl, {             action: 'lu_ajax',             status: 'enabled'             },             success: function (a) {             alert(a)             }      In my file.php i have;               add_action('wp_ajax_lu_ajax', 'lu_ajax');     add_action('wp_ajax_nopriv_lu_ajax', 'lu_ajax'); //for logged users     function lu_ajax() {              if($_GET['status'] != '') {                 $value = $_GET['status'];                 echo $value;                 setcookie("status", $value, time()+3600, "/");         }     }      I am including the file.php in the main plugin such as require_once('inc/file.php'); However, no cookie is being set or any value being echoed, can anyone tell me what the issue is please. initially the issue that I had is that I was calling the file directly and caused wp functions to be undefined so i was recommended to use ajaxurl and then the action to perform and the variables i wanted to send over to php, but nothing is happening now. ps. both jquery and php are in the same file.php i do not have a separate js file as it doesnt fit my purpose. **update new issue** As I am making the ajax call from jquery i am firing them up based on conditionals, the following is a sample;               var stat= true;                     jQuery.ajax({                         type: 'POST',                         url: ajaxurl,                         data: {action: 'lu_ajax', status: 'enabled'},                         success: function (a) {                             alert(a)                         }                     });             } else {                 var stat= false;                 jQuery.ajax({                         type: 'POST',                         url: ajaxurl,                         data: {action: 'lu_ajax', status: 'false'},                         success: function (b) {                             alert(b)                         }                     });                 }      however the cookie is always set to enabled, meaning that the first call is only being made, the problem is not in the condition as i test it by setting it to false manually.


title: Show latest posts on responsive theme

text: I've installed Responsive theme on my new blog. I want the home page to show my recent posts, so I configured `Settings->Reading` to show my 10 recent posts, instead of a static page. Alas, the static home page (with the "Call to Action button") remained. Any idea how to change it?


title: Is it possible to create a RSS feed containing all blog entries?

text: More specifically I have a blog at riduidel.wordpress.com for which I would like to create that feed, for it to be later consumed in a site backup solution called autoblog, which can create a site copy by simply reading a RSS feed. So is there such a tool available for wordpress.com sites (directly or not), or should I do a backup of my blog database then write a script generating that stream ?


title: WP_Query ignores post_type in category view

text: I have following query to select posts by my custom post-type. This works fine while being on the frontpage (the snippet is included in the sidebar). As soon it gets executed on a category page the `post_type` attribute is ignored and posts of the type "post" are returned. I guess this has to do with multiple loops but I have also tried to call `wp_reset_postdata();` and `wp_reset_query();` before and after.               $customPosts = new WP_Query( array(          'post_type' => 'mycustomtype',          'posts_per_page' => 12,          'orderby' => 'date',          'order' => 'DESC',          'post_status' => 'publish'     ));          while ( $customPosts->have_posts() ) : $customPosts->the_post();          $thumbnailUrl = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), "thumbnail");         if ( !empty($thumbnailUrl)) {           /* echo result */          }        endwhile;


title: Using query string on edit CPT page

text: I'm adding a query string on the edit CPT page so I can add different meta boxes depending on what type it is. We're doing profile types, and the choices are student, staff, alumni and external. The url looks something like this: http://www.website.com/profiles/wp-admin/wp- admin/post.php?post=2226&action=edit&profile_type=student profile_type=student is my custom bit. I'm wondering if anyone knows whether this is a good or bad idea? I have it set up and working, but I keep finding edge cases where the edit page is loaded without appending the query string. Now I'm thinking is it better to start again with a more wordpress standards way of doing it, or keep trying to plug the holes in as I find them. For example, the current problems are drafts don't work, and the edit post link in the admin bar doesn't pass the query sting through. I could hopefully just fix them, but I'm sure there will be many other sneaky cases where you can get onto the add / edit page without having my needed query string. Thanks


title: Auto-Tweet if Type is 'Status' using OAuth

text: Should be simple - I'd like WP to tweet the content of a post once (when it's published the first time) if the post format is 'status'. The code below isn't returning an error on publish, nor is it tweeting OR updating the post metadata, which leads me to believe I'm either using the hook incorrectly or there's something wrong with checking the post type as I have. This is currently living in my functions.php I'm using Matt Harris' tmhOAuth and have successfully tweeted from a standalone tweet.php using most of the function below. Keys and secrets removed for security.               function posse_twitter( $post ) {         // check post type if necessary         if ( $post->post_type != 'status' ) return;              $post_id = $post->ID;         $tweet_content = $post->post_content;              if ( !get_post_meta( $post_id, 'tweeted', $single = true ) ) {             // ...run code once             //Include Libraries             require 'libraries/tmhOAuth/tmhOAuth.php';             require 'libraries/tmhOAuth/tmhUtilities.php';             $tmhOAuth = new tmhOAuth(array(               'consumer_key'    => 'XXXXX',               'consumer_secret' => 'XXXXX',               'user_token'      => 'XXXXX',               'user_secret'     => 'XXXXX',             ));                  $code = $tmhOAuth->request('POST', $tmhOAuth->url('1/statuses/update'), array(               'status' => $tweet_content             ));                  if ($code == 200) {               tmhUtilities::pr(json_decode($tmhOAuth->response['response']));             } else {               tmhUtilities::pr($tmhOAuth->response['response']);             }             update_post_meta( $post_id, 'tweeted', true );         }     }          add_action( 'draft_to_published', 'posse_twitter' );


title: Gallery post images on homepage?

text: I have a post with image gallery, it has 10 images. Can I get the direct link to the images in the post, so that I can display first 5 images on the homepage?


title: WordPress.com podcast feed missing iTunes tags?

text: I recently published a podcast hosted on WordPress.com on iTunes and it says "Podcasts by Unknown". It seems like it is missing the author tag. My question is that how can I add the author tag to the RSS since I used the RSS widget to expose my RSS?


title: How to determine when my theme is deactivated?

text: I'm using the following code branch to execute some theme setup options...               $myTheme_initialized = get_option('myTheme_initialized');     if (is_admin() && !$myTheme_initialized && isset($_GET['activated'] ) ) {     //do setup stuff     }      What hook can I tap into when the theme is deactivated?


title: WPML custom post type - not translated

text: I just installed a WPML, but my custom post types is showing just in default language, if I am switching to other languages, it will show the same posts as default language, but in wordpress panel they are translated. Part of my code in function.php               $args = array(              'labels' => $labels,             'public' => true,             'publicly_queryable' => false,             'show_ui' => true,             'query_var' => true,             'rewrite' => true,             'capability_type' => 'post',             'hierarchical' => true,             'menu_position' => 5,             'supports' => array('title','thumbnail','taxonomy')      And to get those post types I am using :               query_posts('post_type=objekts');     ...


title: Display all WP Errors together during form validation

text:
I have a custom front end page where users can post from. All works fine but the i want if more than one field is empty then the errors for all empty fields should show all together. Right now the code only show error for the first empty field it detects. The code is :                   $errors = new WP_Error();              if (isEmptyString($title_stripped))         $errors->add('empty_title', __('Please enter a title'));              if (isEmptyString($description_stripped))         $errors->add('empty_desc', __('Enter a breif description'));              if (isEmptyString($content_stripped))         $errors->add('empty_content', __('Please enter your article here'));              return $errors;      **Edit : Solved** Sorry to bother . It was one of my other functions which was limiting the error to echo only once. Here is the previous code :               function display_message( $message = false ) {         if( is_wp_error( $message ) ) {             echo '

' . $message->get_error_message() . '

';           }      It worked fine when i changed it too :               function display_message( $message = false ) {         if( is_wp_error( $message ) ) {             echo '

';             foreach ( $message->get_error_messages($code) as $error ) {             echo $error . "
\n";               }             echo '

';           }


title: Fail to compare dates in meta_query

text: This is the piece of code I use to get event posts whom date metadata is newer than today :                   <?php             query_posts( array(             'post_type' => 'concerts',             'meta_key' => 'numericdate',             'posts_per_page' => -1,             'orderby' => 'meta_value',             'order' => 'ASC',             'meta_query' => array(                 array(                     'key' => 'numericdate',                     'value' => date('dmY'),                     'compare' => '>=',                     'type' => 'date'                      )                )         ) );         if (have_posts()) : ?>      This returned no results. The "numericdate" field contains a "ddmmyyyy" string, so I expected comparing with a "dmY" today date value will work. I was wrong. Or there is some mistake in the code above. Thanks for your help !


what i am trying to do is create drop down menu in theme customizer from custom db i have created. db name "students". in the db i have only the id and the name. i want to show all students names in the drop down menu. and when the user will choose some of the students name and will click on the save button (i need to save his choose), and i want that next time the same name will be selected. in this drop down menu. i tried to make this work but without any results. thanks for help


title: Redirect after registration in BuddyPress

text: In Buddypress, after Registration first step, users are redirected to Change Avatar step. Im trying to find a way to redirect to an alternate page, for example: http://www.mysite.com/yeah Im using the following code, but Im continuously redirected to Change Avatar page.               function custom_filter_bp_signup() {              global $current_site;              return 'http://' . $current_site->domain . $current_site->path . 'yeah';          }           add_filter('wp_signup_location', 'custom_filter_bp_signup');      Any help is welcome, Thanks in advance.


title:
Convert [xcode]foo[/xcode] to
foo

text: I'm converting vBulletin content to WP with the Crayon syntax highlighter. What is the best way to convert the content's `[xcode]foo[/xcode]` to `<pre class="lang:default decode:true ">foo</pre>` for Crayon? I see info about the Crayon legacy tags conversion but the screenshots are missing and I don't know how to enable "legacy tags" for Crayon.


title: Extending Twenty Eleven Theme

text: In WP 3.3, how can I extend the Twenty Eleven theme such that I can make some custom additions or modifications but still take benefit in the updates that WP pushes out for the theme? Sort of like 'overloading' in programming, I guess. For now, I would like to include a custom css file and jQuery in header.php, and add a js function to single.php.


title: wp_list_pages Format only on Recently Modified Pages

text: wp_list_pages can be a great tool for displaying a tree structure. You can specify the depth, child of, and show_date of when the page was last modified. However, if I want to only show the date for pages that were modified in the last...24 hours say...How can I specify this?


title: what is this HTTP error [plugin: Google Calendar Events]

text: I am getting this error on my Google Calendar Events plugin: > Feed 1: There are no HTTP transports available which can complete the > requested request. Please ensure your feed URL is correct. I have tested this plugin a a web hosting company and it works fine. But when I moved my wordpress site to a local hosting machine I get this error. My server runs IIS6 and server 2003. What could this error be? Does it have to do with google web extensions not installed?


title: Custom title widget / HTML encoding

text: I'm not the first person who has battled the matter of WordPress stripping HTML from widget titles. There are a number of custom widgets out there that allow you to add e.g. links to titles, but I specifically wanted the ability to add br and span tags. I came across this tutorial: http://ponderwell.net/2011/05/how-to-use-html-in- wordpresss-widgets-title/ which tells you how to create a custom widget file based on the native WP default-widgets.php. That gets me nearly there, but both with using his method directly, or adapting it to customize an existing widget (Enhanced Text Widget), I'm getting an output of <br> and <span> instead of proper HTML encoding. I saw that somebody in the comments mentions html_entity_decode() and have tried a few things, but honestly I don't know PHP well enough to get it to work. If I have to do this in functions.php plus a custom_widgets.php file, I'll make that work, but for portability's sake, I'd prefer to accomplish the task as a widget plugin. What do I need, specifically, to get those tags properly encoded now that I've come this far? I did find the solution offered by Chris here: Unfiltered html in widget title not working, but clearly am not putting that code in the correct place. (I did get Amy's own self-solution to work in the functions.php, but not sure if that's a great way of doing it....) TIA.


title: Registration Form Shortcode

text: Is There any way to create a shortcode for registration form using               <?php do_action('register_form'); ?>


title: How To Use Custom Fields With .mp3 Links

text: Hope it doesn't seem to shallow of a question, but I've searched the web as much as I've could and have not found anything similar yet. :: Creating a regular post; How can I place a .mp3 link in a "custom-field", have that "custom-field" wrap the .mp3 in `<a href=ex.mp3">Example</a>` and place it as a `<?php .. ?>` in the single.php file. It shouldn't be that difficult, at least from my perspective. Any help/tutorials will definitely be resourceful right now. ..................... Appreciate the reply @johnsardine . I pretty much went with the basics of WP's Codex on Custom Fields. This is what I ultimately came up with (Note: this is going in The Loop via single.php - as I only want this on posts) `<a class="htrack" tabindex="1" type="audio/mpeg" title="<?php the_title(); ?>" href="<?php $key="mp3link"; echo get_post_meta($post->ID, $key, true); ?>" rel="nofollow"><?php the_title(); ?></a>` **mp3link** is used for the "Custom Field" key and of course, a regular URL to a Mp3 link (ie. http://filehost[.]com/song.mp3) is the value. On the final end I'm wrapping it into Yahoo's Web Player (htrack, tabindex, etc.). All in all, the Custom Field/Link/Link Title/and Yahoo are all working well together, I just can't figure out how to get the img. The code above omits the `<img src=... />` because every option I've used to get the thumbnail of posts, have not worked. If you can help me out on that, it'd be much appreciated as well. Example of what I'm meaning:               <a class="htrack" tabindex="1" type="audio/mpeg" title="<?php the_title(); ?>" href="<?php $key="mp3link"; echo get_post_meta($post->ID, $key, true); ?>" rel="nofollow">     ****     <?php the_title(); ?>      Or Am I trying to include the image wrong all-together? Thanks in advance.


title: How to handle PHP parse errors?

text: I tried to execute the following code and I got a parsing error message (line:3). Here is the code on Pastebin http://pastebin.com/gC7rsJqw. I tried echoing but didn't seem to solve the problem. Maybe I missed something. What am I doing wrong? Please help.


title: get_category_link() is returning nothing

text:
<?php      $categories=get_categories('taxonomy=galeriak');      foreach ($categories as $category) {     ?>
<a href="<?php echo get_category_link( $category->term_id ) ?>" title="<?php echo $category->name ?>"><?php the_term_thumbnail (  $category->term_id, $category->taxonomy, $size = 'thumbnail', $attr = '') ?><?php echo $category->name ?>
     <?php } ?>      I use this code to display the categories from the "galeriak" taxonomy. Everything is working, except the href part, its return nothing. I tried it with and without the echo, but nothing seems to work. Any ideas?


title: Error on Include php:/usr/share/pear

text: I'm trying to work with an old plugin http://wordpress.org/extend/plugins/wp- ecards/ (I'm not the plugin author) and I get this error in the php error log and a blank screen when trying to view the e-card on site:                Failed opening '' for inclusion (include_path='.:/usr/share/php:/usr/share/pear')      in /home/public_html/demo/wp-content/plugins/wp-ecards/ft-wp-ecards.php on line 171      **I don't know what is happening. Is this plugin trying to load the pear library? Any ideas?** The function around line 171 is below (with line 171 marked as such) :               function init_wpecards_viewcard(){         global $wp_query;         if ( isset($wp_query->query_vars['ft_wpecards_view']) ){             if ( $ft_wpecards_parentpost = ft_wpecards_get_post_id($wp_query->query_vars['card']) ){                 if ( ft_wpecards_get_post_type($wp_query->query_vars['card']) == 'post' ) {                     query_posts("p=".$ft_wpecards_parentpost."&ft_wpecards_view=1&card=".$wp_query->query_vars['card']);                     include(get_single_template());                       //exit;                 }else{                   query_posts("page_id=".$ft_wpecards_parentpost."&ft_wpecards_view=1&card=".$wp_query->query_vars['card']);                         include(get_page_template()); //LINE 171                         //exit;                     }                 }else{                     include(get_404_template());                 }                 exit;             }             //die('tr');         }         add_action('template_redirect','init_wpecards_viewcard');


title: Include default functions and methods

text: I'm starting a new service for a customer consisting in adding a input API in their WP website. I started by creating a blank page on the root but then I realized I couldn't access all methods and function to insert datas in WP. Basically I need to insert strings and integers as custom post types and meta datas. What would be the best way to make default functions and methods accessible in my script? Thanks!


title: Post meta not updating

text:
I am trying to make a voting system for WordPress. This is my code in `functions.php`:                 add_action("wp_ajax_add_votes_options", "add_votes_options");       add_action("wp_ajax_nopriv_add_votes_options", "add_votes_options");        function add_votes_options() {     if (!wp_verify_nonce($_POST['nonce'], 'voting_nonce'))         return;          $postid = $_POST['postid'];     $ip = $_POST['ip'];          $voter_ips = get_post_meta($postid, "voter_ips", true);     if(!empty($voter_ips) && in_array($ip, $voter_ips)) {         echo "null";         die(0);     } else {         $voter_ips[] = $ip;         update_post_meta($postid, "voter_ips", $voter_ips);     }             $current_votes = get_post_meta($postid, "votes", true);     $new_votes = intval($current_votes) + 1;     update_post_meta($postid, "votes", $new_votes);     $return = $new_votes>1 ? $new_votes." votes" : $new_votes." vote";     echo $return;     die(0);         }      This is how I place my vote button and vote count button:                   <?php     // This will display "0 votes" and increase as votes are added     $votes = get_post_meta($post->ID, "votes", true);     $votes = !empty($votes) ? $votes : "0";     if($votes == 1) $plural = ""; else $plural = "s";     echo '
'.$votes.' vote'.$plural.'
';     ?>          <?php     // This will display the vote button and disable it if a cookie has already     // been set. We also add the security nonce here.      $hasvoted = $_COOKIE['better_votes'];     $hasvoted = explode(",", $hasvoted);     if(in_array($post->ID, $hasvoted)) {     $vtext = "VOTED";     $class = ' class="disabled"';     } else {     $vtext = "VOTE";     $class = "";     }     ?>     <a href="javascript:void(0)" id="vote"<?php echo $class; ?>><?php echo   $vtext; ? >     <?php if(function_exists('wp_nonce_field')) wp_nonce_field ('voting_nonce', 'voting_nonce'); ?>      The problem is that it isn't updating the meta data. It shows 1 votes but doesn't update the meta data on click. I don't now what I am doing wrong.


title: Custom query (author is post_author or meta co_author) with Pagenavi pagination

text: I need to create a custom query for the author archive (where the author is post_author OR is a meta co_author), and it have to work with WP Pagenavi. The query is something like this (omitting $wpdb and usual clauses for clarity):               SELECT posts.*     FROM posts, postmeta     WHERE         posts.ID = postmeta.post_id AND         (posts.post_author = $author OR             (postmeta.meta_key = 'co_author' AND              postmeta.meta_value = $author)         )      I've already tried with no success:   * using LIMIT and OFFSET with `query_var($paged)` and `'posts_per_page'` option, but Pagenavi total pages are the same as the query was the default author archive one;   * adding a where filter (`' OR posts.post_author = $author'`) to a custom WP_Query checking for meta_key/value only, but Pagenavi completely disregards the filter;   * other stuff I actually cannot remember because I've tried them last night between 3 and 5 AM but I'm sure they didn't work... The actual problem is that I can't find a way to check "meta_query OR post_author" using just the WP_Query argument array, like:               $the_query = new WP_Query(array(         'post_author'    => $author,         /* OR */         'meta_query'     => array(             array(                 'key'    => 'co_author',                 'value'  => $author             )         )     ));      Unfortunately, I'm not really confident with query filters so I'm really really trying to find a simple workaround to make that work with Pagenavi. But, after plenty of hours on this issue, my mind isn't fresh anymore and I don't know how to proceed. Thank you all in advance.


title: get_query_var('paged') always returns empty

text: Putting this up after having hit a brick wall for possible solutions. Have a site with quite a few custom post types and associated custom taxonomies. To help make things easy, I'm using a unified `taxonomy.php` template. Within that template there are three loops. I would like all of them to run on the first page, after that, just the third loop. I understand how to make that work with `is_paged()` but there's a bigger problem that I just cannot resolve. In my `$args` I included `$paged` from                   $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;           But `$paged` always returns as 1, now matter what page I am on. If I do a straight                   get_query_var('paged')      Then nothing is returned, no matter if I am on the first, second, third or etc page. I've read that you need to reset each loops for this to work, and that's a practice I've always followed. I won't include the whole page here, as this is a rather long and complex taxonomy. Instead I'll show the base set up of the two loops. **NOTE:** I can't use `pre_get_posts` for this page as it affects all loops. Each of these loops have separate `posts_per_page` requirements and other aspects that need to be kept separate. At the top of the template I have                   //this present duplication             $do_not_duplicate = array();                  global $wp_query;             $term = $wp_query->queried_object;      And I set up my loop after my args with `while ($new_query->have_posts()) : $new_query->the_post();` The third loop that I want paged has this code nearby                   $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                                                      $args=array(                         'posts_per_page' => $total_posts,                         'post__not_in' => array_merge($do_not_duplicate, $unwanted_post_ids ),                         'paged' => $paged,                         'tax_query' => array(                                 array(                                     'taxonomy'  => $term->taxonomy,                                     'field'     => 'slug',                                     'terms'     => $term->slug,                                     )                                 )                         );                          // Re-run the query with the new arguments                     query_posts( $args );      I have been using `wp_query` rather than `query_posts`, but for my latest attempts that's what I've had there. Would prefer to change it back. Any ideas?


title: Setting up WordPress plugin's page

text: I recently published a WordPress plugin but all the links of plugin page (Description, Installation, FAQs, Screenshots etc) has same two line description I used in readme.txt. Although, I properly filled up the readme.txt template. But it is not picking up anything else except description. ![plugin description showing in changelog too](http://i.stack.imgur.com/U04bk.png)


After updating a 3.4.2 network install to 3.5, I receive Fatal error: Call to undefined function nocache_headers() in /wp- admin/admin.php on line 32 This happens in Chrome, and in Firefox (when I am not logged into admin). I have downloaded a 3.5 zip, and uploaded and overwritten /wp-admin, but the issue remains. I have also renamed plugins to plugins2, but the issue remains.


title: WP-e-commerce (getshopped) Hebrew language files - where can I get them?

text: I’m working on a dual language website (english+hebrew) the website uses wpml+wpec. I’m looking for the hebrew language files (mo/po) – where can i get them?


title: Remove edit post link from static front page

text: Checking for front page with either is_home() or is_front_page() still removes the edit link from all pages/posts. What's wrong with this?               add_filter( 'edit_post_link', 'foo_edit_post_link' );          function foo_edit_post_link() {            if (is_home()) {        return FALSE;       }     }


title: Space Not Being Generated in HTML Output?

text:
I'm using a code called custom_link_pages to generate my multiple page post links, but I'm getting a space between my page numbers and previous link, but my next link is missing the same space. These need to be spaced equally so I would like to either add the necessary space or remove all spaces. For reference to what I'm talking about, view line 281 at: http://themeforward.com/demo2/?p=1813&page=2 I am assuming this could be from the custom code in my functions:                   // Custom Next/Previous Page     add_filter('wp_link_pages_args', 'wp_link_pages_args_prevnext_add');     /**      * Add prev and next links to a numbered link list      */     function wp_link_pages_args_prevnext_add($args)     {         global $page, $numpages, $more, $pagenow;              if (!$args['next_or_number'] == 'next_and_number')             return $args; # exit early              $args['next_or_number'] = 'number'; # keep numbering for the main part         if (!$more)             return $args; # exit early              if($page-1) # there is a previous page             $args['before'] .= _wp_link_page($page-1)             . $args['link_before']. $args['previouspagelink'] . $args['link_after'] . ''         ;              if ($page<$numpages) # there is a next page             $args['after'] = _wp_link_page($page+1)             . $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . ''             . $args['after']         ;              return $args;     }      How I grab that code:               <?php     custom_link_pages(array(         'before' => '
' . __(''),         'after' => '
',         'next_or_number' => 'next_and_number', # activate parameter overloading         'nextpagelink' => __('Next'),         'previouspagelink' => __('Previous'),         'pagelink' => '%',         'echo' => 1 )     );     ?>


title: Custom Fields Not in Search Results

text: I noticed that the content of my custom fields is not in my search results. Is there a good remedy for this? I could just hardcode my content into page templates but I would like the content to be searchable. Thanks.


title: Memorizing syntax

text: I hope the following question is acceptable here. I rely entirely on copy/paste for most WP functions, however I guess WP veterans don't. Is it important to know by heart the common WP syntax, and if it is, do people actually make an effort to memorize them just like we memorize a piece of poetry or a quote?


title: How to process shortcodes in XML-RPC

text: Firstly, I know that XML-RPC is designed to send out the raw post data, but I need it to expand shortcodes out. I don't use it for posting so it won't be an issue there, but there are services that are grabbing posts from it and they're getting the shortcodes [] instead of the expanded shortcodes. I'd switch to RSS but I can't. I've expiremented but can't get do_shortcode to work in class-wp-xmlrpc-server.php Thanks.


title: Sorting posts by custom field value in array

text: I have a custom field value that is an array and it has date as one of the values:               a:3:{s:4:"date";s:10:"03/06/2013";s:6:"target";d:1000;s:8:"currency";s:3:"USD";}      I'm trying to sort posts with this date but I'm having trouble doing it. Here is my query:                  $args = array (                 'showposts' => -1,                 'post_type' => 'project',                 'orderby' => 'meta_value',                 'order' => 'ASC',                 'meta_query'  => array(                            array(                             'key' => 'date',                             'value' => date('m/d/Y'),                             'compare' => '>=',                             'type' => 'DATETIME',                             )                         ),                 'cat' => $cat_id);             $posts = get_posts( $args );


title: Avoiding using a loop to access a single post

text: Sometimes I want to access one particular CPT to extract something from it, for example a custom field value:               $group = new WP_Query( array(          'post_type' => 'group',         'p' => $group_id     ) );     while ( $group->have_posts() ) : $group->the_post();         $group_type = get_post_meta($post->ID, "group_type", $single = true);            endwhile;      However the purpose of a loop is to access more than one element so I dislike using a loop for a single post. Is there a way to do exactly the same thing (accessing this custom field value) without using a loop?


title: Making a specific page wordpress compatable that is not index

text: When I first created my website I overwrote the wordpress php and essentially made the website static. Now I want to make one specific page wordpress compatable (e.g. when i make posts from the dashboard they'll appear on the page), and it is not the index. Which files will I have to redownload and what do I have to do to achieve this?


title: Automatic links to grid references

text: I have grid references on my website for coordinating the start of events. I was wondering if anyone knew a way to get these to link to Street Maps and Google Maps without having to individually link these each time. Many thanks in advance.


title: Moving a WordPress site to a new server

text: I need to copy a WordPress site to a new server. I need this to go as quickly as possible. The URL won't change, but the absolute paths will. Here are the steps I thought of:   * Put a maintenance message on the site   * Copy the database   * Copy all the files (the hidden ones as well, like .htaccess), with permissions   * Check if there are no old absolute paths, and if so, update them   * Check if everything's working   * Update the DNS records   * Remove the maintenance message Am I forgetting something?


title: Taxonomy Custom Column - 'manage_{TAXONOMY}_custom_column' filter only passing 2 arguments

text: I am trying to add a custom column to the tables shown on the Tags & Categories admin pages in Wordpress. I have created a function, and added it as a filter using               add_filter( 'manage_post_tag_custom_column' , 'my_custom_column' , 10 , 2 );      My function is               my_custom_column( $out , $name , $term_id ){       switch( $name ){         case 'my_column_slug' :           echo '<pre>';var_dump( func_get_args() );echo '</pre>';           break;       }     }      My column is shown in the table, with the `<pre>...</pre>` content, but it seems that no `$term_id` is being passed to my function.               array(2) {       [0]=>       string(0) ""       [1]=>       string(12) "my_column_slug"     }      I have referred to a number of resources to confirm that there should be three arguments passed to the function (including this StackExchange article). Am I missing something here?


title: How do the default themes reference style.css?

text: I was expecting to see `get_stylesheet_uri()` called somewhere in the default header.php file for the default themes (2012-14), but anything like it is missing, which has me wondering how the reference is added. The default theme headers have something like this:               <head>         <meta charset="<?php bloginfo( 'charset' ); ?>">         <meta name="viewport" content="width=device-width">         <title><?php wp_title( '|', true, 'right' ); ?></title>         <link rel="profile" href="http://gmpg.org/xfn/11">         <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">         <!--[if lt IE 9]>         <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>         <![endif]-->         <?php wp_head(); ?>     </head>      Looking at the source for the themes, shows a proper link to the stylesheet in the header, so, how does it get there?


title: Using a style sheet for modern browsers and another for older browsers

text: This isn't about using IE conditionals, here is my problem I have a fixed width site, I'm using 960 grid and I like this, and it works in most browsers including ie8 and ie7. Now I like that old browsers like ie7 ie8 and use the **960 file fixed width** and default style.css wordpress and modern browsers use the **fluid version of 960 grid**. **Summarizing** a) In old browsers load fixed width 960. b) In modern browsers use the fluid version of 960 responsive to the site. Modern browsers can be detected and used a style sheet for them and in older browsers another style sheet? Is there any function in wordpress that allows loading a stylesheet if the browser is modern, and load another stylesheet if the browser is old?