title: design and development workflow

text: We're developing a set of websites, complex ones with a lot in common, and the company have decided to use WP as a base CMS. As in every site, there is a design process, followed by HTML, then development/CMS integration. However, I'm wondering how would that work with WP? Do companies design all templates, then HTML, and then theme and CMS development, or do they finish the CMS development (which in this case a layer of custom plugins extending WP), then create individual themes that works on it? As time is crucial and many people are involved -which raises the cost- , I would want to raise efficiency of the team and make design and dev teams work in parallel. Any idea of what the sequence should be are appreciated. By the way, we have common features amongst the sites and then we have site- specific features, which you can think of as theme specific features


title: Photography Based Design - Multiple Images Per Post

text: I'm thinking of using WordPress for my new website.   It's a photography based website and the client will be uploading groups of photographs primarily. They'll want to give it a title and upload up to 20 photographs. Is this possible through WordPress?   To get rid of content in the form of text and instead, opt to upload a series of Photographs? I'm capable in WordPress, but I've not modified it much beyond vanilla previously, has anyone been able to achieve something similar?


title: Automattic's eCommerce Plugin

text: ## Question Does anyone know what plugin Automattic uses for their eCommerce functionality in the MU installation of WordPress located on the free sub-domains at wordpress.com? Please share where it is available, or if it even is available. I suspect that it might be proprietary, but if not, I like to try and follow Automattics lead when developing my own WP sites to ensure better long-term stability. * * * ## More Plugin Details If you have a wordpress.com account, you'll find the admin panel for the plugin here: `{YOUR_USER_NAME}.wordpress.com/wp-admin/paid-upgrades.php`. These two related resources are pulled from the wordpress.com source code:   1. /wp-admin/css/store-bundles.css   2. /wp-content/admin-plugins/wpcom-billing/images/WPCOM-Billing-Paypal-Direct.png There are also multiple references to the plugin in this .pot file... open the link in your browser and do an on-page find for: `wpcom-billing`. Based on the above evidence, it appears that this eCommerce plugin resides in a directory called: **wp-content/admin-plugins/wpcom-billing** , but I'm also wondering if this could just be a modified version of the wp-ecommerce plugin.


title: One WordPress and database but multiple subdomains

text: I want to create a multiple subdomains, but using only one wordpress and database installation. The difference of those subdomain sites are the colors and the blogs, but in terms of functionalities, layout, plugins, they are just the same. Is this possible, or can I only go with the ratio 1 is to 1 (1 wordpress for 1 subdomain)?


title: Form request to page in admin panel

text: I'm current creating a small WordPress plugin for personal use and i have a problem with making forms working. Since i found some problems using the same page with refresh i created another php page where will be execute the code then i use `admin_url` to go back to the previous admin page with the result of the action. My problem is that i'm unable to send the request to the page since my form code will look for the file `submitedit.php` in `wp-admin` and not in the plugin directory. If i try to use my constant `PLUGIN_DIR` i get the full path to the plugin but Chrome will report an error               Not allowed to load local resource: file:///D:/xampp/htdocs/wordpress/wp-content/plugins/post-manager/submitedit.php      I noticed some plugins uses my same code `action="url"` but they work fine Except that they some hidden fields               <input type="hidden" name="_wp_http_referer" value="/wp-admin/options-general.php?page=crayon_settings&settings-updated=true">     <input type="hidden" id="_wpnonce" name="_wpnonce" value="6cbd343800">      My form html is:               <form action="submitedit.php" method="POST">      but when i submit it give 404 error since, as i said, it search the file in `wp-admin`.               http://localhost:90/wordpress/wp-admin/submitedit.php      How can i fix it? I don't find any thing online and i'm very new with WordPress plugins so i don't know if i'm doing something wrong.


title: Looking for Functions File that doesn't Exist

text: My WordPress site seems to be running fine, except that trying to go to the plugins page gives the following error:               Fatal error: Cannot redeclare _verifyactivate_widgets() (previously declared in .../public_html/wp-content/themes/news-child/functions.php:75) in .../public_html/wp-content/themes/news/functions.php on line 452      Deleting the theme so that WP reverts to the orignal does not help, it keeps trying to go to that functions.php. I cannot deactivate the plugins either (since the page is inaccessible). Ideas on what the cause/fix is?


title: Changing WP_CONTENT_DIR and WP_CONTENT_URL in wp-config.php does not register?

text: I tried to add this to the end of my wp-config.php               define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/somedir');     define('WP_CONTENT_URL', 'http://example.com/somedir');      however, echo immediately after that shows the old values (with wp-content value). I tried echo because in wp admin I couldn't see the theme from new location, of course. I have installed wp in example.com/wp subdirectory and site itself is example.com - I copied over .htaccess and index.php over to the root and everything is working fine, I just need to move wp-content into another folder over at root also with a different name.


title: Custom Wordpress Taxonomy problems

text: I have a problem on my site which is www.sultnedyr.dk . There in the menus there are links like HUndefodder , kattefoddr and kattegorier. Under Hundefodder when you click on cateogory ,it doesnt show the subcategory else the other two menus show. Hundefodder is the custom taxonomy i created. Any help will be appreciated. Thanks


title: Get only the top level categories using get_categories() without foreach loop

