title: Moved blog - galleries don't work

text: I moved my client's blog with nearly 800 posts from an ancient installation of WordPress to another host and a new version of WordPress. Now, several months later, we noticed that she had a few posts with gallery tags, and those tags are no longer working. I need to fix that, but I can't find any way to determine what images were used in the respective galleries. the posts just have something like this:               [gallery link="file" columns="4" orderby="ID"]      I do have a full export of the database (and all files) from the old site and looked through it, but can't find any info. However, it is quite possible I just don't know where to look. The images do not show as attached to the specific posts in the media ui. For instance, one of her galleries was in a post where she picked a bunch of images from other posts. Can anyone tell me how to find out what images were used in the galleries?


title: add_filter to apply_filters that exists within class

text: I'm still new to Classes. I have a WordPress issue where I can only use add_filters within a class on a apply_filters command that exists within the same class. Here's an example class that successfully adds a filter:               $CTAExtensions = new CTALoadExtensions;          class CTALoadExtensions     {         public $definitions;         public $template_categories;              function __construct()         {                    $this->add_core_definitions();             $this->load_definitions();           }                   /* collects & loads extension array data */         function load_definitions()         {             $wp_cta_data = $this->template_definitions;             $this->definitions = apply_filters( 'wp_cta_extension_data' , $wp_cta_data);         }              /* filters to add in core definitions to the calls to action extension definitions array */         function add_core_definitions()         {             add_filter('wp_cta_extension_data' , array( $this , 'add_advanced_settings') , 1  );              }              function add_advanced_settings()         {             echo 1;exit; works!         }     }      If I try to add the filter outside of the class like this... I have no luck:               add_filter( "wp_cta_extension_data", "wp_cta_bt_meta_boxes" , 10 , 1 );     function wp_cta_bt_meta_boxes( $wp_cta_data )     {         echo 1; exit; //does not work outside of class.              return $wp_cta_data;     }      I've even tried extending the class and adding the filter to see if it will work but without success:               $wp_cta_bt = new CTABehavioralExtend;          class CTABehavioralExtend extends CTALoadExtensions      {         function __construct(){             add_filter( "wp_cta_extension_data", array( $this , "add_advanced_settings" ) , 10 , 1 );         }              function add_advanced_settings( $wp_cta_data )         {             echo here;exit; // does not work.                                 return $wp_cta_data;         }     }      Does anyone have any insight to what I am not understanding?


title: RSS/XML of all Categories and/or Tags

text: Is it possible to get an RSS / XML feed of all WordPress Categories and/or Tags? I've searched the Codex, which was very helpful in giving examples on how to access specific, individual RSS feeds, but have not been able to find any source on how to display all Categories of a site. Using examples from the Codex, specific Categories can be found with the following structure: > example.com/category/categoryname/feed I'm looking for something along the lines of: > example.com/ **category/*/feed** OR > example.com/ **categories/feed** Any thoughts? Solutions? Suggestions? * * * **EDIT:** I'm not looking for a feed of posts, rather a feed of all actual categories or tags. Ideally, this feed would contain only the categories themselves, no specific post data. Using the categories in the feed, however, I'd be able to then gather posts as needed by looking at each of the categories specific RSS feeds. An example of what I'm looking for would be a feed that returned the following list: >   * Category 1 >   * Category 2 >   * Category 3 >   * Category 4 > Iterating over that, when needed, could give me the posts for each.


title: user_has_cap filter allows edit but will not allow save

text: ## Problem I'm working on a website where we need to be able to put a username in the custom field of a custom post type, and allow the user specified to make changes to that post and only that post. I thought `user_has_cap` would be the filter hook to use but weirdly it doesn't seem to be allowing a user to update the post. The user can see the edit screen for the post and only that post which implies my filter is working correctly, but clicking update gives the error `You are not allowed to edit posts as this user.` which contradicts this. The post type has `capability_type => post` so I feel that shouldn't be the issue. ## Code               function event_cap_filter($all, $cap, $args) {         // if not requesting edit post then return caps         if('edit_post' != $args[0]) return $all;         // if user can already edit others posts then return caps         if($all['edit_others_posts']) return $all;              // if user is the post author then return caps         $post = get_post($args[2]);         if($args[1] == $post->post_author) return $all;              // query to find user in custom field         // and therefore if they are allowed to edit this post              if($can_edit) {             foreach($cap as $c) {                 $all[$c] = true;             }         }              return $all;     }     add_filter('user_has_cap', 'event_cap_filter', 10, 3);      ## Question If my user can edit the post where he is specified in the custom field I check for, why can he not save his changes? Am I overlooking something?


title: Edit default comments page in WP Admin

text: I need to make major changes on the way the comments are rendered in backend, from the following file: wp-admin/includes/class-wp-comments-list-table.php I know editing the WP Core files directly is a bad idea... Is there a way to create an edited version of this file with custom plugin and let wordpress use the file inside the plugin and not the default class-wp- comments-list-table.php ? Thank you.


title: How does WP custom post types fare compared to Drupal's?

text: In Drupal you have the GUI to create whatever type you want. How about in WP, do I still have to code to create one?


title: How to redirect to a passworded page based on password entered on login screen

text: So I'm looking for something like peter's login redirect, but slightly different. I want to build a client portal for a photography website, and I figured the best way would be to add a custom post type for clients and use advanced custom fields to add all of the extra functionality needed for the CPT. When a new client is added, a new URL will be created for the client's access page. Seems simple. Then, we can just password protect each page and send the password to the client. This is all great, however I also want to accompany this with a "login" button in the site's main navigation. When someone clicks this button, I want them to be presented with a password form where they can enter the password we sent them in the email. Based on the password they enter, they'll be redirected to the appropriate CPT page. Anyone have any ideas on how I can go about this? I assumed I could somehow run a query to pull posts based on password, but I'm not sure if the encryption used in the DB would allow for that. Any insight would be greatly appreciated.


title: Plugin options not appearing on options page using tabbed navigation

text: I've modified the plugin options page for my plugin to use tabs, using the existing WordPress system for this. However, The actual options are not appearing on the screen - just the tabs and the "Save Changes" button. Here is the code for the options page. What am I missing?


title: How to Display Details page of future (scheduled) posts

text: My question here is to display all the single detail page of future scheduled posts. It is returning 404 page. How can this be done in wordpress? What I have used so far is               $args =  array(                 'posts_per_page'   => 10,                  'category__in'     => $category->term_id,                 'orderby'          => 'post_date',                 'meta_key'         => 'starttime',                 'order'            => 'ASC',                  'post_type'        => 'post',                  'post_status'      => array('publish','future'),                  );             $loop1 = new WP_Query( $args );      From this code I get published, and scheduled posts. The permalink of the published post is working fine. But it is not working for scheduled posts, and redirecting to 404 page error.


title: Create a dropdown with Custom Post Types as option in admin

text: I need to create a dropdown menu with " **posts** from a custom post type" as option. This dropdown will be placed as custom meta box. For example, I want all posts with the custom type "Video" as option in the select.               <select>        <option>post title n°1<option>        <option>post title n°2<option>        ....     </select>      Thanks


title: Pretty Permalink for Search Queries Not Working

text: As the title suggests I am trying to create pretty permalinks for search queries, but unfortunately I cant get them to work. I am trying to achieve the folllowing:               website.com/search/something+searched      will go to the following               website.com/?s=something+searched      I have tried the following rewrite rule within the 'init' action.               add_rewrite_rule('^search/([^/]*)/$','?search=true&s=$matches[1]','top');      This doesn't work, although 'website.com/search/something' will go to the search page but not pass the var. As does the below code:                     function search_rewrite( $wp_rewrite ) {         $feed_rules = array(             'search/(.+)'    =>  'index.php?s='. $wp_rewrite->preg_index(1)         );         $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;     }     // refresh/flush permalinks in the dashboard if this is changed in any way     add_filter( 'generate_rewrite_rules', 'search_rewrite' );      I believe I'm missing something on my search.php file but I'm not sure what. Is there a reason for search queries / rewrites to behave differently to other rewrites? Thanks in advance for any assistance. Cheers Noel


title: What is the most efficient way to create multiple versions of the same template?

text: I am currently building a WordPress theme that will give users the option to select different layouts for the same template. This will mainly pertain to the home and blog page. I'm thinking like one of the larger commercial themes that have multiple home page layouts. I know from experience that these themes can be quite bloated and load very slowly. What would be the best way to create multiple versions of the same template? Should I use `template_include` (link)?


title: A pagination-sort-of-thing on single.php view for the custom post type

text: First, a quick demonstration of what I need to achieve: ![enter image description here](http://i.stack.imgur.com/NbhNQ.png) It would work similarly to `<?php previous_post(); ?>` and `<?php next_post(); ?>`, but also include an actual "reel" indexing all entries in a specific taxonomy. Yes, I see the major flaw in this - in case of 100 entries the list would be !@#$long, however, the number of entries will be strictly monitored by a client. This solution is so far from optimal, that I can't even see it, but it needs to be done, one way or another. Additionally, I've created a custom post type for this, displaying single images (being Featured Images) and their titles and it's divided into four taxonomies. All four taxonomies need to be displayed on four separate "gallery" pages, so I can't use a single template for that, unless I make a big `if` loop checking the taxonomy of the first entry displayed. **EDIT:** I think I may have figured that out, sort of. By setting the custom post type to hierarchical, I can `wp_list_pages()` whole taxonomy and fiddle with that.


title: Image load issue with custom page template on Internet Explorer

text: I have created a website http://demo.tennis-florida.com/ and it is using custom theme that I built when I am opening this on Internet explorer.   * Images in custom post grid are not showing up (perfectly showing up in source code) but they are working fine with other browsers.   * On internet explorer 8 and below the main slider is displaying in half.


title: Check the Version of an Enqueue'd External Library

text: I want to use an external font library in my plugin, but I want to do a version check first to determine if I should bother enqueue'ing my version or not. I know I can see if a library is already loaded -- `wp_script_is()` -- but I don't know how to check the library's version. Any ideas?                   if ( wp_script_is() || wp_script_is( 'registered' ) ) {             \\ version check here         }


title: Should I save this mulit dementional arary as one post meta?

text: I have several blocks of data to save into post meta, including 'file_property', 'workspace_property', 'user_property','access_type', 'usage_tracking'. Each block in itself is an array. Should I save them all as one post-meta, or save each single data sepeartely? I feel the post-meta table might be a bit too long if one post has 20 to 30 meta-key, but if all in one, I'm not sure if it's convinient when query or update, so to ask.


title: How to wrap this Link with an Image?

text: im working on default wordpress theme twenty eleven, i just wanted to know how can i wrap this previous and next anchor with an image or next/previous button?               <?php previous_image_link( false, __( '← Previous' , 'twentyeleven' ) ); ?>     <?php next_image_link( false, __( 'Next →' , 'twentyeleven' ) ); ?>


title: Disable editing profile for second time

text: Hi and thanks every one . i wonder if there was any way to disable editing profile for users of my site for a second time . because after i approve a user he/she changes his avatar to inappropriate photo ! any suggestion really appreciated .


title: Add Field To All Pages

text: I'm trying to add a custom field to the built in Page content type. I've found lots of tutorials on how to do this for a single page, but I want to do this for all pages in my theme. Please point me in the right direction.


title: Rewrite rules causing hole

text: I am using rewrite rules to catch /events/date/* Events is the custom post type I am working with. So archive-events.php, is normally my index, but with my rewrite rules, I need to identify a specific pagename. Do I have to duplicate that specific file, or is there a way I can point to archives-events.php? see below...               function add_events_rewrite_rules($aRules) {         $aNewRules = array('events/date/([^/]+)/?$' => 'index.php?pagename=events&_events_date=$matches[1]');         $aRules = $aNewRules + $aRules;         return $aRules;     }     add_filter('rewrite_rules_array', 'add_events_rewrite_rules');


title: Custom Post Type template for homepage

text: I'm writing a squeeze page plugin and I've hit a bump. The plugin needs to be able to display custom post types with a custom template and also be able to be used for the homepage. So I've got the code to set a template for the custom post type:               add_filter('single_template', 'my_custom_template');          function my_custom_template($single) {     global $wp_query, $post;          if ($post->post_type == "squeeze_page"){         if(file_exists(ABSPATH . '/wp-content/plugins/wpsqueezr/squeeze_page.php'))             return ABSPATH . '/wp-content/plugins/wpsqueezr/squeeze_page.php';     }     return $single;     }      That works fine for displaying the custom post type. Adding it to the Reading settings works:               add_filter( 'get_pages',  'add_my_cpt' );          function add_my_cpt( $pages )     {          $my_cpt_pages = new WP_Query( array( 'post_type' => 'squeeze_page' ) );          if ( $my_cpt_pages->post_count > 0 )          {              $pages = array_merge( $pages, $my_cpt_pages->posts );          }          return $pages;     }      Now here's where it gets messy. That all works fine, but if you set the custom post type to the homepage, it redirects to the custom post type page, no good. I found this code which adds the custom post type to the frontpage, but it doesn't show the custom template I've setup for single pages:               function enable_front_page_stacks( $query ){         if(( ! isset($query->query_vars['post_type']) || '' == $query->query_vars['post_type']) && 0 != $query->query_vars['page_id'])             $query->query_vars['post_type'] = array( 'page', 'squeeze_page' );     }     add_action( 'pre_get_posts', 'enable_front_page_stacks' );      I need to show the custom template for the custom post type on the homepage, not the custom post type in the homepage template. I tried the home_template filter but that didn't do anything. Any ideas? Edit: Worked it out, just add a page_template filter as well as a single_template filter. I hope this helps someone else! Cheers!


title: Media player with branding

text: Please suggest any good media player plugin,Which allows embedding from major video sharing sites, & also allows customization so i can add branding / my own LOGO.


title: Display the link of a custom taxonomy

text:
I'm trying to manually display the link of a custom taxonomy term that I have created. The taxonomy is 'event-themes' and the term is 'Boat'. Here's my code:               <?php $themeOne = array(                 'tax_query' => array(                     array(                         'taxonomy' => 'event-themes',                         'field' => 'slug',                         'terms' => 'boat-theme'                     )                 )             );             ?>
<img src="<?php bloginfo('template_directory'); ?>/images/eventSearch/theme-onFoot.png" /><?php echo $themeOne; ?>
      I'm not very familiar with PHP so I guess I'm probably missing something very obvious here, but my main aim is to simply 'handpick' the taxonomy term I want, and display a link to the page displaying all posts/pages under it. Thanks


title: Custom user profile, registration, login page with theme

text: WordPress user profile page uses the administration interface, and its user registration / login page is not part of the theme. I would like to   1. change it into the custom theme of my site   2. customize login / registration page, hopefully with a custom form, and captcha   3. remove the top bar when the user is logged on   4. retain this top bar functionality, and administration interface access for administrators and contributors (because I'm using 'Debug Bar' plugin, which is a part of the top bar)   5. for the rest of regular users, just hide the dashboard (technically make it inaccessible even if URL is entered), and use the profile page with site theme. How do I achieve this? I'd like to use filters/hooks and maybe create a custom plugin. I prefer not to change the code of WordPress itself. Thank you.


title: Managing updates when Wordpress is in your own svn repo

text: I download and configure Wordpress for a development environment and a production environment. After it's set up on one server we check it into a subversion repo and then go and check it out on the production server. Deployment complete. The trouble is when I have to update. I'm supposed to delete wp-includes and wp-admin but if I do that svn goes crazy. What are some strategies for dealing with Wordpress, subversion, and multiple deployment environments?


title: Query var removed after rewrite

text: I have a WordPress blog that uses custom post types, which I'm creating using the WCK plugin. One of which is the post type **shows**. A permalink to a specific show, then, appears as:               http://my-website.com/wordpress/shows/show-slug/      This is all done through the current functionality of WP and the WCK plugin. However, I am trying to add another "level" of detailed information to be displayed on that single show page. For this, I am using the URL query variable **item** to designate this. So, for example, if I want to view the list of episodes for a certain show, I could visit the URL:               http://my-website.com/wordpress/shows/show-slug/?item=episodes      These "items" vary per-show and are more or less arbitrary, but I already have the logic on the single-shows.php template to determine whether or not the item provided in the URL query is a valid one for that show. Anyway, I want to use the rewrite functionality to make the URLs a little bit nicer, with the format:               http://my-website.com/wordpress/shows/show-slug/episodes      This is where I'm running into problems. Here is my PHP script in my theme's functions.php file to register that URL query var and the rewrite rule:               function shows_item_tag_registration() {         global $wp;          $wp->add_query_var('item');      }          function shows_item_rule_registration($rules) {         $newrules = array();         $newrules['^shows/([^/]+)/([^/]+)/?$'] = 'index.php?pagename=shows/$matches[1]&item=$matches[2]';         return $newrules + $rules;     }          add_filter( 'rewrite_rules_array','shows_item_rule_registration' );     add_action( 'init','shows_item_tag_registration' );      I am not flushing the rewrite rules myself, as I do not want to lose the rules being written by the Permalinks settings in the WP Admin. Instead, as you can see, I am adding my rule to the "current list" in the **rewrite_rules_array** filter. To apply changes, I re-save the Permalinks settings in the WP admin, and that seems to be doing the trick as far as that goes. Frustratingly, it almost works, but when I try to visit the URL with the item at the end, like so:               http://my-website.com/wordpress/shows/show-slug/episodes      It simply redirects me to:               http://my-website.com/wordpress/shows/show-slug/      And removes the item from the query altogether. I found this Stack Exchange question that seemed pretty similar, but I was not able to resolve my issue with the answer from there.


title: Set or change default text in hyperlink popup in post editor

text: When writing a post or page in the post editor (not the Visual editor but the HTML editor) and clicking on the "link" button, a popup appears with `http://` already prefilled. Is there a way to change this default text? For example, since I usually link internally to my own site I would want to use my base URL because then I could either quickly type the rest of the URL, or just overwrite it if I was hyperlinking somewhere else. `http://www.myurl.com/` I swear I saw a blog article on how to do this but I cannot locate it through searching the web. Thanks in advance for any help.


title: Strange font-style / font-weight on CPT list columns screen

text: As you can see below, for some reason the "Author" column displays extremely strange (like non-anti aliased) in Chrome. I added the snippet from the dev tools bar to show that I can't see any difference. Do you know why this happens? ![enter image description here](http://i.stack.imgur.com/RHkbL.jpg)


title: OG:Audio facebook meta tags

text: Does anyone have any Idea how to populate the attached audio file URL into meta elements? Just as you would featured image or something Here's what I tried:               <meta property="og:audio" content="<?php $meta_values = get_post_custom($post->ID);     if(isset($meta_values['meta_audio_attachment'][0])){ $url =$meta_values['meta_audio_attachment'][0]; } ?>" />     <meta property="og:audio:title" content="Test" />     <meta property="og:audio:artist" content="Test" />     <meta property="og:audio:album" content="Test Album" />     <meta property="og:audio:type" content="application/mp3" />      Facebook populates all the rest of the meta's except the audio url?


title: How to best create a jQuery Slider to display a native wordpress gallery?

text: It seems there must be a plugin for this, but I can't find it. I'd like to enable a jQuery slider in a post, using the images I've added to the gallery for that post. Does anyone know of a plugin? And if not, what would be the smartest way to implement this? Again it's important that it calls from that posts gallery - using the native WordPress gallery. Thanks in advance!


title: Not getting an ajax readystatechange on my page

text: I've been trying to get a stand alone web page I use rebuilt as something that can be accessed as a page in my blog. Following advice I've created a new template for this page and do all my work there. The page remembers $_SESSION correctly and the php works well. On this page there are drop down boxes that update other drop downs. If I update them manually all is well with the world. When I attempt to introduce my ajax calls things go wonky. At the moment update.php just echos back "hello".               <script>     function changeFn( ) {       var newOpt = document.createElement('option');       var oldSel = document.getElementById('slight');       while ( oldSel.length > 0 )         oldSel.remove(oldSel.options.length-1);              var ajaxRequest;     alert("start req"); // I observe this alert         try {         // Opera 8.0+, Firefox, Safari         ajaxRequest = new XMLHttpRequest();         } catch (e) {         try {         // Internet Explorer Browsers         ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");         } catch (e) {         try {         ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");         } catch (e) {         // Something went wrong         alert("Your browser isn't supporting XML HTTP requests.");         return false;         }         }         }              // Create a function that will receive data sent from the server         ajaxRequest.onreadystatechange = function () {        alert("state change: "+ajaxRequest.readyState);  // I never observe this         if (ajaxRequest.readyState == 4) {           if (ajaxRequest.status == 200) {     alert(ajaxRequest.responseText);             //extract( ajaxRequest.responseText, "one" );           } else {             alert("There was an error retriving the data");           }         }       }          alert("trying"); // I observe this alert       var url = "http://myurl/update.php";       var params = "CID="+classID+"&GID="+genreID;       ajaxRequest.open("POST", url, true);       ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");       ajaxRequest.setRequestHeader("Content-length", params.length);       ajaxRequest.setRequestHeader("Connection", "close");       ajaxRequest.send(params);               alert(" hi"); // I never see this alert     newOpt.text="got this far";       newOpt.value= -1;            document.getElementById("slight").add(newOpt, null);       return true;     }     </script>      Some alerts fire, but the ones associated with the callback function do not. PS I am not trying to access anything that is specific to the wordpress site itself, I'm accessing an entirely different database.


title: Set Default Listing "View" in Admin

text: I'm looking for a way to set the default "View" options under post types in the admin area. For example, by default Posts will default to a "list" view instead of "excerpt" - I'd like to change this to excerpt by default - what would be the best way to achieve this? I've done a bit of searching on this, but am stuck in the mud thus-far. Any help would be greatly appreciated. Thanks!


title: Allow User Can See His Post on his dashboard

text: I want to allow user that Post option display on his dashboard. Where User's Can Show only his post. How I manage this. Please Help me.


title: What's the best way to create a new design for other pages?

text:
I want to create a different design for all new and existing pages, with the exception of the frontpage. The new design includes another subheader, container, and an extra subfooter. My guess was to edit footer.php/header.php in my child theme directly, and create seperate subheader/footer/container for these pages, and apply them as follows:               <?php if ( is_home() || is_front_page()){

                                      }     else {

     } ?>      Is this a correct way of applying a new design, or could this be done simpler?


title: New post notification plugin

text: I need a plugin that makes a menu item to start flashing on the frontend if there is a new post / or lets say the will be green button that will turn to red. and stops flashing the menu item/button if we turn it off manually. Thanks a lot


title: get_user_meta() to Return User Meta Only for Current Blog in Multi Site

text: I've written a plugin that allows users to bookmark their favorite posts, but have run into a small problem when using it on a multisite network. Each time a post is bookmarked, the ID of that post is stored in an array of IDs in the current user's meta table. This all works great, until it's used on a MS setup. If viewing the site that the bookmarks were created on, everything works great, but when viewing a different site, I get a list of post IDs that belong to the other site. This is because the user meta table is shared between sites. So, what I need to do is retrieve only the user meta for the current site. Is there a way to do this? I don't think there is, so if anyone has some insight, that'd be great.


title: Runng Cron Job for Plugin With No CronTab Access

text: I have a site running WordPress and the Twitter Wordpress plugin (http://community.plus.net/opensource/twitter-wordpress/) My host does not provide access to crontab, so I am looking for a way (plugin?) to run the Twitter Wordpress update automatically on a scheduled basis. According to the plugin website, this is possible: > If users wish to have regular/automatic updates of their Twitter account > tweets, then that is achievable through creating a crontab entry, or similar > automation mechanism, to execute the supplied “runTwitterScript.php” file. The question is: how can I do this without cron access?


title: Display only a single CPT

text:
I have used the CptUI plugin to create a 'Products' CPT. The admin side of things seems to work fine but I can't quite get the front end to display how I'd like. For example I create a product, say "Guitars" and another called "Drums". Their permalinks in admin are dispay as `http://mysite.com/products/guitars` and `http://mysite.com/products/drums` respectively which looks great. However, when I navigate to one of the URLS, I see a page that lists all the current products. This makes sense considering my `single-products.php` contains the following:               <?php      /*Template Name: Products Template      */          get_header(); ?>

         <?php         $mypost = array( 'post_type' => 'products', );         $loop = new WP_Query( $mypost );         ?>         <?php while ( $loop->have_posts() ) : $loop->the_post();?>             <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                         <?php the_post_thumbnail( array( 100, 100 ) ); ?>
                          Name: <?php the_title(); ?>

<?php the_content(); ?>

              <?php endwhile; ?>

     <?php wp_reset_query(); ?>     <?php get_footer(); ?>      What I'd ideally like is for `http://mysite.com/products/guitars` to display only the single CPT with the guitars content, (the same for the drums) and then `http://mysite.com/products` to display all the products (As it currently does for `http://mysite.com/products/guitars`). Is this possible and if so, how?


title: register user only with specific Host name

text: Hii i want to that whenever any user register at my wordpress that just accepet email of specific host for example if I want to accept only User register with username@gmail.com this email format otherwise that show some error that you can only register with @gmail.com so how to apply this condition and in which file thanks


title: Query posts from different categories in multisite

text: In my planed multisite installation, I want the members to be able to post in one of two different categories.   Members in A can post in 1. Members from B can post in 2. All members can comment everything. Then, I plan to create a custom page template to the blogs index, and I hope to query all posts from members in 1 and 2, and display title and a minor excerpt (along with avatar image) in separate columns (widgets). Is this possible? (I am not planning to use Buddypress).


title: How to disable the editing of the time and date published?

text: I would like to ask how to disable the editing of time and date published? Also, I would like to ask if it's possible for people who doesn't own the blog to post, not just comment, but post their own posts in the blog. Please and thank you.


title: Show last post from multiple categories using wp_list_categories

text: I have the following code that lists out the children categories on a separate page when you click on its parent category. The code renders a list like so: Home › Archive for IQ Issue 7   * Journal   * news   * world view However I would like to retrieve the latest post from each of these categories and print underneath the category name. How could I achieve this within the loop below? I have tried several foreach loops but none seem to print the correct info. Thanks in advance. category.php               <?php $this_category = get_queried_object();          // if parent is 0, category is top level     if( 0 == $this_category->parent ) :              // top level category,         // show child categories of this issue         $args = array(             'child_of' => $this_category->term_id,             'title_li' => '',             'hide_empty' => 0         ); ?>              <!-- output a list of child cats for this issue         see also get_categories or get_terms if you wish to use your own markup-->                   <?php wp_list_categories($args); ?>                              <?php else :              // child category,         // show articles in this subcategory, etc.         echo 'child category';          endif; ?>


title: which page Shop template use?

text: I am finding the template to edit but don't know where to look in woocommerce directory? I want to edit the page that displays all category when someone click on shop, more specifically i am looking to remove the item count show in brackets.


title: Pagination working everywhere but the index page

text: No idea why but pagination on my homepage isn't working although it works in every other place..custom templates, archive, searches. I've tried every version of pagination possible it seems. I've used wp_query, query_posts, get_posts. I've tried the method of setting temp wp_query and wp_query to null and then adding it again after the pagination. I've tried just setting paged to $paged. The odd thing to me is the same loops works on an older theme I have but not on mine. It works on a page I've created using the exact same loop. So I'm looking for some hints on what might be causing this. Here is my loop.                global $wp_query;      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;      $args = array(         'meta_key' => 'rating',         'meta_value' => 0,         'meta_compare' => '>',         'orderby' => 'meta_value_num',         'order' => 'DESC',         'cat' => -1,         'posts_per_page' => 16,          'paged' => $paged,         'post_type' => array( 'post','videos','articles'  )      );     $wp_query = new WP_Query($args);     while ( $wp_query->have_posts() ) : $wp_query->the_post();       get_template_part( 'loop', 'contents' );     endwhile;     ?>     <div class="infinitescroll">       <?php next_posts_link('next posts'); ?>     </div>      I've tried setting `global $paged`. I've tried setting the `get_query_var` to page instead of paged. No dice.


title: If two users attempt to modify a page, does Wordpress still work correctly?

text: I am worried about allowing more than one user of my Wordpress installation use Wordpress at the same time. What if one user updates a page or deletes a page while the other user is editing it? How robust is Wordpress under this multi-user case? I am talking about users who are logged into Wordpress as editors.


title: WPDB is not working when trying to run a custom query

text: I'm developing a WordPress plugin, and have no other plugins installed. The logging function is as simple as               function log($message){         global $wpdb;         $message = $wpdb->escape($message);         $wpdb->query("INSERT INTO {$this->db['log']} (message) VALUES ('{$message}');");      }      Since the `$wpdb->query` didn't do anything but`@mysql_query( $query, $this->dbh );` did, I'm not sure if this question is about wordpress. source code http://xref.yoast.com/trunk/nav.html?wp-includes/wp- db.php.source.html#l1053 Plugin workflow: 1) Gather a list of events. 2) Loop the list. 3) Process each event. The function log will be invoked here when someting important should be logged such as "file is saved in /path/". 4) Stop The whole work flow will take about 2 minutes to finish. The log function is invoked 75 times while running. However, no log entry is found in the database while running. When the plugin completes execution, those log entries are inserted and can be seen from database table. What can I do that will insert log entry to database on the fly? Thanks in advance.


title: How to create Sub Sub domain Multi User blogs?

text: Hi to all I would like to create a big Wordpress network with this structure:   * sitename.com (Main website)     * cat1.sitename.com (sub website)       * cat11.cat1.sitename.com (sub-sub website)       * cat12.cat2.sitename.com (sub-sub website)     * cat2.sitename.com (sub website)       * cat21.cat1.sitename.com (sub-sub website)       * cat22.cat2.sitename.com (sub-sub website)     * cat3.sitename.com (sub website)       * cat31.cat1.sitename.com (sub-sub website)       * cat32.cat2.sitename.com (sub-sub website) Is it possible using only one wordpress installation with subdomains? If it is not is it possible to share userdatabase (and why not also posts and all the stuff) between all the websites? Is there anyone that already did it and can help me to achieve this? Thank you very much!


title: Use plugin multiple times

text: I have a site for a booking agency for entertainers. Each entertainer has their own page. The sidebar currently contains the advanced twitter profile widget for the agency's twitter account. Each of the entertainers' pages needs the same widget in their sidebar with their own account id. Question is: Is it possible to use the same plugin with different id's? Or: Must I create multiple sidebars (20 +) and hard code the plugin using the different account id's? The hard code I have used that is suppose to mimic this plug falls short on functionality and cannot be styled to look identical to the widget. Any help is appreciated.


title: Math notation on WordPress.com?

text: I am a new user with WordPress, and I would like to use mathematical formulas. I have been reading the mathjax pages for hours, such as this one and quite a few others. This may be a bad question, but can someone please help me? All I want to do is enable Latex, and I am hopelessly lost. My most recent attempts have been trying to find the "header file" so that I can copy and paste in               <script type="text/javascript"         src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">     </script>      I have tried looking for it, and looked over a whole bunch of forum posts about where to find this header file, but I just do not understand. A step by step explanation of how to make mathjax work in the simplest way possible would be extremely appreciated!! (Also, don't worry about leaving in too many steps!)


title: Chance post id into post name

text: I´d like to echo the post name instead post id. My code shows just the id.               <?php      global $post;     $customlink = get_post_meta( $post->ID, 'clink', true );      echo $customlink;     ?>      Thanks   Ogni


title: A reliable AdSense plugin. Does it exist?

text: I've tried a bunch of AdSense plugins but I can't seem to make any work. Can someone recommend something that is known to work? My requirements are simple: display an ad under the header.


title: wp_list_tables bulk actions

text: How to fire on bulk actions inside of an extended WP_List_Table. I have been adding the following bulk actions to may table's select box but on Apply won't really happens anything here are how I added my bulk actions               function get_bulk_actions() {       $actions = array(                  'delete'    => 'Delete',                  'parsing'    => 'Parsen'       );            return $actions;     }      and here is the check box column               function column_cb($item) {              return sprintf(                      '<input type="checkbox" name="record[]" value="%d" />', $item['Round']             );              }


title: Query posts by content lenght

text: I am using the code below to pull a random post of my site every 6 hour.               if ( false === ( $social_trans_post_id = get_transient( '$social_trans_post_id' ) ) ) {                     $args = array('numberposts' => 1, 'orderby' => 'rand');                     $social_trans = get_posts($args);                     set_transient('$social_trans_post_id', $social_trans[0]->ID, (60*60*6));                 } else {                     $args = array('post__in' => array($social_trans_post_id));                     $social_trans = get_posts($args);                 }      To integrate with Twitter, I'd like to only pull posts with 140 characters or less. I know about `<?php echo substr(($post->post_content), 0,140); ?>` which I am using already as a temporary solution. I tried to setup a condition and this is where I got stuck:               if ( false === ( $social_trans_post_id = get_transient( '$social_trans_post_id' ) ) ) {                     $args = array('numberposts' => 1, 'orderby' => 'rand');                     $social_trans = get_posts($args);                             if (strlen( $social_trans->post_content > 140 ) ) {                                // Pull another post?                              }                     set_transient('$social_trans_post_id', $social_trans[0]->ID, (60*60*6));                 } else {                     $args = array('post__in' => array($social_trans_post_id));                     $social_trans = get_posts($args);                 }


title: Do i need the git directory?

text: I have installed a wordpress site and for some reason I can see these 2 directories: .git .qidb Do I need them? Can I remove them? Will it hurt me in any way?


title: Automatically load Wordpress page on server every XX hours

text: I have a page in my Wordpress site that calculates post popularity and updates several meta fields on the posts and calls a few functions as well. This page is set to "Private" so that only myself and other admins can see it. Is there a way to load this page automatically every 6, 12, or 24 hours? I'd be satisfied with a plugin, but generally prefer to write my own PHP code.


title: Building a WP Shortcode: Loading Markers on a Google Map

text: I'm learning about plugins. I've built a basic Google Map plugin. But, I'm having problems putting markers on the map. I've pulled the lat long coordinates from a mySQL db. I'm following the Using PHP/MySQL with Google Maps tutorial. My problem is that the tutorial assumes that you can call the php file in a browser to check if its producing valid XML. I'm at the part with the heading "Using PHP's DOM functions to output XML". I'm not sure how to test whether the XML is created and being outputted correctly. In the part about loading the XML, they use GDownloadUrl("phpsqlajax_genxml.php", function(data). But, my PHP that builds the XML is part of the main plugin file, it's not in a separate php file. This is what I've got:               $dom = new DOMDocument('1.0');     $node = $dom->createElement('markers');     $parnode = $dom->appendChild($node);              $csf_data = $wpdb->get_results($wpdb->prepare("SELECT  * "));                               foreach($csf_data as $incident) {                 $node = $dom->createElement('marker');                 $newnode =  $parnode->appendChild($node);                 $newnode->setAttribute("lat", $incident->latitude);                 $newnode->setAttribute("lng", $incident->longitude);             }                  die();                  echo $dom->saveXML;        * a) How do I build the XML file in WordPress?    * b) How do I load the XML file in WordPress? Any suggestions? Thank you. * * * UPDATE: Google revised their tutorial. Please see this link. Thank you. * * * UPDATE 2: Making some progress. I figured out how to load a static XML file and place the markers on the map. Now, all I need to figure out is how to build an XML file from data pulled from the db in PHP in a WordPress plugin.


title: Filter all html output

text: I would like to make sure no email address is published in plain. So i developed a plugin that replace all email addresses by a spambot-safe alternative. But some users put their email address in their blog header, outside the post loop. How can i capture and filter that? This works:                       add_filter('the_content', array(&$this,"pep_replace"));             add_filter('the_excerpt', array(&$this,"pep_replace_excerpt"));             add_filter('the_comments', array(&$this,"pep_replace"));      This does not (it does not capture the email address i've added in my test theme header.php file).               add_filter('template',  array(&$this,"pep_replace"));     add_filter('wp_head',  array(&$this,"pep_replace"));     add_filter('shutdown',  array(&$this,"pep_replace"));      I'm digging into the hook documentation, but i'm out of ideas on what could be the right filter hook. Thank you for your time.


title: IF statement not falling over to ELSE with Options Framework

text: I am using the Options Framework to give the theme user the ability to upload their own background image. I have an image upload option with option ID = page_background. In header.php, I have:               <?php if (of_get_option('page_background', 'no entry')) { ?>     <style>     body {      background: url(<?php echo of_get_option('page_background', 'no entry');?>) no-repeat center center fixed;         -webkit-background-size: cover;         -moz-background-size: cover;         -o-background-size: cover;         background-size: cover;     }     </style>     <?php } else { ?>     <style>     body {      background: url(<?php echo get_template_directory_uri(); ?>/images/bodybg.jpg) no-repeat center center fixed;         -webkit-background-size: cover;         -moz-background-size: cover;         -o-background-size: cover;         background-size: cover;     }     </style>     <?php } ?>      At present, there is no background image uploaded, so the IF statement should return false, and proceed to the ELSE section, where a predefined background image is applied. However, the front end returns code: `background: url(no entry)` I use this exact same code on another theme and it works. Any ideas what is wrong with this theme?


title: Get a single post ID based on an exact match of 1 or more meta values

text: I'd like to find the post ID based on an exact match of meta values (could be more than 1). All the examples I have found show find the post ID from 1 meta value. In my example I'd like to pass in an array of values and find an exact match. Below is what I have so far, which can find the correct post ID but isn't an exact match. It returns the post ID if **any** of the values match in the array below. I need it to match **all** of the values.               // these values are dynamic, so multiple meta_query arrays are not an option     $array_of_values_to_match = array( '1', '2', '3' );          $args = array(         'post_type' => 'post',         'meta_query' => array(             array(                 'key' => '_some_meta_key', // they all have the same meta_key                 'value' => $array_of_values_to_match,                 'compare' => 'IN' // can't use = when passing in an array             ),         ),     );          $posts = get_posts( $args );      As per the codex, `Array support is limited to a compare value of 'IN', 'NOT IN', 'BETWEEN', or 'NOT BETWEEN'` So if my wp_postmeta table looked like the following, it should match list the post with the id of `122`               post_id   meta_key          meta_value     122       _some_meta_key    1     122       _some_meta_key    2     122       _some_meta_key    3      But **not** if it looked like this (there's no 3)               post_id   meta_key          meta_value     122       _some_meta_key    1     122       _some_meta_key    2     122       _some_meta_key    8


title: Echo the key from a select-box in Array with get_option (Settings API)

text: I'm trying to print a key from one select box. I'm using the WordPress Settings API. This is the array:               $options = array (     array(  "name" => "Styles & Fonts",             "type" => "title"),                 array(  "type" => "open"),                 array(  "name" => "Color scheme",                         "desc" => "Select the color scheme for the theme.",                         "type" => "select",                         "id" => "st_styles",                         "options" => array("style", "dark", "grey", "green", "red"),                         "std" => "style"),                 array(  "name" => "Loop style",                         "desc" => "Select the style loop for the theme.",                         "type" => "select",                         "id" => "st_loops",                         "options" => array('default' => 'Normal (default)', 'small' => 'No thumbnails', 'large' => 'Big thumbnails'),                         "std" => "style"),                 array(  "type" => "close"),     );      You can see 2 examples on this code, the first has the options in an array, and the second has the options in an **associative array**. I can get the value with this code:               echo get_option('st_styles', 'style')      If the selected option is 'dark', it prints 'dark'. By default it's 'style'. This works fine!! But in the second example I used an associative array because I want to show 'Normal (default)' in the select box; then I want to use 'default' (without spaces) as a CSS class. I tried:               echo get_option('st_loops', 'default')[key];     //It returns me the letter 'N'; the first of 'Normal (default)', I think.          print array_keys(get_option('st_loops', 'default'));     //Nothing.          echo get_option(array_keys('st_loops', 'default'));     //Nothing.      And finally I tried with this:               global $options;foreach ($options as $value) {         if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_option( $value['id'] ); }         }              echo $st_loops;             //Prints 'Normal (default)'.         echo $st_loops[key];             //Prints 'N'.         echo $st_loops[$key];             //Prints 'N' again.         print array_keys($st_loops);             //Prints nothing.         echo key($st_loops);             //Prints nothing.      So I have no idea what to do about this. I'm sure it's easy but I'm being unlucky. **Updated 1:** This:               global $options;foreach ($options as $value) {      if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_option( $value['id'] ); }     }     print_r($options);      returns this:               [29] => Array         (             [name] => Loop style             [desc] => Select the style loop for the theme.             [type] => select             [id] => st_loops             [options] => Array                 (                     [default] => Normal (default)                     [small] => No thumbnails                     [large] => Big thumbnails                 )                  [std] => style         )      **Updated 3:** At the moment, this is the code as provisional solution:               $loop_class = get_option('st_loops');     if($loop_class == "Normal (default)") { $loop_class = "default"; }     elseif($loop_class == "No thumbnails") { $loop_class = "small"; }     elseif($loop_class == "Big thumbnails") { $loop_class = "large"; }     echo $loop_class;      Easiest way, but too many lines, I think.


