title: WP Cron and wp_insert_post

text: I'm trying to insert posts using a cron job, but I keep running into errors where WP is missing functions (`is_user_logged_in`, `wp_get_current_user`). Is there a proper way to run wp_insert_post using a cron job? This is the code I have so far. `phrets_hourly` is the WP_CRON hook               add_action('phrets_hourly', 'run_listings_update' );          function run_listings_update(){       $fetch = new Fetcher();       $fetch->fetch();     }      This is the code inside the `$fetch` object (Fetcher class) that is run.               public function fetch(){       $options['class'] = 'RES';       $options['limit'] = 10;       $options['offset'] = 0;       $options['silent'] = true;            $data = $this->query( $options );       foreach ( $data as $datum ) {         $this->place( $datum, true );       }     }          public function place( $data, $silent ){       $rets = $this->connect_to_rets();       $listing = new Listing( $data );       // check to see if listing already exists       $post_id = $listing->check_listing_exists( $data['MST_MLS_NUMBER'] );       if ( ! $post_id ) {         $action = $listing->put();       } else {         $action = $listing->update($post_id);       }     }      This is the method called from the `$listing` object (Listing class) that puts the data into the DB               public function put(){       $title = $this->create_title( $this->data );       // setup the 'post' data       $post = array(         'post_type' => 'listing',         'post_title' => $title,         'post_content' => $this->data['Remarks'],         'post_status' => 'publish'       );       // add new meta data       if ( ! is_wp_error( $post_id ) ) {         $this->add_meta_data( $post_id );         $this->assign_community( $post_id, $data );       }       // set the action       $action = 'inserted';       return $action;     }      Thanks!


title: Permalink broken for pages after adding rewrite rule

text: After adding these rewrite rules:               add_rewrite_rule( '([^/]+)/page/([0-9]{1,})?$', 'index.php?author_name=$matches[1]&paged=$matches[2]', 'top' );     add_rewrite_rule( '([^/]+)?$', 'index.php?author_name=$matches[1]', 'top' );      The permalinks for pages do not longer work. I get a "not found" template everytime I try to access a page. Posts, home, and archives do work. I added that rewrite rule because I want to be able to access users' archives without the author base tag like this:               http://sitename.com/authorname


title: How to manage ajax calls and JSON in wordpress

text: I have a custom post type that i want to access through jQuery - preferably using JSON. So first things first. creating a function that returns/echos json is easy enough, but how would I access it through jquery. as Mike writes in this question, he - as far as I understand - places it in the wordpress root. which would make it accessable using the php file name - but Is this recommendable? I would rather put it inside a plugin folder. I have tried reading the wordpress codex, but the way ajax calls are handled just confuses me, as you are posting every ajax call to admin-ajax.php, even though it is not an admin page? Can someone please straighten out the problems I'm having? /Storm **edit** The problem I had was understanding how ajax calls were to be made in wordpress, as well as where to place your php and js code to do/handle the calls. In the other question I linked to, you created a function placing the file in the wp root - I dont want to do that. But I have now learned how to use the wp_ajax_(nopriv_)[action] and can effectivly access the json i create. The problem remaining is Where i should place the JS to make the call. I want to place it in the plugins js file, but as this is to be presented in a page, **not** on the admin site, ajaxurl isn't defined, so i have to echo using php.               echo admin_url('admin-ajax.php');      So the question becomes how should I combine this php with the javascript, and how should i then enqueue it, seeing as it's not a file or a script.


title: WP Theme Development, Adding Content Areas to Custom Page Template

text:
I am not sure how to ask this, which is why I have been having trouble finding anything via google searches. I am hoping someone here will understand what I am looking for and be able to direct me to information about how to implement it. I am working on a custom theme. What I want to do is have on my template page, several areas that the client can add text. Each area would be in a different div. On the admin edit page, when the template page is selected, there would be a field for the client to add content for each div.
        Content brought in by admin

        Content brought in by admin

        Content brought in by admin
      I would like to do this via the admin edit page, rather than widgitize the content. In the template is:               <?php the_content(); ?>      Is there way to create more than one which, combined with some magic in the functions.php would create the field to edit on the admin edit page? In advance I thank you for your time in assisting me with this. Please let me know if you need more information. I am just looking for direction, I did try to figure this out on my own but my searches do not bring anything relevant up so I think I am not using the correct language.


title: The comment login form is visible to me but not to the user

text: I am beginner in wordpress & i am working on my own blog ( http://cssground.com/ ). Right now i am facing an issue with the comment form. The comment form is visible to me & it's work fine but is not visible to the user. Check this http://cssground.com/?p=30 I want a comment form like smashing magazine have. Please give your suggestion thanks :)


title: Add array of post id's to a category?

text: Is there a function to add array of post id's to a category,something like this array(2,3,5,6) to put in some category,not looking for update post. Tnx in advance.


title: Highlight a Featured Post?

text: I would like to "highlight" a featured post above all other posts with a special indicator. Is there a feature in WordPress that will do this or do I need to install a third party plug-in? I am using a custom WordPress install (not WP hosted).


title: Archive sorting functions by custom fields (front-end)

text: I want to give the users the ability to sort the posts in the archive by some custom fields that I pre-define. The end result would be en a tabbed container, and the user will click on the relevant filter-link that he/her want to see. As an example: http://www.metacritic.com/browse/games/genre/date/action/all I want to:   - Filter by date   - Filter by title   - Filter by meta_key Is this possible to do? Thanks for all help.. :)


title: Most Flexible Photo Gallery Plugin?

text: What is the most flexible photo gallery plugin available on WordPress? By flexible, I mean a plugin that can:   * create galleries per folder / event   * display / generate thumbnails per size I want (it would be good to have an API/function for this)   * display the most recent gallery from either certain event or all photos uploaded. Is there any? Or something close to this?


title: Can I attach image to post without adding it to post?

text: another question about image. Can I add/attach images to post without adding it to post? The reason behind this is so that I can manipulate it whatever I want using API.


title: Wordpress problem with htmlentities

text: I make some changes over the post before storing it in the database. I use `content_save_pre` to do this. Some characters like `"` get done into `“` in the JavaSript code which I insert (part of the change). How do I prevent that from happening?


title: Is it possible to determine proxy based comments?

text: I think proxy based comments mostly spam. So what is the best way of determining proxy using comments ?


title: sidebar isn't showing, what's wrong w/ this code?

text: Here's what I have in my sidebar.php:                          <?php if ( is_user_logged_in() ) {           echo ''         } else {           echo ''         }         ?>                    <img src="<?php bloginfo('template_url') ?>/images/ipad-ad.png" alt="iPad 2 Giveaway!" />                      For some reason, it doesn't show (not even in the markup) for any of the pages. I've double-checked all of the other templates to make sure `<?php get_sidebar(); ?>` is included. Is there something wrong w/ the code above? Edit: I should note that the below works, that is, without the if/else statement.                          <img id="join-the-forums" src="<?php bloginfo('template_url') ?>/images/join-the-forums.png" alt="Join the Forums!" />                    <img src="<?php bloginfo('template_url') ?>/images/ipad-ad.png" alt="iPad 2 Giveaway!" />


title: Customize WooCommerce Error Message

text: I would like to change the wording of an error message I see in WooCommerce. Are there any filters I can use to do this?


title: wp_editor removes HTML and inline styles

text: I use the `wp_editor` function to display an editor in front-end. The problem is that this editor doesnt behave like the editor in backend based on the settings I give as input:               $settings = array(             'wpautop' => true,                 'media_buttons' => false,             'tinymce' => array(                     'theme_advanced_buttons1' =>                       'formatselect,|,bold,italic,underline,|,' .                                     'bullist,blockquote,|,justifyleft,justifycenter' .                                     ',justifyright,justifyfull,|,link,unlink,|' .                                     ',spellchecker,wp_fullscreen,wp_adv ',                                                                     'mode' => 'specific_textareas',     ),     'quicktags' => false);          wp_editor($content, 'contentEditorBox', $settings );      The website is a front end private community, and the content inserted by all members is coming from Microsoft Word. This same content, if instered in backend, appear as a text wrapped by HTML tags (`p`, `br`...) and inline CSS styles when I swap to HTML mode in editor. But in front end, the editor doesn't show the mode tabs, and content is always raw content containing no HTML and no styles. I need that the content maintain its style i.e, to be inserted from front end like it does from backend. How can copy-paste from MS word to wordpress editor in front end maintain the styles and HTML? Your help is highly appreciated.


title: Automatically Query Parent Taxonomy

text: I have a custom taxonomy on my site that I query from the sidebar of the currently displayed term. Say I am on the `Term X` archives, then my custom post type of Products with the term of `Term X` are shown. I would like to avoid an empty result so I would like to query up the chain until posts are found. For example:   * **Term W** (5 products)      * **Term X** (1 product)        * **Term Y** (0 products)          * **Term Z** (0 products) If I were to query `Term Z` then I would like to show the result from `Term X` and stop there. **Here is what I currently have, but I can only get it to go one level above.**               <?php $queryvar = query_posts(array('post_type' => 'event',$the_taxonomy => $the_term,'showposts' => 10 ) ); ?>     <?php if(count($queryvar) < 1) {          do     {     $parents = get_ancestors( $term, $the_taxonomy );     $the_term = $parents[0];     $queryvar = query_posts(array('post_type' => 'event',$the_taxonomy => $the_term,'showposts' => 10 ) );     $term = get_term($the_term, $the_taxonomy);     echo $term->name;     }     while (count ($queryvar) == 0);     }     else { $the_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );     }?>


