title: How to use if statements to check and echo terms by hierarchy in a post?

text: I'm seeing a lot of posts on here with helpful snippets to resolve my problem, but nothing has been specific enough to help me - or I just don't understand how to make those solutions work for my issue as I'm still pretty new to custom taxonomy. What I have is a custom taxonomy for a custom post type, with two "levels" of terms. So in a template, I'm creating a loop for the custom post type, looking for the terms within each post, and then if the term is a parent, I need to echo out that term and it's children. If the term is not a parent, then I just need to echo out that term alone. I'm using these terms to determine what post content I'm spitting out and the content is organized either as a stand alone topic or a topic with sub-topics. I've looked at these questions here to try and figure this out: How to only list the child terms of a taxonomy and not their parents? Get the Term List - Ordering As well as this forum topic: http://wordpress.org/support/topic/if-current- taxonomy-has-child-andor-parent This seemed useful but since it requires IDs, I feel like it's not dynamic for where the terms can be changed and won't always have the same IDs: http://codex.wordpress.org/Function_Reference/term_is_ancestor_of This is the code I have so far, I feel like either a) I'm going about this wrong and need to re-think how I'm building this or b) I'm almost at the solution, but I just don't have it yet. Here is what I have in a page template:               <?php     $tutGroup = 'tut_group'; //taxonomy          $mainTopicsArgs = array(         'post_type' => 'tut_page',//custom post type         'orderby' => 'menu_order'         );      $mainTopics = get_posts($mainTopicsArgs);           foreach( $mainTopics as $mainTopic ):         $taxArgs = array(             'tax_query' => array(                 array(                     'taxonomy' => $tutGroup,                     'field' => 'slug',                     'terms' => $mainTopic                 )             )         );              $series_query = new WP_Query( $taxArgs );         foreach( $series_query->posts as $post ):                  //this is getting all terms             $allTerms = get_the_terms( $post->ID, $tutGroup );             foreach( $allTerms as $singleTerm ):                     //this gets current term and checks for parent/child                 $thisTerm = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); // get current term                 $parent = get_term($thisTerm->parent, get_query_var($tutGroup) ); // get parent term                 $children = get_term_children($thisTerm->term_id, get_query_var($tutGroup)); // get children                      if( ($parent->term_id!="") && (sizeof($children)==0) ) {                      echo 'This is the child term with one parent and no children';                 }                      if( ($parent->term_id=="") && (sizeof($children)>0) ) {                      echo 'This is the parent term with only one level of children';                 }                      if ( term_is_ancestor_of( 6, 2, $tutGroup ) ) {                     echo 'true'; //this specifically sees if a term is a parent and if the second integer is a child of the first integer                 } else {                     echo 'false';                 }             endforeach;              endforeach;          endforeach;      ?>      Can someone tell me what I'm missing or if I need to re-build this a bit if there is a better way to arrange this? Thanks in advance.


title: remove_shortcode('gallery') version 3.8.1 vs 3.6.1

text:
I've developed a plugin for my own needs on version 3.8.1. Fully tested. I've copied the files to version 3.6.1 on my hosting machine, and it doesn't work. The first error I got, was that the class I've programmed isn't found. This class was in the plugin php file. I moved the class to the functions.php, but the plugin still didn't work. Tried an number of other things, but no cigar. At this moment, the remove_shortcode works when I add it to the functions.php, but the only effect is that I see "[gallery ...]" instead of my desired output. The output generated by the class is correct, however. The class is called in the header.php and footer.php. So, to me, it seems that the remove_shortcode/add_shortcode isn't called when placed within the plugin.php At this moment, my plugin.php is as follows:               <?php     /**      * @package MyGallery      * @version 0.1      */     /*     Plugin Name: MyGallery     Plugin URI: http://.../plugins/MyGallery/     Description: My gallery     Author: GUI Junkie     Version: 0.1     Author URI: http://     */     remove_shortcode('gallery');     add_shortcode('gallery', 'MyGallery_');          function MyGallery_()     {     return "Hey!";     }      The original function in my plugin is this:               function MyGallery_()     {         $MyGallery = new MyGallery();         if( !$MyGallery->has_gallery )             return;         return '

';     }     ?>


title: Data Validation, dynamically generated fields (select for example)

text: Working to secure my plugin, I'm not sure what (if anything) to do about output such as dynamically generated select fields. For example, I have a country code select generated on the backend via PHP which is 200+ options long, but is stored - in its entirety - simply as `$ctry_code_sel`. Of course, I get the sentiment that "Everything is Suspect", and I get using wordpress's native `esc_url` and `esc_attr_e` etc. in response, but it seems that `esc_html_e` et.al. are of no use in cases such as this. When the time comes - on any given page - that I want to output my select field (e.g `echo $ctry_code_sel;`) is there something I can/should be doing there to guard against cross-site-scripting attack etc.?


title: each user having category with their name and can add sub categories post in that category

text: I am looking for help or plugin for the following conditions of my site I am using wordpress 3.0+ version. my site is about School where students will get register and post their experience and share knowledge. **User Registration:** Once the user is created automatically a new Category should be created with its Reg. ID and user name which will be displayed as below **mysite.com/jan2345** **User Blog:** each user will be able to create new blog which will be the sub category that user's category for example: jan wants to post his expedition to Europe so he will create new blog from frontend but in backend that will be a category with atleast single post which will be the default post and have default parent category as jan2345. This post url will look like **mysite.com/jan2345/europetour** **user Page** User will log in and be able to see only his Blogs and post for edit. if there is any more suggestions and any way i could do this please reply me **FYI:** i am not able to use Wordpress multisite functionality bec that creates a 9 new tables so, if there are 1000 users with their site details so there will be more than 9000 tables in database .... **If there is any other solution where i can create site and that will not increase my tables in data base** Thank you all in advance Nikhil J.


title: Displaying Posts Using a Custom Query with a Custom Field and a term_id