text:
Very simple Question: Here is my `get_categories()` code:               <?php $args = array(                             'show_option_all'   => '',                             'show_option_none'  => '',                             'orderby'           => 'ID',                             'order'             => 'ASC',                             'show_count'        => 0,                             'hide_empty'        => 0,                             'exclude'           => '1',                             'hierarchical'      => 0,                             'depth'             => 1,                             'number'            => 12                             );                         ?>          <?php $categories = get_categories( $args ); ?>

                                 <?php for( $i=0; $i<4; $i++ ) {                                     echo "
" . $categories[$i]->{'name'} . "
";                                 } ?>

                                 <?php for( $i=4; $i<8; $i++ ) {                                     echo "
" . $categories[$i]->{'name'} . "
";                                 } ?>

                                 <?php for( $i=8; $i<12; $i++ ) {                                     echo "
" . $categories[$i]->{'name'} . "
";                                 } ?>

      After a long search I got the way how to get into the stdClass object without foreach loop and I want to proceed with this way. But I want only the top level categories, no subcats. How can I modify the argument here?


title: Different image and background color depending on page type

text:
Here is the HTML/PHP and CSS code for a part of my page **HTML/PHP**               <?php     $product_pages_args = array(         'meta_key' => '_wp_page_template',         'meta_value' => 'page_library_html_content.php',         'hierarchical' => '0'     );     $product_pages = get_pages( $product_pages_args );     ?>          <?php     foreach ( $product_pages as $product_page ) {         $author_id =  get_post_field('post_author', $product_page->ID );         $author_details = get_user_by( 'id', $author_id );         $author_name = $author_details->first_name . ' ' . $author_details->last_name;                echo '

';         echo '
ID ) . '">' . $product_page->post_title  . '
';         echo '
' . get_post_field('post_content', $product_page->ID ) . '
';          echo '
Tutorial Instructor:  ' . $author_name . '
';         echo '
' . get_avatar( $author_id , 32 ) . '

';;      **CSS**               #posts {     float: left;     width: 48%;     background-color: #FFF;     height: 300px;     margin-left: 20px;     margin-top:20px;     -webkit-border-radius: 5px;     -moz-border-radius: 5px;     border-radius: 5px;     }     #posts:before {     content: "";     position: absolute;     z-index: 2;     top: 0;     right: 0;     bottom: 0px;     left: 60%;     background-image: url(http://localhost/wordpress/wp-content/themes/Techyoucation%202014%20Wordpress%20Theme/images/html.png);     background-repeat: no-repeat;     background-position: center;     background-color: #39ADD1;     -webkit-border-top-right-radius: 5px;     -webkit-border-bottom-right-radius: 5px;     -moz-border-radius-topright: 5px;     -moz-border-radius-bottomright: 5px;     border-top-right-radius: 5px;     border-bottom-right-radius: 5px;     }      Now with this code you can see that there is a box with the post tile and content (only post's with page type (page_library_html_content.php)) What I would like to do is show only the posts with the page type: page_library_html_content.php page_library_css_content.php page_library_wordpress_content.php and the background image in               #posts:before      will change depending on the page type of the page and the background color will change too. Is this possible and how. Thanks


title: How to add a class to the comment submit button?

text: How do I add a class to the comment submit button? The simplified function `comment_form(array('id_submit'=>'buttonPro'));` obviously only changes the id and `class_submit` does not seem to exist. I have read through both Otto's and Beau's writeups but to no avail.


title: Custom Permalinks for Custom post Type Archives?

text: I know that WP 3.1 has added support for archives for custom post types but is there any way to customize the permalinks for them?


title: bbpress Not Showing: How to troubleshoot?

text: BBPress isn't showing on the front-end in a custom theme I've built and I can't figure it out. I activated TwentyTwelve and it shows, so I know it's not a plugin. I also cleared out functions.php and that didn't have any impact. How do I begin troubleshooting from here?


title: Breaking up the results of a loop

text:
In my query, I'm gathering 6 posts and displaying them into an unordered list. Here's the code I'm using:               $args = array(         'post_parent' => $page_id->ID,         'showposts' => 6,         'post_type' => 'page',         'orderby' => 'menu_order',         'order' => 'ASC'     );     $subpages = new WP_query($args);          if ($subpages->have_posts()) :         while ($subpages->have_posts()) : $subpages->the_post();             $output .= '
post_name.'-link">
post_name.'-info">
post_name.'-img">'.get_the_post_thumbnail($page->ID,'icons').'

'.get_the_title().'

post_name.'-excerpt">'.get_the_excerpt().'

';         endwhile;     endif;      I'd like to breakup the and show three posts, then insert a different div, then continue the loop. The html outcome would look similar to:

Post1

Post2

Post3

Some text goes here

Post4

Post5

Post6

      **EDIT** I got this working with the suggestions from @Rarst. Here's my updated code:                   $args = array(             'post_parent' => $page_id->ID,             'showposts' => 6,             'post_type' => 'page',             'orderby' => 'menu_order',             'order' => 'ASC'         );         $subpages = new WP_query($args);              if ($subpages->have_posts()) :             while ($subpages->have_posts()) : $subpages->the_post();                 $output .= '
post_name.'-link">
post_name.'-info">
post_name.'-img">'.get_the_post_thumbnail($page->ID,'icons').'

'.get_the_title().'

post_name.'-excerpt">'.get_the_excerpt().'

';                 if (2 == $subpages->current_post):                         $output .= '
';                         $output .= 'test';                         $output .= '
post_name.'">';                 endif;             endwhile;         endif;


title: Main timeline in a different path

text: I have a home.php file which I am using as my home page and it is showing a specific page. In my index.php I have my main timeline. But when I access this page I get redirected to home.php. How can I do that? To show my main timeline in a differente path then home. Something like mysite.com/blog


title: User profiles and object associations

text: I'm coming over from Drupal and I'm very used to the way Drupal handles users and objects (called nodes over there.) I have to learn how WordPress handles these same situations. Since we're going to be confused with the same words that mean different things, I will define some of them here:   * **Node** - In Drupal, everything is a node. A post is a node. A page is a node. A product is a node.   * **Author** - In Drupal, every node has an author. Think of the WordPress post author.   * **Product** - In Drupal, a product is a node. On my site, I sell books. So a book is a product which is a node.   * **Book Author** - In the normal sense, a book's author is the person who wrote it. I'm going to refer to this as book-author from now on to avoid confusion with node author. Every book-author is a user on the site. On my site, since every node needs an author, when I create the products I associate the author of the node with the book-author. Imagine creating a post on WordPress and saying the post author is someone other than yourself. Same thing. On the user's profile page (the book-author's profile) I can list the books they have written (with links to the actual product node) on their profile page. I simply have a section where I render each product where they are the node author. Now I need to learn the way WordPress handles this situation whether via a plugin or code in the `functions.php`. So far I've been reading up on the user profiles and they aren't near the same as Drupal.   1. How do I associate a user as a book-author? I assume this will be some kind of custom role in WordPress; however, I've been reading up on that and it seems the roles in WordPress are related only to posting permissions and the like.   2. How do I associate a user (book-author) to a product? I'm using the WooCommerce plugin. I know I can create a custom field on the product, call it Author, and then put a name in there but this will just render as simple text. I need to associate this field as a link to the user (book-author) profile and be able to associate this product on the user's profile.   3. Is the user profile even the appropriate way to handle this in WordPress? Or should I be looking into some other kind of template? Perhaps a custom post type that has a block of code in the template that will render a listing of products based on the post's title (used here as the author name) or something like that? If that's a good way to do it, how then do I associate links back to this custom post page? i.e. when clicking a user's name in a comment it should now go to that associated custom post instead of the user profile. Sorry if all of this is confusing. It's out of the box behavior in Drupal and since this is literally my second week using WordPress it's all a bit confusing to me as well. **NOTE:** an admin should create a Drupal tag. Doing a quick search I find many posts in relation to Drupal here and it may better assist users who are familiar with both platforms find questions they can expertly answer. ;-)


title: Custom options page, add_options_page deprecated?

text: I'm trying to create a page in my theme to allow users to add generic info (phone numbers etc) I followed a tutorial and thought I had something good but it turns out part of it is deprecated. So what's the best way?               function site_options_menu() {         add_options_page( 'Company Info', 'Company Info', 'manage_options', 'company-info-options', 'site_options_options' );               function site_options_options() {...}      Here is my full function which included all the fields I am trying to store (14 fields in total) http://pastebin.com/dV9bfsXh The page and fields show OK but trying to save the page settings results in: > Notice: options.php was called with an argument that is deprecated since > version 2.7! > > Warning: Cannot modify header information - headers already sent by ...


title: Insert dynamic content into posts

text: I'm currently using this plugin http://wordpress.org/extend/plugins/automatic- featured-image-posts/ which creates batches of posts from uploaded images I'm also using this code here to generate the default content for every new post               add_filter( 'afip_new_post_content', 'diww_default_post_content' );     function diww_default_post_content() {       $content = "<iframe src=></iframe>";       return $content;     }      Now I have a php array of URL's which I want to insert into the src for each post. Is it possible via some loop or sequential manner insert each URL into each post sequentially? e.g.   * URL[0] -> Post[0]   * URL[1] -> Post[1]   * URL[2] -> Post[2] and so on.


title: Display Child Term if it exists

text: I have a page that lists all the members of my band. The members are categorized into 'sections'. There are a few child sections, and I'd like to display the child section (if it exists) for each member. For example: Trumpets Trombones Drumline   * Snare   * Tenors I'd like each member that is a "snare" or "Tenors" to list this sub-section. This is the code I'm using:                <?php           // grab terms of current post, replace taxonomy name     $terms = get_the_terms($post->ID, 'section', $args);     // define arguments of following listing function     $args = array (         'child_of' => 5, // current post's (first) category          'title_li' => '', // disable display of outer list item          'taxonomy' => 'section' // replace as well     );     // list child categories     foreach ($terms as $term) {         echo $term->name;     };                           ?>      If there is a child section, it lists the parent AND child section, instead of only the child section. Also, it lists the parent section if no child exists. Any ideas on how to only list a child section, if it exists?


title: Create a comments template for custom post types

text: Is it possible to create a comment template for custom post types? I want the wording for comments on a custom post type to be different for wording on a regular wordpress post. I tried comments-posttype.php but that didn't seem to work.


title: Display custom taxonomy for product

text: I have to display custom taxonomy for every product which is i have selected for every product from back end. I have created custom taxonomy `city` in that custom taxonomy i have added the `Nashik ,Mumbai` city. In product page i have assigned custom taxonomy city `Nashik` to that product that assigned city `Nashik` i have to display at product page. i have tried out with bellow code but it's displaying the all city list like `Mumbai` `Nashik` here i have to display specific city name for product.               wp_tag_cloud( array( 'taxonomy' => 'city', format => 'list' ) );


title: Rewrite Custom Fields url

text: I use custom fields named 'url' to add another website url (like `http://www.youtube.com`), I want to rewrite the 'url' as `http://www.mysite.com/go/123`. I tried all rewrite plugins, no one could do this. Can I set post id as 123? Or can I set a random number as it?


title: Query Custom Post Type by Taxonomy

text:
I've created a query working fine pulling posts from a specific taxonomy—but before I had only 7 taxonomies that were permanent, now I have sub taxonomies under that main taxonomy and they will be dynamic. Any ideas of how I might be able to write this but have a for-each loop going through this query for any taxonomy that is a child of the main taxonomy (in this example the parent taxonomy is 'Cameras') So again: I have 7 parent taxonomies ('Cameras' is one) and each one has a dynamic amount of sub taxonomies, i'm trying to create a for each loop that will allow me to do the following without writing the query for each specific sub-taxonomy. Thanks
Cameras

     <?  $args = array(                                     'post_type'=> 'rental_gear',                                     'type'    => 'cameras',                                     'order'    => 'ASC',                                     'posts_per_page' => '-1'                                     );                                                    $the_query = new WP_Query( $args );                                 if($the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();                                       ?>
<a href="<? the_permalink(); ?>">› <? the_title(); ?>
                                   <?php endwhile; endif; wp_reset_postdata(); ?>


title: Querying multiple meta_keys in Wordpress SQL query

text: Here's my Query... I'm looking to narrow this query down to users of one specific role ("meta_key = 'wp_capabilities' AND meta_value = 'employee'")...how do I add that additional conditional to this string?               $get_users = "SELECT * FROM $wpdb->users     WHERE ID = ANY (     SELECT user_id FROM $wpdb->usermeta     WHERE meta_key = '$meta_key'     AND meta_value LIKE '%$search%'     ) ORDER BY user_nicename ASC LIMIT 10000";      Thanks in advance...


title: delete a photo tag in rtmedia

text: I am using rtmedia photo tag in my website. When deleting a user I am also trying to delete all the photo tags added by him on the albums of other users. How can I do that?. Is there any functions available or should I write a custom one for that?


title: What's a good way to put authors into groups

text: I have 7 companies contributing to one blog, and each company has 3 authors. I'd like to show all posts by all authors of one company. Is that possible?


title: Plugin SVN & update API - how are plugins identified?

text: One thing that's never been clear to me (especially since I haven't submitted a plugin to the repository) is how a plugin's unique "ID" (slug) is generated (i.e. this list).   1. Is it a choice by the author at the point of SVN submission, or by a moderator?    2. Is it the sanitized plugin name (title)?   3. Is it the `plugin_basename`?   4. Is it the main plugin file (without the directory name)?   5. Something else? I'm curious as to which attribute(s) of a plugin **link it to it's SVN counterpart** (if it has one) for the plugin update API? I ask, partly out of my nature to want to know, but also how to ensure (to some degree), my own one-off plugins won't clash with one in the SVN. For example, if it was only **3)** , I could use a highly unique directory name, but keep my plugin name (title) short 'n sweet. * * * **N.B.** Whilst the "standard" file naming convention seems to be `[my-plugin- name]/[my-plugin-name].php`, I've become fond of `[my-plugin- name]/plugin.php`. It gives all my plugins some consistency, it's clear that it's the "bootloader" (main) file, and from a petty standpoint I hate the repetition of the directory name. This is another reason I ask the question, since **4)** would screw me over. Plus I'd like to hear your thoughts on this "standard" too :)


title: Custom table or form

text: i need a form or table plugin that can be customized to do this: For example: I am a parcel shipping company. I need some form that can be filled out with shipping info. Later, customer logs on the site to retrive information about the parcel with associated id number. Simple


title: ID for posts/blogs page

text:
I have a website which has a static front page and a blog page where all the blogs are displayed. I am using my own theme and have created some custom meta boxes that display content in a sidebar based on the return value from `$post->ID`. The interesting behaviour I am getting is that `$post->ID` gives me the ID of the first blog not the id of the blog page itself. I am using $post outside the loop and have declared it global but to no avail. I have also tried using `$wp_query->post->ID` but that gives me the ID of the last post. The relevant code is where I use $post is below this piece of code is located in footer.php:               <?php require_once('wp-content/plugins/markdown.php'); ?>                      <?php                 global $post;                 $leftSidebar = get_post_meta( $post->ID, '_my_meta', true );                 // Convert markdown to HTML and then convert smilies                 if ( isset( $leftSidebar['leftContent'] ) ) {                     echo convert_smilies( markdown( $leftSidebar['leftContent'] ) );                 }             ?>               The code that is used for the loop is below and is placed in index.php:               get_header(); ?>          <?php if (have_posts()) : ?>         <?php while (have_posts()) : the_post(); ?>         <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

<?php the_time(get_option( 'date_format' )); ?>
                          <?php the_excerpt(); ?>
Posted in: <?php the_category(', '); ?>

Tags: <?php the_tags(); ?>

        <?php endwhile; ?>     <?php else : ?>

Not Found

Sorry, but you are looking for something that is not available

     <?php endif; ?>      Please do let me know if any further information is required. If there is a way to find the ID of the blog page programatically and make the blog page recognize itself as the blog page and not the first post that would solve me problem I think. Thanks in advance.


title: Removing Automatic Redirects Without Plugin

text: I've been working on a wordpress site and run into the automatic redirect feature when you change a slug. On the current site I am using the Redirects plugin, and was able to modify the redirects so that I could reuse slugs that had been altered without getting the infinite loop problem. My company has a similar wordpress site that is not using the Redirects plugin. I am curious to know how I would be able to remove a redirect from a slug that WordPress has put into place without installing Redirects. From my understanding, it's in the database somewhere, but I'm not sure where to look.


title: Credit link that if removed stops site from working

text: Im trying add a credit link to the footer of all the WP sites i make saying: _Designed by ..._ While this is simple enough, i want to code it so that if this link is removed from the footer, the entire site shows an error or doesn't load up etc. Any one have ideas?


title: Exclude from search all custom posts which are NOT in a taxonomy term

text: I have a custom post with a taxonomy associated to it. That taxonomy only has one term, and posts either belong to it or not, in a boolean fashion. On the search results, I wish to show the custom posts that belong to the taxonomy, and not show the ones that don't belong. I've thought of two ways of accomplishing this, but I'm not sure which one is the best:   * include only custom posts that belong to the taxonomy term;   * exclude all custom posts that don't belong to the taxonomy term. I've managed to do the exact opposite from what I want, with the following code:               global $query_string;     $query_args = explode("&", $query_string);     $search_query = array();     foreach($query_args as $key => $string) {         $query_split = explode("=", $string);         $search_query[$query_split[0]] = urldecode($query_split[1]);     }          $custom_query = array();     $custom_query['tax_query'][] = array( 'taxonomy' => 'tax-whatever', 'terms' => array('term-whatever'), 'field' => 'slug', 'operator' => 'NOT IN' );     $args = array_merge( $wp_query->query, $custom_query );     query_posts( $args );          $search = new WP_Query($search_query);      This, of course, outputs all the custom posts which are NOT IN the term- whatever. How can I accomplish the exact opposite? **EDIT** I will try to explain my problem a bit better. Let's use an example. Imagine I have a taxonomy which is called "Selected" and **only one** taxonomy term called "Yes" that users can choose with a checkbox. I suppose I should have used two checkboxes ("Yes" and "No"), but I thought it didn't make much sense at the time. When users search for something in the website, all pages, posts and custom posts appear in the results. The only thing I want to remove from the search results are the custom posts **that are not associated** with the taxonomy term "Yes", leaving all the rest like it is. This means I want to output all pages, posts and "Yes" custom posts. Any ideas how I can achieve this? Thanks. **UPDATE** Here's an idea I had: Is there any way I can make two queries and merge the results?   * One query with all the posts and pages except the custom post (`'exclude_from_search' => true`);   * Other query with only the custom posts that match the taxonomy term (`$custom_query['tax_query'][] = array( 'taxonomy' => 'tax-whatever', 'terms' => array('term-whatever'), 'field' => 'slug', 'operator' => 'IN' );`). However, if I use something like:               $mergedposts = array_merge( $wp_query->query, $custom_query );     query_posts( $mergedposts );      It will only show me the custom posts. I suppose I could make a direct query with SQL but I've never worked with it. Although that is something I wish to learn in the future, right now it doesn't seem like a good way to solve this kind of problem, since I won't understand what I'm doing. Right now my best option so far is create a new taxonomy term and classify all the "uncategorized" custom posts with it. However, they are a few hundreds, so it will take a while. **NEW UPDATE** I found a way to detect if a custom post belongs to a specific term in a taxonomy. This is a piece of code I picked up somewhere, since I don't have the PHP knowledge to create something like this all by myself. However, I understand what's being done and I adapted it to my situation.               function is_selected( $selected, $_post = null ) {         if ( empty( $selected ) )             return false;              if ( $_post )             $_post = get_post( $_post );         else             $_post =& $GLOBALS['post'];              if ( !$_post )             return false;              $r = is_object_in_term( $_post->ID, 'selected', $selected );              if ( is_wp_error( $r ) )             return false;              return $r;     }      This function will work correctly but only if used inside the loop. However, if I change the loop after the search query is made, it can mess up the pagination, and the number of results found will possibly be wrong. Not sure if this is a step in the right direction, but at least it's a step.


title: Minimising number of queries on a page when using Advanced Custom Fields

text: I'm currently working on a site where there is extensive use of the popular Advanced Custom Fields plugin. However, as a result the page loading time can be quite slow, especially when using the Gallery plugin. Does anyone have suggestions regarding what the best practice is with managing a large number of custom fields? In some cases I am effectively working with thousands of variables, and need to reduce the page load time from some cases around 5s. Quite an open question I know, though really it would be great to have some suggestions regarding how number of queries in a page can be minimised (such as through directly accessing values in the database perhaps rather than relying on a plugin's APIs?).


title: Undefined index notice when using the $args parameter in add_settings_field()

text: I'm using the Settings API to provide my admin-user with some options for a plugin I'm writing. I have about 30 text fields to output on the plugin options page so I have created a very general callback:               public function my_fields_callback( $args ) {              $name = esc_attr( $args['name'] );         $value = esc_attr( $args['value'] );         echo "<input type='text' name='$name' value='$value' />";          }      The part I'm having problems with is the `$args` parameter in add_settings_field(). Specifically, I'm getting the following PHP debug notice: > Notice: Undefined index: height > > Notice: Undefined index: weight Here is how I'm adding my settings field(s):               add_settings_field( 'field-1', 'Field One', array( $this, 'my_fields_callback' ), 'slug', 'section', array( 'name' => 'settings[weight]', 'value' => $settings['weight'] ) );          add_settings_field( 'field-2', 'Field Two', array( $this, 'my_fields_callback' ), 'slug', 'section', array( 'name' => 'settings[height]', 'value' => $settings['height'] ) );      Why am I getting the 'undefined index' notice and how can I avoid this? I'm trying to pinpoint what I am doing wrong.


title: Add visual editor capability to custom excerpt window?

text: The custom excerpt field (under Add New Post) only accepts html. Thus, you can't just cut and paste a segment from the Visual Editor. If you want links to appear in custom excerpt, you have to know how to create them. This doesn't work so well for users who are unfamiliar with html. Is there any way to give the same Visual Editor capabilities to the custom excerpt field? Thank you.


title: Browser loading content from Twitter in admin area?

text: I have noticed that when I am in my Dashboard and switching from main Dashboard to for example plugins, Twitter seems to be loading something. As I am located in China where Twitter is blocked, it always takes forever for my browser to realise that Twitter cannot be loaded, and thus before the page(s) finish loading. This screenshot is for going to the plugins page, but it happens everywhere in the Dashboard. ![Browser at plugin page loading something from platform.twitter.com](https://img.skitch.com/20110519-m3224n1ur5mqmkwqsjq4g4adjd.jpg) Is this normal? And can it be blocked/removed/undone?


title: Using require_once() within admin

text: In my theme directory I have the following structure: /includes/functions-custom.php   /includes/avatax/AvaTax.php   /includes/classes/gmaps.class.php I'm making a call from the functions-custom.php to include the second file within the WordPress admin using this code               require_once('avatax/AvaTax.php'); //Avalara Sales Tax API     if ( is_admin() ) {         require_once('classes/gmaps.class.php');     }      The first require applies to both the theme and to the admin. The second, obviously, only applies to the admin. However, the first require fails with the following message:               Warning: require_once(/Users/philipdowner/Sites/dms/wp-content/themes/dms/includes/avatax/classes/BatchSvc/WP_User_Search.class.php) [function.require-once]: failed to open stream: No such file or directory in /Users/philipdowner/Sites/dms/wp-content/themes/dms/includes/avatax/AvaTax.php on line 23          Fatal error: require_once() [function.require]: Failed opening required '/Users/philipdowner/Sites/dms/wp-content/themes/dms/includes/avatax/classes/BatchSvc/WP_User_Search.class.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Users/philipdowner/Sites/dms/wp-content/themes/dms/includes/avatax/AvaTax.php on line 23      I don't feel like this should be such a stumper. Perhaps I'm overlooking something obvious? I've tried preceding the file path with the constant 'TEMPLATEPATH' and using the obvious WordPress functions like               require_once(get_template_directory().'/path/to/file');      I'm developing locally on MAMP. Particularly odd is the call to the file (in the error message) '/classes/BatchSvc/WP_User_Search.class.php'. Can anyone help?


title: Alternative to WP Remote - manage multiple WP sites in a dashboard (updates, plugins...)

text: Do you know of a (possibly free) alternative to WP Remote? It would be handy to have a dashboard to manage many Wordpress installations across multiple domains. They have no privacy policy, privacy gaurantee, or terms of use in any form on their website; and I'm not keen to jump on their bandwagon if they have no 'service gaurantees'.


I am using the enqueue function to link two javascript files. I get this error `Object [object Object] has no method 'slides'` I checked and I am not loading jquery more than once. The code that is causing this error is               jQuery(document).ready(function ($) {         $('#slides').slides({             preload: true,             preloadImage: '<?php echo get_template_directory_uri(); ?>/images/loading.gif',             play: 5000,              pause: 2500,              hoverPause: true                          });       });      Example Link


title: Limit content size

text: Does anyone know how I can set a limit on the char length for posts when using the "content=yes" function? I need something like excerpt_size but for the content, not excerpt. Before someone suggests using excerpt, it strips out the formatting and line breaks so I want to use the content output function but set a limit like you can with excerpt_size. I hope that makes sense to you. I don't mind hacking the php in the plugin if someone knows what I need to change in there. Thanks in advance!


title: Show Blogroll of another WordPress site

text: I am managing a couple of WordPress sites, all hosted on the same VPS, and the client would like the homepage blogroll of `Site A`, that the own, to appear on `Site B` that the also own with the same Author attribution, preferably to link to the originating sites author as opposed to a duped author on `Site B`. I was thinking of either querying the database on `Site B` with a replica `query_posts()` query however I am having trouble reverse engineering the `query_posts()` function. Is there a way to do this for an 'external' site? NB; sites are not `multisite`. I tried that but it all dropped off and a critical plugin we need is not compatible.


title: ow to change cutsom page url of wordpress site using htaccess

text: i need help in httaccess rewrite of a wordpress site. i have url like below http://thewhiterabbit.dk/beta/steder-detail/?id=floos i want it to be like http://thewhiterabbit.dk/beta/steder-detail/floos i have developed using id=floos, now instead of redeveloping all thing i just want a rule to change the url any help will be greatly appriciated thanks.


title: the_widget() and widget's ID

text: Let's assume I have a widget that displays only its name:                   <p>              <?php echo $args['widget_id'] ?>         </p>      So when I drag & drop my widget to any sidebar it shows:               <p>          myWidget-number     </p>      The problem is I want to call this widget with a shortcode:                   (...)                 ob_start();                     the_widget(MyWidget);                 return ob_get_clean();        }              add_shortcode('myWidget_short', 'myWidget_shortcode');      And when i do [myWidget_short] it shows only               <p>     </p>      Any ideas how to call widget's ID with a shortcode?


title: Creating a plugin to sanitize comment and the url field before display only

text: I want to create a plugin to sanitize comment and mainly the url field before display only (not before adding to database), to filter the url fields and only allow displaying this field only if it contains specific data, otherwise I want to replace this url field with something safe or clear it. ( i do not want users to enter the url as "test.com" or "example.com" , i want to remove it in these cases) How can I do that, which filter do i need to add to ? EDIT: based on the selected answer, I created this plugin to reset all urls to empty strings:               <?php     /*     Plugin Name: Get rid of websites before display     */     function my_custom_remove_website( $comments ) {         foreach ($comments as $k => $comment) {             $comments[$k]->comment_author_url = "";         }         return $comments;     }     add_filter( 'comments_array', 'my_custom_remove_website' );      Please feel free to comment or answer if this plugin is not done with best practices.


title: Is it safe use wp_editor in public contact form

text: I'm going to make a contact form for my site, and i want to use WYSIWYG editor (wp_editor) in my form message field. Here is my question, is that safe use wp_editor in public though disable media button? something like this: http://i.stack.imgur.com/dpspL.jpg Thanks.


title: How to redirect non admins to homepage if trying to view mysite.com/wp-admin/?

text: I want all my users (contributors and authors too) but the admin to be redirected to the homepage if they try to view mysite.com/wp-admin/. Contributors and Authors must be able to add and edit posts as usual, along with others they've to be forced to be redirected... I've already removed the link to the dashboard... I've also tried some plugins but the one that gets closer (Remove Dashboard Access) redirects to main page but prevents the contributors and authors from adding, editing and deleting posts. Thanks!


title: WordPress ReAuth =1 Loop with wpCAS

text: The **wpCAS plugin** appears to be working: I have a **subdomain** on a website which contains the **WordPress** installation (i.e. `test.mywebsite.com`), and I'm running through a **WordPress GitHub Repo** along with **Capistrano** for actual deployment. This is important because, due to this setup, the content is within a subdirectory, i.e. `test.mywebsite.com/wp`. The result is that, in order to access the site's admin section, I have to input `test.mywebsite.com/wp/wp-admin` in my browser. Accessing the frontend website, however, only requires that I input `test.website.com`. Confusing enough? I'm testing all of this with a **localhost MAMP server**. It should also be worth nothing that I have also redirected the IP of `test.mywebsite.com` to my local box via my Mac's `hosts` file, so everything is correctly taking place on the local box. Now, here's the catch: I'm using the wpCAS plugin with a **RubyCAS server**. Everything works up until the actual login process. wpCAS is designed to simply **re-direct the login page to my CAS login** , and then **match the credentials** typed into the CAS interface with those in WordPress's database. If there's a match, it (theoretically) would bring me to the admin page with my credentials logged in and working correctly. As a result of this setup, my typing in `localhost/wp/wp-admin` takes me to `auth.mywebsite.com`, the CAS interface where I can input my credentials. However, once I put my credentials into the CAS interface I'm instead hit with a **redirect loop** that looks like: `wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2Fwp%2Fwp-admin%2F&reauth=1` and `wp-admin/` so around and around we go! Any idea why this would happen and how to solve the problem?


title: SSL Certificate and WordPress

text: One of my clients has decided to install an SSL certificate for his website/domain. I have developed a WP website for them it's ready to be deployed. We are currently accessing it via the IP address and it works fine. Normally I just change the URL settings via admin (2 options) and run a search and replace throughout the database, and that's all that's needed. Should I be doing anything else for SSL? I assume the URL should also start with https:// in the admin settings right?


title: Translate wordpress date from Italian to English

text: I'm developing a wordpress based site in English but I've installed the Italian version of it...   In my blog page, I get dates, exactly months, in Italian instead of English... How can I translate this? Are there other things I must manually translate?   For example, where should I translate errors? Thanks!


title: Paginate tags page

text:
If I click a random tag I want the tag page to list only 20 posts that is related to that tag and paginate it.               <?php     /**      * The template for displaying Tag Archive pages.      */          get_header(); ?>

<?php                         printf( __( 'Tag Archives: %s', 'twentyten' ), '' . single_tag_title( '', false ) . '' );                     ?>
          <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $args = array( 'orderby' => 'title', 'order' => 'ASC', 'post_type' => 'post', 'posts_per_page' => 20, 'paged' => $paged );     $wp_query = new WP_Query($args);     while ( have_posts() ) : the_post(); ?>                  <div <?php post_class() ?>>
<li id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
                     <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_post_thumbnail(thumbnail); ?>

                  <?php endwhile; ?>           <?php if (function_exists("pagination")) {         pagination($additional_loop->max_num_pages);     } ?>
          <?php get_sidebar(); ?>
     <?php get_footer(); ?>      The problem with this code is it's listing all the posts and not posts that are related to that tag. Can anyone help me fix?


title: wp e-commerce group product by category

text: Sorry for my bad english.   I have WP 3.3.1 & wp-e-commerce.3.8.7.6.2. On the products page (which use wpsc-products_page.php template) I have list of products. I want to group this products by category. For example: _*_ *Cat1   Product 1   Product 2   * _*_ Cat2   Product 1   Product 2   * _*_ Cat3   Product 1   Product 2   I try to use this method, but it`s does not work                 add_filter('posts_join', create_function('$a', 'global $wpdb; return $a . " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";'));     add_filter('posts_where', create_function('$a', 'global $wpdb; return $a . " AND $wpdb->term_taxonomy.taxonomy = \'wpsc_product_category\'";'));     add_filter('posts_orderby', create_function('$a','global $wpdb; return "$wpdb->term_taxonomy.term_id DESC";'));     query_posts('');      Thank you all in advance for your reply!


title: Make datestamp for status updates show time

text: I have an installation of Wordpress 3.6 running on my server. Playing around with it, I found that 'status updates' don't show the time posted: ![enter image description here](http://i.stack.imgur.com/ZB5DD.png) Here's the thing: I want the time there too. Something like this would be best: ![enter image description here](http://i.stack.imgur.com/4txdH.png) Is there a way to change the format the time is shown in? Something in a child theme?


title: Prevent "main" WPMU site_url() being returned in functions

text: I've noticed that in a WordPress MU install with domain mapping enabled, some functions return URIs that don't use the current WPMU site's primary domain name which possibly means they are "WPMU Domain Mapped-ignorant functions" (a little harsh, I know). What can I do to ensure the primary domain of the current WPMU site is used in returned URIs when I call these kinds of functions, in an effort towards referencing assets (js, css, img, etc) in a canonical, siloed manner? A quick example being the following:               $ft_img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full');      So in this example `$ft_img[0]` would have the same URI for every subsite in a WPMU network, using the base site's `siteurl` when it should be subsite- specific.


title: Trouble with editing template for "List category posts" plugin

text: WP 3.0.4   local installation, multisite network enabled   theme: Twentyten   plugin: List Category Posts v .15, network activated I've created the folder `list-category-posts` inside my theme folder, and placed `default.php` inside it. Edited `default.php` and saved as `lcp_template_1.php` inside same folder. However, the changes are not appearing at all. I'm trying to change the style of the lcp output from the default `<ul>` to `<div>` classes defined in my theme (child)'s `style.css`. NOT WORKING. That is, the plugin is functioning, but the style changes are not working. Code for my template file is up at http://wordpress.pastebin.com/EGmrkerQ Please help. Sorry, no url for viewing the output, because this is a local installation. Oh, btw, I should mention that in the shortcode I have called for the new template, as follows: `[catlist id=1 template=lcp_template_1]`.


title: Upgrade not working & themes not supporting

text: I just transfered my website from shared hosting to VPS, I installed all the backup from previous website to the VPS, Everything was fine, My website was functioning all perfect, But I was not able to see wp-admin page, When I hit on url "mywebsite.com/wp-admin", I get a blank white page, I disabled all plugins and themes by renaming the folder names, Then I was able to login, no white screen was there, After digging my head into it for long time, I found that there is problem with the plugins folder, My theme is all up-to-date, and works fine without any errors If I de-activate all the plugins, then I don't get any blank white screen during login, **but if any one plugin** is activated the I get white blank screen on wp-admin page, This is not it, when trying to update any plugin or theme I am getting this message: > Unpacking the update… > > Notice: Undefined offset: 1 in /home/admin/onlinemba.co.in/wp- > admin/includes/class-ftp-sockets.php on line 93 > > Warning: Invalid argument supplied for foreach() in > /home/admin/onlinemba.co.in/wp-admin/includes/class-wp-filesystem- > ftpsockets.php on line 299 > > Notice: Undefined offset: 1 in /home/admin/onlinemba.co.in/wp- > admin/includes/class-ftp-sockets.php on line 93 > > Installing the latest version… > > Notice: Undefined offset: 1 in /home/admin/onlinemba.co.in/wp- > admin/includes/class-ftp-sockets.php on line 93 > > Warning: Invalid argument supplied for foreach() in > /home/admin/onlinemba.co.in/wp-admin/includes/class-wp-filesystem- > ftpsockets.php on line 299 > > Incompatible Archive. > > Plugin upgrade failed . (I have included `define("WP_DEBUG",true);` to wp-config file, after @Backie suggestions, so I am getting errors) I am not able to update my wordpress, but I did it manually, I am having the latest version of wordpress, I am not able to update my any plugins and themes.


title: Dynamic User State & City selection

text: I need to implement a state-city selection for my users to choose from. Where they first choose their state and then there is a city drop down field that shows only the cities in that state. Currently, users have to type in the state and city for their account. This concerns me because they may not enter the correct names. I would like this in order to keep these values consistent and to make the site more user friendly. I thought about creating all the states and cities as categories. I tried this which totaled to over 10,300 categories and sort of crashed my site. Certain pages that needed to access the categories would take update 10 minutes to load the page due to the large number of categories it had to process. I am looking a solution to this. I would like them to choose their state from a dropdown list and then based on the state chosen they can pick a city of that state from a dropdown list. I need some major help with this. Thanks a lot.


title: add metabox to specific custom plugin page

text: Hello I am new to WordPress and I am creating a custom plugin called ZeeFields. Now i wanna add a meta box to my custom plugin page. I tried but still i cant get it to work. btw I can add meta box to post or dashboard but not to my plugin. how can i do that ? here's my code               <?php     /*     Plugin Name: Post to exlcel     Plugin URI:     Description: Download posts to CSV...     Version: 0.1     Author: ZeeFields     Author URI: http://ZeeFields.com     License: GPL2     */          add_action( 'add_meta_boxes', 'cd_meta_box_add' );       function cd_meta_box_add(){             add_meta_box( 'my-meta-box-id', 'My First Meta Box', 'metaBox_details',     'custompage', 'normal',  'high');           }     function metaBox_details()       {           echo 'What you put here, show\'s up in the meta box';          }            //============================================================================================================     add_action( 'admin_menu', 'register_my_custom_menu_page' );     function register_my_custom_menu_page(){         add_menu_page( 'ZeeFields', 'ZeeFields', 'manage_options', 'custompage',     'my_custom_menu_page',NULL,26 );           }     function my_custom_menu_page(){         echo 'I wanna Meta box showing here';     }     //============================================================================================================


title: Multiple Select Boxes Settings API

text: I know how to do select boxes, those are easy - but how would you do multiple select boxes? where you can select and save multiple things? Would you still use the `selected()` function? if so can some one provide a example? google is not being very nice about this.


title: Secure wordpress_logged_in cookie

text: I have to make sure, that the Wordpress cookie set after successful log in, "wordpress_logged_in_[salt-sth]" is set to be available for secure connections only. It looks like that it´s a filter used in pluggable.php, line 653 $secure_logged_in_cookie = apply_filters('secure_logged_in_cookie', false, $user_id, $secure); How can I set it to secure, WITHOUT modifiyng the wordpress core files? If I modify the core (set to true) - it´s not possible to logout anymore... Thank U!


title: Wordpress front end posting to multiple blog in multisite with advanced custom field

text: I am using advanced custom field frond end posting.               <?php           function my_pre_save_post( $post_id )     {         // check if this is to be a new post         if( $post_id != 'new' )         {             return $post_id;         }              // Create a new post         $post = array(             'post_status'  => 'draft' ,             'post_title'  => 'A title, maybe a $_POST variable' ,             'post_type'  => 'post' ,         );                // insert the post         $post_id = wp_insert_post( $post );               // update $_POST['return']         $_POST['return'] = add_query_arg( array('post_id' => $post_id), $_POST['return'] );                  // return the new ID         return $post_id;     }          add_filter('acf/pre_save_post' , 'my_pre_save_post' );          ?>      I want to use this method               <?php     $original_blog_id = get_current_blog_id(); // get current blog          $bids = array(1,2); // all the blog_id's to loop through     foreach($bids as $bid):            switch_to_blog($bid); //switched to blog with blog_id $bid            // ... your code for each blog ...     endforeach ;           switch_to_blog( $original_blog_id ); //switched back to current blog     ?>      How can I Post to multiple blog at same time. please help me.


title: WordPress add options to theme not displaying

text: Hi I am trying to learn to add theme options to WordPress themes by reading The Complete guide to WordPress Settings Api on wptuts I have gotten as far as the 4th part and have stoped to create an example for myself because I have gotten confused with how can I add the sections I create in a page.Here is my code:                function thanatos_theme_menu(){         add_theme_page(                        "Thanathos Theme Options",                         "Thanathos Theme",                         "administrator",                         "thanathos_theme_options",                        "thanathos_theme_display_callback"                       );     }     add_action('admin_menu' , 'thanatos_theme_menu');     function thanathos_theme_display_callback(){           echo "Johny la hanta este mui loca";      }          add_action('admin_init' , 'thanatos_initializa_theme_options');     function thanatos_initializa_theme_options(){         add_settings_section(                 'general_settings_section',                  'Thanatos Options',                  'thanatos_general_options_callback',                  'thanathos_theme_options' //I believe this where my mistakes is          );     }          function thanatos_general_options_callback(){         echo 'mergem la mare';     }      I have used the page id in order to set where to put this section and I belive the thanatos_general_options_callback() should display there but for some reasons it doesn't.What am I doing wrong here?


title: Change the name of an installed plugin

text: I have installed a third-party plugin for my wordpress site. What I want is to rename that plugin so that it matches my purpose for installing it. Is it possible? The plugin I'm trying to modify is CubePoints.. It's a pointing system for the users. But for the sake of better understanding, I'll be calling it MyPoints or something like that.a When I rename it in the plugin `PHP` file, it affects only the plugin listing. But it has a separate menu in the left panel. What I need is it to take effect there, so that the user can see the modified name in their user panel.


title: Is it possible to get the comment_reply_link within latest comments?

text:
I have the following code to get the latest comments;               function get_recent_comments($no_comments = 5, $comment_len = 80, $avatar_size = 48)      {          $comments_query = new WP_Comment_Query();     $comments = $comments_query->query( array( 'number' => $no_comments ) );          $comm = '';     if ( $comments ) : foreach ( $comments as $comment ) :         $comm .= '
' . get_avatar( $comment->comment_author_email, $avatar_size );         $comm .= 'post_ID ) . '#comment-' . $comment->comment_ID . '">';         $comm .= get_comment_author( $comment->comment_ID ) . ': ';         $comm .= 'reply';         $comm .= '
' . strip_tags( substr( apply_filters( 'get_comment_text', $comment->comment_content ), 0, $comment_len ) ) . '

';          endforeach; else :         $comm .= 'No comments.';          endif;          echo $comm;       }      Is it possible to get the reply link to reply inline to these comments? So far, I have tried getting the               comment_reply_link();      But this doesn't seem to work either,,,,


title: Adding Custom Product Attribute and Variable in WooCommerce Programatically

text: Can you please let me know how I can add Custom Product Attribute and Variable in WooCommerce Programatically? I know this easy to be done in Woocommerce GUI but I need to do this through functions.php I have a Attribute Called "Class" and Some Variables as [A,B,C,D] now I would like to add them to the Cart and Shop page, I already tried this function but it didn't add any thing to the page:               function woocommerce_variable_add_to_cart() {        //Type attribute         $product_attributes['type'] = array(             //Make sure the 'name' is same as you have the attribute             'name' => htmlspecialchars(stripslashes('Class')),             'value' => $attributes,             'position' => 1,             'is_visible' => 1,             'is_variation' => 1,             'is_taxonomy' => 0         );          //Add as post meta     update_post_meta($post_id, '_product_attributes', $product_attributes);          }      Thanks


title: get_permalink() with wp_rewrite giving wrong permalink?

text: I have two custom post types: news and special, each would require ID within the url, like example.com/news/ID or example.com/special/ID. Since wordpress's custom post type always have post title in the it's url, I have to rewrite them in functions.php with the following code.               add_action('init', 'cdsb_rewrite');     function cdsb_rewrite() {         global $wp_rewrite;         $queryarg = 'post_type=news&p=';         $wp_rewrite->add_rewrite_tag('%cpt_id0%', '([^/]+)', $queryarg);         $wp_rewrite->add_permastruct('news', '/news/%cpt_id0%', false);         $queryarg1 = 'post_type=special&p=';         $wp_rewrite->add_rewrite_tag('%cpt_id1%', '([^/]+)', $queryarg1);         $wp_rewrite->add_permastruct('special', '/special/%cpt_id1%', false);     }          add_filter('post_type_link', 'cdsb_permalink', 1, 3);     function cdsb_permalink($post_link, $id = 0, $leavename) {         global $wp_rewrite;         $post = &get_post($id);         if ( is_wp_error( $post ) )         return $post;         if(get_post_type() == 'news'){             $newlink = $wp_rewrite->get_extra_permastruct('news');             $newlink = str_replace("%cpt_id0%", $post->ID, $newlink);             $newlink = home_url(user_trailingslashit($newlink));             return $newlink;}         elseif(get_post_type() == 'special'){             $newlink = $wp_rewrite->get_extra_permastruct('special');             $newlink = str_replace("%cpt_id1%", $post->ID, $newlink);             $newlink = home_url(user_trailingslashit($newlink));             return $newlink;}         else {             return $post_link;         }         }      the rewritten urls are working good, they can be visited using a browerser. But when i'm developing themes, weired things happen: I'm getting DYNAMIC urls! **get_permalink(NEWSID1);** within **single-special.php** , the function should return **example.com/news/NEWSID1** ，instead it's returning **example.com/special/NEWSID1** ,hence the link is not accessable. What's happening here? What can I do to get the right url? is it because all the custom post type urls are really flattened out in wordpress wp_posts table, so you can't really get STATIC url depending on custom post type? I know I can use **get_post_type();** to compile the right url , but can someone help me sort it out? sorry for my english by the way.


title: How can I get rid off url pagination?

text: I use to paginate my posts but a few day ago I decided to quit split posts in more that one page. But the old links to the secondary pages are still crowlable by the google because they still work. I mean, for example: initially I had one post split in two pages. Because of that there were two URLs for that post (`www.example.com/post` and `www.example.com/post/2`). After I remove the pagination code from that post I expect that only the `www.example.com/post _url` to be available. But the `www.example.com/post/2` is still available. Besides, I found that instead of the "2" from `www.example.com/post/2` I can put any number, and that URL is working (displaying the content of `www.example.com/post` ). Do you know how can I get rid of the `www.example.com/post/2`?


title: Using/compiling Foundation SASS on live WordPress server

text: so far I've used extensively LESS and BootStrap for many of my sites. However, I decided to start using Zurb Foundation as it seem more powerful, especially with the latest release (5). With LESS, what I have always done was installing `WP-Less`, a plugin that uses phpLess library to compile `.less` stylesheets by looking at whatever `.less` file was enqueued using `wp_enqueue_style()` function within my WordPress theme. So if I made any editing on my main `.less` file and its dependanciens/inclusions, etc. and updloaded it on my server, WP-Less would notice that and recompile for me a new `.css` stylesheet, which is served to the end users. Magic! I understood that Foundation is based on SASS and Compass. But these require ruby to run? Is there any equivalent of WP-Less for Foundation? Like, I enqueue `.sass` stylesheet and I have a library compiling for me the resulting `.css` if there's an update? So I can just do my edits locally, upload to the server and have my final stylesheet(s) recompiled automagically? Sorry if I made any stupid assumptions, but this is how I had been working with LESS and BootStrap and it was rather efficient to me. Thank you


title: Debian drops connection in wordpress admin section

text: I have installed wordpress 3.6(also tried 3.7). The problem is when I get to admin section, server after approximately 10 requests began to abort connection (on both get and post requests). I have checked ip tables. There is no restrictions at all in neither of the tables. I checked apache log which is empty when 'droppy' request comes in. I traced down packages, they come to the server, but server is not responding at all. Any good Ideas what to look for and where? I'm running: > Distributor ID: Debian, Description: Debian GNU/Linux 6.0.7 (squeeze), > Release: 6.0.7, Codename: squeeze, Apache 2, php 5.3


title: Adding CSS Classes to Sub items in Menus is not working

text:
Ok, so this is the code I have to my Mega Menu that works with Bootstrap framework for Wordpress. For some reason, when I enter a class name in the backend of Wordpress > Menus > Sub item > CSS Classes, it's not showing up int he mark up. However if I put a Title, the title tag shows up. I've been going back and forth and I'm at loss what to do to fix it. Below is the navigation coding:               class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu {          //
 elements     function start_lvl(&$output, $depth) {         // code indentation         $indent = ($depth > 0 ? str_repeat("\t", $depth) : '');         // build classes         $classes = array(         // only the top level will have dropdowns         $depth == 0 ? 'dropdown-menu' : '',         // assign a class to items nested deeper         $depth >= 1 ? 'sub-menu col-sm-4' : '');         $class_names = implode(' ', $classes);         // build html -
 becomes
 at top levels         if ($depth == 0)             $output .= "\n" . $indent . '
' . "\n" . $indent . '
' . "\n";         else             $output .= "\n" . $indent . '
' . "\n";     }          //
 elements and  links     function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {         // code indentation         $indent = ($depth) ? str_repeat("\t", $depth) : '';         // prepare         $li_attributes = '';         $class_names = $value = '';         $classes = empty($item -> classes) ? array() : (array)$item -> classes;         // build classes and attributes for
 elements that have nested
         if ($args -> has_children && $depth == 0) {             $classes[] = 'dropdown yamm-fw';             $li_attributes .= 'data-dropdown="dropdown"';         }         $classes[] = 'menu-item-' . $item -> ID;         // if we are on the current page, add the active class to that menu item         $classes[] = ($item -> current) ? 'active' : '';         // add all of the wordpress classes, including those set by user in Wordpress         $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args));         $class_names = ' class="' . esc_attr($class_names) . '"';         // add id to
 elements         $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item -> ID, $item, $args);         $id = strlen($id) ? ' id="' . esc_attr($id) . '"' : '';         // build html - the
 elements at top level become
         if ($depth == 0)             $output .= $indent . '
' . "\n" . $indent . '
';         //         elseif ($depth == 1)             $output .= $indent . '
';         else             $output .= $indent . '
';         // build attributes and classes for  link elements         $attributes = !empty($item -> attr_title) ? ' title="' . esc_attr($item -> attr_title) . '"' : '';         $attributes .= !empty($item -> target) ? ' target="' . esc_attr($item -> target) . '"' : '';         $attributes .= !empty($item -> xfn) ? ' rel="' . esc_attr($item -> xfn) . '"' : '';         $attributes .= !empty($item -> url) ? ' href="' . esc_attr($item -> url) . '"' : '';         $attributes .= ($args -> has_children && $depth == 0) ? ' class="dropdown-toggle" data-toggle="dropdown"' : '';         // build  link html         $item_output = $args -> before;         $item_output .= '';         $item_output .= $args -> link_before . apply_filters('the_title', $item -> title, $item -> ID) . $args -> link_after;         // add a bootstrap "caret" to top level dropdowns toggles         $item_output .= ($args -> has_children && $depth == 0) ? '  ' : '';         $item_output .= '';         if ($depth == 0)             $item_output .= '
' . $item -> description . '
';         else             '';         $item_output .= $args -> after;         // final html output         $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);     }          function end_el(&$output, $item, $depth) {         // closes elements opened in start_el         if ($depth == 0)             $output .= '
' . "\n" . '
' . "\n";         elseif ($depth == 1)             $output .= '
' . "\n";         else             $output .= "
\n";     }          function end_lvl(&$output, $depth) {         // code indentation         $indent = ($depth > 0 ? str_repeat("\t", $depth) : '');         // closes elements opened in start_lvl         if ($depth == 0)             $output .= $indent . '
' . "\n" . $indent . '
' . "\n";         else             $output .= $indent . '
' . "\n";     }          // Overwrite display_element function to add has_children attribute @since WP 3.4     function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) {         if (!$element)             return;         $id_field = $this -> db_fields['id'];         //display this element         if (is_array($args[0]))             $args[0]['has_children'] = !empty($children_elements[$element -> $id_field]);         else if (is_object($args[0]))             $args[0] -> has_children = !empty($children_elements[$element -> $id_field]);         $cb_args = array_merge(array(&$output, $element, $depth), $args);         call_user_func_array(array(&$this, 'start_el'), $cb_args);         $id = $element -> $id_field;         // descend only when the depth is right and there are children for this element         if (($max_depth == 0 || $max_depth > $depth + 1) && isset($children_elements[$id])) {             foreach ($children_elements[ $id ] as $child) {                 if (!isset($newlevel)) {                     $newlevel = true;                     //start the child delimiter                     $cb_args = array_merge(array(&$output, $depth), $args);                     call_user_func_array(array(&$this, 'start_lvl'), $cb_args);                 }                 $this -> display_element($child, $children_elements, $max_depth, $depth + 1, $args, $output);             }             unset($children_elements[$id]);         }         if (isset($newlevel) && $newlevel) {             //end the child delimiter             $cb_args = array_merge(array(&$output, $depth), $args);             call_user_func_array(array(&$this, 'end_lvl'), $cb_args);         }         //end this element         $cb_args = array_merge(array(&$output, $element, $depth), $args);         call_user_func_array(array(&$this, 'end_el'), $cb_args);     }          }          function Bootstrap_nav_menu_css_class($classes, $item) {     // CHANGE .current-menu-item .current-menu-parent .current-menu-ancestor INTO .active     $classes = preg_replace('/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'active', $classes);          // Add the .dropdown class to the list items that have children     if ($item -> hasChildren) {         $classes[] = 'dropdown';     }          return $classes;     }      Below is the HTML mark up that it outputs, I put a comment on where the class attribute is not being added:
                     <button data-target=".navbar-ex1-collapse" data-toggle="collapse" class="navbar-toggle" type="button">                         Toggle navigation                                                                                </button>                     A leader in the field of assessment and career guidance

Products
Career and Psych Assessments

             Section Title

Test Link

Test Link

Test Link

Test Link


title: wp_get_attachment_image_src() and custom sizes

text: As said in this page, `wp_get_attachment_image_src()`only accepts built-in sizes such as thumbnail, medium, large or full. How do you get the same return value with custom sizes you add with `add_image_sizes()` ?


title: How can i fix a 404 error when targeting custom taxonomy slug ?

text: I have defined my new taxonomy like this               $args = array(      'labels'       => $labels,      'show_tagcloud'    => false,      'hierarchical'     => true,      'rewrite'          => array( 'slug' => 'activites', 'hierarchical' => true ),     );     register_taxonomy( 'business_category', 'business', $args );      I have no custom rewrite rules. this url works :               http://mydomain.com/activites/architecture-decoration/      calling my taxonomy-business_category.php template. so i want to reach this url now :               http://mydomain.com/activites/      but it throws a 404. the purpose (besides having a functional breadcrumb) on this page is to list all my custom category terms. how can i target a page that englobes all categories ? is it a rewrite conflict or a rewrite missing ? thank for your further explanation.


title: Child Theme: how to override variables?

text: I'm going to build my first Child Theme. I understood how to override functions (hope!), but how to override variables? For example, in a Premium Template I want to change the values of feed variables shown in functions.php:                 $app_rss_feed = 'http://xxx.rss';     $app_twitter_rss_feed = 'http://yyy.rss';     $app_forum_rss_feed = 'http://zzz.rss';      But if I create my functions.php file inside my child theme and assign a different RSS feed value to these variables... nothing happens. So, which is the right way to change variables?


title: Make buddypress posts likes count show to all users

text: Im using the buddypress likes plugin and I'm using a code to show the like count for posts on the index page of my site. The problem Im running into is the Like count only shows if you've liked the post and then it shows the total number. If you're logged out you won't see any like counts. How can I show the Like Counts to everyone? Here's how I call it inside the index page loop.               <?php if ( bp_like_is_liked( $id, 'blogpost' ) ) : ?>         <?php            $liked_count = count( get_post_meta( $id, 'liked_count', true ) );           if ( $liked_count ) echo 'Likes '. $liked_count . ''; ?>         <?php endif; ?>      I changed it so now all the liked show but for some reason all posts show atleast a like count of 1 even when they don't have any. Any idea why that is. Here's what I changed.               <?php            $liked_count = count( get_post_meta( $id, 'liked_count', true ) );           if ( !$liked_count==0 ) echo 'Likes '. $liked_count . ''; ?>


title: Listing Sub-Pages & Sub-Sub-Pages

text:
So I don't really know why I am having so much trouble with this, it seems like functionality in wordpress that should be a bit easier to working with. Anyhow **I need to generate a menu system for a sidebar that looks like this (for a top level page):**

Sub-Page

Sub-Page

Sub-Sub-Page

Sub-Sub-Page

Sub-Page

Sub-Sub-Page

Sub-Sub-Page

Sub-Sub-Page

Sub-Page

      * * * On top if this, **I need to show the same menu, no matter how deep in the sub pages the user is at**. For example, if I was on a sub-sub-page, then I still wish to show the same menu. In other words, even if I was at a 3rd level page, it would still show 3rd and 2nd level pages - exactly the same as the above menu. * * * Thanks for the help in this one!


title: How to remove _wp_http_referer from URL when husing WP_List_table?

text: I have built a plugin that displays a table using the WP_List_Table class. The table displays entries on which it's possible to apply a filter and some bulk actions. The problem is that is that when I click on the "filter" button or "apply bulk action" button multiple times, the _wp_http_referer paramater is added to the URL and keeps being longer and longer each time I click on the button. Eventually the URL is so long that I get a blank page in the browser with the following error message:               Request-URI Too Large     The requested URL's length exceeds the capacity limit for this server.      I think I have set up the filter and bulk action select menus properly inside a simple form tag:               form action method="get"      The sale problem seems to have been described here: How to stop _wpnonce and _wp_http_referer from appearing in URL and as I am facing the same issue I am wondering if someone would have any idea how to remove the _wp_http_referer paramater from the URL after clicking on my form action buttons. Thanks


title: role manage_options always return true

text: i have a serious problem with wordpress roles, i have some custom roles                (      [data] => stdClass Object (          [ID] => 7         [user_login] => test         [user_pass] => $P$BSaGUc/dZwyl1PLaauaQdWBDIIkrWL.         [user_nicename] => test         [user_email] => [email protected]         [user_url] =>          [user_registered] => 0000-00-00 00:00:00         [user_activation_key] =>          [user_status] => 0         [display_name] => test     )     [ID] => 7     [caps] => Array (          [uploader_team_moderator] => 1     )     [cap_key] => acwp_capabilities     [roles] => Array (          [0] => uploader_team_moderator     )     [allcaps] => Array (          [read] => true         [sucuriscan_cap_lastlogins] => 1         [role_image] => /wp-content/images/89r6lbhsgnm37a0h2t4y.png         [role_title] => مدیر تیم آپلود         [role_color] => color: #2A537C; font-weight: bolder;         [publish_posts] => 1         [upload_edit] => 1         [upload_add] => 1         [upload_remove] => 1         [manage_options] =>          [uploader_team_moderator] => 1     )     [filter] => )      even i set manage_options false (remove_cap) but still return true when i try current_user_can                           if (current_user_can('manage_options')) {                 echo 'beep';             }      i even tried this:                               $cu = wp_get_current_user();                 $cu->remove_cap('manage_options');                 if ($cu->has_cap('manage_options')) {                    echo '123';                 }       but still see 123!!! i really don't know what the problem here. all i found when i disable buddypress plugins it work properly but when i enable it it stop working properly (this only happen by manage_options).


title: How to add plugin activity in the menus?

text: I have Installed CM answer plugin, but how can I add that as a menu at the top? Note: I can install plugin but the problem is that I don't know the way to add the plugin into the menu or a page.


title: How do I display a user specific content?

text: I have a site that displays the content only to registered users. Most of the content is available to all the users, but some of it is user specific (i.e. all users have that page, but each sees a it's own content which no one else can see). Any idea as to how I can restrict(and display) specific content per specific user ?


title: wordpress plugin license issue -New plugin development

text: Can i copy all the codes of a free plugin and paste it in my new plugin ?. Is there any license issue for using the others plugin code. My new plugin is working properly ,but for making this plugin i copy the resources of other free plugin .


title: rewrite rules and querystring

text: When I go to the url `mysite.com/photos/120` I'm _wanting_ to get the `120` out. In the PHP I want to be able to grab these "parameters" like the url was `mysite.com?page=photos&id=120` or even just `mysite.com/photos?id=120` Can I leverage **rewrite rules**? Or do I need to do **regex** in php to get what I want? Thanks **** EDIT 1 **** For the life of me I can't get this to work. Based on the answers given (thanks) here is what I have:               add_action( 'init', 'rewrite_photo_url' );     function rewrite_photo_url() {         add_rewrite_rule( '^photos/([^/]*)/?','index.php?page=photos&photo_id=$matches[1]', 'top' );     }          add_rewrite_tag('%id%','([0-9]+)');          print(get_query_var('photo_id'));      I suspect I'm missing a concept somewhere? **** EDIT 2 **** I'm starting to see that perhaps this needs to be in functions.php so I now have:               function rewrite_photo_url() {         add_rewrite_rule( '^photos/([^/]*)/?','index.php?page=photos&photo_id=$matches[1]', 'top' );     }     function register_custom_query_vars( $vars ) {         array_push( $vars, 'photo_id' );         return $vars;     }          add_action( 'init', 'rewrite_photo_url');     add_filter( 'query_vars', 'register_custom_query_vars', 1 );      Now I just need to know how to get my desired var in my page template. I've tried               print(get_query_var('photo_id'));      But that's not doing the trick atm.


title: How to test wp_cron?

text: This is kind of a stupid question... I scheduled a action to run every hour:               if(!wp_next_scheduled('my_hourly_events'))       wp_schedule_event(time(), 'hourly', 'my_hourly_events');          add_action('my_hourly_events', 'the_function_to_run');          function the_function_to_run(){        echo 'it works!';      }      How can I test if this works without waiting an hour? :) I tried adding `wp_clear_scheduled_hook('my_hourly_events');` before this code and adding `wp_cron()` after, but I don't see my function running... **edit:** ok, I added a `trigger_error()` inside my function, checked out the apache error log, and it's there :) So now I'm even more confused:   * How can the wp-cron run in the background? because apparently that's what happens if I see no output...   * this doesn't seem to work in a object context; why?


title: is_taxonomy is deprecated. What's the alternative?

text: Now that `is_taxonomy($taxonomy)` function deprecated how do I know if a taxonomy exist? What's the alternative? On a second note, the codex for `wp_insert_term()` says that if the taxonomy does not exist, an error is fired. Here, the "if taxonomy exists" part is ambiguous to me. Does that mean if the taxonomy has currently been registered with the registered_taxonomy or does that mean there is at least one term in the `wp_term_taxonomy()` table that's been associated with that taxonomy? And my 3rd question final question is how do I catch an error when an error is raised by the `wp_insert_term()` function? Would this work?               if (list($term_id,$taxonomy_id) = wp_insert_term(...)):     else:       //error here?     endif;


title: bbPress - Post count increases after every edit

text: I’ve installed bbPress 2.4 recently and I’ve noticed that each time I edit a post, my post count increases. Is there a way to stop that from happening? Thanks. > ![screenshot](http://i.stack.imgur.com/6F4AL.png) P.S. Is it normal for this to happen or is there something wrong on my end?


title: Scripts only working on home page

text: I am using the following example code to enqueue several scripts..                   add_action( 'wp_enqueue_scripts', 'my_scripts' );         function my_scripts() {               wp_enqueue_script( 'jQuery-Main', get_template_directory_uri().'/js/jquery.js',array(),'2.0.3', true);         }      If I set the `$in_footer` parameter to true, the scripts load in the footer and work correctly **only on the homepage**. If I leave the `$in_footer` parameter blank, the scripts work correctly on all pages **except the homepage.** This problem only started occurring recently and I cannot figure out why.


title: Return array of categories to php function

text: I am looking for a function that will retrieve the names and ids of all categories that will output a checkbox, or give me the data so I can perform a loop.               <input type="checkbox" name="category" value="category_id" /> Category 1     <input type="checkbox" name="category" value="category_id" /> Category 2     <input type="checkbox" name="category" value="category_id" /> Category 3     <input type="checkbox" name="category" value="category_id" /> Category 4     <input type="checkbox" name="category" value="category_id" /> Category 5


title: Empty space instead of admin bar

text: So I upgraded to 3.1 now I have a white band above the header of my website in the frontend when I'm logged in, I know this should be the control menu, but just a white band :-(


title: WordPress category

text: I want to get all categories in a new page which doesn't include any post. I tried wp_list_categories(); function. But it show only "No category" message. How do I do it?


title: WP admin broken. Not saving catgories or adding categories to menu

text: Wordpress Admin panel is not saving categories when creating new post or editing it. Also same problem with adding categories or pages to menu. It just doesn't save changes when I press update.


title: Exclude the category in Wordpress

text: ## My question: This code retrieves the categories. I need to exclude the category number:81. Is there an easy way to exclude it in this code?               <?php                    $cat_lists = retrieve_cat_data_sp( get_option('bn_exclude_home_lists') );                      for ($i = 1; $i < count($cat_lists); $i++ ) {                      if( (get_category( $cat_lists[$i] )->count) > 0 ):             ?>


title: Tinymce list of shortcodes button

text: does someone know about tutorial or how to do button with list of shortcodes in tinymce? For example like in this video http://www.youtube.com/watch?v=DmzUuwW9AU4 (This function in the video is exatly what I want to). Same function have a lot of templates on themeforest. Thx for reading my question.


title: Get wordpress taxonomy slug name(s) to use as div class

text: I'm trying to mark up my posts using their custom taxonomy slug as the div class so that they can be filtered... So far what I have displays the taxonomy name but what I need is the slug so I have a nice-space-free-name, I have the below so far outputting the name:                <div class="box-item cocktails-box       <?php $terms_as_text = strip_tags( get_the_term_list( $wp_query->post->ID, 'cocktail_type', '', ' ', '' ) );      echo $terms_as_text; ?>">      Any help would be much appreciated - I'm getting a bald patch from scratching my head on this..


title: Wordpress home page showing 404 error

text: I've had a look for anyone experiencing the same issue but to no avail. I am currently working on a Wordpress site that previously did not have permalinks, so have added these (i.e. to change the URLS from ?p=123 to /about/the-company etc.) in the standard way but I've ended up with the homepage displaying a 404 error. All of the other pages work fine bar the home page. I have since tried deactivating it though now end up with the error still occurring. It seems to be a bit temperamental; in some browsers it works but others it doesn't. The issue can be seen at: http://www.walkerpoolenixon.com/wordpress/ Thanks in advance!


title: Display different number of posts from one category on the different pages

text: according with Pagination with custom loop. I use the custom loop for display flash game. For make a pagination on the page with posts from one category (mydomain/category/categoryName) I used:               add_action( 'pre_get_posts', 'wpse5477_pre_get_posts' );     function wpse5477_pre_get_posts( &$wp_query )     {         if ( $wp_query->is_category() ) {             $wp_query->set( 'post_type', 'game' );             $wp_query->set( 'posts_per_page', 9 );         }     }      I have the section on the main page of my site, where displayed three game from each category. But according with code above I can't display only 3 games, even if I determine in array('post_per_page', 3) or smth like this, because this number have been already determine in $wp-query. how could I kill two birds with one stone? Thanks.


title: Prev/Next child navigation for current page?

text: How can I get a Previous / Next navigation that only navigates the child pages of the current page? By that i mean url.com/page/ **child1** , url.com/page/ **child2** and so on.. I've been searching around alot but I'm still lost. It seems like you can't do that according to wordpress (they recommend plugins..)


title: add_image_size in a Plugin i created

text: I created a plugin and i need to use add_image_size in it. I know how it work in the function file and for a theme, but how can i implement this in a plugin? I want new images uploaded by wordpress users to be smaller for mobile with               add_image_size( 'wp_small', 60, 75, true ); //mobile      I read that you need to use init or admin_init but i don't know how to implement this.


title: query order by category

text: i have this line.. in sidebar..               <?php query_posts ( ( array('orderby' => 'rand', 'showposts' => 12)));?>      i want to order by category not random.. so if i am in a post from category animals.. i want to show 12 post just from this category. Not Random like now.. how can i do that?


title: How to put JQuery/Ajax inside shortcode?

text:
The purpose of this plugin is to create a list that users can modify with up or down votes. The shortcode is supposed to display the list on a page and use JQuery to fadeIn and fadeOut while updating the database. A demo of the concept is available at http://bucketlingerwedding.com/80s-music-reception/ (note: the working code does not yet use AJAX). I would like to put this plugin in the Wordpress Repository, but the AJAX is killing me. The following is the latest code. It shows only a page with a blank content area. I need to get this code to update the database with AJAX, and to avoid re-loading the page, so that I can work in animations/transitions. The code is commented to reflect my understanding of what I'm trying to do. **Code:**               /*     *     *     SHORTCODE     *     *     */          add_shortcode('list-up-down', 'cb_lud_scfunc');          //This creates the shortcode.     function cb_lud_scfunc() {     //Define some basic variables.     global $wpdb;     $cb_lud_prefix = $wpdb->prefix;     $cb_lud_table = $cb_lud_prefix . 'cb_list_up_down';     $cb_lud_homeurl = home_url();     $cb_lud_upimg = plugins_url('list-up-down/images/up-arrow.png', _FILE_);     $cb_lud_downimg = plugins_url('list-up-down/images/down-arrow.png', _FILE_);     $cb_lud_sample_query = $wpdb->query('SELECT * FROM '.$cb_lud_table);     $cb_lud_field1_name = $wpdb->get_col_info('name',1);     $cb_lud_field2_name = $wpdb->get_col_info('name',2);          /*     CREATE THE JAVASCRIPT/JQUERY FUNCTION     */     //Create the Javascript and AJAX     //add_action('init', 'cb_lud_action_javascript');          function cb_lud_action_javascript() {     ?>                <?php     //End Javascript function.       }          //Call the javascript function.     //Rather than hook into an action, call whenever shortcode is in a page.     cb_lud_action_javascript();          /*     *     CREATE THE AJAX (HELP!)     *     */          /*     ARROW CALLBACK     */          //Use the Wordpress AJAX functions     //Apparently, there has to be an if->then statement depending on whether the user is an admin.     if( is_admin() )     {     add_action('wp_ajax_cb_lud_arrow_action', 'cb_lud_arrow_callback');     add_action('wp_ajax_nopriv_cb_lud_arrow_action', 'cb_lud_arrow_callback');     }     else     {     //Assume the 'else' is the normal execution of the shortcode.          //Want to get the POST values from the form, above.          //These don't seem to be working.              $cb_lud_entry_id = $_POST['entry'];         $cb_lud_arrow_direction = $_POST['arrowdirection'];               //If the post value is 'up', do this. If 'down', do this.               if ($cb_lud_arrow_direction == 'up') {             $wpdb->query('UPDATE '.$cb_lud_table.' SET up_votes=up_votes+1             WHERE entry_ID='.$cb_lud_entry_id.'');         }              else if ($cb_lud_arrow_direction == 'down') {             $wpdb->query('UPDATE '.$cb_lud_table.' SET down_votes=down_votes+1             WHERE entry_ID='.$cb_lud_entry_id.'');         }          die(); // this is required to return a proper result     }               //Create the function that executes the AJAX Callback     function cb_lud_arrow_callback(){         }          /*     CREATE THE FORM     */     //Create the form to allow users to add records         $cb_lud_sc_form = '             <form id="list-up-down-form" name="list-up-down-form" action="" method="post">

     //Using inputs rather than links because inputs can contain values.
'.$cb_lud_field1_name.':
<input id="field1_input" name="field1_input" type="text"></input>
'.$cb_lud_field2_name.':
<input id="field2_input" name="field2_input" type="text"></input>	                     <input name="add_record" type="submit" value="Add Record" />

             </form>             ';          /*     DEFINE HOW THE FORM HANDLES THE INPUT(S)     */     $field1_data = htmlspecialchars($_POST['field1_input'], ENT_QUOTES);     $field2_data = htmlspecialchars($_POST['field2_input'], ENT_QUOTES);     $up_votes = 0;     $down_votes = 0;     $new_data = array(         $cb_lud_field1_name => $field1_data,         $cb_lud_field2_name => $field2_data,         'up_votes' => $up_votes,         'down_votes' => $down_votes,         );     $format = array('%s', '%s', '%f', '%f');          if (isset($field1_data) && !empty($field1_data) && isset($field2_data) &&!empty($field2_data)) {         $wpdb->insert(             $cb_lud_table, $new_data, $format         );     }          /*     DISPLAY THE LIST     */               //Get the list from the database, and set the variables for display in the output.     $get_list = $wpdb->get_results('SELECT entry_ID, '.$cb_lud_field1_name.' AS "field1", '.$cb_lud_field2_name.' AS "field2", up_votes, down_votes, up_votes - down_votes AS "total_votes"         FROM '.$cb_lud_table.'         GROUP BY entry_ID         ORDER BY total_votes DESC         ',OBJECT);          //Check if list is null, and if so, set a variable to display a warning. Otherwise, display the list.     if (empty($get_list)) {         $cb_lud_sc_output .= "Warning: You don't seem to have any records for this list. Why don't you add some now?";         $cb_lud_sc_output .= $cb_lud_sc_form;         return $cb_lud_sc_output;     }     else {         $cb_lud_sc_output .= $cb_lud_sc_form;         $cb_lud_sc_output .= '
';         $cb_lud_sc_output .= '
';         $cb_lud_sc_output .= '
'.$cb_lud_field1_name.'	'.$cb_lud_field2_name.'	Score	Vote Up/Down
';             foreach ($get_list as $list_items) {                 $cb_lud_sc_output .= '
'.stripslashes($list_items->field1).'	'.stripslashes($list_items->field2).'	'.$list_items->total_votes.'	<form id="up-down-arrows-form" action="" method="post"><input class="up-arrow" name="arrow-up-ID-'.$list_items->entry_ID.'" type="image" src="'.$cb_lud_upimg.'" value="'.$list_items->entry_ID.'"/> <input class="down-arrow" name="arrow-down-ID-'.$list_items->entry_ID.'" type="image" src="'.$cb_lud_downimg.'" value="'.$list_items->entry_ID.'"/></form>
';                 }         $cb_lud_sc_output .= '
';         return $cb_lud_sc_output;     }     };     /*     END SHORTCODE     */


title: Is it possible to rewrite a page url Without setting the permalinks to Post Name?

text: Is it possible to rewrite the page url if your page link is for example `localhost/wordpress/?p=123` ? Instead of `post_name.php?...`. (So the first option of permalinks and not `post_name`.


title: Random sidebar/widget background

text: Does anyone have a clever idea to get a random/changing background for just the widget sidebar?


title: Pages included in another page and duplicate content issues for SEO

text: in a recent project I've decided to create a page template (PageX) which is a kind of "stack" of subpages. This template simply includes the content of three other separate pages (PageA, PageB, PageC). I'm just trying now to find the best way to avoid duplicate content for SEO, as Wordpress automatically create specific permalinks for these 3 subpages. Is there a way to tell Wordpress that these pages must not have permalinks?


title: Adding Pinterest Script Before Closing Body Tag

text: According to the Pinterest website in order to add the Pinterest button to any page I have to add the following just below the closing body tag:               <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>      What's the best way to do this? Should I follow the link, grab the script and use wp_enqueue_script? Or can I somehow include the script element another way? Thanks.


title: Upacking the package... stalls, but installs plugin

text: I have been searching high and low for the correct solution to my problem. I have found many searches relating to this, but can not find a solution... Here is the Updated Video to see what happens ? http://youtu.be/ILkaSyxFaDs When installing plugins or themes , it will get to the page:               "Unpacking the package..."      ![enter image description here](http://i.stack.imgur.com/RfUwx.png) and then just stalls. Nothing else happens. **The Plugin or Theme Installs just fine, but it doesn't output the correct info on this "update.php" page.** I have tried to edit my .htaccess page, increase memory_limit and a bunch of other tips that I found from searches. I even tried to install a fresh Wordpress and the problem still persists. Here is a snapshot of the source code of where the page stops loading from every time. Thanks in advance.. my head is spinning... **EDIT: Here is the debug info I am receiving:** > [24-Mar-2014 14:51:18] PHP Notice: ob_end_flush() [ref.outcontrol]: failed > to delete buffer zlib output compression. in /home/web/public_html/store/wp- > includes/functions.php on line 2773 ![enter image description here](http://i.stack.imgur.com/09iMb.png)


title: Is it a good idea to make whole theme widgetized?

text: I have mainly seen sites using widgets on sidebars or inside multi-column layout. However, I was wondering what if we could use widgets in every blocks like header, main content block, footer etc. Is that a good or a bad idea?