title: Should I use custom menu, C.P.T. or theme options, or something else for this?

text: On many sites ( particularly CMS style business sites) there are 2, 3 4 or sometimes more boxes usually containing a title, icon and some text. These appear under the header linking to strategic parts of the site. I have set up my custom theme so that the user can decide which parts of the site to link these boxes to via the theme options; but I can think of at least 2 or three other ways of doing this, and I'm wondering if I've made the right choice. The alternative options include   1. Setting it up as a WordPress custom menu ( which would only display the first 4 links in my case ) (though wrt menus, I was really hoping to display these 4 links in div's not ul's so I'm not sure about menus   2. a custom post type where the user could set up 'tiles' or something like that, working in a similar way.   3. I also could imagine a special category and using a query but I don't think that would work for me.  Has anyone got any wisdom/experience/pros&cons to share on this? Is there any reason to completely avoid one of the options?


title: Redirect loop error on wordpress landing page on localhost

text: I am trying to run a local version of a live Wordpress site, however, after setting up the local environment and attempting to access:               http://localhost/wordpress/       I receive the following error:               This webpage has a redirect loop     The webpage at http://localhost/wordpress/ has resulted in too many redirects.     Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.      Whilst I cannot visit the site, I am able to access the dashboard for the site locally at:               http://localhost/wordpress/wp-admin/      I have been trying to fix this for many hours, and have had another wordpress expert (who _already_ runs a local version of the same site) spend 2 hours hashing through this with me. No luck. I would appreciate any help. As hopefully useful background: To run the local version I installed MAMP, and both the MySQL and Apache server are green. I have placed a copy of all the site files in MAMP/htdocs/wordpress. I have exported the site database as an .sql file, created a new database in the phpmyadmin page loaded through MAMP, and imported the .sql file. I have also updated the config.php file to have the following details:               define('DB_NAME', 'database_name');          /** MySQL database username */     define('DB_USER', 'root');          /** MySQL database password */     define('DB_PASSWORD', 'root');          /** MySQL hostname */     define('DB_HOST', 'localhost');          /** Database Charset to use in creating database tables. */     define('DB_CHARSET', 'utf8');          /** The Database Collate type. Don't change this if in doubt. */     define('DB_COLLATE', '');      I have also changed all the wordpress urls to run off localhost:80/wordpress through a SQL find and replace statement. My .htaccess file contains the following:               # BEGIN WordPress          <IfModule mod_rewrite.c>      RewriteEngine On      RewriteBase /      RewriteCond %{REQUEST_FILENAME} !-d      RewriteCond %{REQUEST_FILENAME} !-f      RewriteRule ^(.+)$ /index.php/$1 [NC,L,QSA]     </IfModule>          # END WordPress      All of this setup yields the error when trying to view If anyone requires any further information or any of the above is not clear, I will be happy to provide. Thanks in advance for any help.


title: Limit the number of pages created by the paging

text: Any way to limit the number of pages that are created automatically by paging? I would limit to five pages in all, authors, tags, categories ... Ex: "site.com/tag/news/page/5", "...author/admin/page/5." Thanks.


title: Show Woocommerce Product "attributes/extra information tab" in widget

text: I have a question concerning WP in combination with WooCommerce, I hope someone can help me out. When viewing a product on the site I would like the "extra information tab" (containing all the attributes I added to the product) to be showed in a widget next to the product description (via a sidebar in the theme) instead of them showing as a seperate tab underneath the product photo. I'm guessing I would need to add a widget with a custom hook/filter or something to display the product attributes? Could anyone help me out here? Would be greatly appreciated! Thx!


title: How do I allow anyone to edit a post -- but not access dashboard

text: I have a a business directory using premium press theme ---- I want all registered users -- to be able to edit and publish, upload images to any listing that has not been secured by payment. I do not want them to be able to delete and I do not want them to be able to access that dashboard. I have front end edit and update api -- but WP expects them to be the owner of the post to actually update. I have tried using different plugins -- but I just do not have enough experience with WP internals to get this accomplished -- can any one assist me please.. I have tried using role scoper, user role etc


title: Do not allow to search certain words

text: I would like to delete (not allow) searches with certain keywords (eg "of", "a"). If the search is done using exactly these terms, do not return anything or redirect to 404 page ... Thanks guys.


title: Getting an extra post's meta data?

text: I seem to be getting an extra post's data when calling `get_the_time('Y');` I only have 2 posts, but I seem to be getting 3 dates? I have no idea why. Here's the code:               <?php $args = array( 'post_type' => 'post', 'category_name' => 'celebrity');             $loop = new WP_Query($args);             while($loop->have_posts()) : $loop->the_post();              $get_year[] = get_the_time('Y');              foreach($get_year as $year) {               echo $year;             }             endwhile; wp_reset_postdata(); ?>      This outputs: "2013 2013 2013" It seems to only be doing this when I do a `foreach` if I just `echo get_the_time` it works fine, outputting two "2013". The point of this code is that I just want a list of years that have posts. My plan was to just stick each occurrence of the year into an array, use `array_unique()` and echo out each year. There will probably be better ways to do this, I'm open to suggestion but this was the first thing that came to mind. So to recap, I seem to be getting 3 dates instead of 2 when I only have 2 posts.


title: Possible to filter custom post type with multiple meta data?

text: I'm wondering if it's possible in one loop to accomplish what I need to do. What I would like is to sort all custom post types by the meta data of county and put them in order which it is doing here. But I would also like it to then sort by acres within that. So it would look like: County 1 - acres 1, County 1 - acres 2, County 2 - acres 1, County 2 - acres 2 etc. But I have a third meta data value that I would like to sort by also. So I would like it to behave this way but show the properties that are not sold first and then the ones that are sold second. So it would look like: County 1 - acres 1 - not sold, County 1 - acres 2 - not sold, County 2 - acres 1 - not sold, County 2 - acres 2 - not sold, County 1 - acres 1 - sold, County 1 - acres 2 - sold, County 2 - acres 1 - sold, County 2 - acres 2 - sold etc. Is this possible? Thanks in advance!                              <?php $args = array(                          'post_type' => 'property',                          'posts_per_page' => 100,                          'orderby' => 'meta_value',                          'meta_key' => 'county',                          'order' => 'ASC'                         );                                   $loop = new WP_Query( $args );


title: getting id of page

text: I am using taxonomy.php to display records from database. The function get_the_ID() in taxonomy.php gives the ID of first record from database. My URL is http://www.example.com/taxonomy_name/page_slug. I also tried :               global $post;     $post->id;      It is also giving ID of first record from database. How to get the ID of page?


title: Pass additional parameter in the URL

text: How do I pass additional parameter in the url for pagination to work my existing page link is `http://localhost/site/wp- admin/admin.php?page=myPage` How do I create the syntax / logic in PHP to add `&pagenum=1` in the url? currently I have this code               global $wpdb;          $per_page = 6;     $page_query = $wpdb->get_var("SELECT COUNT('id') FROM form");           $pages = ceil($page_query / $per_page);          $currentPage = (isset ($_GET['pagenum'])) ? (int)$_GET['pagenum'] : 1;     $start = ($currentPage -1 ) * $per_page;          $row = $wpdb->get_results("SELECT * FROM form LIMIT $start , $per_page");          //foreach loop here


title: How do I keep images in posts below a certain size without editing the post?

text:
I'm writing a theme that has a max body width of 620px. I've set `$content_width` to `620` in `functions.php`, as well as included the following code in my `style.css` file following the Codex page on `content_width`               .size-auto,      .size-full,      .size-large,      .size-medium,      .size-thumbnail {         max-width: 100%;          height: auto;      }      However, when I tested this by creating a new post with an image of width 1290px, the image still appeared in full size, instead of respecting the content width set. When I inspected the HTML generated I found this:

...

      which suggests that either the code in the documentation is outdated, or I must be missing some option to reduce the image dimensions down without having to modify the post?


title: I cannot log into my site

text: I cannot log into my site http://www.petsawarenews.com When I try asking for a password reset, it says that the address I registered with is invalid. What problem could there be?


title: Use shortcode as parameter for another shortcode

text: I'd like to use a shortcode as a parameter to pass to another shortcode:               [google_map address="[content field='address']"]      However, this outputs a blank map plus this string: "] I've looked in both shortcodes to see if do_shortcode() on the parameter would solve it, but no luck. Would anybody have an idea how to fix this?


title: wp custom field image and text multiple time

text:
from previews example link try to achieve this link this is working but is recreating double time the $text and $image and how can i create a new table to wrap every time a call the text and image?               <?php      $text = get_post_meta($post->ID, "text", false);     $image = get_post_meta($post->ID, "image", false);     if ($text . $image[0]=="")           { ?>     <?php } else { ?>                        <?php          foreach($text as $text1){        foreach($image as $image1){            echo '
'.$text1.'
' ;            echo '';        }     } ?>          <?php } ?>


title: How to make a Post Tag primary?

text: We are trying to rethink how a blog is laid out, by using Tags as primary headers for each post, instead of Categories. In order to do this, we have to set a Tag for the post as Primary. So, we are trying to read the Tags as they are input into the Post Tags widget in the Post Admin, by using Javascript to read the AJAX output printed to the page. We have accomplished that part of the equation. What we haven't be able to do, is then use document.write after printing the tags using .ready to another widget we created, so that the end user may select one of the Tags as primary. For some reason, it does not seem to like the document.write statement and we're not sure why. Any suggestions?


title: Wordpress Custom Post Type Admin Page really slow

text: (I've posted this on the normal stack exchange, but it was suggested that I put it here too. Glad to know this place exists... :)) So, I've been all over the internet trying to figure out what is going on with a couple of sites that I have, and I think I've finally been able to track it down... BUT I want to first make sure I'm doing everything correctly before going to Wordpress and suggesting that there's a small bug that is causing all sorts of annoyance to me and quite possibly a bundle of others. The crux of the problem is that I have multiple Wordpress (WP 3.5.1) sites that have a custom post type "products" on them. I've defined the custom post type as follows:               /* Create custom Products taxonomy */     function create_custom_products_taxonomies() {     register_post_type( 'products',         array(             'labels' => array(                 'name' => __( 'Products' ),                 'singular_name' => __( 'Product' ),                 'add_new' => __( 'Add New' ),                 'add_new_item' => __( 'Add New Product' ),                 'edit' => __( 'Edit' ),                 'edit_item' => __( 'Edit Product' ),                 'new_item' => __( 'New Product' ),                 'view' => __( 'View Product' ),                 'view_item' => __( 'View Product' ),                 'search_items' => __( 'Search Products' ),                 'not_found' => __( 'No products found' ),                 'not_found_in_trash' => __( 'No products found in Trash' ),                 'parent' => __( 'Parent Product' )             ),             'public' => true,             'hierarchical' => true,             'menu_position' => 20,             'publicly_queryable' => true,             'query_var' => true,             'rewrite' => array("slug" => "/products", "with_front" => false),             'supports' => array('title', 'author', 'thumbnail', 'editor', 'excerpt', 'comments', 'page-attributes', 'common', 'custom-fields', 'revisions'),             'register_meta_box_cb' => 'products_meta_box',             'taxonomies' => array('products')         )     );     register_taxonomy(         'products',         'products',         array(             'hierarchical' => true,             'label' => __(ucfirst('products')),             'show_in_nav_menus' => true,             'rewrite' => array('slug' => 'categories')         )     );     }     add_action('init', 'create_custom_products_taxonomies'); // Create the necessary custom taxonomies for products      The problem comes in where I'm trying to access the listing page for that custom post type. The analogous page for posts is "Posts" in the admin sidebar on the left side of an admin page. The name of the page that I have for my custom post type listing is, appropriately enough, "Products". When accessing that page, it takes a literal AGE to load. Okay, so it's really something like 8-12 seconds from load to load, where any other page on the admin side will load in about 1-2 seconds. Additionally, the page will frequently time-out and throw the generic error about "Service being temporarily unavailable". (Not sure where this error is coming from. Apache, Wordpress, etc) This aberrant behavior led me to try and debug the admin side of my site. I found the plugins "Debug Bar" and "Debug Bar Extender". Using these plugins in tandem, and after loading the appropriate page, I can view the query for that page, but the query arguments are the more important comparison in this case: -- for the Posts listing page -- post_type=post&posts_per_page=400 * * * -- for the Products listing page -- order=asc&orderby=menu_order+title&post_type=products& **posts_per_page=-1** &posts_per_archive_page=-1 * * * In this case, the number of posts to display on the "Posts" page (set in the Screen Options tab at the top of the page) is set to 400. Looks good. The number of products to display, however, (set in the same way, but on the Products page) has been set to 25. Regardless of this fact, the posts_per_page query argument for the Products page (shown above) is set to -1, which means Wordpress is grabbing ALL of the posts with my custom post type "products", but then only display the requisite 25. This happens in an identical manner for the multiple pages (pagination) associated with my list of products. This seems bogus to me. Thus my question: Have I set up (registered) the custom post type incorrectly? I am seeing this same behavior when I disable all other plugins on my site, and I am only using the register_post_type function to set up this custom post type. If something wrong is happening here, (as it seems to me to be) I'll report it to Wordpress. If not though...I didn't want to "bug" them unnecessarily. :) I've seen this behavior on multiple sites, but the reason that the admin page- load time stuck out to me on this site is because I have 3k+ posts with this custom post type, whereas on other sites employing my custom post type registration code only have ~300-400 products on them. Thanks to anyone willing to help and/or comment.


title: Addition Text to Post Titles (Custom Post Types) in RSS

text: First, I have used this code to add my custom post types into my feed (below):               function myfeed_request($qv) {         if (isset($qv['feed']))             $qv['post_type'] = get_post_types();         return $qv;     }     add_filter('request', 'myfeed_request');      Later, I encountered WPBeginner's Adding Additional Text to Post Titles in RSS and decided to modify the following code:               function wpbeginner_titlerss($content) {     global $wp_query;     $postid = $wp_query->post->ID;     $gpost = get_post_meta($postid, 'guest_post', true);     $spost = get_post_meta($postid, 'sponsored_post', true);          if($gpost !== '') {     $content = 'Guest Post: '.$content;     }     elseif ($spost !== ''){     $content = 'Sponsored Post: '.$content;     }     else {     $content = $content;     }     return $content;     }     add_filter('the_title_rss', 'wpbeginner_titlerss');      Into this to suit the display of my custom post types in RSS:               function wpbeginner_titlerss($content) {     global $wp_query;     $post_type = $wp_query->post_type;          if( get_post_type() == 'essays' ) {     $content = 'Essay: '.$content;     }     elseif ( get_post_type() == 'gallery' ){     $content = 'Gallery: '.$content;     }     elseif ( get_post_type() == 'games' ){     $content = 'Game: '.$content;     }     else {     $content = $content;     }     return $content;     }     add_filter('the_title_rss', 'wpbeginner_titlerss');      This final code does not display my custom post types the way I want at all, any idea/help will be greatly appreciated!


title: Remove "Published On" inside wp-admin

text: How do I remove this? Preferaly would like to do an action hook inside functions.php to remove this. I don't want the editor to see/edit when they published the article. Thank you for your help. ![enter image description here](http://i.stack.imgur.com/bUpFI.jpg)


title: Posts archive index pagination in a static page custom query

text:
In WordPress, I have a page for News that is using a specific page template I created. This page is populated by news posts assigned to the news category. I need to show only two of the latest news posts on this page with Previous / Next links at the bottom if users want to read more news. However, the next / previous links are not working. Clicking on them does go to /page/2 but it's shows the same posts. Here is my code .. any ideas / help appreciated!

         <?php query_posts( "category_name=news&orderby=date&order=ASC&posts_per_page=2" ); ?>                     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

Posted on <?php the_date(); ?>                         <?php the_excerpt(); ?>                     <?php endwhile; ?>                     <?php endif; ?>

<?php previous_posts_link("< previous news") ?>

<?php next_posts_link ("more news >") ?>


title: Add existing images from Media Library in to custom gallery

text: I have `[gallery]` inside the post, and I'm interested in a way to add already existing images from media library in to this gallery? once I trying add any image I have only one option - insert into post. Thanks in advance, Dmitry


title: anyone can help me to know whats going wrong?

text: when posting a comment I got the follow error, Warning: call_user_func() [function.call-user-func]: First argument is expected to be a valid callback in /home/... .../wp-includes/functions.php on line 1904 Warning: Cannot modify header information - headers already sent by (output started at /home/... .../wp-includes/functions.php:1904) in /home/... .../wp- content/plugins/jetpack/modules/subscriptions.php on line 487 Warning: Cannot modify header information - headers already sent by (output started at /home/... .../wp-includes/functions.php:1904) in /home/... .../wp- content/plugins/jetpack/modules/subscriptions.php on line 492 Warning: Cannot modify header information - headers already sent by (output started at /home/... .../wp-includes/functions.php:1904) in /home/... .../wp- includes/comment.php on line 586 Warning: Cannot modify header information - headers already sent by (output started at /home/... .../wp-includes/functions.php:1904) in /home/... .../wp- includes/comment.php on line 587 Warning: Cannot modify header information - headers already sent by (output started at /home/... .../wp-includes/functions.php:1904) in /home/... .../wp- includes/comment.php on line 588 Warning: Cannot modify header information - headers already sent by (output started at /home/... .../wp-includes/functions.php:1904) in /home/... .../wp- includes/pluggable.php on line 881 can it be related to JETPACK plugin ???


title: Move WordPress site from one domain to another

text: I've read through the codexs and I'm trying to find out the best way to change or move my MySQL and subdirectory files to a new domain without extraneous effort. For instance, I built a stage site under my name/subdirectory/and have recently purchased a new domain for a friend and would like to migrate the data over to the new domain. I spoke with my domain hosting company at length and makes like to me that it is not a hosting concern. That they would offer no support for anything WordPress. So I have everything working under a public_HTML/subdirectory… But I'm not sure what steps to take next. I've moved WordPress into different folders before but not in 2 different domains. Any help would be greatly appreciated because my host was completely unwilling. ADDITIONAL INFORMATION: userabuser- thank you for the very detailed response. I think you should provide a little bit more details in order to narrow down which options would work best. The stage site is hosted on my hosting company. The current website is hosted on another platform in the domain is owned and operated through Go Daddy. The current site is active and those who are in charge of the site did not want any gaps in service. So I cannot transfer the domain name or point the DNS to my hosting company until site launch. If I continue building the site, adding links, and photos everything is still going to be on my primary domain and I fear will be incredible mess once the stage site becomes an active life site. I've backed up the databases multiple times along with all the WP files. I'm a little anxious to do any additional work without preplanning the next stage. Does this help or make any sense?


title: wp_nav_menu not appearing correctly on category page

text:
this is the code i am using to call wp_nav_menu               <?php          wp_nav_menu(                 array(                     'container_class' => 'menu-header',                     'theme_location' => '',                     'menu_id'         => 6,                     'depth' => 4                 )             );     ?>      the menu appears perfect on home page and single post pages, as seen here: http://www.enkitec.com/ but when i visit a category page e.g. http://www.enkitec.com/education/ the menu items change, it seems like some menu items don't appear. **note:** i have only 1 menu in dashboard and it is set as default menu **strange thing is:** the code above is included in header.php, so it is the same on all pages, but still the results are different on category page. _any help would be highly appreciated._ more over i am also including the code of my theme pages: **header.php**               <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                   <meta charset="<?php bloginfo( 'charset' ); ?>" />         <title><?php wp_title('-', true, 'right'); ?> <?php bloginfo('name'); ?></title>         <meta name="description" content="<?php echo is_single() ? single_post_title('', true):bloginfo('name')." - ".bloginfo('description'); ?>" />         <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" />         <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/font_kit/stylesheet.css" type="text/css" charset="utf-8" />         <link rel="shortcut icon" href="<?php bloginfo('template_url'); ?>/favicon.ico" />         <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />                                             <?php if (is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply'); ?>         <?php wp_head(); ?>

                     <?php                         wp_nav_menu(                             array(                                 'container_class' => 'menu-header',                                 'theme_location' => '',                                 'menu_id'         => 6,                                 'depth' => 4                             )                         );                     ?>

                  <?php $single_cat_title = single_cat_title(); ?>             <?php $p_title = trim(wp_title(NULL, FALSE)); ?>             <?php $cat = get_the_category(); $c_title = trim($cat[0]->name); ?>      **category.php**

                     <?php if (have_posts()) : ?>                     <?php while(have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>"><?php the_title(); ?>
                         <?php // the_content(); ?>                         <?php the_excerpt(); ?>

                             <?php the_time('F jS, Y') ?>,                             By <?php the_author_posts_link(); ?>.                             Filed Under: <?php the_category(', '); ?>

                          <?php endwhile; ?>                          <?php if (  $wp_query->max_num_pages > 1 ) : ?>

<?php next_posts_link(__('« Older posts', '')); ?>

<?php previous_posts_link(__('Newer posts »', '')); ?>

                     <?php endif; ?>                          <?php else : ?>
Nothing Found

Sorry, but you are looking for something that isn't here.

<a href="<?php echo get_option('home'); ?>">Return to home page

                          <?php endif; ?>                          <?php if (is_home()) : ?>

                     <?php endif; ?>

                     <?php get_sidebar(); ?>

          <?php get_footer(); ?>      **footer.php**

                     <?php get_sidebar('footer'); ?>

                     © COPYRIGHT <?php echo date("Y"); ?>, ENKITEC, LP.

         <?php wp_footer(); ?>                          **functions.php**               <?php         /* Register a Custom Post Type (Slide) */         add_action('init', 'slide_init');         function slide_init() {             $labels = array(                 'name'                  => _x('Slides', 'post type general name'),                 'singular_name'         => _x('Slide', 'post type singular name'),                 'add_new'               => _x('Add New', 'slide'),                 'add_new_item'          => __('Add New Slide'),                 'edit_item'             => __('Edit Slide'),                 'new_item'              => __('New Slide'),                 'view_item'             => __('View Slide'),                 'search_items'          => __('Search Slides'),                 'not_found'             => __('No slides found'),                 'not_found_in_trash'    => __('No slides found in Trash'),                  'parent_item_colon'     => '',                 'menu_name'             => 'Slides'             );             $args = array(                 'labels'                => $labels,                 'public'                => true,                 'publicly_queryable'    => true,                 'show_ui'               => true,                  'show_in_menu'          => true,                  'query_var'             => true,                 'rewrite'               => true,                 'capability_type'       => 'post',                 'has_archive'           => true,                  'hierarchical'          => false,                 'menu_position'         => null,                 'supports'              => array('title', 'excerpt', 'thumbnail')             );              register_post_type('slide', $args);         }              /* Update Slide Messages */         add_filter('post_updated_messages', 'slide_updated_messages');         function slide_updated_messages($messages) {             global $post, $post_ID;             $messages['slide'] = array(                 0 => '',                 1 => sprintf(__('Slide updated.'), esc_url(get_permalink($post_ID))),                 2 => __('Custom field updated.'),                 3 => __('Custom field deleted.'),                 4 => __('Slide updated.'),                 5 => isset($_GET['revision']) ? sprintf(__('Slide restored to revision from %s'), wp_post_revision_title((int) $_GET['revision'], false)) : false,                 6 => sprintf(__('Slide published.'), esc_url(get_permalink($post_ID))),                 7 => __('Slide saved.'),                 8 => sprintf(__('Slide submitted.'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))),                 9 => sprintf(__('Slide scheduled for: %1$s. '), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))),                 10 => sprintf(__('Slide draft updated.'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))),             );             return $messages;         }          /* Update Slide Help */     add_action('contextual_help', 'slide_help_text', 10, 3);     function slide_help_text($contextual_help, $screen_id, $screen) {         if ('slide' == $screen->id) {             $contextual_help =             '
' . __('Things to remember when adding a slide:') . '
' .             '
' .             '
' . __('Give the slide a title. The title will be used as the slide\'s headline.') . '
' .             '
' . __('Attach a Featured Image to give the slide its background.') . '
' .             '
' . __('Enter text into the Visual or HTML area. The text will appear within each slide during transitions.') . '
' .             '
';         }         elseif ('edit-slide' == $screen->id) {             $contextual_help = '
' . __('A list of all slides appears below. To edit a slide, click on the slide\'s title.') . '
';         }         return $contextual_help;     }     if (function_exists('add_theme_support')) {         add_theme_support('post-thumbnails');     }               function checkFeild($a) {         if (trim($a)==""||$a==NULL||empty($a)) {             return false;         } else {             return true;         }     }          if (function_exists('register_sidebar')) {         register_sidebar(array(             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));     }          function register_my_menus(){         register_nav_menus(             array(                 'header-menu'=>__('Header Menu')             )         );     }     add_action('init', 'register_my_menus');          function fix_missing_menu($query) {         $query->set('post_type', array('post', 'nav_menu_item'));     }     add_filter('pre_get_posts', 'fix_missing_menu');     ?>


title: turn single domain off

text: I am running `WordPress` 3.3.2 with `multi site` in sub-domain mode. I want to add a new `sub-domain` but have it be "offline" until I finish working on it. Is there an easy way to do this? I know that if its a single site i can just add an `if` in the header file and the site will be online only to me, but in this case all of my sites are using the theme, making it the same header file thus making this solution invalid. thank you.


title: WP_Query on custom taxonomy works fine but fails if run through wp_ajax_

text: I'm using WP_Query to collate some info about posts based on their custom taxonomy. My arguments are as follows:               $args = array(             'posts_per_page'=> -1,             'post_status' => 'publish'         );              if ( isset($_POST['tag_id']) ) :             $args['tax_query'] =                 array(array(                     'taxonomy' => 'region',                     'field' => 'id',                     'terms' => $_POST['tax_id'],                 ));         endif;      Then I loop through and collate my data. And that works perfectly well. But because it's quite a heavy query, and appears for each taxonomy id I thought I'd run it on user demand and return the data with wp_ajax_ The same query seems to ignore all the tax_query arguments when returned through ajax. The arguments are the same and the correct "terms" is being passed. It's identical. I can't figure it out. Is this a bug? It's bugging me. Updated to put the code in pastebin: http://pastebin.com/rxSJ1C2n The class is at the top, then the bit of jQuery I've put at the bottom but is actually in a separate file.


title: How To Add New Option Types To Option Tree?

text: I am using option tree in theme mode and child theme mode and I am trying to add new option types. The new option types will be based off of the post- select option type, but will only list posts from a specific category. I created a new file and added it to the array of files to be included that begins on line 178 of ot-loader.php. In the new file I cut and pasted the post-select option type that begins on line 905 of /includes/ot-functions- options-type.php. You can see this new file here. In my post select option type I appended a unique slug to the function name. I also put that slug on the css class .type-post-select for the format outer setting wrapper. In the post query post array I added a category parameter. Then I added my new post-select option type to my theme options, hoping it would show only posts in the category I had set. It showed the posts from all categories. Interestingly enough the option was wrapped in .type-post-select. I also created a regular post-select, which did not have the modified css. As an experiment I tired adding the category parameter to the original post- select option in the same way and it worked exactly as I expected--only showing posts from that category. Unfortunately I need to create 6 new post- selects each showing posts from a different category. Clearly I am missing a step, but for the life of me I can not find it. I looked for some other place that option types need to be registered or something, but couldn't find it...


title: Is wordpress a library with a default GUI?

text: First let me give little bit background about myself. I'm a desktop application developer and a systems programmer. I usually write all my applications in Assembly,C,C++. I'm not much of a web developer. I did developed couple of websites in PHP. Nothing great, No design patters, No frameworks, No external libraries, just a simple database querying and generation of HTML. I'm trying to understand Wordpress. This is my view point about wordpress. Just correct me if I'm wrong.   1. WordPress is a library (set of functions) which has inbuilt functions for Creating, Updating, Deleting & Retrieving Posts & Comments from the database. Like QT has functions for creating widgets.    2. Wordpress is not just a library it also has a sample Frontend to demonstrate those functions from its library.Like QT ships with some sample GUIs built using the functions. If you want a different GUI, you can modify the default GUI to your needs. Now, this modifying frontend (GUI) can be done in two ways:   3. For simple modifications, Unlike in QT, they've provided with an interface for modifying - a customization panel (Admin panel)   4. For large modifications, like QT, you'll have to edit the code and make further changes.   5. Suppose, I've made changes to default GUI to meet my needs. And I'm updating a wordpress, only the library will be updated not the (default) GUI because, it would break my frontend.


title: Rewrite ugly URL to clean URL

text: Im trying to go from:               http://www.example.com/product?level1=value1&level2=value2&level3=value3&level4=value4      To:               http://www.example.com/product/value1/value2/value3/value4      Sometimes not all values are set, so it also needs to work with only 2 values set:               http://www.example.com/product/value1/value2      The `http://www.example.com/product/` page uses its own template file. This is how my code looks like:               function my_rewrite_rules( $wp_rewrite ) {         $wp_rewrite->rules =         array_merge( array(             '^product/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$' =>             'index.php?level1=$matches[1]&level2=$matches[2]&level3=$matches[3]&level4=$matches[4]'         ), $wp_rewrite->rules);     }          add_filter( 'generate_rewrite_rules', 'my_rewrite_rules' );          function my_rewrite_queryvars( $qvars ) {         $qvars[] = 'level1';         $qvars[] = 'level2';         $qvars[] = 'level3';         $qvars[] = 'level4';         return $qvars;     }          add_filter( 'query_vars', 'my_rewrite_queryvars' );      It works when im trying to get the query_vars, but it also gives me a 404 page, and not the right template. What am I doing wrong?


title: Can user meta be shown or hidden depending on user logged in status?

text: Can **is_user_logged_in** be combined with **jquery** somehow to add/remove fields wrapped in a certain class? More specifically:   * I want to wrap the users' phone and email in class "private".    * Then if the user viewing the page is logged in, they can see those two fields in the User Directory and on the User page. I don't want to just hide these fields via 'display: none;' (since they'd still be in the source).


title: Why isn't my registered sidebar showing up in the admin?

text:
I'm using sidebars in my mega menu drop downs to let the admin add widgets specific areas of the menu:

<?php if ( ! dynamic_sidebar( 'submenu1-1' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu1-2' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu1-3' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu1-4' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu2-1' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu2-2' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu2-3' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu2-4' ) ) : ?><?php endif; // end sidebar widget area ?>

      in my functions.php:               function my_widgets_init() {     /**      * menu widget areas      **/      //area 1     register_sidebar( array(         'name'          => __( 'First Menu Item - First Column', 'cfhof' ),         'id'            => 'submenu1-1',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'First Menu Item - Second Column', 'cfhof' ),         'id'            => 'submenu1-2',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'First Menu Item - Third Column', 'cfhof' ),         'id'            => 'submenu1-3',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'First Menu Item - Fourth Column', 'cfhof' ),         'id'            => 'submenu1-4',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );          //area 2     register_sidebar( array(         'name'          => __( 'Second Menu Item - First Column', 'cfhof' ),         'id'            => 'submenu2-1',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'Second Menu Item - Second Column', 'cfhof' ),         'id'            => 'submenu2-2',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'Second Menu Item - Third Column', 'cfhof' ),         'id'            => 'submenu2-3',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'Second Menu Item - Fourth Column', 'cfhof' ),         'id'            => 'submenu2-4',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     }     add_action( 'widgets_init', 'my_widgets_init' );      the first set shows up but not the second.


title: SQL: Search query to get attachments only of those parents which are published

text: i'm having some problem creating nice 1 query to be able to get search results which includes NOT only post_type POST but also attachments. BUT if search query return attachment, i want that it won't be returned if that's attachment's parent is NOT published. I'm using ajaxy-search plugin and i want to customize it to search what i want. I pasted query which works for me, but i want to exclude attachments which parents are not published.               $results = $wpdb->get_results(         $wpdb->prepare(             "select $wpdb->posts.ID,                 $wpdb->posts.post_status,                 $wpdb->posts.post_parent             from $wpdb->posts             where post_title like '%%%s%%' and                 (post_type='albumas' OR post_mime_type='audio/mpeg')                  AND (post_status = 'inherit' OR post_status = 'publish')             $excludes limit 0,".$setting->limit,             ($setting->search_content == true ? array($name, $name):$name)         )     );                                                                             `      I know how to do that, but i want to get the most optimal code here, not executing in loop queries to check post_parent id and then if it's published. I want as much performance friendly code as it can be :D


title: plugin not updated after update wordpress 3.5.2

text: after upgrade to 3.5.2 plugin update not working showing error : > Downloading update from > http://downloads.wordpress.org/plugin/adminimize.1.8.4.zip… > > Unpacking the update… > > Installing the latest version… > > The package could not be installed. The plugin contains no files. > > Plugin update failed. and another problem is created I cant upload any image showing "HTTP ERROR" and cant see any thumbnail in media library. any help appreciated...


title: Using Jetpack carousel w/o creating a gallery

text: I want to use the Jetpack Carousel for all my posts without editing all of them. Is there a way to show pictures in the carousel even if they're not in a gallery?


title: How to Get Logged-in to "Remote WP Site" from my local script (in Same Browser)?

text: In Wordpress, is it possible:   * To "make my current browser" to get "logged-in" to the a WP site, from a script in my localhost? Means, i will be running a script in my `localhost`:   * `http://localhost/do_login.php` And after that, in the same browser, when i go to:   * `https://www.my_remote_wpsite.com/wp-admin` I should already be logged in there.   So my local script will make my current browser logged-in into the remote WP site. How can it be done please?


title: get_pages Not accepting my query

text: Im hoping someone maybe able to point out my mistake. I have a function in functions.php with a simple meta_query. If I use this query.               $args = array(     'meta_query' => array(       array(        'meta_key' => 'Partner_Level',        'meta_value' => 'Gold',        'post_type' => 'page',        'post_status' => 'publish'      )));     $pages = get_pages($args);               foreach ( $pages as $page ) {     $option = '<option value="' . get_page_link( $page->ID ) . '">';                 $option .= $page->post_title;                 $option .= '</option>';                 echo $option;     }      I retrieve every page in my site, not the ones matching the $args passed to get_pages(); If I simplify the $args to               $args = array(         'meta_key' => 'Partner_Level',         'meta_value' => 'Gold',         'post_type' => 'page',         'post_status' => 'publish'         );      Then Im not getting any results at all. So it really is an all or none, from what I can see my query looks good, but I know Im overlooking something, but what.... ? Appreciate any help with this. I have performed a SQL statement and Im able to retrieve the expected results using..               $querydetails = "        SELECT wposts.*        FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta        WHERE wposts.ID = wpostmeta.post_id        AND wpostmeta.meta_key = 'Partner_Level'        AND wpostmeta.meta_value = 'Gold'        AND wposts.post_status = 'publish'        AND wposts.post_type = 'page'        ORDER BY wposts.post_date DESC      ";       So my assumption is its something with get_pages() not listening to my $args. Thanks in advance.


title: Given a WP_Query, how can I get a list of tags?

text: I have a `new WP_Query` that I use to generate a custom loop and display a set of posts. One of the things the query does is provide pagination. Before I display the queried posts though, I'd like to get a list of all the tags for the posts found. I know I can do this by looping through each of the posts and then removing duplicates, but I was hoping for a more elegant approach.


title: Saving value of a selection option in comment form as comment meta

text: In a plugin that I am writing I need to let user choose an option from a dropdown list before they post a comment. I used the comment_form action and inserted a drop down into the comment form.               /**      * Modify the comment to add our custom left and right dropdown      */     function modify_comment_form($post_id) {         echo "         <label class='comment'>Choose your side:</label>         <select id='tallytree_side' name='tallytree_side'>             <option selected='selected' value='neutral'>Neutral Comment</option>             <option value='left_answer'>" . $this->get_left_answer() . "</option>             <option value='right_answer'>" . $this->get_right_answer() . "</option>         </select>";     }     add_action('comment_form', 'modify_comment_form');      Which looks like this: ![enter image description here](http://i.stack.imgur.com/X3bAr.png) Now I just need to be able to save the value of this dropdown list when the comment is posted as a meta data of this particular comment. Note that this is a plugin and I dont want to modify core wordpress files as suggested in a tutorial here. I found a relevant discussions on the wordpress forum but I still could not find the answer I was looking for. How can I save the selected option value as a comment meta in wordpress database? Do I need to use AJAX for this or can this be achieved by simply using an action or filter that I could use to retrieve the value of the dropdown menu?


title: Problem with registration page

text: I am sorry if this is a very trivial question, but I am very new to wordpress and this is the first time I use wp. I am trying to set a website with wordpress and buddypress. I followed all the steps and the website is up and running in my localhost. Now I would like that a new members can register in the website. When I try to go to registration page server tell me that the page does not exist. I googled for a while, but I did not found any basic tutorial. Then I believe that this is a very trivial question, so I am wondering if something goes wrong during the installation. Who can help me or give me a resource to fix this problem?


title: Add subtitle to Woocommerce product title

text: I'm using WooCommerce on a site built with Pagelines Framework. I need to have a subtitle/customisable field appear under the product name anywhere it appears in the site. As it is, WooCommerce doesn't offer that option. I've tried using custom fields but WooCommerce use these too and output a bunch of stuff I don't want along with my subtitle. If I were to name my custom field "bookauthor" would this code work to display only the custom field I want?               <?php echo get_post_meta($id, "bookauthor", true); ?>      And if so, how do I make my new field output straight after the product title on the front end? I've found the hooks I need in this php file (I think, I don't know php, which is why I'm asking you):                   <?php      /*       * @hooked woocommerce_template_single_title - 5       * @hooked woocommerce_template_single_price - 10       * @hooked woocommerce_template_single_excerpt - 20       * @hooked woocommerce_template_single_add_to_cart - 30       * @hooked woocommerce_template_single_meta - 40       * @hooked woocommerce_template_single_sharing - 50     */     ?>      I know how to filter out but how do I add in the custom field to that list? Or is there an entirely different way to achieve what I need? Undying gratitude to anyone who can help.


title: WP E-Commerce - Navigation 'current item'

text: I'm using WP E-Commerce on a Wordpress site, which creates a 'Store' page and a 'Checkout' page. I'm also using wp_nav_menu() to create a menu. The problem is, when I'm viewing an individual product, the 'store' menu item doesn't have the 'parent_item' class, so I can't give it's active state in CSS. In fact, it sets the 'blog' page as the 'parent_item' class...which is really odd. Seems like a strange bug, unless I'm missing something of course. Any thoughts?


title: Modified Categories.php, it now displays wrong posts

text:
I recently modified Categories.php for a friend's website. The website is using the Twenty Twelve theme that I have customised to his specifications. I modified Categories.php in the following way:               <?php         $i = 0;              query_posts($query_string.'&posts_per_page=10');              /* Start the Loop */         while ( have_posts() ) :               the_post();         $post = get_post(get_the_ID());     ?>          <div class="custom-archive-item" style="<?php if($i == 0 || $i == 2 || $i == 4) echo "border-bottom: none;"; // awesome hacks ?>">
          <?php echo $post->post_title; ?>

Posted on:

<?php echo the_time("F dS Y"); ?>

<?php echo_first_image(get_the_ID()); echo get_the_excerpt(); ?>

          <?php $i++; endwhile; ?>      Every time a user clicks on an "archive" link, for example "June", it won't just show posts from that month, but posts from the beginning of time. Could anybody help please? see the website at: http://www.nbanewssource.com the archive links are in the sidebar. Thank you.


title: Query Not working as expected

text: So I wrote a rather - unattractive function - a while ago and I was re- factoring some code and I realized my query function doesn't work ... I recently made a post about how my tansient posts were not working and it all boiled down to the basics of the query not working. Now yes, I do actually get a post object back, and yes I do manage to loop through it and display some content. How ever the paging isn't working, its the same set of posts regardless of page number your on. So in reading that post I checked to make sure I am getting the max number of pages. and I am. But as stated, no matter the page I am on the posts are the same. Does the same concepts applied in the answer to my other question apply here or ...                   protected function _query_post($query, $remove_nav = false){             global $wp_query;             $original = $wp_query;             $wp_query = new WP_Query($query);                  if($wp_query->have_posts()){                 while($wp_query->have_posts()){                     $wp_query->the_post();                          if(isset($this->_options['post_before'])){                         echo $this->_options['post_before'];                     }                          $this->_components->thumbnail($this->_options);                          $this->_components->title($this->_options);                          the_excerpt();                          if(isset($this->_options['post_after'])){                         echo $this->_options['post_after'];                     }                                }                 if($remove_nav != true){                     $this->_general_loop_nav($wp_query->max_num_pages);                 }             }else{                 $this->_components->error_page($this->_options);             }                  $wp_query = $original;           }      Keep in mind this function is planning to be re-factored. This question has **not already been answered** as the query coming in looks like this:               'query' => array(         'post_type' => 'post',         'paged' => get_query_var('page') // Look i'm already paged     ),


title: How to access my php page in wordpress

text: I created a services folder in `wordpress/wp-content/services`. This folder will have web services coded in PHP. But when i try to access the `.php` file it is being redirected to `index.html` While checking the `.htaccess` file i came across the line `# ErrorDocument 404 /index.php` even though i commented the line the problem is still same. Is there any particular standard to be followed to access my php. I also tried including `require_once(wp-load())` but no use.. please help.. thanks


title: avoiding the display of certain categories to certain user roles at content entry time

text: How can I eliminate the "featured" category (and its sub tree ) in the admin panel when the user role is not editors or admins?


title: Creating Photo Gallery System with Custom Post Type

text: I'm creating a movie blog using WordPress. I have Movie and Trailer custom post types and I want to add a Photo feature for this and I want to add a relationship between this photos and Movie CPT. What the best way to handle this? Is custom field the answer? And manually add the movie post id on the custom field?


title: Extra User Profile Field Upload File / Image

text: I have been following the following tutorial to try and an upload form to the user profiles. http://www.scribd.com/doc/81666407/Add-and-Remove-WordPress- User-Profile-Fields-and-Display-Them-Within-Your-Theme- I'd like to be able to make this a little more simple and just have an upload button and text box that allows the user to upload one file at a time rather than multiple files. I was going to use Cimy Plugin which allows file uploads, however it doesn't seem to be possible to add sub headings for some fields. If any of you have any recommendations that would be brilliant.


title: How do I display a tag cloud under my post that only shows tags from that post?

text: I've be looking to add a tag cloud under my post that only shows tags pertaining to the post. The tags shown should be in a tag cloud format; the post tags that have more post tagged with it will be displayed in a bigger font. I've tried adding the following code under my posts:               <?php wp_tag_cloud( array(                  'smallest' => 8,          // font size for the least used tag             'largest'  => 22,         // font size for the most used tag             'unit'     => 'px',       // font sizing choice (pt, em, px, etc)             'number'   => 45,         // maximum number of tags to show             'format'   => 'flat',     // flat, list, or array. flat = spaces between; list = in li tags; array = does not echo results, returns array             'orderby'  => 'name',     // name = alphabetical by name; count = by popularity             'order'    => 'ASC',      // starting from A, or starting from highest count             'include'  => $post_id,         // ID's of tags to include, displays none except these             'link'     => 'view',     // view = links to tag view; edit = link to edit tag             'taxonomy' => 'post_tag', // post_tag, link_category, category - create tag clouds of any of these things             'echo'     => true        // set to false to return an array, not echo it              ) ); ?>      I was attempting to use the include array to call up the post id to take reference of the post tag. But it does not work. It shows all the tags in existence, instead of the tags that are specific to the post. Does anyone have a solution. Please help.


title: WP_Query leaking absurd amounts of memory

text: Every time I call WP_Query() in the function below, Wordpress leaks 8 megs of memory. And since I call this function a lot, things get hairy pretty quickly... :( I've tried unsetting the resulting $queryObject as well as periodically calling wp_cache_flush(), but neither seems to have any effect. Any thoughts?               function get_post_ids_in_taxonomies($taxonomies, &$terms=array()) {         $post_ids = array();              $query = gen_query_get_posts_in_taxonomies($taxonomies, $terms);         // var_dump($query);              //Perform the query         $queryObject = new WP_Query($query); //*****THE 8 MEGABYTES IS LEAKED HERE*****              //For all posts found...         if($queryObject->have_posts()) {             while($queryObject->have_posts()) {                 $queryObject->the_post();                      //Get the $post_id by capturing the output of the_ID()                 ob_start();                 the_ID();                 $post_id = (int) ob_get_contents();                 ob_end_clean();                      // echo $post_id."\n";                 $post_ids[] = $post_id;             }         }              unset($queryObject);              return $post_ids;     }      gen_query_get_posts_in_taxonomies() is:               function gen_query_get_posts_in_taxonomies($taxonomies, &$terms=array()) {         //General query params         $query = array(             'posts_per_page'    => -1,  //Get all posts (no paging)             'tax_query'             => array('relation' => 'OR'),         );              //Add the specific taxonomies and terms onto $query['tax_query']         foreach($taxonomies as $tax) {             //Get terms in the taxonomies if we haven't yet             if(!array_key_exists($tax, $terms)) {                 $terms[$tax] = array();                      $terms_tmp = get_terms($tax);                 foreach($terms_tmp as $tt)                     $terms[$tax][] = $tt->term_taxonomy_id;             }                  $query['tax_query'][] = array(                 'taxonomy' => $tax,                 'terms' => $terms[$tax],                 'field' => 'term_taxonomy_id',             );         }              return $query;     }


title: Sort the data in Wordpress using get-page-by-title

text: Just got this "fresh" task this morning. I have a website that using the following syntax               $thenews = get_page_by_title(date("Y"));      But in the website it's displaying not the latest news. What other parameter should I include in this syntax? To be honest I just start explore WordPress this morning but quite familiar with PHP Another problem is I only have the CMS module from vendor, I have no source file to play along. Thank you -sea-


title: PHP Warning on fresh install (Connection timed out)

text: I get this PHP Warning when accessing my fresh WordPress 3.4.1 install (Norwegian language).               Warning: fopen(URL_TO_MY_WORDPRESS_PAGE/wp-cron.php?doing_wp_cron=1341476616.7605190277099609375000): failed to open stream: Connection timed out in PATH_TO_MY_WP_FILES/wp-includes/class-http.php on line 923      This is of course with the `WP_DEBUG` flag set to `true`, as it's running on a development server. ![enter image description here](http://i.stack.imgur.com/fkFpe.jpg) This happens intermittently, so it seems to be a problem with `wp-cron`. Is this likely an error in WordPress or something wrong on my server? **Should I worry?** The server is a fresh Ubuntu Server 12.04 VM with the LAMP stack. Google search shows I'm not the only one experiencing this. (See buffered/indexed versions of pages listed to see the actual errors.) **EDIT: I'm also getting this same PHP Warning on the front page. Could it be related to the fact that the webserver is being NATed to? Currently I've set up the firewall to point port 19235 to 80 on the development server.**


title: Dynamically output a class to an anchor tag depending on what tag is chosen

text:
Not sure if this is possible, but what Id like to do is have the ability to output/add a class to an anchor tag depending on what tag I choose when creating the post. My reasoning behind this is to be able to call up different background images via CSS depending on the tag that will be chosen for each specific post. Here is an example of what Im ive got going already... What Im essentially doing here is showing a featured image from the post and then on hover, a jquery script is called to reveal the anchor tag over the image which contains the background image that Id like to dynamically change depending on the tag chosen.
              <?php $epr_acces = new WP_Query(array('post_type' => 'product', 'productcategory' => 'epr-accessories', 'posts_per_page' => 6, 'orderby' => 'rand', 'paged' => $paged )); ?>     <?php while ($epr_acces->have_posts() ) : $epr_acces->the_post(); ?>
     <a href="<?php the_permalink(); ?>" title="View Item" class="product_view_sm">..View Item..     <?php the_post_thumbnail('prod-img-sm', array('class' => 'single_product_img_sm', 'alt' => 'View Product')); ?>
          <?php endwhile; ?>     <?php wp_reset_query(); ?>


title: Latest posts by category — how to exclude current post?

text:
This is the code I use to display the 4 most recent posts under the category the current post belongs to (right below the current post):               <?php if (is_single()) : ?>         <?php             $count = 0;             $aahan_category = get_the_category();             $aahan_category = get_term_by( 'name', $aahan_category[0]->cat_name, 'category');             $some_featured_posts = new WP_Query(array('category_name' => $aahan_category->slug, 'posts_per_page' => 4));             while ($some_featured_posts->have_posts()):                 $some_featured_posts->the_post();                 $count++;                 $no_margin = (2 == $count || 4 == $count) ? ' no-margin-right' : '';         ?>              <div class="latest-category-posts-image-t<?php echo $no_margin; ?>">         <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">             <?php the_post_thumbnail( 'thumbnail' ); ?>
<?php the_title(); ?>

              <?php             endwhile;             wp_reset_postdata();         ?>     <?php endif; ?>      In case it matters, I added this code in `content-single.php`. The code basically shows the featured images (post-thumbnail) of the 4 most recent posts under the category the current post belongs to, along with their titles. Now the question is, if the current post is among the `n` most recent posts (`n = 4` as per my code), how do I exclude it from the listing? **PS:** Although it goes without saying, it would be great if you can show how the code I use could be _optimized_.


title: When a user creates a post (pending), send a confirmation link that allows them to publish

text: I've got another question for you guys! I need the following thing:   1. User creates post (automatically sets it to pending for approval)   2. Send the user an email with a confirmation link   3. The User clicks the link   4. The posts will be set to approved and will be posted automatically How can this be created? Are there hooks in Wordpress available to create such a confirmation link?


title: Featured Image uploaded, attached and set but only appearing in the media library

text: I am using the function in this answer to upload, attach and then [set_the_post_tumbnail][2]/featured image to a post which I am creating from an RSS feed. I ran a test and the output is showing that the attachment ID matches my thumbnail ID. I checked in the media library and it is assigning the correct IDs according to get_post_thumbnail_id but **the problem is** my featured image meta box is not displaying the image through the dashboard or when using [get the post thumbnail][4] in my template. Am I missing any steps here? The code is mostly from the answer linked above with a few tests on the end.               global $wp_query;                     wp_insert_post($my_post); // create a new post                     $post_id = $wp_query->post->ID;  // get the ID for the new post                               $image_url = $thumbnail;                     $upload_dir = wp_upload_dir();                     $image_data = file_get_contents($image_url);                     $filename = basename($image_url);                     if(wp_mkdir_p($upload_dir['path']))                         $file = $upload_dir['path'] . '/' . $filename;                     else                         $file = $upload_dir['basedir'] . '/' . $filename;                     file_put_contents($file, $image_data);                          $wp_filetype = wp_check_filetype($filename, null );                     $attachment = array(                         'post_mime_type' => $wp_filetype['type'],                         'post_title' => sanitize_file_name($filename),                         'post_content' => '',                         'post_status' => 'inherit'                     );                     $attach_id = wp_insert_attachment( $attachment, $file, $post_id );                     require_once(ABSPATH . 'wp-admin/includes/image.php');                     $attach_data = wp_generate_attachment_metadata( $attach_id, $file );                     wp_update_attachment_metadata( $attach_id, $attach_data );                          set_post_thumbnail( $post_id, $attach_id );                     echo "Attachment ID: " . $attach_id;                     $post_thumbnail_id = get_post_thumbnail_id( $post_id );                                  echo "Thumbnail ID: " . $post_thumbnail_id;                      get_the_post_thumbnail($post_id, 'full');


title: Auto add content such as pages upon plugin activation?

text: I'm creating my first plugin and it requires some pages with content to functionally work properly. I was wondering if it is possible to show a message like "Click here to automatically add the required pages for this plugin" in the wordpress plugins area. So when the user activates the plugin this message will show and if the user clicks the button a function will run that will add the pages necessary. Any help in direction most appreciated. Matt


I have created a "custom link" under Menus. ![enter image description here](http://i.stack.imgur.com/HtIGQ.jpg) The problem is that URL in the browser retains the Wordpress URL ( http://blog.tabsonrahm.org ) instead of the linked URL ( http://tabsonrahm.org/about ). When I click a custom menu link, how do I make it update the URL in the browser to the external link? Thanks.


title: split wordpress loop into columns of categories and associated posts

text:
Here is what I need to do with 5 columns on the "archive" page: I can already loop through the categories and posts in a loop to display them quite nicely, I just cant figure out how to split it into columns. I also need it to be paged. Basically show only 18 post titles/excerpts per page. Any help? My loop below: **UPDATE: I am posted the working solution below. This works perfectly to break a continuous loop of posts sorted and displayed by category of any type or taxonomy.** **WHAT STILL NEEDS WORK:** I cannot seem to figure out how to make the paging work. I need the paging to count total posts (ignoring the categories) and display only 12 or so per page. I have added the paging code but it is commented out.               <?php     // for a given post type, return all             $post_type = 'retailers';             $tax = 'states';             $tax_terms = get_terms($tax);             $post_counter = 0; // reset so we can generate columns              $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                      if ($tax_terms) { ?>
                      <?php foreach ($tax_terms as $tax_term) {                      $args=array(                     'post_type' => $post_type,                     "$tax" => $tax_term->slug,                     'post_status' => 'publish',                     'posts_per_page' => -1,                   //'posts_per_page' => 15,                   //'paged' => $paged,                     'orderby' => 'title',                     'order' => 'ASC',                     'caller_get_posts'=> 1                     ); // END $args                          $my_query = null; // clear the query variable                     $my_query = new WP_Query($args);                          if( $my_query->have_posts() ) { ?>

<?php echo $tax_term->name; ?>

                  <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
                                    <div class="retailer_wrap retailer_id-<?php the_ID(); ?>" style="padding:0; width:165px; float:left;">
                                   <?php the_title(); ?>
                                                                        <?php if (get_post_meta($post->ID, '_simple_fields_fieldGroupID_1_fieldID_2_numInSet_0', true)) { ?>                                       <?php echo get_post_meta($post->ID, '_simple_fields_fieldGroupID_1_fieldID_2_numInSet_0', true); ?>                                     <?php } ?>                                     <?php echo " "; ?>                                     <?php if (get_post_meta($post->ID, '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_0', true)) { ?>                                       <?php echo get_post_meta($post->ID, '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_0', true); ?>                                     <?php } ?>
                                                                                <?php if (get_post_meta($post->ID, '_simple_fields_fieldGroupID_2_fieldID_3_numInSet_0', true)) {                                       echo get_post_meta($post->ID, '_simple_fields_fieldGroupID_2_fieldID_3_numInSet_0', true); ?>                                     <?php } ?>

                               <?php $post_counter++; ?>
                                  <?php if ( 0 == $post_counter % 7 ) { ?>

                             <?php } ?>                           <?php                           endwhile;                           //wp_pagenavi( array( 'query' => $my_query ) );                          } // END if have_posts loop                         wp_reset_query();                            } // END foreach $tax_terms                     } // END if $tax_terms                     ?>


title: Do I need to instantiate the XMLRPC class or any class in another class to access its methods?

text: I would like to use some of the methods of the XML RPC class, "wp_xmlrpc_server" in my own class. Is this class instantiated already or should I declare it myself? If so how?


title: Plugin data shared in Multisite

text: I am trying to build a site that very closely resembles another and so far so good with WordPress Multisite Networks. I am also using the plugin WP-FileBase - this plugin creates a database table per site (http://wordpress.org/support/topic/plugin-wp-filebase-download-manager-does- it-work-on-multisite) - is there any way for me to set it up so that the sites share the same database?


title: How to move wp-content (or uploads) outside of the Wordpress directory

text: I am trying to move the wp-content directory outside of the wordpress directory and hitting all kinds of weird problems. Even though http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder says you can do this, it seems that the directory structure is deeply wired into the WP code. For example, I get error messages like:               PHP message: PHP Warning:  file_exists(): open_basedir restriction in effect.     File(/srv/wp.content/themes) is not within the allowed path(s): (/srv/wordpress/:/tmp)      in /srv/wordpress/wp-includes/theme.php on line 369      All I need to do is to move the uploads directory outside of the main hierarchy. I tried to symlink it as well but then I am getting permission errors. Did anybody manage to successfully have the wp-content directory, or at least, uploads directory outside of the root directory?


title: Getting headers already sent error from plugin

text: I'm having a bit of trouble with a 'headers already sent' error from a Wordpress plugin I had built for me and now I'm adapting. This is the error: > Warning: session_start() [function.session-start]: Cannot send session cache > limiter - headers already sent (output started at > /home1/uname/directory/domain.com/wp-content/themes/ibm/header.php:2) in > /home1/uname/directory/domain.com/wp-content/plugins/osu-rfm/osu-rfm.php on > line 225 I've looked at header.php line 2 and this is what is there with no extra white spaces nor funny characters etc:               <!DOCTYPE html>     <!--[if lt IE 7 ]> <html class="ie ie6 no-js" <?php language_attributes(); ?>> <![endif]-->     <!--[if IE 7 ]>    <html class="ie ie7 no-js" <?php language_attributes(); ?>> <![endif]-->     <!--[if IE 8 ]>    <html class="ie ie8 no-js" <?php language_attributes(); ?>> <![endif]-->     <!--[if IE 9 ]>    <html class="ie ie9 no-js" <?php language_attributes(); ?>> <![endif]-->     <!--[if gt IE 9]><!--><html class="no-js" <?php language_attributes(); ?>><!--<![endif]-->     <!-- the "no-js" class is for Modernizr. -->          <head id="osu-rfm" data-template-set="html5-reset-wordpress-theme" profile="http://gmpg.org/xfn/11">              <title>                <?php                   if (function_exists('is_tag') && is_tag()) {                      single_tag_title("Tag Archive for ""); echo '" - '; }      I've looked at line 225 in osu-rfm.php and this is what is part of that file (this is the plugin btw):               public static function enable_sessions()     {         if( is_post_type_archive( "ibmdirectory" ) || "ibmdirectory" == get_post_type() )         {             if( ! isset( $_SESSION ) )         /*         if(headers_sent($filename, $linenum)) {             //if headers already sent out print some message.             echo "Headers already sent in $filename on line $linenum\n";         } else {             //if headers not already sent             echo "New headers";         }         */             session_start();         }     }      And now I'm completely stuck as I don't know what to try next...can anyone make some suggestions? I removed all white space at the end and beginning in all my theme files as suggested here, but it doesn't seem to make a difference. I've also tried removing the closing `?>` tag at the end of my plugin file, but nada. By the way, this only happens on my live server, not my local set up, so I have the feeling it could be a server issue. Thanks Osu


title: Is there an action/filter called when WP_Query->query is finished and assigns posts

text: I took a look at the `WP_Query->get_posts()` function and couldn't see any action/filter that is called **AFTER** a query finishes. I want to be able to manipulate the results once they are sent, rather than the query itself (Using a Human Name Parser to sort by last name). I'm revamping an old site that alters the global `$wp_query->posts` right within `archive.php`, so I was just wondering if there was a way to take this logic completely out of the archive file and store it with my other CPT functionality. Cheers!


title: "Custom Post Type Permalinks" plugin URL strcuture

text: I've found this great plugin _Custom Post Type Permalinks_ by a Japenese developer which is awesome at generating hierarchical permalink structures for Custom Post Types. Only I'm having an issue which I cannot get around and am looking for a solution. I have a custom post type `classes` and a taxonomy `classes_categories` (ex: languages, technology, sciences...) The links generated by WordPress for the 'classes_categories' look like this:               http://site.com/classes/class_categories/languages/      I would like them to be like this:               http://site.com/classes/languages/      Strangely, both of the URL's work but I would like WordPress to generate them without 'class_categories' in the URL. I'm looking for a solution which would involve either plugin configuration, my taxonomy declaration parameters or perhaps a workaround with a hook or something (maybe parse the URL when they a being rewritten). thank you


title: Creating a Lightweight Media Tags Plugin with a Custom Taxonomy

text: We’ve been using Media Tags ( http://wordpress.org/plugins/media-tags/ ) for a while, particularly for the dashboard media management features rather than any of its front end display features. It isn’t really actively maintained anywhere, and since WP 3.5, is just a massive amount of overhead for something that should be able to be accomplished with little more than a custom taxonomy. In trying to create a working, minimal Media Tags plugin, I’ve used this Question ( How it is possible to use taxonomies on attachments? ) as my primary guide, but it suffers from at least two problems that I’m having issues resolving. ~~1) When viewing the tags in the dashboard, I always get a count of 0 displayed, even when there are clearly items tagged with said tag (and clicking on the 0 even takes you to them). I tried updating the update_count_callback value to ‘_update_generic_term_count’ per the other Question I’ve linked to, but it doesn’t give me anything other than 0s.~~ EDIT: My counts were off due to, not to this code, but to pre-existing entries in the database from code used earlier. 2) When viewing the Media Tags in the backend, you’re always presenting with a ‘View’ link when hovering on an item. That view link always tries to go to a non-dahsboard page that always brings back no posts. Ideally, the View link would just not be present - but it it needs to show up, I’d like it to at least work. Here’s the code I’m currently trying, but running into the two problems above:                   // Register Custom Taxonomy     function cets_media_tags_init()  {         $labels = array(             'name'                       => _x( 'Media Tags', 'Taxonomy General Name', 'text_domain' ),             'singular_name'              => _x( 'Media Tag', 'Taxonomy Singular Name', 'text_domain' ),             'menu_name'                  => __( 'Media Tags', 'text_domain' ),             'all_items'                  => __( 'All Media Tags', 'text_domain' ),             'parent_item'                => __( 'Parent Media Tag', 'text_domain' ),             'parent_item_colon'          => __( 'Parent Media Tag:', 'text_domain' ),             'new_item_name'              => __( 'New Media Tag', 'text_domain' ),             'add_new_item'               => __( 'Add New Media Tag', 'text_domain' ),             'edit_item'                  => __( 'Edit Media Tag', 'text_domain' ),             'update_item'                => __( 'Update Media Tag', 'text_domain' ),             'separate_items_with_commas' => __( 'Separate Media Tags with commas', 'text_domain' ),             'search_items'               => __( 'Search Media Tags', 'text_domain' ),             'add_or_remove_items'        => __( 'Add or remove Media Tags', 'text_domain' ),             'choose_from_most_used'      => __( 'Choose from the most used Media Tags', 'text_domain' ),         );              $args = array(             'labels'                     => $labels,             'hierarchical'               => false,             'public'                     => true,             'show_ui'                    => true,             'show_admin_column'          => true,             'show_in_nav_menus'          => false,             'show_tagcloud'              => false,             'update_count_callback'      => '_update_generic_term_count',             'query_var'                  => false,             'rewrite'                    => false,         );              register_taxonomy( 'media-tags', 'attachment', $args );     }          // Hook into the 'init' action     add_action( 'init', 'cets_media_tags_init', 0 );


title: Add File Attachment Name and URL into Javascript

text: I'm working on incorporating the jPlayer into our WordPress site. I don't particularly care for the two plugins that are available as our client is a bit on the technically deficient side. What we are looking to accomplish is have the Title and Mp3 load into the JavaScript for the jPlayer playlist. Currently everything is loading just fine and returning the appropriate texts, however I'm unable to get the File Name and the Attachment URL to load appropriately. I'm fairly new to java and wordpress for that matter. Any help would be appreciated. If you would like to see a live site example, please visit http://www.ourgoodfight.com/?p=6054               <!--Begin Jplayer Playlist -->     <script type="text/javascript">         //<![CDATA[         $(document).ready(function(){             new jPlayerPlaylist({                 jPlayer: "#jquery_jplayer_1",                 cssSelectorAncestor: "#jp_container_1"             }, [              <?php                 global $post;                     $jukebox_args = get_posts( array(                         'post_type' => 'attachment',                         'posts_per_page' => -1,                         'post_mime_type' => 'audio/mpeg',                         'orderby' => 'menu_order',                         'order'  => 'ASC',                         'post_parent' => $post->ID                             ));                     $the_jukebox_query = new WP_Query( $jukebox_args );                     ?>             <!--This is what needs to loop -->                 <?php                     $loop = new WP_Query( $jukebox_args );                         while ( $loop->have_posts() ) : $loop->the_post(); ?>                     {                         title:<?php echo apply_filters( 'the_title', $attachment->post_title ); ?>,                         mp3:<?php echo wp_get_attachment_url( $attachment->ID, false ); ?>,                     },                 <?php endwhile;?>             <!--This would be the end of the loop -->             ], {                 swfPath: "<?php echo get_template_directory_uri(); ?>/js",                 supplied: "mp3",                 wmode: "window"             });         });         //]]>     </script>


title: Regenerate slugs from title of posts

text: is it possible to regenerate the slugs programmatically after changing the titles of the post?   The girl that updated the title of more than 200 posts just "forgot" to update the slug too, so i was wondering if there was some sort of plugin that regenerates the slugs from the new titles


title: phpMyAdmin displays error when importing database

text: I'm migrating a WordPress for a friend to a different server. I have already backed up all files and was given a copy of the database by the old server admin. The problem is that when I try and import the database using phpMyAdmin, I get this error message: `SQL query: -- -- Database: ``wordpress_6`` -- CREATE DATABASE ``wordpress_6`` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; MySQL said: Documentation #1044 - Access denied for user 'prvtres9'@'localhost' to database 'wordpress_6` I'm not sure what would initiate this error message, but the tiny amount of information I found out in several hours of frustration eludes that it could be in the way the database was copied, therefore putting me in a helpless position, but I don't want to approach the old server admin just to be wrong about this


title: How to use a .edu domain with WordPress?

text: I work with a university that already has a domain name that ends in `.edu` (clari.buffalo.edu). I want to use this domain name as we have decided to migrate our web page to WordPress. From the sign up page, it appears that `.edu` is not supported. Is this true? If not, how can I use a `.edu` name with WordPress?