text: I'd like to display a list of posts in a category of a taxonomy using a Custom Field. Here's my code:               if($current_term->term_id=='143') {             $querystr = "  SELECT wposts.*             FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta, $wpdb->terms wpterms             WHERE wposts.ID = wpostmeta.post_id             AND wpostmeta.meta_key = 'apecard'             AND wpostmeta.meta_value = 'on'                  AND wpterms.term_id  =  '143'             AND wposts.post_status = 'publish'             AND wposts.post_type = 'locali'             ORDER BY wposts.post_date DESC ";      .....      The results display all posts that have meta_key='apecard' in every category of the taxonomy. But I want to display that posts only in the category with term_id=143. Thanks you!!!


title: How to use permalink query to go to specific tabs in posts

text: I'm not really sure how to phrase the questions, but hope it's not too confusing. Basically I've create a plugin which inject custom tabs into the posts content when displaying. For now, just assume I'm using DomTab, and I have permalink configured as `/%category%/%postname%/`. Now I would like achieve 2 things with the tabs.   1. Beautify the url by appending the tab name to the url according to the tab highlighted. e.g. If tab "Detail" is clicked/highlighted, the url should change from `http://myhost/catgegory/post1/` to `http://myhost/catgegory/post1/detail/` without requiring to refreshing the page, much like how google did it. The content of all the tabs are preloaded and hidden.   2. When url with the tab name are access directly, say from a bookmark, the tab should be highlighted automatically. e.g. If user access `http://myhost/catgegory/post1/comment/` then the "Comment" tab should highlighted instead of the default tab when displayed. I don't really need a full solution to this, but hints of where to start. As I understand query, but not sure how to access it with permalink enable. Thanks EDIT: Currently accessing `http://myhost/catgegory/post1/comment/` ends up in 404


title: What is the cleanest way to extract custom variables from a post

text: At the moment I am doing something like the following from inside the main loop;               $custom_values = get_post_custom_values('tenderfields');     $custom_values = unserialize($custom_values[0]);     $custom_values = $custom_values[0];      Then accessing them with `$custom_values['my-custom-value']` This works fine but feels a little clunky, it feels like something there is probably already an internal call for that I am just missing? I have looked through the docs and couldn't find anything.


title: How to break down importing of feeds

text: I am attempting to update a large array of feeds into WordPress, using fetch_feeds. As can be expected, when going over 50 feeds the server is starting to time out. I would still like to update the feeds in bulk but without crashing the server. Can you suggest a method through which I can break things down? Maybe using AJAX? Is that the best technique? Any examples I can look at?


title: Passing the JQuery string to Worldpress URL

text: I have already followed the tutorial here: http://www.rlmseo.com/blog/passing- get-query-string-parameters-in-wordpress-url/ But it still doesn't work. In the function.php, my code is                   //decode wordpress url to jquery string         function add_query_vars($aVars) {         $aVars[] = "lastName";          return $aVars;         }              // hook add_query_vars function into query_vars         add_filter('query_vars', 'add_query_vars');              function add_rewrite_rules($aRules) {         $aNewRules = array('^physician-profile/([^/]*)/?' => 'physician-profile?lastName=$matches[1]');         $aRules = $aNewRules + $aRules;         return $aRules;         }         // hook add_rewrite_rules function into rewrite_rules_array         add_filter('rewrite_rules_array', 'add_rewrite_rules');      I would like my link from                   physician-profile?lastName=Rae-Lee       to                   physician-profile/Rae-Lee.      In the pysician-profile page, my code is: but I don't know why I put it here. It seems like just return the value of lastName.                    if(isset($wp_query->query_vars['lastName'])) {          $lastNameS=(urldecode($wp_query->query_vars['lastName']));       In the main page,I linked the physician link as                   physician-profile/Rae-Lee,       but it keep going to the home page.When I tried changed the link as                   physician-profile?lastName=Rae-Lee,       it goes directly that page, but the URL doesn't change. As a wordpress beginner, could you point it out which part I did wrong? Or do I need other codes? Thank you for your help!


title: SQL Statement - Mass Delete Custom Post Types

text: This website lists a nice way of deleting posts based on category http://www.tripwiremagazine.com/2010/06/how-to-effectively-bulk-delete-many- posts-in-wordpress.html The relevant code is:               delete a,b,c,d     FROM wp_posts a     LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )     LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )     LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )     LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )     WHERE e.term_id =<category id>      where `<category id>` needs to be replaced with the relevant number. I need to modify this code to mass delete custom post types based on their taxonomy. By pressing on the edit button in wordpress admin i can retrieve the following information:               http://www.domain.com/wp-admin/edit-tags.php?action=edit&taxonomy=estate_agents&tag_ID=9098&post_type=os_estate      So i will need to modify the SQL code above to take:               post_type= os_estate     taxonomy= estate_agents     tag_ID= 9098      Any help with this would be much appreciated.


title: Function to grab specific image IDs from media library.

text: I want to grab images 161 thru 166 without having to calling my entire media library array and having to splice those up. In time, the more I have in there the more it's going to slow my site down. Here is what I have so far, I use array_reverse to reverse the IDs so the most recent uploads are last and I use array_splice to find the images I need to extract. Is there a more direct way for me to find images with ID 161 thru 166?               function get_images_from_media_library() {                     $args = array(                         'post_type' => 'attachment',                         'post_mime_type' =>'image',                         'post_status' => 'inherit',                         'posts_per_page' => -1,                     );                     $query_images = new WP_Query( $args );                     $images = array();                     foreach ( $query_images->posts as $image) {                         $images[]= $image->guid;                     }                     $images = array_reverse($images);                     $images = array_splice($images, 3,6);                     return $images;                 }                      $img = get_images_from_media_library();                 foreach($img as $image){                     echo "<img src='$image'/>";                 }


title: How to throw the "We need ftp info" at a user

text: I recently asked a question about an error I was getting for doing theme updates where the user did not have permission. I would like to write a credential check, much like how wordpress does theirs. essentially when you update WordPress you either have the worlds most insecure set up and it will just update when you click the button or it will do the smart thing and ask you for your ftp credentials. My theme is built on the same concept except I don't know how to ask you for your ftp credentials. Now I know there are wordpress functions that do the update of themes for you, except I check my version number in a custom way, I also get the zip from my hosting and I don't use wordpress theme repo for any of this, so the one quick fix function won't work. So my question is: **How do you write a custom credential check function that basically checks if you need ftp or not.**


title: Show infos only to the author in the author.php

text: I need to be able to show some informations only to the author in his profile viewable in the front end, for istance I need to add a text under the avatar that only the author, if logged in, can see. This text will inform them that they can change the avatar anytime by adding it in their profile page... I could also add some more details... Is there a way to achieve this? Thanks!


title: How is the WordPress.org plugin download history calculated?

text: I'm interested to know how the download history of plugins is calculated on WordPress.org. I'm noticing that one of my plugins is displaying a small percentage of users using a version which I haven't released yet via WordPress.org. Is it because I have installed it manually on a couple of my sites for testing?


title: Create custom page and add it in nav menu by code

text: I am creating a plugin, and this time it should: create a page and add it to the nav menu, all by code ... Here is an example: http://img823.imageshack.us/img823/8531/09072012205520.png


title: What is the right way to set up a one-page portfolio theme?

text: I would like to create a simple one-page portfolio theme for my own use. Most of the content will be static. The main reason I want to make it in WordPress at all is to make use of Contact Form 7 and include blog posts from another site of mine. My questions:   * I'll create a page template for the main content. What needs to be in the `index.php` file, considering that I won't actually use it (but WordPress still requires it)?   * What is the right way to pull in blog posts from my other site?


title: How do you set the default page in WordPress?

text: Assuming I have a page with the URL `http://papermepress.com?page_id=2` that I want to set as the default, what do I need to do so that when a user types in just `http://papermepress.com` they see that page? Is it a simple configuration option or do I need a plugin of some sort?


title: hfeed CSS class in Twentyeleven Theme

text: The twentyeleven theme has hfeed class attached with the main container #page. I could not find any definition of hfeed in style.css. Does it have any purpose or its just a random class name given?


title: How do I make a draft post accessible to everyone?

text: I have several **unpublished** posts in my Wordpress website and I am trying to make it accessible for normal users (who are not logged in) using the normal post slugs (`site.com/post-here`). I understand it may not be the best practice but for my special purpose, this needs to be done. I have tried adding the following code snippet into my `functions.php` file:               function enable_view_drafts() {     $role = get_role( 'subscriber' );      $role->add_cap( 'read_private_posts' );      $role->add_cap( 'edit_posts' );     }     add_action( 'after_setup_theme', 'enable_view_drafts');      I've also tried `init` hook instead of `after_setup_theme`. No luck. My understanding is that changes to roles are saved to the database so only need to be done once. That is why I'm using `after_setup_theme` hook to call the function. But when I try to access the page as a normal user, I'm being shown a 404 page instead of showing the post content. I've also tried loading the preview URL (`site.com/?p=212&preview=true`) but that didn't work either. These are my guesses:   * the normal user doesn't have enough `caps` to read the drafts post.   * testing and viewing draft posts on the front-end is not possible for any users (including administrators). What changes do I have to make in order to accomplish what I'm trying to do? If it's not possible, what alternative solutions do you suggest? **Note:** I'm not looking for plugin-based solutions.


title: Consequences if using PHP include TEMPLATEPATH?

text: I have created a **Theme Options page** using Settings API so now I need to style it using CSS. Instead using function like this inside **functions.php**               function mytheme_add_init() {     if ( is_admin() ) {         $get_path=get_bloginfo('template_directory');         wp_enqueue_style("functions", $get_path."/css/admin.css", false, "1.0", "all");              }     }     add_action( 'wp_enqueue_scripts', 'mytheme_add_init' );      I am using `<?php include (TEMPLATEPATH . "/functions/admin_css.php"); ?>` directly inside my file responsible for creating my **Theme Options Page**. Reason for this approach is that I will use some images _(their path will be dynamicly generated using`get_template_directory_uri()` thingy)_ inside my **Options Page**.      So what really want is to add my theme to **WordPress.org repository**. **Question:** Because I am using that approach will I **_suffer consequences_** like being my theme rejected by **WordPress Theme Review Team ?**


title: URL rewrite custom taxonomy using add_rewrite_rule() or generate_rewrite_rules()

text: I'm trying to get my head around amending some URL's for a website I have created. After reading two (very informative) answers (1, 2) but I'm still a little unsure how to approach creating a URL that shows a custom post type in the hierachy of it's categories (created by custom taxonomies). From my reading, I gather that `add_rewrite_rule` or `generate_rewrite_rules` seem to be the best options to use, but I cannot seem to get it functional... like... at all! **Here is the URL structure I have currently** :               Base        = http://domain.com/bands     Category    = http://domain.com/band-type/acoustic-duos     Single Post = http://domain.com/bands/duo-1      And **here is what I am looking to achieve** :               Base        = http://domain.com/bands     Category    = http://domain.com/bands/acoustic-duos     Single Post = http://domain.com/bands/acoustic-duos/duo-1      In the scenario above, **`bands` is the custom-post-type**, whilst **`band- type` is the custom-taxonomy** I have created for 'bands'. From using @jan-fabry Rewrite Analyzer plugin, I can see the custom taxonomy pattern is: `band-type/([^/]+)/?$` for the first argument for `add_rewrite_rule()` but I don't know how Wordpress references custom taxonomies in the index.php URL variable, used for the `$redirect` argument (e.g. `index.php?tax=bands`)... so unsurprisingly the following code (placed within `functions.php`) did not work at all:               wp_reset_query();     function sheixt_init()     {     add_rewrite_rule(         'band-type/([^/]+)/?',         'index.php?cat=&band-type=$matches[1]',         'top' );     }     add_filter( 'query_vars', 'sheixt_query_vars' );     function sheixt_query_vars( $query_vars )     {         $query_vars[] = 'band-type';         return $query_vars;     }      I still feel I'm not grasping how this works (at all!) and reading the codex is confusing me further so I'm not sure how to approach using `generate_rewrite_rules()`. Lastly, I'm wondering if I'm fooling foul of a permalink conflict, as I want the custom-taxonomy (band-type) to use the custom-post-type's slug ('bands') as the baseline for the URL. Please can you point me in the right direction, I can provide more information if necessary. Thanks.


title: how to server over http and https with one installation

text: is there an easy way to set up a single wordpress intallation to serve its pages both over http and https? I have an http based website, and I have some pages that I would like to make accessible as facebook pages too. But facebook requires https, and I would prefer to stay with https for normal requests. Do you know a way to share the same page over both protocols? I'm running my wordpress on a webfaction account. Akasha


title: Add category description to list of category with taxonomy image

text:
I'm using the Taxonomy Images plugin. Would like to list categories with their thumbnails AND descriptions. Code below give a list of categories (titles are linked to category archive) and thumbnails. I can't figure out how to add category description.                   $terms = apply_filters( 'taxonomy-images-get-terms', '', array('taxonomy' => 'category') );          if ( ! empty( $terms ) ) {            echo '
';            foreach( (array) $terms as $term ) {           echo '
taxonomy ) ) . '">' . $term->name . '
';           echo '
taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'thumbnail-small' ) . '
';           echo '