title: How to get custom post types to play nice with schema.org (aka how to wrap the contents in the schema.org markup)?

text: Building a Culinary site with a Custom Post Type like "Recipes". I'm fixing to wrap the content of the said post type in schema.org's recipe microformat. How do I achieve this ?


title: Why does WP_Query show only the same post even with different categories and endwhile?

text:
I have 3 divs that WP_Query with 3 different categories and end it with the php endwhile,but it only shows the same most recent post query three times over. Do I need to hard reset the query loop somehow? I'm looking to see where to put wp_reset_postdata...
         <?php $test = new WP_Query('category=[errands]&showposts=1');         while ($test->have_posts()) : $test->the_post(); ?>
<?php the_title(); ?>
         <img src="<?php bloginfo('template_directory'); ?>/images/errands.jpg" />                  <?php the_content(__('Read more'));?>             <?php endwhile;?>             <?php wp_reset_postdata(); ?>

         <?php $test2 = new WP_Query('category=[shopping]&showposts=1');         while ($test2->have_posts()) : $test2->the_post(); ?>
<?php the_title(); ?>
         <img src="<?php bloginfo('template_directory'); ?>/images/shopping.jpg" />                  <?php the_content(__('Read more'));?>             <?php endwhile;?>             <?php wp_reset_postdata(); ?>

         <?php $test3 = new WP_Query('category=[calendar_maintenance]&showposts=1');         while ($test3->have_posts()) : $test3->the_post(); ?>