In this issue

[CATEGORY DESCRIPTION SHOULD GO HERE]

';       }            echo '
';          }


title: Include caption underneath post images

text:
Hello I've been struggling for ages trying to find a solution for this. Basically I just want to retrieve all images from a post and display a caption underneath. Here is the code i'm using:                   <?php     $argsThumb = array(         'order'          => 'DESC',         'post_type'      => 'attachment',         'post_parent'    => $post->ID,         'post_mime_type' => 'image',         'post_status'    => null     );     $attachments = get_posts($argsThumb);     if ($attachments) {         foreach ($attachments as $attachment) {             echo '
ID, 'thumbnail', false, false).'" />

'.apply_filters('the_title', $attachment->post_title).'

';         }     }     ?>      As you can see it currently displays the title, but not the caption. I have tried using: $caption = $attachment->post_excerpt; - but not exactly sure where to implement it and what I have tried doesn't work. Any help would be greatly appreciated!


title: .current_page_ancestor broken in Twenty Eleven

text: I would like to have a level 1 menu in a vertical menu and a full menu in a vertical menu in the left sidebar in Twenty Eleven. My problem is that I would like to make the top item bold if the user is in it, or in one of it's child menues. The ideal solution would be to apply a rule for `.current_page_ancestor`. But for my biggest surprise, that rule IS already in the original css file for Twenty Eleven. But it seems to be broken, as nothing happens!               #access .current_page_item > a,     #access .current_page_ancestor > a {         font-weight: bold;     }      Do you know how to fix this? Is there a ticket for this bug already? To have an idea, have a look at this site, I made the selector red to make it visible. What I would like to achieve is that the top menu stays red even if I'm in one of the child menus on the left. sample page


title: Can I limit this meta box to a particular page?

text: I am using a version of this (http://www.deluxeblogtips.com/meta-box-script- for-wordpress/) meta box script but I want to be able to limit which edit screen a meta box shows. For example, if I only want a meta box to show in the "contact" page edit screen, is that possible?               $meta_boxes[] = array(     'id' => 'project-box-1',                            // meta box id, unique per meta box     'title' => 'Project Box 1',         // meta box title     'pages' => array('page'),   // post types, accept custom post types as well, default is array('post'); optional     'context' => 'normal',                      // where the meta box appear: normal (default), advanced, side; optional     'priority' => 'high',                       // order of meta box: high (default), low; optional


title: Sorting custom post types in edit.php : Post disappear

text: I've got a few custom post types with different taxonomies and I have a function that adds certain categories to post list view in edit.php admin screen. Everything good there. I've also added a function that will allow the user to sort by those categories. This is where things go wrong. When you sort by name or date, everything is fine, but when you sort by the custom categories all the posts disappear and I can't figure out why. Here's the code all the way back through the custom post type registration. The code in question is the very last block, but I figured people may need to see the whole thing in context               // Add custom post type Artists         add_action( 'init', 'create_post_type' );         function create_post_type() {             register_post_type( 'band_artists',                 array(                     'labels' => array(                         'name' => __( 'Artists' ),                         'singular_name' => __( 'Artist' ),                         'add_new' => __( 'Add New','Artist' ),                         'add_new_item' => __( 'Add New Artist' ),                         'edit_item' => __( 'Edit Artist' ),                         'new_item' => __( 'New Artist' ),                         'view_item' => __( 'View Artist' ),                         'search_items' => __( 'Search Artists' ),                         'not_found' => __( 'No Artists Found' ),                         'not_found_in_trash' => __( 'No Artists In Trash' ),                         'parent_item_colon' => ''                     ),                 'public' => true,                 'has_archive' => true,                 'supports' => array( 'title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail' ),                 'rewrite' => array('slug' => 'artists'),                 'taxonomies' => array('category', 'post_tag')                 )             );             register_taxonomy('large_feature', array('band_artists'), array('hierarchical' => true, 'label' => 'Large Feature', 'rewrite' => false));             register_taxonomy('small_feature', array('band_artists'), array('hierarchical' => true, 'label' => 'Small Feature', 'rewrite' => false));         }          // Add custom taxonomies to Admin "Post List" Page         add_filter( 'manage_edit-band_artists_columns', 'my_edit_band_artists_columns' ) ;         function my_edit_band_artists_columns( $columns ) {                  $columns = array(                 'cb' => '<input type="checkbox" />',                 'title' => __( 'Artists' ),                 'large_feature' => __( 'Large Feature' ),                 'small_feature' => __( 'Small Feature' ),                 'date' => __( 'Date' )             );             return $columns;         }          // Make those columns display data         add_action( 'manage_band_artists_posts_custom_column', 'my_manage_band_artists_columns', 10, 2 );         function my_manage_band_artists_columns( $column, $post_id ) {             global $post;             switch( $column ) {                 case 'large_feature' :                     $terms = get_the_terms( $post_id, 'large_feature' );                     if ( !empty( $terms ) ) {                         $out = array();                         foreach ( $terms as $term ) {                             $out[] = sprintf( '%s',                                 esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'large_feature' => $term->slug ), 'edit.php' ) ),                                 esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'large_feature', 'display' ) )                             );                         }                         echo join( ', ', $out ); }                     else { _e( '' ); }                 break;                 case 'small_feature' :                     $terms = get_the_terms( $post_id, 'small_feature' );                     if ( !empty( $terms ) ) {                         $out = array();                         foreach ( $terms as $term ) {                             $out[] = sprintf( '%s',                                 esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'small_feature' => $term->slug ), 'edit.php' ) ),                                 esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'small_feature', 'display' ) )                             );                         }                         echo join( ', ', $out ); }                     else { _e( '' ); }                 break;                 default :              break;              }         }          // Make those columns sortable         add_filter( 'manage_edit-band_artists_sortable_columns', 'my_band_artists_sortable_columns' );         function my_band_artists_sortable_columns( $columns ) {             $columns['large_feature'] = 'large_feature';             return $columns;         }         add_action( 'load-edit.php', 'my_edit_band_artists_load' );         function my_edit_band_artists_load() {             add_filter( 'request', 'my_sort_band_artistss' );         }         function my_sort_band_artistss( $vars ) {             if ( isset( $vars['post_type'] ) && 'band_artists' == $vars['post_type'] ) {                 if ( isset( $vars['orderby'] ) && 'large_feature' == $vars['orderby'] ) {                     $vars = array_merge(                         $vars,                         array(                             'meta_key' => 'large_feature',                             'orderby' => 'meta_value'                         )                     );                 }             }                  return $vars;         }


title: Image format not using single-image.php

text: I am trying to isolate a particular post format for images, and reading the Codex, I thought it would be possible to create a new template file single- image.php. However, that file is not being used. Instead, I've got a file called content-image.php instead. I've refreshed permalinks, still no joy. Here's register_post_type():               function register_post_type( $post_type, $args = array() ) {     global $wp_post_types, $wp_rewrite, $wp;          if ( !is_array($wp_post_types) )         $wp_post_types = array();          // Args prefixed with an underscore are reserved for internal use.     $defaults = array(         'labels' => array(), 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null,         'capability_type' => 'post', 'capabilities' => array(), 'map_meta_cap' => null,         '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'hierarchical' => false,         'public' => false, 'rewrite' => true, 'has_archive' => false, 'query_var' => true,         'supports' => array(), 'register_meta_box_cb' => null,         'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null,         'can_export' => true,         'show_in_nav_menus' => null, 'show_in_menu' => null, 'show_in_admin_bar' => null,         'delete_with_user' => null,     );     $args = wp_parse_args($args, $defaults);     $args = (object) $args;          $post_type = sanitize_key($post_type);     $args->name = $post_type;          if ( strlen( $post_type ) > 20 )             return new WP_Error( 'post_type_too_long', __( 'Post types cannot exceed 20 characters in length' ) );          // If not set, default to the setting for public.     if ( null === $args->publicly_queryable )         $args->publicly_queryable = $args->public;          // If not set, default to the setting for public.     if ( null === $args->show_ui )         $args->show_ui = $args->public;          // If not set, default to the setting for show_ui.     if ( null === $args->show_in_menu || ! $args->show_ui )         $args->show_in_menu = $args->show_ui;          // If not set, default to the whether the full UI is shown.     if ( null === $args->show_in_admin_bar )         $args->show_in_admin_bar = true === $args->show_in_menu;          // Whether to show this type in nav-menus.php. Defaults to the setting for public.     if ( null === $args->show_in_nav_menus )         $args->show_in_nav_menus = $args->public;          // If not set, default to true if not public, false if public.     if ( null === $args->exclude_from_search )         $args->exclude_from_search = !$args->public;          // Back compat with quirky handling in version 3.0. #14122     if ( empty( $args->capabilities ) && null === $args->map_meta_cap && in_array( $args->capability_type, array( 'post', 'page' ) ) )         $args->map_meta_cap = true;          if ( null === $args->map_meta_cap )         $args->map_meta_cap = false;          $args->cap = get_post_type_capabilities( $args );     unset($args->capabilities);          if ( is_array( $args->capability_type ) )         $args->capability_type = $args->capability_type[0];          if ( ! empty($args->supports) ) {         add_post_type_support($post_type, $args->supports);         unset($args->supports);     } elseif ( false !== $args->supports ) {         // Add default features         add_post_type_support($post_type, array('title', 'editor'));     }          if ( false !== $args->query_var && !empty($wp) ) {         if ( true === $args->query_var )             $args->query_var = $post_type;         else             $args->query_var = sanitize_title_with_dashes($args->query_var);         $wp->add_query_var($args->query_var);     }          if ( false !== $args->rewrite && ( is_admin() || '' != get_option('permalink_structure') ) ) {         if ( ! is_array( $args->rewrite ) )             $args->rewrite = array();         if ( empty( $args->rewrite['slug'] ) )             $args->rewrite['slug'] = $post_type;         if ( ! isset( $args->rewrite['with_front'] ) )             $args->rewrite['with_front'] = true;         if ( ! isset( $args->rewrite['pages'] ) )             $args->rewrite['pages'] = true;         if ( ! isset( $args->rewrite['feeds'] ) || ! $args->has_archive )             $args->rewrite['feeds'] = (bool) $args->has_archive;         if ( ! isset( $args->rewrite['ep_mask'] ) ) {             if ( isset( $args->permalink_epmask ) )                 $args->rewrite['ep_mask'] = $args->permalink_epmask;             else                 $args->rewrite['ep_mask'] = EP_PERMALINK;         }              if ( $args->hierarchical )             add_rewrite_tag("%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=");         else             add_rewrite_tag("%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=");              if ( $args->has_archive ) {             $archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;             if ( $args->rewrite['with_front'] )                 $archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;             else                 $archive_slug = $wp_rewrite->root . $archive_slug;                  add_rewrite_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );             if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) {                 $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';                 add_rewrite_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );                 add_rewrite_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );             }             if ( $args->rewrite['pages'] )                 add_rewrite_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' );         }              add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite );     }          if ( $args->register_meta_box_cb )         add_action('add_meta_boxes_' . $post_type, $args->register_meta_box_cb, 10, 1);          $args->labels = get_post_type_labels( $args );     $args->label = $args->labels->name;          $wp_post_types[$post_type] = $args;          add_action( 'future_' . $post_type, '_future_post_hook', 5, 2 );          foreach ( $args->taxonomies as $taxonomy ) {         register_taxonomy_for_object_type( $taxonomy, $post_type );     }          do_action( 'registered_post_type', $post_type, $args );          return $args;      }


title: is_post_type_archive not working in feed

text: I'm trying to alter a feed for my plugin's custom post type to add lines for podcasting. Here is the code I've got right now:               add_action ('init', 'my_plugin_init');          function my_plugin_init() {         if ( is_post_type_archive('my_plugin_custom_type') ) {             add_action('rss2_ns', 'my_plugin_podcast_ns');         }     }          function my_plugin_podcast_ns() {         echo 'xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"';     }      The archive for this post type is located at `http://example.com/custom_type/`, and I'm getting the feed at `http://example.com/custom_type/feed/`. However, my extra line is not showing up. What am I doing wrong?


title: Remove full size image in wordpress

text: I am using wordpress 3.5 and everuthing is good except that each time one image uploaded, it will created many unnecessary image sizes. I confirmed my theme and found that it does not use the full size image and i think it's kind of cost my host too much with all image sizes saved. Would you please let me know how can solve this issue .Actually i am searching for solutions to resolve below two things   1. Do not upload full size image at Media   2. Remove existing full size images I found http://sumtips.com/2011/12/custom-image-sizes-in-wordpress.html link which guide how to disable unnecessary image but it does not remove the full size image Thank you very much in advanced for any advice.


title: ACF Image Object Sizes Issue on Multisite

text: I am using Advanced Custom Fields and have added an image with the return value being an image object. In my theme I if I dump the values of the object all the URL's for sizes are the same regardless if it is `thumbnail`, `medium`, or `large`. I am doing this on a multisite. Here is what the image object looks like:               (     [id] => 123     [alt] =>      [title] => My image     [caption] =>      [description] =>      [mime_type] => image/jpeg     [url] => http://example.com/files/2013/12/my_image.jpg     [width] => 5400     [height] => 3600     [sizes] => Array         (             [thumbnail] => http://example.com/files/2013/12/my_image.jpg             [thumbnail-width] => 150             [thumbnail-height] => 100             [medium] => http://example.com/files/2013/12/my_image.jpg             [medium-width] => 300             [medium-height] => 200             [large] => http://example.com/files/2013/12/my_image.jpg             [large-width] => 1024             [large-height] => 682         )     )


title: Custom Post Type Dynamically Updates other Custom Post Type

text: I have two custom post types, one is products, the other is vendors. The vendors CPT has things like name, address, and which products are sold there. The products CPT has the product name, description of the product and which vendors carry each product. Is there a way to have each CPT update the other? So say, if I put that this vendor sells this product it will automatically update the product to say that it is sold by that vendor?


title: A way to automatically install pages on theme install?

text: I'm trying to build a theme which would require specific pages to be included. Is there a way to automatically create pages and assign them to their page templates when a theme is installed?


title: wp.getUsers XML-RPC method is returning only 50 users, how can i get all the users

text: In my iphone app i am trying to list out all the users using the **wp.getUsers XML-RPC method** , but its not returning all the users, in that blog i have around 180 members , but it has returned only **50 users** in the list,,how can i get all the users ?? i am passing these following 3 parameters **blog_id** , **username** and **password** ,,should i pass **any other parameter** to get all the users in the list?? plas help me out thanx in advance


title: Returning all radio button options when using Advanced Custom Fields

text: When using the Advanced Custom Fields plugin for Wordpress, Suppose I have a radio button field with possible choices: o Apples o Bananas o Cranberries How can I return each one of these options regardless of which one is selected? Thanks everyone


title: Thumbnails generated by "add_image_size" are not removed when removing media

text: I've noticed that images which are generated by "add_image_size" wont be deleted whenever i delete the media item. So after removing all media items in the media manager i have a upload folder full of thumbnail images. Anyone else experiencing this?


title: How do I represent 'chunks' of content within Wordpress?

text:
I've only ever used wordpress as a self-hosted blogging platform - until now. I have a requirement to use it for a very basic CMS which will consist of ~ 10 pages, most of which will be static content, updated periodically. I'm going to need to ability to upload documents, embed images, edit copy using the text editor - pretty much all of the standard features wordpress offers. However, I'm having difficulty surrounding the issue of editing specific sections within a page - in particular, just knowing where to begin. A 'normal' CMS would traditionally break a page into separate sections and allow me to edit any of those sections, either by directly editing the content, or by including shared content in that spot. I cannot find out how to do this using wordpress. Is it possible to 'stretch' the Page model so that a Page is actually just a chunk of content, it gets included by a specific page/template, and it's - somehow - protected from being viewed directly (removing it from navigation menus being a start). Any pointers on where to begin? ## Update To clarify, imagine a standard wordpress blog post. Pretend it's a static piece of content. Suppose you wanted an editor to be able to change _just_ the first paragraph of that blog post. Now,   * should the static content on that page be in a Post, Page, Template, or something else?   * should the editable content be a Page, ... or something else? For example:
About us

Example.com is a company specialising in examples, demonstrations,     and canonical stuff.
      If I want that paragraph to be editable, presumably I need something like:
About us

<?php insert_page('name-of-content-chunk'); ?>
      ## Update 2 OK, after a lot of research, trial, and error, I've included the following:   1. Wordpress is _not_ set up to _easily_ replicate a classic CMS, particularly with regard to having several pieces of content on one page.   2. This model _can_ be imitated, more or less, using custom posts (see below)   3. Pages very nearly offer the ability to do this, however:      * A plugin is required just to include a page     * Pages don't seem to be as flexible as posts - e.g. no custom page types The method I've used, using custom post types, is broadly as follows:   1. The page is a 'Page' with a custom template - call it 'mypage.php'   2. That template contains the following:
       <?php         query_posts(array('name' => 'foo', 'post_type' => 'header-text'));         get_template_part('header-text');       ?>

Some static copy in the template that can       only be changed by the site administrator.
            <?php         query_posts(array('name' => 'bar', 'post_type' => 'image'));         get_template_part('image');       ?>
      Does that make sense to **anyone** out there? :-)


title: custom taxonomy archive permalink shows 404 error

text: In my plugin I have a custom post type with a slug of 'ready-to-wear' and I have a custom taxonomy called 'seasons' associated with it. The odd thing is that this url with query works: `http://dev.catwalkyourself.com/ready-to-wear/?seasons=autumn- winter-2012-2013-en` but the same one with custom permalink doesn't: `http://dev.catwalkyourself.com/ready-to-wear/seasons/autumn- winter-2012-2013-en` It throws a 404 error. You can try pasting the links yourself. Here is my relevant plugin code: Here is where the custom post type is registered $post_types = array();                   $post_types['rtw'] =  $args = array(             'labels' => array(                 'name' => __('RTW Collections'),                 'singular_name' => __('Ready to Wear Collection'),                 'add_new' => __('Add new RTW collection'),                 'add_new_item' => __('Add a new show to the RTW collection'),                 'edit_item' => __('Edit Collection'),                 'view_item' => __('View Collection'),                 'search_items' => __('Search Ready to Wear Collections'),                 'not_found' => __('No RTW Collections found'),                 'not_found_in_trash' => __('No RTW Collections found in trash')             ),             'query_var' => 'rtw_collections',             'supports' => array('title', 'editor', 'thumbnail', 'author', 'comments'),             'has_archive' => true,             'publicly_queryable' => true,             'show_ui' => true,             'taxonomies' => array('seasons','city'),             'rewrite' => array(                 'slug' => 'ready-to-wear',                 'with_front' => false             ),             'public' => true,             'menu_position' => 6         );      Here is where the taxonomy is configured: $taxonomies = array();                   $taxonomies['seasons'] = array(             'query_var' => 'seasons',             'rewrite' => array(                 'slug' => 'seasons',                 'with_front' => false             ),             'single_value' => true,             'required' => true,             'labels' => array(                 'name' => __('Seasons'),                 'singular_name' => __('Season'),                 'edit_item' => __('Edit Season'),                 'update_item' => __('Update Season'),                 'add_or_remove_items' => __('Add or remove seasons'),                 'new_item_name' => __('Add new Season'),                 'all_items' => __('All Seasons'),                 'search_items' => __('Search Seasons'),                 'popular_items' => __('Popular Seasons'),                 'separate_items_with_commas' => __('Separate Items with commas'),                 'choose_from_most_used' => __('Choose from most used Seasons')             )         );      and here is the call to `register_taxonomy`:               foreach ($taxonomies as $taxonomy => $arr) {                 register_taxonomy($taxonomy, null, $arr);             }      I have tried:   * Flushing the permalinks repeatedly   * Setting 'with_front' true and false repeatedly   * add flush_rewrite action to my functions.php Unfortunately, none of these work. Please help me out.