<?php the_title(); ?>
         <img src="<?php bloginfo('template_directory'); ?>/images/calendar.jpg" />                  <?php the_content(__('Read more'));?>             <?php endwhile;?>             <?php wp_reset_postdata(); ?>


title: How do I use "if field exists" with $curauth?

text: I've added some extra $curauth fields to the user profile page via ths method:               function change_contactmethod( $contactmethods ) {          $contactmethods['twitter'] = 'Twitter URL';          // more $contactmethods go here          return $contactmethods;      }          add_filter('user_contactmethods','change_contactmethod',10,1);      And they are displayed this way on the author.php template, which only displays the link if it is entered in te user profile: `<?php echo $curauth->twitter; ?>` But what I need to do is determine if the curauth field exists before display, as I want to turn the twitter URL into a linked image. Calling $curauth->twitter; as above with a linked image still displays the image if no link is entered in the users profile. This is what I'm trying with no luck:               <?php $my_post_meta = get_post_meta($post->ID, 'twitter', true);     if ( ! empty ( $my_post_meta ) )         echo '<img src="<?php bloginfo(\'template_url\'); ?>/images/twitter.png">'; ?>      **Update 12/23/11 - This now works:**               <?php if ( !empty( $curauth->twitter ) ) { echo 'twitter . '">'; } ?>


title: How to check if a WP_Query has data

text:
I have the following WP_Query, which works great:
Frequently Asked Questions

          <?php          $args = array(         'post_type' => 'questions',         'posts_per_page' => '3',                                                 'tax_query' => array(             array(             'taxonomy' => 'types',             'field' => 'slug',             'terms' => 'customer-service'             )         )     );          $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>
     <?php endwhile; ?>
      As you can see, there's a title on the top of the query and I would like to find a way to only show that title if there are values inside the query. If not, in case there are no questions, the title still shows and it looks weird. Any ideas how can I check if there are values inside a query or not? Thanks!


title: What questions do you ask when asked to give an estimate on theme development?

text: I just recieved an email that asked the following question: "How much will cost to code a WordPress theme?" I cannot answer this question without know the answer to a plethora of other questions. I cam up with the following off the top of my head:   1. What browsers/devices need to be supported?   2. What core WordPress functionality needs to be supported?   3. What template files need to be created?   4. Are there and custom page templates?   5. Is the theme to be internationalized?   6. Does the theme offer functionality outside the scope of WordPress core?   7. How complex is the design?   8. What level of accessibility is expected?   9. How much of WordPress functionality is represented in the PSD? Unfortunately, I do not have all of these written down anywhere and I'm sure that I am missing very important things. To save me time in the future as well as to help other freelancers, I thought it might be a good idea for everyone to list the questions they ask potential clients when asked to develop a theme from an unknown design.


title: Converting an existing query_posts to WP_Query

text:
I am having trouble trying to convert my query_posts loop that is bugging out to a WP_Query, was hoping someone may have some luck looking at it: This is my old loop:
                      <?php                   query_posts(array( 'post_type' => 'work', 'taxonomy' => 'type', 'posts_per_page' => '-1', 'orderby' => 'title', 'order' => 'ASC' ));                   if ( have_posts() ) : while ( have_posts() ) : the_post();                 ?>                          <aside class="work_item" data-id="id-<?php the_id(); ?>" data-type="<?php $posttags = get_the_tags(); if ($posttags) { foreach ($posttags as $tag) { echo str_replace('-','_',$tag->slug . ' '); } } ?> <?php $posttags = get_the_terms($post->ID, 'type'); if ($posttags) { foreach($posttags as $tag) { echo str_replace('-','_',$tag->slug . ''); } } ?>">

                                     <?php echo get_the_post_thumbnail($post_id, 'Work Gallery', array('class' => 'lazy',)); ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                                          <?php if ( 'work' == get_post_type() && has_term( 'case-study', 'type') ) { // show 25 characters from the content if the post is a case study ?>
<?php the_excerpt(25); ?>
                                          <?php } else { ?>                                          <?php if ( 'work' == get_post_type() && has_term( 'portfolio', 'type') ) { // if the post is a portfolio item show the DESCRIPTION of the image ?>
<?php echo get_post(get_post_thumbnail_id())->post_content; ?>
                                          <?php } } ?>                                          <?php                                         if( has_tag() ) {                                             // IF THE POST HAS TAGS                                             the_tags('
', '.

', '.
');                                             //$articletags = strip_tags(get_the_tag_list('',', ','')); echo $articletags;                                         }                                         else {                                             // IF NO TAGS                                         }                                     ?>

<a class="tooltip" title="full details" href="<?php echo the_permalink(); ?>">View All

<a rel="prettyPhoto[mixed]" class="expanded tooltip" title="preview" href="#prettyPhoto-<?php the_id(); ?>">Expand

                                         <?php if (has_post_thumbnail( $post->ID ) ): ?>                                         <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>                                             <a class="work_lb tooltip" title="view in lightbox" href="<?php echo $image[0]; ?>" rel="prettyPhoto">Lightbox                                         <?php endif; ?>

                                  <aside class="work_expanded" id="prettyPhoto-<?php the_id(); ?>">                                      <?php the_title('
', '
'); ?>                                                                                <?php                                         $images = get_field('gallery');                                         if( $images ):                                     ?>

                                                 <?php foreach( $images as $image ): ?>
                                                         <img class="lazy" src="<?php echo $image['sizes']['Portfolio 1200']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php echo $image['caption']; ?>

                                                 <?php endforeach; ?>

                                     <?php endif; ?>                                                                                <?php get_template_part( 'sidebar', 'work' ); ?>
                                              <?php the_content(); ?>
                                                                                <?php endwhile; endif; wp_reset_postdata(); ?>
      My attempted new loop:
                      <?php                     $all_work = new WP_Query(array( 'post_type' => 'work', 'tax_query' => array(array('taxonomy' => 'type', 'field' => 'slug', 'terms' => array( 'case study', 'portfolio' ) ) ), 'posts_per_page' => '-1', 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC' ) );                     while ( $all_work->have_posts() ) : $all_work->the_post();                 ?>                               <aside class="work_item" data-id="id-<?php the_id(); ?>" data-type="<?php $posttags = get_the_tags(); if ($posttags) { foreach ($posttags as $tag) { echo str_replace('-','_',$tag->slug . ' '); } } ?> <?php $posttags = get_the_terms($post->ID, 'type'); if ($posttags) { foreach($posttags as $tag) { echo str_replace('-','_',$tag->slug . ''); } } ?>">

                                     <?php echo get_the_post_thumbnail($post_id, 'Work Gallery', array('class' => 'lazy',)); ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                                          <?php if ( 'work' == get_post_type() && has_term( 'case-study', 'type') ) { // show 25 characters from the content if the post is a case study ?>
<?php the_excerpt(25); ?>
                                          <?php } else { ?>                                          <?php if ( 'work' == get_post_type() && has_term( 'portfolio', 'type') ) { // if the post is a portfolio item show the DESCRIPTION of the image ?>
<?php echo get_post(get_post_thumbnail_id())->post_content; ?>
                                          <?php } } ?>                                          <?php                                         if( has_tag() ) {                                             // IF THE POST HAS TAGS                                             the_tags('
', '.

', '.
');                                             //$articletags = strip_tags(get_the_tag_list('',', ','')); echo $articletags;                                         }                                         else {                                             // IF NO TAGS                                         }                                     ?>

<a class="tooltip" title="full details" href="<?php echo the_permalink(); ?>">View All

<a rel="prettyPhoto[mixed]" class="expanded tooltip" title="preview" href="#prettyPhoto-<?php the_id(); ?>">Expand

                                         <?php if (has_post_thumbnail( $post->ID ) ): ?>                                         <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>                                             <a class="work_lb tooltip" title="view in lightbox" href="<?php echo $image[0]; ?>" rel="prettyPhoto">Lightbox                                         <?php endif; ?>

                                  <aside class="work_expanded" id="prettyPhoto-<?php the_id(); ?>">                                      <?php the_title('
', '
'); ?>                                                                                <?php                                         $images = get_field('gallery');                                         if( $images ):                                     ?>

                                                 <?php foreach( $images as $image ): ?>
                                                         <img class="lazy" src="<?php echo $image['sizes']['Portfolio 1200']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php echo $image['caption']; ?>

                                                 <?php endforeach; ?>

                                     <?php endif; ?>                                                                                <?php get_template_part( 'sidebar', 'work' ); ?>
                                              <?php the_content(); ?>
                                                                                <?php endwhile; wp_reset_postdata(); ?>
      Not sure what I am missing but its not working. When I try to reload the page it just draws a blank... but I am not seeing anything in my error log either. Thanks for any input!


title: Changing name of sidebar widget

text: I have created dynamic sidebars. They are working fine and appear in the Widgets area. However, I would like to customize the name that appears on each sidebar. So, right now each sidebar is named "Sidebar 1", "Sidebar 2", etc. Instead, I would like them to say something like "About Sidebar", "Toolkit Sidebar". This is not the title (that field is blank and the user can enter whatever text they please). Thank you for any help! Jeff I am not sure how to do that.


title: Internal error (500) on local & Fatal error on live when trying to access post type edit screen

text: I'm building a CMS for a company that has 60,000+ static pages which have been converted into posts. 30,000 of these are a particular post type. When I try to access the edit screen in the admin area (http://www.mysite.com/wp- admin/edit.php?post_type=post-type. On my local server I get an internal 500 error. On my live site, (database migrated with wp-migrate-db-pro) i get: Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /home/omol/public_html/wp-includes/post.php on line 1876 seems like 256m should be enough memory? I wasn't having this error before and was able to see the 30,000 articles on the edit screen just yesterday. I've reverted to twenty-twelve theme & checked the htaccess, to no avail.


title: A single instance of WooCommerce with multilanguage on mapped domains?

text: I'm tinkering with the following scenario which includes WordPress, bbPress, BuddyPress and WooCommerce. My understanding is that currently WooCommerce does not support multisite. If one goes multisite, one gets a separate instance of WooCommerce for each site in the network. But this is troublesome, there would be no syncing of stock, price updates, sales, etc. Suppose though that my purpose is not having multisite, but **multilingual**. I need the same content of my main site translated but I need a different domain for each locale. And this multilingual setup should have only with one instance of WooCommerce. How do I achieve a setup where:   1. I have a **single instance** of WordPress, BuddyPress, bbPress and WooCommerce   2. I want to **translate** this instance in multiple languages    3. each language gets its **own domain** (not subdomain)   4. **content** that is not translated just does not appear in domains where the translation is missing   5. I can **translate permalinks** according to language (silly example: if I have a post-type called "horse" in the English site, the _post type archive_ would be `englishdomain.com/horse/` but can I get `spanishdomain.com/caballo/` for Spanish? and the same logic for single posts and everything else. Is that even possible? What solutions could I use? If it's impossible or cumbersome to achieve, do you have an alternative approach to suggest? The most important points is to have centralized shop and users, but different domain per language (possibly with localized permalinks). Thanks!


title: Modifying previous_posts link to use AJAX

text: I am editing the `wp-includes/link-template.php` file in Wordpress, and would like to use Ajax to load posts into my ID of `#box-right`. I am aware that there are many plugins for this usage but I am using my own HTML and CSS layout, and including posts (not having integrated my site with WordPress). I am using AJAX to load content in certain DIV's within my site, I need to change the following code to load posts into my box-right div.               return '". preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) .'';      The AJAX link looks like this:                     I need to make the top link load the AJAX, I thought it would look like this (I am new to PHP).               return '$attr>". preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) .'';      What am I doing wrong here?


title: Regex For Extracting First 4 letters of search term

text: I am using a redirection plugin and want to redirect the existing search url `http://www.example.com/search/abcdef` to `http://www.example.com/?s=abcd` I am able to redirect `/search/abcdef` to `/?s=abcdef` however I can't get hold of how to trim and use the first of characters of search term i.e `abcd` in short it should look like `/?s=abcd` As of now I am using following regex with plugin: Source URL - `/search/(.*)` Target URL - `http://www.example.com/?s=$1` I'd appreciate any pointers in that direction or maybe a working answer ;)


title: Is the Block Bad Queries Plugin Still Relevant?

text: The Block Bad Queries Plugin hasn't been updated recently. Is WordPress still subject to these types of malicious attacks or has it been hardened sufficiently to make the plugin obsolete? Is there an alternative?


title: About WP's save_post action

text: Quick question, in API's some times `save_post` is used(most of the time actually). Is `save_post` the equivalent of the query action `INSERT INTO` whereas `save_post` saves metadata and forces Wordpress to do the rest of the work when used correctly? Thanks in advance!


title: Shortcode inside <a><span> WP wraps in in a <p> and shortcode is done after

text:
I want to do this:               [shortcode]      The Shortcode should be disabled but linked to a loginform. but wordpress does this:                [shortcode]          The crazy thing is It worked a few days ago... If you look here: http://www.manugoo.com/beta/kaninchenrasierer-4/ the "mitmachen" button is the shortcode and should link to loginform _EDIT_ After playing with some functions.php codes I found somewhere this is the output:

     Mitmachen!      I tried to insert other shortcodes which has no a-tag inside. Same result.


title: How to setup a Custom Taxonomy Term template

text: I have a Custom Post Type and 2 taxonomies attached to it. Each taxonomy has about 20 terms containing several posts. While I have successfully setup a custom archive template for my custom-post-type. My Taxonomy terms are creating problem. When I view any of the terms page (by clicking them from CPT menu) it shows me the titles of the posts under it. I tried setting up taxonomy-my-taxonomy-my-term.php but the page does not pick it up. Instead it is using archive template. Here is the body class that is returned: archive tax-path term-a-path term-19 logged-in Which template do I need to make in order to list all posts under a specific term, and can I have a generic template for all terms, since all of them have posts with similar data fields.


title: How to change the full capitals font title of my WordPress Blog?

text: I would like to show my WordPress blog's title as "Dummit foote 4.2.4". But I am getting all capitals as "DUMMIT FOOTE 4.2.4" What should I do to change this? I do not see any editor case in my dashboard. ![enter image description here](http://i.stack.imgur.com/gX9wU.png) It was mentioned that i should change something in .css but i do not even know where to find that.


title: Issues with post_content when using wp_insert_post

text: I have a very weird problem and I would really appreciate your help with it. I am using wp_insert_post when a user submits a post. It works fine when I submit the form (i.e. the admin of the wordpress site), but when I try the same thing with a different user (i.e. different email, not the admin of the wordpress site), it only shows part of the content I used in the post_content field. my code:               $my_post = array(     'post_title'    => 'My bet',     'post_content'  => '<form action="" method="post" id=form_id>' . 'bet ID: ' . '<input readonly id=betid     type=text value=' . $bet_id . '>' . '<input id=url name=urlpath type=hidden value=>' . '</form>' ."\r\n match: " . '' . $_POST[event] . '' . "\r\n" . $current_user->user_login . "'s Pick: " . $_POST[bet] . '' . '' . '' ."\r\n Amount: " . '' . $_POST[amount] . '' . "<?php include('wp-content/themes/twentyfourteen/test.php') ?>"     'post_status'   => 'publish');      When it is executed for the wordpress admin user (user ID=1) it works fine. when it is executed for any other user (user ID!=1) it is not showing the input fields of the form, and more important, not including the test.php I have included.


title: How to cache posts based on $_GET? Option name is too long? Options / transients

text: I have a search feature set up that is fairly expensive and I want to cache the results, based on the $_get string, like: `?search_type=product&relation=or&date=all&s=tagsearch&merchcat=cotton&brand=brandx&color=blue&etc=morestuff` So, i'm trying to cache the array of posts that I get:               if (false === ( $products = get_transient($name) ) ) {         $products = getproducts();         set_transient($name, $products, 60*60*12);     }      for the transient name, I've been trying various things like               $name= base64_encode(serialize($_GET));      But, I'm running into the problem of the option name getting truncated and possibly encoded, slashed, etc. How would you go about solving this?


title: Dev, Stage and Production Deployment for WordPress Sites?

text: So I need to be able to have dev/stage/production iterations (over separate servers) for a WordPress website, I use git usually but this obviously isn't going to work with WordPress sites because of the reliance on the database for the main configuration of... well, almost everything. So my question is how do you guys do it? I had a quick Google and saw that there was a few plugins, is this the only way? Which ones do the job the best in terms of ease of use, speed, reliability, ui etc.?


title: pull custom fields values from wp-database in a nested foreach loop

text: I am trying to display custom fields on my template values of which i am pulling from postmeta table doing something wrong with a loop or not writing the foreach args correctly not sure whats the problem pastebin link for the code http://pastebin.com/eyPD6Qws basically i want to display 15 div's with 3 cols so to say (name, photo,region) To make it more simple to explain exactly what i am doing is using a plugin called flutter(yes i know it is dead now) but it works for me i am creating profiles for say agents there individual pages work perfectly but now i want to create a page where i display small brief of everyone's profile (like we have portfolio pages) for which i have created a code(which can be seen here http://pastebin.com/eyPD6Qws)


title: How to display more than one instance for a widget?

text:
I'm using a plugin called Recent category post widget. Unfortunately the plugin developer is no longer offering support. The way this plugin is coded, displays only one instance of the widget (meaning that I can use this widget only once). What must be changed in the code below so as to use multiple instances of the widget?               <?php     register_activation_hook    (   __FILE__,           array('single_category_posts_widget', 'activate')       );     register_deactivation_hook  (   __FILE__,           array('single_category_posts_widget', 'deactivate')     );     add_action                  (   "widgets_init",     array('single_category_posts_widget', 'register')       );          class single_category_posts_widget {              function activate()         {             if( get_option( 'single_category_posts_widget_title' ) === FALSE ) {                 update_option( 'single_category_posts_widget_title', 'Recent Category Posts' );             }             if( get_option( 'single_category_posts_widget_category' ) === FALSE ) {                 update_option( 'single_category_posts_widget_category', 0 );             }             if( get_option( 'single_category_posts_widget_qty' ) === FALSE ) {                 update_option( 'single_category_posts_widget_qty', 5 );             }         }              function deactivate()         {             delete_option( 'single_category_posts_widget_title' );             delete_option( 'single_category_posts_widget_category' );             delete_option( 'single_category_posts_widget_qty' );         }              function register()         {             wp_register_sidebar_widget( 'recent-category-posts', 'Recent Posts in Category', array('single_category_posts_widget', 'widget' ));             wp_register_widget_control( 'recent-category-posts', 'Recent Posts in Category', array('single_category_posts_widget', 'control' ));         }              function control()         {             if (isset($_POST['single_category_posts_widget_title']))        update_option(  'single_category_posts_widget_title',       mysql_real_escape_string($_POST['single_category_posts_widget_title'])      );             if (isset($_POST['single_category_posts_widget_category']))     update_option(  'single_category_posts_widget_category',    intval($_POST['single_category_posts_widget_category']) );             if (isset($_POST['single_category_posts_widget_qty']))          update_option(  'single_category_posts_widget_qty',         intval($_POST['single_category_posts_widget_qty'])      );             ?>
                 Widget Title:
                 <input class="widefat" type="text" name="single_category_posts_widget_title" value="<?php echo get_option( 'single_category_posts_widget_title' ); ?>" />

                 What Category:
                 <?php wp_dropdown_categories( Array(                             'orderby'            => 'ID',                              'order'              => 'ASC',                             'show_count'         => 1,                             'hide_empty'         => 0,                             'hide_if_empty'      => false,                             'echo'               => 1,                             'selected'           => get_option( 'single_category_posts_widget_category' ),                             'hierarchical'       => 1,                              'name'               => 'single_category_posts_widget_category',                             'id'                 => 'single_category_posts_widget_category',                             'class'              => 'widefat',                             'taxonomy'           => 'category',                         ) ); ?>

                 How Many Posts:
                 <input class="widefat" type="text" name="single_category_posts_widget_qty" value="<?php echo get_option( 'single_category_posts_widget_qty' ); ?>" />
             <?php         }              function widget( $args )         {             echo $args['before_widget'];             echo $args['before_title'] . get_option( 'single_category_posts_widget_title', 'Recent Category Posts' ) . $args['after_title'];             echo self::get_cat_posts( get_option( 'single_category_posts_widget_category', 0 ), get_option( 'single_category_posts_widget_qty', 5 ) );             echo $args['after_widget'];         }              function get_cat_posts( $cat, $qty )         {             $posts = get_posts( Array(                 'cat'           =>  $cat,                 'orderby'       =>  'date',                 'order'         =>  'DESC',                 'numberposts'   =>  $qty             ));             $returnThis = '';             if( count( $posts ) )                 $returnThis .= '
'."\r\n";             foreach( $posts as $post )                 $returnThis .= "\t".'
ID ).'">'.$post->post_title.'
'."\r\n";             if( count( $posts ) )                 $returnThis .= '
'."\r\n";             return $returnThis;         }          }


title: Where can I learn to create my own theme?

text: I want to learn how to create a theme for WordPress. Where can I find information and resources on how to do it?


title: I want to have my custom field use HTML, how do I do that?

text: I want to have my custom field use HTML, how do I do that in such a way that I can use a rich text editor to view the content?


title: wp-admin seems to be redirecting

text: I'm having a strange problem with my w-admin login. This has only started since I upgraded to 3.0 When I go to wp-admin, the login form appears as normal, but when I enter my username and pass, I am presented with the login form again every time. Using the password recovery feature results in an email not found error. I know the username password and email are correct, b/c I have access to the mysql database and I can see the values (at least the user name and email). Anyone have any ideas of what could be going wrong?


title: Is it possible to override this function/class in a child theme?

text: Is it possible to override this `widget` function from a parent theme? I saw this blog, but it dealt with a simpler case. http://venutip.com/content/right-way-override-theme-functions ### parent               class Chocolat_Widget_New_Entrys extends WP_Widget {            function __construct() {...            function widget( $args, $instance ) {...     }     add_action( 'widgets_init', create_function( '', 'return register_widget( "Chocolat_Widget_New_Entrys" );' ) );      I attempted to use `remove_action('widgets_init','???');` but soon realized I could not get a handle on the function that registered it! I thought about overriding the function and creating a subclass, but still, it is registered in the parent by the name of the parent class. I thought about just copying the whole class, but child `functions.php` is loaded before `parents.php`.


title: Custom post type post taxonomies

text: I created simple custom post type with few taxonomies. I               <?php $query_params = getQueryParams(); $query_params['post_type'] = 'client';          if(isset($query_params['search'])){             $query_params['post_title_like'] = $query_params['search'];             unset($query_params['search']);         }         $loop = new WP_Query($query_params);         if($loop->have_posts()) : while($loop->have_posts()): $loop->the_post();               // SOME HTML              endwhile; endif; ?>      Then I tried to list display taxonomies for each post, by this:               $categories = get_categories("taxonomy=city");          foreach ($categories as $category) :          echo '<li>' . $category->name . '</li>';          endforeach;      But I always get all created taxonomies, not only selected to post. Any suggestions?


title: Unable to select an old date in wordpress

text: I am unable to set the year below 1899 for a post. If i set year below 1899 it is set to the current year automatically. ![screen shot](http://i.stack.imgur.com/IC73X.gif) I have purchased the _Timeline_ theme and asked in their support forum. They replied: > This sounds like a limitation created by your hosting provider. Nothing in > the theme is preventing the date you assign – as you can see, the demo has > posts using dates in the 1400s. Try contacting your hosting provider and see > if they have any insight on how to address that.


title: customizing recent posts

text:
Im working on my first wordpress blog and trying to avoid plugins if at all possible for a lot of what doesn't really need to have a plugin. I am slightly familiar with php ( I don't understand it but I know where to put it and what file should go where). I understand the how to change the theme files around, CSS & HTML. So if I can do it with some practice and time I'd rather hand code it then use a plugin. I'm trying to style my home page sidebar's recent posts and I'm not finding that hard at all, but I'm not sure how to get images into the recent posts. I have an image in each of my posts and now I'm just trying to get a small thumbnail view of the first image into my "RECENT BLOGS" area on my homepage. ![enter image description here](http://i.stack.imgur.com/DyzRv.png) Like in my design, here. Does anyone have a method or snippet of code that would work for what I'm trying to do? @Tom: This is what my code looks like after placing your suggestion in
<?php _e( 'Recent Blogs', 'toolbox' ); ?>

             <?php             if(has_post_thumbnail()) {                 the_post_thumbnail();             } else {                 // show a default image if no featured image is specified                 echo '';             }             ?>
         <?php             $args = array( 'numberposts' => '3' );             $recent_posts = wp_get_recent_posts( $args );                 foreach( $recent_posts as $recent ){             echo '
' .   $recent["post_title"].'
 ';          }         ?>           I have made it point to a default image but that's not even showing up. My image is styled               .thumbnail { width: 50px; height: 50px; border: 1px solid #093; padding: 5px;}      And this is the site you can find my sidebar problem at So I'm not sure what I'm doing wrong..


title: Incremental number handling on duplicate file names

text: After a couple of hours searching the WP core I've lost hope finding this myself (for once). Could someone guide me perhaps to where WordPress handles the incremental number when having duplicate file names during uploading? As a side question. When handling questions like this, where and how would you start searching? AFAIK I've searched through every file containing `file` and `upload`.


title: Pagination on custom query

text: I'm using the following code with `query_posts` to put together a custom search:               $args = array(         'post_type' => 'species',         'meta_query' => $meta_query,         'tax_query' => $tax_query     );      `$meta_query` is put together with a few segments of code like this:               if (!empty($_POST["s_aquarium_H"])) {         $val = convert_values('size', $size, $_POST["s_aquarium_H"]);         $aquarium_H = array(             'key' => 'aquarium_H',             'value' => $val,             'type' => 'numeric',             'compare' => '<='         );         $meta_query[] = $aquarium_H;     }      This works perfectly well and is accessed by visiting `/advanced-search/`. However, my pagination does not. When you click `Next Entries`, the URL changes to `/advanced-search/page/2/` but simply re-opens the Advanced Search form. I guess this is because I'm using `$_POST`. Is there a way of using pagination with `$_POST` or do I need to change my code to `get_query_var` or something? * * * **EDIT** My rewrite rules appear to be correct: `/advanced-search/page/2/` displays `pagename: advanced-search, paged: 2` in Monkeyman's Rewrite Analyzer plugin. ![Rewrite Rules](http://i.stack.imgur.com/PfY3i.png) * * * **FURTHER EDIT** My `advanced-search.php` page uses the following code to determine whether it should show the search form or the results. I guess this needs re-writing if I'm to use pagination:               <?php if ( isset( $_POST["act"] ) && $_POST["act"] == "s" ) : ?>      Does anyone have any ideas as to how I could go about rewriting this? I guess `GET` instead of `POST` needs to be used? * * * Thanks in advance,


title: 2 localizations inside a WordPress theme

text: I'm building a theme which includes a separate "section" and I want to make both the theme and the separate section localizable. However, I don't want to have them under the same textdomain. Would someone advise against doing this? Could there be any issues? I don't want to have the separate section as a plugin. This is what could appear inside e.g. `functions.php`:               __('String', 'themename');     __('Another string', 'somethingelse');


title: WordPress Active and Development server best practices

text: I currently have a separate WordPress install on a subfolder /dev and the live site in the root directory. I developed the site on the dev folder and then copied it over when it was complete. I want to maintain the dev site for future enhancement testing. Is there a better or easier way to do this using built in WordPress features like multisite? Can anyone verify that this is a good way to approach it?


title: Limiting query_posts to 1, regardless of sticky post?

text: As part of my homepage template, using the standard query_posts I'm pulling out 1 post (styled using a different content_part), then an ad, then the rest of the posts. This works fine, except for when someone sets a post as sticky, when the loop with a posts_per_page set to 1, pulls out 2. How can I get his loop to only ever show 1 post, either the latest, OR the top sticky, but not both (which I understand is the expected behaviour)? Currently I have:                   <?php      $posts_per_page = get_option('posts_per_page');     $num_featured_posts = 1;          query_posts(array('posts_per_page' => $num_featured_posts)); ?>            <?php if ( have_posts() ) : ?>              <?php while ( have_posts() ) : the_post(); ?>                <?php get_template_part( 'content', 'super' ); ?>              <?php endwhile; ?>            <?php elseif ( current_user_can( 'edit_posts' ) ) : ?>              <?php get_template_part( 'no-results', 'index' ); ?>            <?php endif; ?>      Thanks, **UPDATE:** After explicitly calling out out only 1 post, regardless of sticky statuses, and exclusing that from the main loop of posts, my main loop now duplicates a post on subsequent pages (last one becomes first on page 2). Offset is causing me headaches and generally breaks pagination easily - is there another way to fix/add to this:                 wp_reset_query();       $args = array(         'post__not_in' => array($first_sticky_post),         'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ),               );       //query_posts( $args );       $main_loop = new WP_Query( $args );      ... to reset where the loop should start on pages > 1? You can see it in action here: n2.project14.co.uk Thanks,


title: help in magento with wordpress function

text:
I am new to magento and what i have magento wordpress by figpig installed.After much research i found that wordpress functions won't work in magento. As my function was placed in theme folder, which would display thumbnails in rss as well as turn hyperlinks in post. As i am new to magento, i want to convert the following function to make it work and where to use it? I already have it wordpress function.                   add_filter( 'the_excerpt_rss', 'insert_thumbnail_into_feed' );     add_filter( 'the_content_feed', 'insert_thumbnail_into_feed' );               function insert_thumbnail_into_feed() {         global $post;         if ( has_post_thumbnail( $post->ID ) ){             // replace thumbnail with yours             $content = '
' .get_the_post_thumbnail( $post->ID, 'thumbnail' ) .'
';         }              // get post content and replace feed content with         // you can also limit/filter the content to exclude shortcodes and html code etc.         $content .= '
' .get_the_content() .'
';              return $content;     }      also if someone can point me in right direction to learn about magento development wise.


title: delete category name in the pages

text: I'm looking for a way so that I can delete category's name in the pages. I tried to find something for category in index.php but I couldn't find anything. Please help me to solve this problem. Thanks in advance


title: Testing for post title in 'if/else' statement returns no content

text:
I'm testing for a certain fixed post on an about page, I guessed that the best way is to test for post title (?). Here's my code, what's going wrong?               <?php     if (is_page()) {       $cat=get_cat_ID($post->post_title);       $posts = get_posts ("cat=$cat&showposts=35");            if ($posts) {         foreach ($posts as $post):           setup_postdata($post); ?>

<?php the_title(); ?>

          <?php    if ($post->post_title('skillset')) {                 echo '
';                     the_content('');                 echo '
';          }             else{             the_content('');             }                     endforeach;       }     }     ?>


title: get_template_directory_uri does not seem to work when defining WP_CONTENT_DIR

text: I have defined in my config:               define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/somedirectory' );      after Codex: Editing WP Config BUT `<?php echo get_template_directory_uri(); ?>` prints out:                 http://dev.domain.com/wp-content/themes/mytheme      Even though it should print out               http://dev.domain.com/somedirectory/themes/mytheme      Has anyone else experienced this or know of a fix?


title: Publishing videos and images from blog to facebook

text: Is there any wordpress plugin for publishing videos and images from blog to respected facebook user's profile wall? I have a wordpress blog and having 1000+ users. these users will upload images and videos from wp-admin. These uploaded images and videos should be published to their respected facebook user's profile wall. Please help me if any solution....Thanks in advance.


title: Custom Menu echo own HTML

text:
I've registered a custom menu and got all that set up, however the formatting of the HTML that the menu uses doesn't fit with the CSS/HTML menus I had previously and want to keep. Therefore I was wondering If there was a way to use the custom menu but `echo` your own HTML code for the menus. WordPress Generated HTML:

                 Home

                 About

                         What we do

                         Who we are

      My Custom HTML:

                   <img src="<?php echo get_template_directory_uri(); ?>/assets/drawing-pin.png">

Products

                   <img src="<?php echo get_template_directory_uri(); ?>/assets/corner-flick-cyan.png">

Products 1

Products 2


title: WP_Query on custom post type not displaying, multiple loops & get_template_part

text:
I'm having problems getting my testimonials to display. On page.php I have a testimonials section. So I have a loop that grabs the content for page.php, and then a get_template_part('content', 'testimonials') to get the testimonial loop.
              <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_title(); ?>

<?php the_content(); ?>

              <?php endwhile; else : ?>
There were no posts :(
              <?php endif; ?>
          <?php get_template_part( 'content', 'testimonials' ); ?>      So my main loop is up there and looks like that above ^^. My testimonials loop looks like this below in content-testimonials.php:               <?php               $args = array(             'post_type' => 'testimonials',             'posts_per_page' => 1,             'orderby' => 'rand'         );              $the_query = new WP_Query( $args );          ?>          <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

“<?php the_field( 'testimonial' ); ?>”
             —<?php the_field( 'name' ); ?>
          <?php endwhile; else : ?>
There were no testimonials :(
          <?php endif; ?>      I'm still quite new to Wordpress, so I can't see what I'm missing, I've been through the admin area and made sure there were testimonials, edited the custom field to display if the post type is equal to testimonial, I just can't see why it wouldn't load. I look forward to your responses, thanks in advance!


title: Top menu disapears in Category Pages when filtering using ACF

text:
I am using ACF (Advanced Custom Fields) and filtering the results using the method they posted on their website. http://www.advancedcustomfields.com/resources/tutorials/creating-wp-archive- custom-field-filter/ Filtering works fine, however, top menu disappears when the result is displayed. The code I am using is below: In functions.php add_action('pre_get_posts', 'my_pre_get_posts'); function my_pre_get_posts( $query ) { // validate if( is_admin() ) { return; }               // get original meta query     $meta_query = $query->get('meta_query');              // allow the url to alter the query         // eg: http://www.website.com/events?location=melbourne         // eg: http://www.website.com/events?location=sydney         if( !empty($_GET['bedrooms']) )         {             $bedrooms = explode(',', $_GET['bedrooms']);                  //Add our meta query to the original meta queries             $meta_query[] = array(                 'key'       => 'bedrooms',                 'value'     => $bedrooms,                 'compare'   => 'IN',             );         }          // update the meta query args     $query->set('meta_query', $meta_query);          // always return     return;      }      In category.php
         <?php               $field = get_field_object('bedrooms');         $values = explode(',', $_GET['bedrooms']);              ?>
             <?php foreach( $field['choices'] as $choice_value => $choice_label ): ?>
                     <input type="checkbox" value="<?php echo $choice_value; ?>" <?php if( in_array($choice_value, $values) ): ?>checked="checked"<?php endif; ?> /> <?php echo $choice_label; ?>

             <?php endforeach; ?>

           Demo: http://thepursesociety.com/_web/category/houses