title: Application / Admission Form plugin

text: I'm looking for a plugin that would allow tracking of an application similar to the admission forms used for colleges. Ideally, a student would be able to fill out the application and submit it (and pay, if there's a application fee) and the student could check back periodically on the status of application, i.e. Received, Under Review, Accepted / Rejected, etc. On the Admin side of things, the applications would show up and would allow the admin to review, make notes, etc and mark the application with a new status. Has any one seen or heard of a plugin to do something like this?


title: Feed links not working even with add_theme_support('automatic-feed-links')

text: My feed links don't work, even after I add this code to functions.php:                         add_theme_support('automatic-feed-links');      When I try go to mysite.com/feed or mysite.com/?feed=rss or any of the links specified in the Codex, I don't get a feed with my content. In Safari, I get this: > Safari could not update this feed because the source file is no longer > available. In Chrome I get this:                <channel>        <title>My Site Name » Page not found</title>          <atom:link href="http://mysite.com/feed/" rel="self" type="application/rss+xml"/>      etc. My site used to have a feed through Feedburner, but I wanted to switch to built-in Wordpress feeds. It's very possible I'm misunderstanding something basic fact about how feeds work. What am I doing wrong?


title: How do I remove WordPress Custom Menus hover event and replace it with jQuery onclick?

text: I am using the WordPress (Appearance > Menus) feature to create a custom navigation menu. I created a menu item that has a dropdown and would like to activate the dropdown menu with a click rather than mouse hover. How would I go about doing this? I'm familiar wit jQuery, I just don't know how to remove the current hover state.


title: Changing admin user id for database

text: Is it correct or ok to change default admin user id from 1 to any other number as done by better-wp-security plugin for wordpress for better security? what is best way for admin security. Thanks


title: Post per page not working if no category specified

text: I'm going crazy...               <?php query_posts(array('cat' => 3, 'posts_per_page' => 1)); ?>      This shows 1 post (there is two in the category) >> OK               <?php query_posts(array('posts_per_page' => 1)); ?>      This shows 4 posts (there is four in the whole database) >> WTF? :P This is crazy... or am I ? Note: I only have one loop (this one), in this template.


title: Resources for a complete beginner to learn to work professionally with Wordpress

text: I have a friend who is interested in starting a side business where she would freelance websites. I have recommended for her Wordpress as probably the best choice where she could most quickly start making useful, customized websites for clients. While I have done a decent amount with Wordpress I am not really plugged into that community so I don't know what the go-to learning tools are. From personal experience I know that reading the wrong thing can be worse than reading nothing at all and I simply don't know what the community-accepted recommendations are. What websites/screencasts/books are the must-haves for a complete novice who is trying to get started with the platform? I would like to point out that she is not so interested in using it as a blogging platform so much as a simple CMS and site-builder that will allow her to build custom websites so the question is more: what are the best resources for a complete programming novice to learn Wordpress theme development? PS, if you feel like Wordpress is not appropriate for this either please let me know and I'll change my recommendation.


title: Add user capability and check against it

text: I just realized the following:               // Call the current user info     global $current_user;          // Add a capability     // and set the 2nd argument ($grant) to false     $current_user->add_cap( 'some_cap', false );       Now I've successfully added a capability to the user, but denied her/him the access to this capability. If I now check with `$current_user->has_cap( 'some_cap' );` I'd get a `true` in return. The same goes for `current_user_can( 'some_cap' );` as this is only a wrapper for the has_cap functions arguments. **Q:** Where is the 2nd argument used? Did I get something wrong?


title: List Category Posts V0.21 upgrade breaks site

text: I just upgraded the List Category Posts plugin from 0.18.3 to 0.21 and my website has failed. I've determined that the difference causing the failure is that the previous version passes a string parameter to get_posts() while the new version sends the arguments as an array. The problem is that the default value for post_parent=0 does not seem to have an effect when passed as a string (e.g. "?cat=55&post_parent=0") but it is being applied when the parameter is being passed as an array (e.g. array( 'cat'=>'55', 'post_parent'='0') ). My posts are post_type='post', for which post_parent should not be applicable. Many of my posts have a post_parent value which is not zero. They were previously batch converted from pages and it appears that the conversion has left the post_parent value with the id of the previous parent page. As a result of this, all those posts which were previously converted from pages with a parent have disappeared from my category lists. Can anyone explain why the parameter is being applied as an array and not as a string. Why is the default value for post_parent 0 fro the plugin, while it is empty for get_posts()?


title: Add action hook conditionally - only when home.php in use

text: I am trying to add action hook in functions.php only if the page is `home.php` but the following does not work               if ( is_page_template("home.php") ) {          // do stuff          }      To make sure that file being used is `home.php` I do this               global $template; echo $template;


title: How may I filter get_users() similarly to pre_get_posts?

text: I have filtered posts, pages and custom_post_types based on $current_user custom usermeta field values using pre_get_posts(). Is there a similar method/function to alter get_users() based on $current_user custom field values? I've searched quite a bit but came up empty handed. For example, let's assume I want to filter the results of get_users() for an editor with the "town" custom meta of "Paris" to only return the list of users with the same value in "town" field. Similarly, an editor with "Rome" in "town" should get only users from "Rome", and so on... Ideally, I'd like this parameter to append itself to all get_users() done by the website's functions in both back and front end as long as the user is logged in. Is this possible in WordPress? Thank you.


title: Is this the proper usage of creating / using a transient?

text: I'm new to using transients. Is this the proper format to create a transient and have it pull from the DB instead of using the http api? I have standardized my snippet so others can double check their code as well...               function google_transient() {              $url = 'http://www.google.com';         $the_whole_body = wp_remote_retrieve_body( wp_remote_get($url) );              $transient_name = 'google';              // Get any existing copy of our transient data         if ( false === ( $transient_name = get_transient( $transient_name ) ) ) {                  // It wasn't there, so regenerate the data and save the transient              set_transient( $transient_name, $url, 60*24); // 24 hour cache                   }              return $the_whole_body;     }


title: Search URL parameters query

text: > **Possible Duplicate:**   >  Custom search form with empty parameters Hopefully this is a quick one, but I've hit a wall here. I have multiple search terms, keyword, category, country and date. I've set it up so that the user doesn't have to search all of these filters. I can leave off category and/or date and it will show looser results. But if I leave off country it shows no results, doing the same to any other parameter still shows results. The problem lies with country only. `/?s=a&cat=41&country=&monthnum=&year=` produces no results but `/?s=a&cat=41&monthnum=&year=` does. Why is this? Surely these are the same thing? This is my wp_query, simply pulls posts, I had the foreach to clear this issue before but currently if I remove it. The search works no differently.               $args = array('post_type' => 'post')     // This foreach doesn't actually need to be here ?     foreach(array('s', 'cat', 'country', 'monthnum', 'year') as $key) {         if(isset($_GET[$key]) && trim($_GET[$key]) !== '') {             $args[$key] = $_GET[$key];         }     }


title: How can I make wp_list_categories output li with category-slug as class, for its children?

text:
Simply put, I'd like to change the `wp_list_categories` output from this:
Articles

Design
      to this instead:
Articles

Design
      So I tried Google and I've found a solution mentioned on this question add filter to wp_list_categories and query if used to list tax-terms? . I need to put this on my `functions.php`:                add_filter('wp_list_categories', 'add_slug_css_list_categories');           function add_slug_css_list_categories($list) {               $cats = get_categories();               foreach($cats as $cat) {              $find = 'cat-item-' . $cat->term_id . '"';              $replace = 'category-' . $cat->slug . '"';              $list = str_replace( $find, $replace, $list );              $find = 'cat-item-' . $cat->term_id . ' ';              $replace = 'category-' . $cat->slug . ' ';              $list = str_replace( $find, $replace, $list );*/          }               return $list;      }      **EDIT:** Now I realize the problem! The filter above works for parent categories. However it doesn't work for the children! So, using that code, if I use `wp_list_categories`, it will output as this:
Articles

Tips

Tutorials

Design
      Notice that even if the parents' class are `category-articles`, the children class stays as `cat-item-10`. Is there any fix to this?


title: Pagination in category

text:
**Updated:** **I have 50 categories and i wants to show each 5 category on one page and next 5 on next page and next 5 on next page. and so on. with pagination.** I have 50 categories in a WordPress site. I wants to show five categories on every page with pagination with 10 post. I have tried but pagination is not creating.               <?php          // get all the categories from the database         $cats = get_categories();         // loop through the categries         foreach ($cats as $cat) {         // setup the cateogory ID         $cat_id= $cat->term_id;         // Make a header for the cateogry         ?>

<?php echo '
'.$cat->name.'
'; ?>

                     <?php                     // create a custom wordpress query                     query_posts("cat=$cat_id");                     $count = 1;                          if (have_posts()) : while (have_posts()) : the_post(); ?>                              <div class="post-wrap<?php if ($count%3 == 0) { ?> right<?php } ?>">                                  <div <?php post_class(); ?> id="post-main-<?php the_ID(); ?>">

<a href="<?php the_permalink() ?>" rel="<?php _e("bookmark", "solostream"); ?>" title="<?php _e("Permanent Link to", "solostream"); ?> <?php the_title(); ?>"><?php the_title(); ?>

                             <?php include (TEMPLATEPATH . "/postinfo.php"); ?>

                 <?php if ( $count%3 == 0 ) { ?>

     <?php } ?>                              <?php $count = $count + 1 ?>                     <?php endwhile; endif;                     // done our wordpress loop. Will start again for each category ?>

     <?php } // done the foreach statement ?>


title: Possible to change the slug of default post type?

text: I have custom post types on my wordpress site and I've set the slugs to say "/blog/{post_type}/{post_title}". I'm using the default post type as a "notes" section, so I want that slug to be "/blog/notes/{post_title}". Is this possible?


title: Sign in with social media accounts without creating a WP account

text: I'd like users to sing in with their social media accounts (facebook, twitter, linkedin, google+) without creating a WP account. This is for them to be able to leave comments on a website. Is this possible and what's the best approach for this?


title: Export WordPress Posts and Meta Information in CSV format

text: I need to export all WordPress Posts and related Meta information using an SQL query. I've managed to export just the Posts but realised that the Meta information is in another table. Could someone please tell me how I would go about doing this please? Thanks! **EDIT: The final outcome of the CSV file should look something like this.** [POSTS TABLE] post_content | post_title | post_excerpt | Author (meta_key) | [META TABLE] AuthorName (meta_value) | Publisher (meta_key) | PublisherName (meta_value) | BookCondition (meta_key) | BookCondition (meta_value) So one post per row with the meta information in one row but in the same column.


title: how to keep currently selected menu item while selecting another menu item in second menu

text: In wordpress 3.9.1 I'm trying to create my own theme. One of the things my theme should be able to deliver is to have two menu's. I do have that. It is working. So no worries there. One of the menu's is the "main" menu and when selecting an item in this menu it is styled as the so named "current-menu-item". Some of the selections show a second menu at the top of the window. If I select an item in this second menu a new page is rendered and the menu item in the main menu is no longer selected. And there is where it does not work as I want. If one of the items is selected in the top menu I still want the item in the main menu be styled as the current menu item. So my users still know in which main menu item they are. Is there someone who can point me in the right direction on how to solve this issue? Why I did not include any code? Because I want to grasp the idea of how to solve it and then try to build it myself. I don't want a cut-n-paste solution as I think it will not teach me that much.


title: False URL for shopping cart

text: OK. Re wording my question   1. I have a digital product on a wordpress site   2. Using a shopping cart I'm charging .99 cents for people to look at a video (going to charity)   3. The cart directs them to a page on the site for them to view the video   4. It's in the form of an email link which is encrypted (Good)   5. It loads the page BUT then show the real URL in the address bar (bad)   6. This means that someone can view it and copy the URL and email it to anyone and nothing goes to charity, (bad) So, I need a way of showing the page with the embedded video in it but not showing the correct URL so that someone could copy & paste it and view it. It need to be unobtainable, false, random as the displayed URL but linkable from the cart. For example the page may be www.abc.com/page but it display something like www.abc.com/785df76wd9 and if copied and pasted into a browser it wouldn't exist.


title: Dashboard Disappears after Upgrade

text:
Following a recent upgrade to WP and MySQL one site that has a custom built plugin throws a Fatal error: > Fatal error: Cannot re-assign auto-global variable _REQUEST in > /home/mysitexyz/public_html/wp- > content/plugins/employment_application/employment_application.php on line > 549 Here is the offending code:               function getApplications($_REQUEST) {         global $wpdb;         $sql = "SELECT * FROM employment_applications";         if($_REQUEST['s'] != '') {              }         $sql .= " WHERE applicant_name LIKE '%" . $_REQUEST['s']  . "%'";     //echo "SQL: $sql
";          $applications = $wpdb->get_results($sql);         $wpdb->show_errors();         //$errors = $wpdb->print_error();         $error = $wpdb->last_error;              if($error != '') {             echo '
' . $error . '
';         }         //print_r($applications);         return $applications;     }      I know that this forum does not support Plugins, and since I am not the original developer and have only inherited the problem, I would like to address the other problem: When I remove the above mentioned plugin by changing the name of the folder the site comes back up but only the sidebar navigation of the Dashboard shows. The rest of it is blank. ![enter image description here](http://i.stack.imgur.com/zWHJ2.png) Is there a way to disable plugins without removing them from the Plugins folder? Is there a better way to troubleshoot the root cause of the empty dashboard? Thanks!


title: Rewrite and replace url wp-admin/edit.php and wp-admin/post-new.php

text: everybody I want to rewrite and replace all url **mydomain.com/wp-admin/edit.php -> mydomain.com/wp-admin/edit/** and **mydomain.com/wp-admin/post-new.php -> mydomain.com/wp-admin/addnewpost/** How i can do it or suggest ? Thank you very much.


title: Force WordPress to NOT display the manual excerpt

text: I'm forced to use manual excerpts on a number of my posts to integrate them with a shortcode plugin. However, this is interfering with how they're being displayed on an archive page (using a page template). Is there a way to force WordPress to display an automated excerpt (ie, the first 80 words) on one page template only?


title: Is it possible to create a conditional for content_width?

text: Searching here I've found two questions related and at the time, this wasn't possible. how to create a conditional content_width for a wordpress theme? And an alternative way via CSS described by Philip Arthur Moore (the code is also on Codex): What is the role and history of the $content_width global variable? Since the questions mentioned are a little old, my question is if the versions released after mid 2013 have improved the function so we could use it with conditionals.


title: URL Rewrite for CPT single posts

text: I'm struggling with Wordpress' rewrite function I have the following URL structure               http://example.com/album/test-7/      'album' is the slug for the CPT single page 'test-7' is the slug for the CPT post I'm trying to create a rewrite to allow a URL like               http://example.com/album/test-7/page/2      I'm using `paginate_links()` to create these links but when you visit a link with the desired structure the URL reverts to               http://example.com/album/test-7/      I've tried adding a URL tag and rewrite, but I'm very bad with both of these, here's what I have:               add_rewrite_tag('%paged%','([^&]+)');          add_rewrite_rule('^album/([a-z])/([0-9]{1,})?','index.php?p=$matches[1]&page=$matches[2]','top');      I'm not sure if I'm way off or close to getting it, but this would help clear up rewrite situations involving CPT ID's and pagination variables.


title: Uploading Images to Multi-Site Causes Failure to HTTP Error

text: Just to fill you in on my situation. Running WordPress multi-site version: 3.5.2 clean install. Zero 3rd party plugins. All of my plugins have been disabled for debugging. Using WordPress MU Domain Mapping for multiple different TLDs in the network. I have also spoofed all network URLs to serve file from my local server, rather than the existing live network. Hosts file: `vi /etc/hosts/` **Might contain something like:**               127.0.0.1 domain-a.com     127.0.0.1 www.domain-a.com     127.0.0.1 domain-b.com     127.0.0.1 www.domain-b.com      for each site in the network .... etc. I did that, so that I do not have to change site URLs and what have you. * * * Everything on each network site works as intended. The only issue is uploading media attachments. For whatever reason, they are not uploading properly. User is full-blown administrator user role, so it cannot be permission related. I am currently running _Ubuntu 12.04 with PHP 5.4.6 (FAST-CGI)_. When uploading an image, I get some very generic error from WordPress. ![Error 40 Year Old … to Life.jpg HTTP error.](http://i.stack.imgur.com/XHWev.png) `Error 40 Year Old … to Life.jpg HTTP error.` After switching the PHP from `FAST-CGI` to `MOD-PHP` I received a bit more specific of a response from WordPress. ![Error 40 Year Old … to Life.jpg The uploaded file could not be moved to wp- content/uploads/sites/3/2013/07.](http://i.stack.imgur.com/jjzk4.png) `Error 40 Year Old … to Life.jpg The uploaded file could not be moved to wp- content/uploads/sites/3/2013/07.` I have checked out the directory: `./wp-content/uploads/sites/3/2013/` and there is no `/07/` created automatically. So I have tried manually creating it and uploading again from both `FAST-CGI` and `MOD-PHP`, still the same errors follow. I have looked at something like: `./wp-admin/network/site-settings.php?id=3` in the network admin dashboard, searching for media related options.               Uploads Use Yearmonth Folders => true     Upload Path => '' //blank     Upload Url Path => '' //blank      I have checked the live multi-site network along with other multi-site installs and they seem to have the same settings. I then began to think it might be .htaccess related. When I go to `Network Admin -> Settings -> Network Setup` It tells me to use:               RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^wp-admin$ wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^(wp-(content|admin|includes).*) $1 [L]     RewriteRule ^(.*\.php)$ $1 [L]     RewriteRule . index.php [L]      Which is what I have been using, other than the slight modification at the beginning (Immediately following `RewriteEngine On`) allowing non-www URLs to redirect to www URLs. **Example:**               # DOMAIN-A Redirect non-www urls to www     RewriteCond %{HTTP_HOST} ^domain-a.com     RewriteRule ^(.*)$ http://www.domain-a.com/$1 [R=301,L]          # DOMAIN-B Redirect non-www urls to www     RewriteCond %{HTTP_HOST} ^domain-b.com     RewriteRule ^(.*)$ http://www.domain-b.com/$1 [R=301,L]      However, those rules are not the same as the WordPress Codex explains. I have tried the recommendations as per the WordPress Codex, still with no luck on image uploads within my WordPress Multi-Site Network. I currently have `SUBDOMAIN_INSTALL` set to true, using the appropriate rewrite rules as per the WordPress Codex. I have also tried setting `SUBDOMAIN_INSTALL` to false, again ... using the appropriate rewrite rules. Neither have corrected the issue. Live network (Version: 3.5.2) install has also stopped allowing image uploads. I am not experienced enough with multi-site to know what might be causing this issue. I will continue investigating this unless someone else may have an idea how to fix this issue, please share your acquired knowledge! Please note that it is 100% not a memory issue. It won't even upload a 1kb image file. I have tried all of the possible solutions as mentioned in How to Fix HTTP Error When Uploading Images? and still no luck getting this working. Using `Dashboard -> Media -> Add New -> browser uploader` instead of the multi-file uploader, results in and Internal Server error. For what ever reason, I am able to consistently upload this one random particular image over and over without ANY problems but any other image I try uploading fails... even 1kb sized images. ![media uploader success](http://i.stack.imgur.com/Z3NhL.png) I'm able to upload some images and not others. Some image uploads throw internal server errors and some don't. Some could be 1kb and some could be 5mb. Absolutely puzzling.


title: Get WP Install Directory

text: I have a theme which - I was quite proud of myself! - I designed to be installed in wp sites where wp is on root level. Then half my users installed the theme on a mysite.com* _/wordpress/_ * ! ...and it no work... So some path conversion are in order. I created a number of constants so I didn't always have to rewrite paths. Example:               //http constants     $symbiostock_template_directory = get_bloginfo('template_directory');               define('symbiostock_CLASSDIR', $symbiostock_template_directory . '/inc/classes' );      ...and more constants like this for various paths               //filepath constants      $symbiostock_theme_root = get_theme_root() . '/symbiostock';     define('symbiostock_STOCKDIR', $_SERVER['DOCUMENT_ROOT'] . '/symbiostock_rf/' );      ...and more constants like this for various paths define('symbiostock_STOCKDIR', $_SERVER['DOCUMENT_ROOT'] . '/symbiostock_rf/' ); These should work, right? Is there a nice universal way to get wordpress operating from any level? A "best practice" tutorial out tehre?


title: Automatically generate custom post title based on meta

text: I'm working with custom post types to create a custom "product review" type. I'm customizing the UI to have fields for the "Reviewer", "Product", and their "Review". This doesn't really require a post title though, so I've removed that field. This is all working fine, but when I go to look at all Product Reveiws, the titles are completely unhelpful (Auto Draft, Auto Draft 2, etc.). What I want to do is automatically set the post title to be a combination of the Reviewer's name and the product they reviewed; something along the lines of "John Smith, Car Radio". I have a function that hooks into the save_post action, and updates the custom meta fields I have set. I figure I need to add something here to accomplish what I'm trying to do, but I'm not sure what function or process this requires. Thanks in advance!


title: Display one category and its suncategories

text:
I am using this code to filter posts. How can I modify to display only one category and its subcategories. Not all categories.               <form action="<?php bloginfo('url'); ?>/" method="get">     <?php     $select = wp_dropdown_categories('show_option_none=Select category&show_count=1&orderby=name&echo=0');     $select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);     echo $select;     ?>
<input type="submit" value="View" />
     </form>


title: How do I remove RSS feeds from themes?

text: How do I remove RSS feeds from being listed in the HTML source? Like I want to remove the following:               <link rel="alternate" type="application/rss+xml" href="foo.com">      I don't want to remove the RSS feeds by any means, just the automatic output in the theme.


title: Displaying a message upon user registration

text: I have a question that I hope will be pretty simple for some of the WordPress Gurus out there. I have a WordPress network and whenever a users signs up, I would like to show (on signup confirmation page) a message that shows the code:               <script type="text/javascript" src="http://mysite.com/js/redirection-mobile.js"></script>          <script type="text/javascript">          SA.redirection_mobile ({nmobile_url :     "USERURL.mysite.com", });          </script>      **Note** that I am trying to display the user's URL that they just signed up with in the message. Does anybody know how to do that without modifying any of the WordPress core? Let me know if this is a little too vague, or if you need any more information. Thanks, Keenan


title: Paginate yearly archives for a custom post type

text: Here's the code I'm using to create yearly archives for a custom post type:               function myquery_custom_post_rewrite( $rewrite_rules ) {       $myqueryslug = 'customposttype';       $month_archive = array( $myqueryslug . '/([0-9]{4})/?$' => 'index.php?year=' . $wp_rewrite->preg_index(1) . '&post_type=' . $myqueryslug . '&paged=' . $wp_rewrite->preg_index(3));       $rewrite_rules = $month_archive + $rewrite_rules;       return $rewrite_rules;     }     add_filter('rewrite_rules_array', 'myquery_custom_post_rewrite');      This works okay, except for the pagination. Trying to get to page 2 or any page other than 1 always shows a 404 page. Here's the URL I'm trying to use to get to pages other than 1:               http://mysite.com/customposttype/year/page/2      With the slug for my custom post type for customposttype and a year, like 2012, for year. What am I doing wrong? ============================= UPDATE: I got it working! Just in case anyone else needs it, here's the code that got it working:               function myquery_custom_post_rewrite( $rewrite_rules ) {       $pagination_base = $GLOBALS['wp_rewrite']->pagination_base;       $myqueryslug = 'customposttype';            $year_archive = array(         $myqueryslug . '/([0-9]{4})/' . $pagination_base . '/?([0-9]{1,})/?$' => 'index.php?post_type=' . $myqueryslug . '&year=$matches[1]&paged=$matches[2]',         $myqueryslug . '/([0-9]{4})/?$' => 'index.php?post_type=' . $myqueryslug . '&year=$matches[1]',       );       $rewrite_rules = $year_archive + $rewrite_rules;       return $rewrite_rules;     }     add_filter('rewrite_rules_array', 'myquery_custom_post_rewrite');


title: Force core to use .dev JavaScript files

text: I was wondering if there's some constant telling WordPress **not** to use the minified versions of scripts but instead load .dev ones. Already tried `define('SCRIPT_DEBUG', true);` but it only turned off script unification.


title: Custom Capabilities for CPT and Problem with current_user_can()

text: I have setup a CPT with custom capabilities.               add_action('init', 'fac_product_posttype_init');     function fac_product_posttype_init(){         $product_labels = array( ... );         $caps = array(                 'publish_posts' => 'publish_products',                 'edit_posts' => 'edit_products',                 'delete_posts' => 'delete_products',                 'edit_published_posts' => 'edit_published_products',                 'delete_published_posts' => 'delete_published_products',                 'delete_others_posts' => 'delete_others_products',                 'edit_others_posts' => 'edit_others_products',                 'edit_post' => 'edit_product',                 'delete_post' => 'delete_product',                 'read_post' => 'read_product',                 'upload_files' => 'upload_files'             );         $args = array(             'labels' => $product_labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,              'query_var' => true,             'rewrite' => true,             'capability_type' => 'product',             'capabilities' => $caps,             'hierarchical' => false,             'supports' => array('title','editor','thumbnail'),             'has_archive' => 'products',             'menu_position' => 5,              'show_in_nav_menus' => false         );          register_post_type('product',$args);     }      Then assigned those capabilities to `administrator` and `subscriber`               function fs_add_roles(){         $roles_set = get_option('fs_roles_are_set');         //if(!$roles_set){              $admin = get_role('administrator');         $admin->add_cap('publish_products');         $admin->add_cap('edit_products');         $admin->add_cap('delete_products');         $admin->add_cap('edit_published_products');         $admin->add_cap('delete_published_products');         $admin->add_cap('edit_others_products');         $admin->add_cap('delete_others_products');              //update_option('fs_roles_are_set', true);              $subscriber = get_role('subscriber');         $subscriber->add_cap('publish_products');         $subscriber->add_cap('edit_products');         $subscriber->add_cap('delete_products');         $subscriber->add_cap('edit_published_products');         $subscriber->add_cap('delete_published_products');         //}     }     add_action('init', 'fs_add_roles');      All good upto this point and I can see on `$wp_roles` global array that all those custom caps are set `true` for `administrator` and `subscriber`. **BUT** when I call `current_user_can('delete_product', $post_id);` it returns `false`. I have double checked the $post_id. Its created by the `$current_user` I am trying to figure out the problem for hours. But not sure whats going on. Any advice on troubleshooting is greatly appreciated!


title: wordpress 3.4.2 + wp_nav_menu + chunk theme not working

text: I'm trying to create a page for each of the categories i got in my blog and it should appear on the menu i got in Chunk theme. the idea is to have a link to each of the categories which would guide you to something like this 'http://blog.direktio.com/category/business-intelligence/' so I found out that wp_nav_menu is the one that creates the menus, and that it has a parameter named `'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>'` which allows me to add other stuff to the wrapping of the menu created by the function.. so te idea is to do something like this: `<?php wp_nav_menu( array( 'theme_location' => 'primary', 'items_wrap' => 'sssssss %3$s' ) ); ?>` so I would get a menu with some 'sssss' and then the usual list items.... but hey... it doesn't show 'sssss' at all... so the question here is why is this parameter `items_wrap` not working according to documentation thanks in advance for any help edit: as requested here is a link to the theme in question, hadn't include that since it is one of the default themes anyway... i don't think there is a real problem with the them per se, im reading wp_nav_menu docs (more) thouroughly now edit2: found an answer.... lemme write it!


title: How to access variables in the function where apply_filters() is called?

text: I am trying to filter some data based on whether a variable from within the function that calls `apply_filters()` is equal to specific value. That variable is not passed to the `apply_filters()` parameters. This might explain what I mean:               // function in wordpress core     function get_var_b() {         // generating $var_a         $var_a = "a";         // some code ...         $var_b = apply_filters('get_var_b', $var_b);         return $bar_b;     }          // in functions.php     add_filter('get_var_b', 'filter_var_b');     function filter_var_b($var_b) {         if ($var_a == "c") {             $var_b = "d";         }         return $var_b;     }      I tried to use `global $var_a;` inside of my function but with no success. The only way I could access `$var_a` was by editing the core file and passing `$var_a` to the `apply_filters()` function like:               apply_filters('get_var_b', $var_b, $var_a);      Is there a way to access this variable without editing the core file or trying to regenerate $var_a from scratch? Thanks. **EDIT:** The filter that I am trying to hook to is `dynamic_sidebar_params` which is called from `dynamic_sidebar()` function in `wp-includes/widgets.php` file. I am trying to change the `$params[0]['before_widget']` from `<aside>` to `<nav>` IF the `$id` was equal to `categories-2`.


title: Securing Admin Accounts - Username Discovery

text: We've had Limit Login Attempts installed for some weeks now, and the number of brute force attempts occurring on wp-admin/wp-login is pretty amazing. At first the attempts were all with the username "Admin," which doesn't exist on our site, so I considered it an annoyance but not much of a threat. However, now we're seeing lockouts occurring with other named admin user accounts and I'm completely at a loss of understanding for how the attackers are deducing the usernames of these accounts. No content on our site is authored by anyone in particular and I can't find any other location on our site where these usernames are publicly published. Any idea as to how usernames might be discoverable?


title: Get the ID of the current post's child category

text: A client of mine wants to create a simple "related posts" loop that shows 6 of the most recent posts that match the current post's category. The issue is that every one of their posts have the same parent category and then are organised using children of that category so simply using `get_the_category` as I have been doing isn't going to work as they all share the same parent. So, my question is, is there a way that I can get the ID of the current post's lowest tier child category, but ignore it's parent(s)? So for example if you're viewing a post that has the following category structure;               - Parent Category         - First Child Category             - Second Child Category      How could I get the ID of JUST the `Second Child Category` while ignorning it's parents?


title: Wordpress add_options_page() function not considering role

text: I am new to WordPress plugin development and i am stuck at why the wordpress function `add_options_page()` is not accepting role. This is my code which is not working               add_action('admin_menu', 'ct_admin_settings_page');     function ct_admin_settings_page()     {         add_options_page(             'CT Settings',             'CT Settings',             'Administrator',             'ct_admin_settings',             'ct_admin_settings_page'         );     }      but if i try the following, the menu appears (changing **Administrator** to **manage_options** ),               add_action('admin_menu', 'ct_admin_settings_page');     function ct_admin_settings_page()     {         add_options_page(             'CT Settings',             'CT Settings',             'manage_options',             'ct_admin_settings',             'ct_admin_settings_page'         );     }      It is my understanding that the third parameter in function `add_options_page` is ROLE so why Administrator which is a ROLE not being accepted?


title: How to limit number of attachments

text:
I'm using Sweet Cake theme. As you can see the portfolio section show all pictures. I want when someone load the site to be displayed items of the first category , instead of everything. How can I do that?               <?php if($data['anchor_portfolio'] == 1){ ?>

             <a href="<?php echo $data['anchortoplink_portfolio']; ?>"><img class="anchortop" alt="" src="<?php if($data['anchortopimage_portfolio']): ?><?php echo $data['anchortopimage_portfolio']; ?><?php else: ?><?php echo get_template_directory_uri(); ?>/img/anchors/topportfolio.png<?php endif; ?>" />             <a href="<?php echo $data['anchorbottomlink_portfolio']; ?>"><img class="anchorbottom" alt="" src="<?php if($data['anchorbottomimage_portfolio']): ?><?php echo $data['anchorbottomimage_portfolio']; ?><?php else: ?><?php echo get_template_directory_uri(); ?>/img/anchors/bottomportfolio.png<?php endif; ?>" />

               <?php } ?>
                       <div class="grid_12 titlesection <?php if ($data['introeffect_portfolio'] == 1): echo $data['animation_portfolio']; endif ?>">
<?php echo do_shortcode(stripslashes($data['title_portfolio'])); ?>

Show all
                                               <?php                     $args=array(                         'type' => 'attachment',                         'child_of'                 => 0,                         'orderby'                  => 'name',                         'order'                    => 'ASC',                         'hide_empty'               => 0,                         'hierarchical'             => 1,                         'post_status'              => 'inherit',                         'taxonomy'                 => 'portfolio'                     );                     $categories=get_categories($args);                          foreach($categories as $category) { ?>
<a style="background-color:<?php echo $category->description; ?>;" href="#filter" data-option-value=".<?php echo $category->slug; ?>"><?php echo $category->name ?>
                     <?php } ?>

                  <?php             foreach($categories as $category) {                 $args = array(                     'post_type' => 'attachment',                     'posts_per_page' => -1,                     'post_status' => 'inherit',                     'tax_query' => array(                         array(                             'taxonomy' => 'portfolio',                             'field' => 'slug',                             'terms' => $category -> slug                         )                     )                 );                           $attachments = get_posts($args);                 if ($attachments) {                     foreach ( $attachments as $attachment ) { ?>                              <?php                         $id = $attachment->ID;                         $big_image = wp_get_attachment_image_src($id, '');                         $thumb_image = wp_get_attachment_image_src($id, 'portfolio-thumbnail');                         $alt = get_post_meta($id, '_wp_attachment_image_alt', true);                         $image_title = $attachment->post_title;                         $caption = $attachment->post_excerpt;                         $description = str_replace('"', '\'',$attachment->post_content);                         ?>                                                       <div class="element <?php echo $category -> slug; ?>" data-category="<?php echo $category -> slug; ?>">                                                               <?php if (!empty($alt)) { ?>                                 <a href="<?php echo $alt; ?>">                             <?php } else { ?>                                 <a class="alttooltip" title="<?php echo $description; ?>" data-rel="prettyPhoto[]" href="<?php echo $big_image[0]; ?>">                              <?php } ?>                                                                   <img alt="<?php echo $alt; ?>" class="imgwork" src="<?php echo $thumb_image[0]; ?>" />
                                 <img alt="" src="<?php echo get_template_directory_uri(); ?>/img/section-works/arrow.png" />

<?php echo $image_title; ?>

<?php echo $caption; ?>

                                                   <?php } ?>                 <?php } ?>             <?php } ?>

              This is the code from portfolio.php. It displays "Show all", all other categories and all attachments. As you can see the section _Start Options_ is calling all categories + Show All button. After that is the section _Start images_ where are displayed all images for the current category. I don't know how to get rid off "Show all" and display only first category.


title: Using XML RPC to import data into WordPress

text: I've been asked to create a website in WordPress that should display many phone operators/agents who can be called from a given phone number on the website. So far so good but the website should also display to status of the agents status (available, away, busy etc) in realtime. The agents use external software for this and the data to show their availability is available through XML RPC. En example of a response can be seen below               <?xml version="1.0"?>       <methodResponse>       <params>         <param>         <value>          <struct>               <member>           <name>param1</name>           <value><string>value1</string></value>         </member>              <member>          <name>param2</name>          <value><string>value2</string></value>         </member>            </struct>       </value>      </param>           </params>      </methodResponse>      Is this even possible as I can't hardly find any information about importing non-WordPress data with XML RPC. The information that I've found is either outdated or really unclear and confusing to me. If anyone know if it is possible to display the received data/status into a (custom) post type in WordPress please let me know. Or if anyone has more information about this please let me know.


title: Permalinks URL not working without index.php

text: we've just transferred a WordPress site to its domain. The Permalinks settings all have an `index.php` at the end. This results into URLs such as `http://[domain].com/about` not working but `http://[domain].com/index.php/about` works. **Screenshot:** ![enter image description here](http://i.stack.imgur.com/C6GeS.jpg) I've tried setting it to Default and set a Custom Structure as `/%postname%/` but this did not change anything. Maybe it's something to do with the htaccess or config? This is what I have in the htaccess, which seems to be correct               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      Thanks in advance for any help.


title: How to hide a customization link themes menu in wordpress?

text: Anyone know how to hide or remove customization menu in wordpress? The link menu seen in OPTIONS:Widgets Menus **_Theme Options_** and Appearance -Theme -Widgets -Menus _**-Theme Option_** -Editor Thank you