title: Including post_type = 'wiki' in author archives

text: For a user with wiki-update permission only, I want to list their wiki articles in the author archive page. Currently, it comes back with "NOT FOUND Apologies, but ...". I am using the Twenty-ten child theme and created a custom loop-wiki.php but now have a block about how to proceed. Any ideas? Anyone? I've searched and found similar type discussion but nothing stands out. Thanks!


title: How can I modify RSS item titles to be either the title or a custom meta field?

text: I'd like to optionally replace some RSS item titles with a headline meta field I've added to certain post types. I have the post types showing up in the feed using:               function myfeed_request($qv) {       if (isset($qv['feed']) && !isset($qv['post_type']))         $qv['post_type'] = array('post', 'interviews', 'reviews');       return $qv;     }     add_filter('request', 'myfeed_request');      But I've searched around and can't figure out how to replace the title. Any ideas?


title: First wordpress blog, should I make my own theme for maximum customizability?

text: I am, although still extremely n00by, a semi-competent web designer and developer and I have decided to start a blog. I have heard all about this _WordPress_ phenomena and I am really excited to give it a try! Now, I really want my blog to stand out, and from what I can gather, installing WordPress locally gives me full customizability as I have the freedom to 'create my own theme' so to speak. Is that the correct terminology, first of all? Also, I've heard that by installing WordPress locally, it removes the limitations of having a 'paid' or 'free' version. This would make sense since it is on your own PHP server. How difficult is this to do? I'm assuming you create a design, and integrate the WP features through PHP?    Any suggestions are appreciated! Thanks!


title: Why doesn't YoastSEO allow me to set the title/description for the home page?

text: For some reason, YoastSEO set my home page to the first blog post. So the home page canonical, title, and description are set to the values of the first blog post. And when I tried to set the home page's title/description, I got this screen instead of the form fields to set the values of the title/description: ![enter image description here](http://i.stack.imgur.com/kgCXS.png)


title: How can I transition a site from using the Beta Tester plugin to a "normal" install?

text: I'm currently using the WordPress Beta Tester plugin on a site. Is there a "best" way to transition the site to a "normal" WordPress install? The plugin includes this notice: > Please note: Once you have switched your blog to one of these beta versions > of software it will not always be possible to downgrade as the database > structure maybe updated during the development of a major release.


title: Alert Email when any Post or Page is Changed

text: Is there a way to have Wordpress email me whenever a Page or Post is Published?


title: Wordpress 500 Internal server error when activating custom theme

text: Whenever I try to activate my custom built theme on the clients server, the website returns a '500 - Internal Server Error'. ![enter image description here](http://i.stack.imgur.com/PMaMF.png) The theme is working fine on my local machine, MAMP on my mac. I dont even know where to begin to solve this problem! As far as I am aware, the wordpress is a fresh install and I have no plugins that are activated. **Edit:** As requested, here is the structure of my theme:               > theme-folder       - 404.php       > assets         > css         > font         > images         > js         > sequence       - category-food-and-baking.php       - comments.php       - footer.php       - front-page.php       - functions.php       - header.php       - index.php       - page.php       - sidebar.php       - single-default.php       - single-food-and-baking.php       - single.php       - style.css      And the first section of my CSS is:               /*     Theme Name: OonaghsKitchen     Theme URI: http://www.hknudsen.co.uk     Author:H Knudsen     Author URI: http://www.hknudsen.co.uk     Description: The theme for Oonaghs Kitchen     Version: 1     License: GNU General Public License v2 or later     License URI: http://www.gnu.org/licenses/gpl-2.0.html     Tags: OonaghsKitchen      */


title: not all categories being displayed

text:
I have created a child theme for a theme I purchased. The purchased theme is for restaurants wanting to display their menu. The theme accepts menu items as Posts, and groups them according to category. The theme only accepts 1 level of categories, not more complex menus with 2 levels of categories. The purchased theme is built for 1 level hierarchies. e.g:               >Menu     >>>Breakfast     >>>Lunch     >>>Dinner      However, the restaurant I am working for has a more complex menu:               >Menu     >>>Breakfast     >>>>>>Food     >>>>>>Sides     >>>>>>Drinks     >>>Lunch     >>>>>>Small     >>>>>>Large     >>>>>>Sides      My child theme aims to support two levels of categories. Here is the portion of code which might be causing me problems:               <?php $args=array(             'orderby' => 'slug',             'order' => 'ASC',             'include' => '4, 5, 6, 27',             //'exclude' => '3, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26',             'child_of' => $menuCat             );             $categories=get_categories($args);             foreach($categories as $category) {                     $catName = $category->name;                     $catName = strtolower($catName);                     $catName = str_replace (" ", "", $catName);                     $catName = str_replace ("&", "", $catName);                     $catName = str_replace ("é", "e", $catName);             ?>             <div class="menuSection section" id="<?php echo $catName; ?>">

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

                     <?php if($category->description){ ?>
<?php echo $category->description; ?>
                     <?php } ?>                          <?php $args=array(                     'orderby' => 'slug',                     'order' => 'ASC',                     'parent' => $category->term_id                     );                     $subcategories=get_categories($args);                     foreach($subcategories as $subcategory) {                                  $showPostsInSubCategory = new WP_Query();                             $showPostsInSubCategory->query('cat='.$subcategory->term_id.'&showposts=100');                     ?>     ...loop through display of subcategory      My child theme is an attempt to support 2 levels of categories. Here is the original theme's index.php. Even though I have hard-coded which categories to include, the website only displays Posts for 1 category - Lunch. **Why is Lunch the only category being displayed?**


title: Permalinks not working when bootstrapping from parent directory

text: I am trying to use WordPress from a subdirectory but access it from its parent. This is on order to try Capistrano deploys. I have the following directory structure               index.php     .htaccess     /wordpress      index.php contains the following to bootstrap the WordPress loader.               define('WP_USE_THEMES', true);          /** Loads the WordPress Environment and Template */     require( 'wordpress/wp-blog-header.php' );      .htaccess contains the following               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>     # END WordPress      Now, WordPress is loading the templates and showing in the contents of the themes index.php template so WordPress is working but not matching any URLS. it's also not matching any cookies so I can't access any URL/Rewrite debugging tools. Any thoughts?


title: wordpress wp_reset_query makes jquery tabs stop working

text:
here is my code,the slider tab is working fine if i don't add wp_reset_query() but when i add it. it stops working.I tried all.Please any suggestion for this.               <?php                   query_posts(array(                   'post_type' => 'home_slider',                  'showposts' => 10                   ) );                    ?>

               <?php $j=1; while (have_posts()) : the_post(); ?>               <div id="fragment-<?php echo $j;?>" class="ui-tabs-panel" style=""> <img src="<?php  echo get_field('main_image');?>" alt="main banner" /> Inline HTML

                     <?php  echo get_field('main_text');?>

               <?php $j++;endwhile;  ?>               <?php rewind_posts(); ?>

                   <div class="lightbox_top col12" style="background:url(<?php echo get_field('main_video_background_image');?>);">

                     <iframe id="yplayer" wmode="Opaque" frameborder="0"                                                   src="<?php echo get_field('lighbox_link');?>?wmode=transparent&autoplay=0" >

 <?php echo get_field('light_left');?>

 <img src="<?php echo get_field('light_right');?>">
 <?php echo get_field('lightbox_right_text');?>

               <?php $i=1; while (have_posts()) : the_post(); ?>               <li class="row ui-tabs-nav-item" id="nav-fragment-<?php echo $i?>"><a href="#fragment-<?php echo $i;?>"> <img src="<?php  echo get_field('thumb_image');?>" alt="lexi thumbs" />

<?php echo the_title();?>
                                  <?php  echo get_field('thumb_text');?>
               <?php $i++;endwhile; wp_reset_query(); ?>


title: Creating a Blog with numerous categories

text: I'm creating a health conditions site where contributors will make posts. If I want to have multiple people with the "Author Role" be able to post about various categories, do I have to manually create the categories ahead of time...or is there a better way to do this? Do we increase Author Role permissions to be able to add Categories? Other solutions welcome. We just need guest authors to be able to add categories while ensuring there is not already a existing appropriate category. And if I want all categories to show on the sidebar, how would I achieve that prior to there even being a post? Many Thanks!


title: Adding circles for recent posts under each post in the Spun theme

text: I am trying to add a snippet for a few recent posts under each blog post on my site with the Spun theme, but I think I need to somehow enable the some part of the theme's CSS code for it. So far I have added the following snippet to the single post php code,               <?php         $recentPosts = new WP_Query();         $recentPosts->query('showposts=5');     ?>     <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>                              <?php                             get_template_part( 'content', 'home' );                         ?>     <?php endwhile; ?>      but then I get a bunch of giant square thumbnails. Any ideas on what the next step would be to get the formatting right?


title: All the pages are blank

text: My friend website blog works well but all the pages show blank pages. I even look at the source code and I code nothing. It was empty. What can be causing this when the blog part of WordPress is still working? He is using WordPress version 3.6.1. Here are the plugins he uses:   * Akismet   * Categories to Tags Converter Importer   * ePub Export   * Facebook Fanbox Cache Widget   * Google Analytics for WordPress   * Google XML Sitemaps   * Jetpack par WordPress.com   * Quick Chat   * Responsive Add Ons   * Shareaholic | share buttons, analytics, related posts   * WP-Cumulus   * WP Facebook grabber With the plugins on I get these errors on the blog where does show:               Notice: Use of undefined constant wp_cumulus_widget - assumed 'wp_cumulus_widget' in /home/---/public_html/wp-content/plugins/wp-cumulus/wp-cumulus.php on line 375          Notice: register_sidebar_widget est dÃ©prÃ©ciÃ© depuis la version 2.8! Utilisez wp_register_sidebar_widget() Ã  la place. in /home/---/public_html/wp-includes/functions.php on line 2919          Notice: register_widget_control est dÃ©prÃ©ciÃ© depuis la version 2.8! Utilisez wp_register_widget_control() Ã  la place. in /home/---/public_html/wp-includes/functions.php on line 2919      This shows on the blank pages, again with the plugins on:               Notice: Use of undefined constant wp_cumulus_widget - assumed 'wp_cumulus_widget' in /home/---/public_html/wp-content/plugins/wp-cumulus/wp-cumulus.php on line 375          Notice: register_sidebar_widget est dÃ©prÃ©ciÃ© depuis la version 2.8! Utilisez wp_register_sidebar_widget() Ã  la place. in /home/---/public_html/wp-includes/functions.php on line 2919          Notice: register_widget_control est dÃ©prÃ©ciÃ© depuis la version 2.8! Utilisez wp_register_widget_control() Ã  la place. in /home/---/public_html/wp-includes/functions.php on line 2919          Parse error: syntax error, unexpected '<' in /home/---/public_html/wp-content/themes/ifeaturepro/page.php on line 15


title: Page downloads as file in Chrome

text: I'm looking to see if I could get pointers in where to look to solve this issue. ## Issue In Chrome, viewing the blog http://www.bitesizeirishgaelic.com/blog/ in Chrome v21, the page downloads as a file "download", rather than opening normally. The rest of the site on the same server loads fine in Chrome. All pages load fine in Firefox. ## Background I suspected that it was something to do with the APC caching for Apache, and/or WP Super Cache. However, after disabling both, and clearing my browser cache, the problem continues.


title: Stop wordpress automatically abbreviating the domain url

text: I'm trying to include webtrend js script in the footer template               <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/style/js/webtrends/webtrends.load.js"></script>       The problem is the "domain" turn into `..` automatically in the webtrends.load.js calling other scripts               { yt:{src:"http://mydomainname.com/wp-content/themes/mytheme/style/js/webtrends/webtrends.yt.js", mode:"automatic"}, }           { yt:{src:"../wp-content/themes/mytheme/style/js/webtrends/webtrends.yt.js", mode:"automatic"}, }


title: jQuery UI Autocomplete showing all results

text: I've built an Autocompleting search box for WordPress categories (it's actually a Custom Taxonomy), which works great (i.e it shows the categories when typed). However, when 1 key is typed, it will show all the results, regardless of the fact whether that string matches any of the categories. Here is my PHP code (autocomplete.php, in the root of my theme directory):               <?php     include_once($_SERVER['DOCUMENT_ROOT'].'/wp-load.php' ); // I know the traditional way to do it is loading admin_ajax but I read this was exactly the same and didn't increase the overhead to the server     if (isset($_GET['term'])) { // I suspect the problem is something to with this         $tradeList = get_terms('trade');         $tradeNames = Array();         foreach ($tradeList as $trade) {             $tradeName = $trade->name;             array_push($tradeNames, $tradeName);         }         echo json_encode($tradeNames);     }     ?>      and my Javascript code:               $(document).ready(function() {         $(".main-search-field").autocomplete({             source: "/wp-content/themes/local_directory/autocomplete.php",             minLength: 1         });      });      and finally HTML:               <input type="text" class="main-search-field" name="search" id="search">      I realise this might be badly coded, if it is feel free to re-do it. But what I really need to know is how to get the autocomplete suggestions to be relevant to the string that is typed in the search box. Thanks for any help :)


title: Wordpress Categories on post edit page

text: I am building a magazine style site with around 60 categories. When adding a new post, selecting its categories is a real pain with the default category tree. What I would like is for the Categories to be searchable & auto complete if possible. Anyone have any ideas or plugins they may know of? Cheers, Daniel


title: wp_query conditionally get posts

text:
My wp_query gets posts starting at the 5th one, proceeding it is another loop for the first four, for styling reasons. How do I conditionally get the wrapper for these posts only if they exist? The only way I can get it working is to have the container 'right-hang' before and after the loop, obviously if I put it inside the loop it the markup it spits out is just two ul's.               <?php echo('
'); ?>                                          <?php $featuredPosts = new WP_Query(); ?>                                          <?php $featuredPosts->query('showposts=2&cat=6&offset=4'); ?>                                          <?php while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
                                     <a href="<?php the_permalink() ?>">                                         <?php the_post_thumbnail('extrathumb'); ?>                                         <?php the_title(); ?>                                                                                <?php                                             $category = get_the_category();                                              echo $category[0]->cat_name;                                             ?>
                                                 <?php endwhile; ?>                                    <?php echo '
'; ?>


title: Add gravatar to author list

text:
I am using this code for listing out all authors on the site in my sidebar. It works, except I also need to pull in their Gravatar image. It's working in a loop on the homepage with this               <?php echo get_avatar( get_the_author_email(), '80' ); ?>      but is there a way I can add it to this list as well? Also.. I can't figure out a way to exclude the "Admin" account using this code, is that possible? Thank you!               <?php     $order = 'user_nicename';     $user_ids = $wpdb->get_col("SELECT ID FROM $wpdb->users ORDER BY $order"); // query users     foreach($user_ids as $user_id) :      $user = get_userdata($user_id);     ?>
<?php echo 'user_url . '">' . $user->display_name . ''; ?>

     <?php     endforeach;      ?>


title: A Specific Blog post to be assigned as the landing page of my wordpress blog

text: Is it possible for a specific blog post (in wordpress) to be the landing page? For example my domain name is _www.overflowingstupidity.com_ and I have this blog entitled post _"How to burn your house down in 3 easy steps"_ Whenever a user clicks or type in the url bar of the web browser my domain name, he/she will directed and landed on my blog post "How to burn your house down in 3 easy steps" instead of the default index.php file of my wordpress blog. Is that possible? IF YES, can you point out to me how?


title: get_results using wpdb

text: im trying to retrieve information on my wordpress database, i wanted to display all `pages` using this statement. but im getting a blank `ARRAY`               global $wpdb;     $result = $wpdb->get_results (             "             SELECT *              FROM  $wpdb->wp_posts              WHERE post_type =  'page'             "             );          echo $result; // display data      output:                 ARRAY      [EDIT] after changing below suggestions, im now using this. but i still dont get any results.               global $wpdb;              $posts = $wpdb->wp_posts;         $result = $wpdb->get_results( " SELECT * FROM  $posts WHERE 'post_type' =  'page' "  );              foreach ($result as $page) {                 echo $page->ID.'<br/>';              }


title: wp_enqueue_script not working?

text: Excuse me, I'm very new to PHP and WordPress, but I'm trying to link to an exterenal js file called **trans.js** , that relies on jQuery. Here is the code at the beginning of the header.php:                 <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/trans.js"></script>      and here is the enqueue within the functions.php               function twentytwelve_scripts_styles() {         global $wp_styles;              wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );          }          add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' );          function my_scripts_method() {         wp_enqueue_script(             'custom-script',             get_stylesheet_directory_uri() . '/js/trans.js',             array( 'jquery' )         );     }          add_action( 'wp_enqueue_scripts', 'my_scripts_method' );      Yet it still does not link up with the **trans.js** — does anyone know why this is?


title: Display Meta Data with HTML?

text: Is it possible to display the custom field/meta data content with some html? Usually i would use the following to just display the content...               <?php echo get_post_meta($post->ID, '_cmb__description',true);?>      However, when there is actually meta content i want it to appear within some html, but i only want that html to appear when there is meta data to appear?               <?php echo get_post_meta($post->ID,<div class="box">. '_cmb__description'. </div>,true);?>      Is this possible? I'm not that up to scratch with it all, so wasn't sure if it was doable at all.


title: How to use classes declared in another plugin?

text: I'm developing a Wordpress Woocommerce plugin. On my local environment it works fine but I have problems when adding the plugin to a replica of the prod environment. I am new to wordpress and not very familiar with web dev (I'm a Java programmer). In the plugin file, I instantiate a class from the Woocommerce plugin package like this:               $coupon = new WC_Coupon($some_code);      In the local environment (php 5.4.10 , Woocommerce 2.0.13, Wordpress 3.6) it's fine. In the production environment (php 5.4.10 , Woocommerce 1.6.5.2, Wordpress 3.4.2) I have the following error:               Fatal error: Class 'WC_Coupon' not found      I have tried including the file where the WC_Coupon class is defined but then the error becomes               Fatal error: Cannot redeclare class WC_Coupon      So what is the proper way to use classes declared in another plugin? Note: upgrading is not an option at the moment.


title: Custom members area (interface/design) in Wordpress, is it possible and how?

text: Anybody can suggest tutorial or URLs where I can find information about how to create custom members area in WP ? I mean when member is logged in I would like to show him something that is different from standard WP members area interface (design).


title: User interfaces living in the Admin "back end" area

text: We're currently toying with the idea of building a user interface that lives in the Admin area ("back-end"), effectively meaning that those interfaces will be theme independent. The code that actually renders the user interface will live in a plugin (not touching WP core). To make this less vague, we are roughly looking to do the following:   * Users can belong to one or more Groups (custom post type). For each Group, we render a menu item in the left hand side "Admin menu".   * We render a page for each Group (accessed by clicking on the menu item) that shows Announcements (also a custom post type) for that Group as well as a calendar for that Group (also based on a custom post type). What does best practice and / or Wordpress development guidelines say about this though? Is it a good idea to have user interfaces in the back end, or a bad idea (and if so, why)? I'm trying to make a strong case either for or against this decision.


title: current_user_can not always working properly

text: I have a custom Wordpress theme that includes a members only section. In order to implement this, I have the following code at the top of my restricted pages.               <?php if ( ! current_user_can ('view_players_area') ) { header('Location: ' . wp_login_url( "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" ) ); } ?>      Most of the time, this works fine, however every so often it simply fails to work for NO reason at all. No error message, just when you log in, it redirects back to the login page continually. I originally used `is_user_logged_in()` and had a similar problem which is what caused me to use this code. If anyone has any suggestions what might be causing this I will be hugely appreciative - this has me tearing my hair out, as the members area needs to go live in the next couple of weeks. Regards Ben **_Edit_** Following advice from replies and some users in the chatroom, I have modified my code so the the redirect is not done in the template. Now in a `functions.php` include, I have the following:               <?php          function redirect_restricted_areas( $query )     {         if ( !is_admin() && $query->is_main_query() )         {               if ( ! current_user_can( 'view_players_area' ) && (                    $query->is_singular ('player-page') ||                    $query->is_post_type_archive ('player-page')               ) )                     header('Location: ' . wp_login_url( "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" ) );         }          }          add_action ( 'pre_get_posts', 'redirect_restricted_areas' );      Sadly, although this is good advice that makes my code simpler, it doesn't solve my problem. **_Further Edit_** So with some debugging, I can see that $current_user is not always being set, but I have no idea why. **_Another Edit_** Investigating this further, it seems to be something to do with the cookies. After learning a bit about the Wordpress authentication cookies I noticed the following. Using dBug (a prettier version of `print_r()`) I determined that according to PHP the Wordpress auth cookie didn't exist, yet if I open up Chrome inspector I can clearly see the cookie sitting there. Not quite sure what to make of this yet, but if anybody is able to point me in the right direction...


title: Checking if a file is already in the Media Library

text: I'm creating custom files in a plugin and adding them to the Media Library using the code provided in the Wordpress Codex for wp_insert_attachment. However, my plugin occasionally overwrites those files. I need to make sure that the files are not added again to the Media Library. Here is the current code:               $wp_filetype = wp_check_filetype(basename($filename), null );     $wp_upload_dir = wp_upload_dir();     $attachment = array(        'guid' => $wp_upload_dir['baseurl'] . '/' . _wp_relative_upload_path( $filename ),         'post_mime_type' => $wp_filetype['type'],        'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),        'post_content' => '',        'post_status' => 'inherit'     );     $attach_id = wp_insert_attachment( $attachment, $filename);     // you must first include the image.php file     // for the function wp_generate_attachment_metadata() to work     require_once(ABSPATH . 'wp-admin/includes/image.php');     $attach_data = wp_generate_attachment_metadata( $attach_id, $filename );     wp_update_attachment_metadata( $attach_id, $attach_data );      I just need to check whether or not the file is already a part of the Media Library, and update it if it is. I do not have a post_id to work with, just the permalink and the guid. Thanks for your help.


title: how to filter post listing (in WP dashboard posts listing) using a custom field (search functionality) ?

text: despite the fact I googled a lot, I've not found the answer to a very simple question : I have some posts with a custom field (ie supplier_name). I would like to be able to search and filter my posts according to this custom field. In other words, in the admin posts listing, I would like to have a search box (named "Supplier name") where i can type in a value (ex. "IBM") and then, click on a search button that will give me back all the posts that have a custom field named "supplier_name" and, if so, the value of the custom field will be "IBM". How can i do this ?


title: Get Posts from Last 24 hours and Sort them via GD Star Rating

text: I am trying to sort the posts using GD Star Rating in the last 24 hours. I have two separate queries, but I don't know how to merge them.                         function filter_where($where = '') {                 //posts in the last 24 Hours                 $where .= "AND post_date > '" . date('Y-m-d H:i:s', strtotime('-24 hours')) . "'";                 return $where;               }             add_filter('posts_where', 'filter_where');             query_posts($query_string);      And > query_posts('gdsr_sort=thumbs&posts_per_page=10'); I have no idea how to sort the posts from the last 24 hours using GD Star, but these two queries work perfectly fine individually. Thanks!


title: Can't remove menu items added by plugin

text: I am trying to remove menu items from the backend but for some reason I can't remove specific menu items added by plugins. For example, I can use this line to remove the plugins page and it works just fine:               remove_menu_page('plugins.php');      I have a plugin, CW Image Optimizer, that adds a sub menu under the Settings menu. The php file the plugin uses is named cw-image-optimizer.php. If I use the following line to remove the sub menu it doesn't work:               remove_submenu_page('options-general.php', 'cw-image-optimizer.php');      Is there something specific I need to do to remove menu and sub menu items added by plugins?


title: Create custom links for excerpts with php dynamically

text:
Good Day I am using excerpts in my wordpress theme. Now in wordpress's documentation, they say wordpress does not automatically add links for the excerpts, you have to manually add them like this: Original excerpts file
      <?php the_excerpt(); ?>
      Adding links
     <?php the_excerpt(); ?>     <a href="<?php echo get_permalink(); ?>"> Read More...
      Now what I would like to do is to link each excerpt to a different wordpress **page** , and not to its own excerpt. So for that, I would have to create a custom php function to create a unique link for each excerpt, pointing to a different page each. How do I do that? See my website where the excerpts are located - It is right below the main slider named: Pastor's Corner, Mother's Heart, Sermons etc... Thank you


title: Conditional get template part

text:
My index page look like this...
google ad code goes here

My posts are goes here
      I use                   get_template_part('index')       in another page template. But I want index's posts only NOT google ads. Help me.. Thanks in advance..)


title: only show container with next/prev links if they exist?

text:
hey guys, i know there is something like `if ( function_exists('')` is it possible to use that with `next_posts_link()` and `previous_posts_link()`. The reason I'm asking that is that I have something like

<?php next_posts_link('« older') ?>

<?php previous_posts_link('newer »') ?>

      In my case div.navigation has a colored background and a fixed height. So even there is no next or perv post this div.navigation appears. I wonder if I can only display this if there exists a next or prev post? Any idea how to do that?


title: Disable Other Plugins on my Custom Post Type?

text: I've created a plugin that lets users build super-simple landing pages for mobile devices. The pages my plugin creates are of a custom post type. I want to provide users with an option to "disable all other plugins on this page", to prevent things like tweetmeme, facebook like buttons, and other third-party plugin generated content from displaying inside my plugin's template. I've added an option that lets the user prevent the call to wp_head, but what about those that inject content elsewhere in the page, e.g. by flitering the_content? After typing this out, I'm thinking that a combination of supressing wp_head() plus a remove_all_filters('the_content') might do the trick, but I'll go ahead and post this question anyhow in case any of you have better suggestions. Thanks!


title: How can I remove links from the function "get term list"?

text: <?php echo get_the_term_list( $post->ID, 'people', 'People: ', ' ', '' ); ?>       returns something like this:               People: Person1, Person2, ...      How can I make it return the same thing without links like this:               People: Person1, Person2


title: Preventing index.php?category_name=something from redirecting

text: I'm trying to filter posts in a category by the year of the post's date. I also want to do this without being redirected to the year template so my ideal URL would be http://example.com/category/reports/2011/ which would load the template file category.php where I could then use query_posts to include only the posts that were published in 2011 and are in the reports category. Here is my rewrite rule code...               function filter_category_by_year_rewrite_rules( $wp_rewrite ) {         /* Creates rewrite rules for filtering category archives by year (/category/reports/2011/)*/         $new_rules = array(             "category/(.+?)/(\d\d\d\d)/?$" => "index.php?category_name=" . $wp_rewrite->preg_index(1) . "&year=" . $wp_rewrite->preg_index(2)         );         $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;         var_dump($wp_rewrite);     }     add_action('generate_rewrite_rules', 'filter_category_by_year_rewrite_rules');      My problem is WordPress automatically redirects `index.php?category_name=reports&year=2011` to `/category/reports/` with no trace of the year parameter. How can I intercept this redirect? I tried hooking in to the `template_redirect` action to no avail :(               function testing_redirect() {         global $wp;         if($wp->request['matched_rule'] == 'category/(.+?)/(\d\d\d\d)/?$') {             load_template( 'category.php' ); //TEMPLATEPATH .'/category.php';         }     }     add_action('template_redirect', 'testing_redirect', 1);


title: Does WordPress limit the length of slug names for Post Meta or Terms?

text: The WordPress Codex states the the Post Type Names and Taxonomy Names have a limit to the slug name.   * Register Post Type \-- max. 20 characters, can not contain capital letters or spaces   * Register Taxonomy \-- The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces) and not more than 32 characters long (database structure restriction). However, the WordPress Codex doesn't state whether or not Post Meta or Terms have a limit to the slug name.   * Add Post Meta \-- No slug limit?   * Insert Term \-- No slug limit? Can this be confirmed? Is there no slug name limit for Post meta or Terms?


title: Adding new sites to Multisite won't register in Dashboard

text: I am having a real issue here that I can't seem to find an answer to. I am using Plesk, and have setup a new subscription. I have all of the proper settings, using FastCGI, ownership of files, etc. On a fresh install of wordpress and allowing multisite I cannot seem to create a new site and have it show up in the admin dashboard, or under My Sites dropdown. However, they do actually register in the database and I can access them through the Sites tab. I am completely lost here as to why this is possible. In addition, when I try to activate my Gravity Forms Plugin and click on the Register settings link, I get the "You do not have sufficient permissions to access this page." If anyone can give me some insite here I would truly appreciate it so I can stop banging my head against a wall.


title: Post Type Description for 'Posts'

text: On the site I'm currently developing I am using 'Custom Post Type UI' to manage my custom post types. Within this I can manage the description for any of the new custom post types that I have created. How would I go about editing the description of the default 'posts' post type? I am outputting this description under the heading in each section. Thanks!


title: how to get a list of meta data fields assocaited with a custom post type

text: I am using a theme which has defined a custom post type-- Now, I am trying to retrieve the list of metadata fields used by that post type-- so that I can insert data via PHP code in form of that custom post--I just want the list of meta data fields(not the values of metadata fields for specific posts-- but the list of metadata fields for that type of custom post). How do I do this?


title: How to remove or replace the log-in link for comment replies?

text: I need to edit the function `get_comment_reply_link()` in `wp- includes/comments-template.php`. All I really wanna do is take out the "log in to reply" text is puts in every comment for logged out users which is disturbing to me. How can I do this the right way? Here's the function.               function get_comment_reply_link($args = array(), $comment = null, $post = null) {     global $user_ID;          $defaults = array('add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => __('Reply'),         'login_text' => __('Log in to Reply'), 'depth' => 0, 'before' => '', 'after' => '');          $args = wp_parse_args($args, $defaults);          if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] )         return;          extract($args, EXTR_SKIP);          $comment = get_comment($comment);     if ( empty($post) )         $post = $comment->comment_post_ID;     $post = get_post($post);          if ( !comments_open($post->ID) )         return false;          $link = '';          if ( get_option('comment_registration') && !$user_ID )         $link = '' . $login_text . '';     else         $link = "comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text";     return apply_filters('comment_reply_link', $before . $link . $after, $args, $comment, $post);     }


title: Closest thing to an is_widget() tag?

text: I have a custom widget with a WP_Query loop that's using `get_template_part()` to include some standard information that I also use in theme files. However, I need to make one small change to the widget's output that differs from the template file I grab with `get_template_part()`. I know I could copy the template file and modify it, but then I have to maintain two sets of that code. What I'd prefer is something like an `is_widget()` check that I could use like:               if( !is_widget() ) {         // include an extra goody     }      I know there is no `is_widget()`, but is there some other WordPress thing I can look for?


title: Wrap Post count in a span

text: I'm using this code:               $args = array(                 'hide_empty' => FALSE,                 'title_li'=> __( '' ),                 'show_count'=> 1,             );             wp_list_categories($args);      How can i wrap the post count in a span for further styling? Thanks


title: Show Post Excerpt in Image Attachement

text:
I want to show excerpt from the post in the below image attachment, here's my code               <?php     /**      * Image Template      *      * Displays singular WordPress Media Library items.      *      * @package Thematic      * @subpackage Templates      *      * @link http://codex.wordpress.org/Using_Image_and_File_Attachments Codex:Using Attachments      */              // calling the header.php         get_header();              // action hook for placing content above #container         thematic_abovecontainer();         ?>
                  <?php             // action hook for placing content above #content             thematic_abovecontent();                  // filter for manipulating the element that wraps the content              echo apply_filters('thematic_open_id_content', '
' . "\n\n");                  // start the loop             while (have_posts()) : the_post();                      // action hook for placing content above #post                 thematic_abovepost();                 ?>                      <?php                 // creating the post header                 thematic_postheader();                 ?>                 <?php include 'share.php'; ?>

Posted In: <a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?>

                         <?php                         $parent = $post->post_parent;                         $attachments = array_values(get_children(array('post_parent' => $post->post_parent, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'DESC', 'orderby' => 'ID')));                              foreach ($attachments as $k => $attachment)                             if ($attachment->ID == $post->ID)                                 break;                              $next = $k + 1;                         $prev = $k - 1;                         $next_link = "";                         $prev_link = "";                              if (isset($attachments[$next])) {                             $next_exists = 1;                             $next_link = "ID) . "'> Next Photo >>";                             $img_link = "ID) . "'>";                         }                              if (isset($attachments[$prev])) {                             $prev_exists = 1;                             $prev_link = "ID) . "'> << Previous Photo";                             if (!$next_exists) {                                 $img_link = "ID) . "'>";                             }                         }                              if (!$next_exists and !$prev_exists) {                             $img_link = "ID) . "'>";                         }                         ?>
<?php echo $img_link;                     echo wp_get_attachment_image($post->ID, 'full'); ?>

<?php if (!empty($post->post_excerpt)) the_excerpt(); ?>

<?php echo $prev_link ?>

<?php echo $next_link ?>

             <?php             $post_parent = get_post($post->ID, ARRAY_A);             $parent = $post_parent['post_parent'];                  $attachments = get_children("post_parent=$parent&post_type=attachment&post_mime_type=image&orderby=menu_order DESC, ID ASC");             foreach ($attachments as $id => $attachment) :                 echo wp_get_attachment_link($id, 'thumbnail', true);             endforeach;             ?>

<a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment">Read Full Gossip Here >>

                  <?php             // creating the post footer             thematic_postfooter();             ?>
                          <?php                     // action hook for placing contentbelow #post                     thematic_belowpost();                          // action hook for calling the comments_template                     thematic_comments_template();                      // end loop                 endwhile;                 ?>
                  <?php             // action hook for placing content below #content             thematic_belowcontent();             ?>
              <?php         // action hook for placing content below #container         thematic_belowcontainer();              // calling the standard sidebar          thematic_sidebar();              // calling footer.php         get_footer();     ?>


title: Comments offset

text:
I need to display comments starting from the second, omitting the first. With posts I did it using "offset" but I can't find anything similar for comments. Since I'm using threaded comments, must start from the second comment that is not a child (only parent comments). I'm using wp_list_comments with a callback. EDIT2: this is actual comments.php code, after replies:                     <?php      $i = 2;     if ( have_comments() ) :      if ( $i > 1 ) :     ?>
         <h3 id="comments-title" class="color-<?php $category = get_the_category(); echo $category[0]->cat_name;?>">
                   <?php                global $wp_query;           $comments_arr = $wp_query->comments;           $comments_arr = sort( $comments_arr);           $comments_arr = array_pop( $comments_arr );          $comments_arr = usort($comment_arr, 'comment_comparator');                           wp_list_comments('callback=gtcn_basic_callback', $comments_arr);               ?>                   <?php         $i++; // count up         endif; // If $i > 1         else : if ( ! comments_open() ) : ?>
<?php _e( 'Comments are closed.' ); ?>
              <?php            endif; // end ! comments_open()      endif; // end have_comments()  ?>
     <?php comment_form(); ?>      Result: comments are not anymore ordered by karma (comment_comparator function) and the first comment (comment with top karma that I want to hide) is still displayed.


title: Most liked page not displaying posts

text:
I was looking for a post rating system for a while, then I stumbled across a great tutorial: http://wp.tutsplus.com/tutorials/how-to-create-a-simple-post-rating-system- with-wordpress-and-jquery/ I have it working (well, its recording clicks ok), but I cannot seem to get a "most liked" page. The tutorial said to use the following code, so made a page, but nothing appears (apart from logo, nav, footer etc)                   <?php     /*     Template Name: Top Rated     */     ?>     <?php get_header(); ?>              <?php query_posts('meta_key=votes_count&orderby=meta_value_num&order=DESC&posts_per_page=10'); ?>                <?php get_sidebar(); ?>          <?php get_footer(); ?>      Can anybody point me in the right direction? Thanks EDIT: Thanks rizqy22, here is how the index displays posts:               `<a href="<?php the_permalink(); ?>"class="img_hover_trans"><?php the_post_thumbnail('featured-small'); ?></a>           <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>`      EDIT2: Made more progress, got the thumb, title etc displaying using the following code (just incase anybody else searches and finds my ramblings) `<?php query_posts('meta_key=votes_count&orderby=meta_value_num&order=DESC&posts_per_page=10'); if (have_posts()) : while (have_posts()) : the_post(); ?> <a href="<?php the_permalink(); ?>"class="img_hover_trans"><?php the_post_thumbnail('featured-small'); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
 <?php endwhile; endif; wp_reset_query(); ?>`


title: WP plugin repository didn't parse readme.txt correctly

text: I just added a plugin on WP repository but it seems like my readme.txt wasn't parsed correctly. I even ran it through the validator but on the plugin page it shows `Description` text under all tabs - `Installation, Changelog, FAQ` Plugin - http://wordpress.org/extend/plugins/facebook-like-thumbnail/ Readme.txt - http://plugins.svn.wordpress.org/facebook-like- thumbnail/tags/0.1/readme.txt So did I do something wrong? Or readme file parser is to blame?


title: What are the Theme tags in style.css used for?

text: In the style.css file in the first comment block, there is a optional "Tags:" directive. What are these tags used for? When are they used?


title: Aggregate comments, with pagination

text: I want to build a page that would display _all comments_ , regardless of which post they're attached to. I also want that page to be paginated, since it'll potentially have 10,000+ comments. * * * I'm not sure how to go about it, but here are some of the functions I've studied so far:   1. `get_comments` \- If no `post_id` is passed in, it'll return all comments. However, I don't see a way to paginate these (there are `offset` and `number` options to fiddle with, but that's _very_ tedious to do manually).   2. `wp_list_comments` \- The documentation on this is pretty bad, but the source code suggests that we can loop over all comments if used in conjunction with `get_comments`, by passing in the `get_comments` array as a second argument. This however would still use `get_comments` to actually... well, get the comments, and there seems to be no way to paginate that.   3. `previous_comments_link` & `next_comments_link` \- These seem to only work in conjunction with `wp_list_comments` (with no second argument).   4. `paginate_comments_links` \- Also looks like it only works with `wp_list_comments` (with no second argument). * * * # What I've tried:   1. Simply using the `number` argument in `get_comments`:              $comments = get_comments(array(         'status'    => 'approve',         'number'    => '2'     ));          wp_list_comments(array(         'callback' => 'my_rendering_function'     ), $comments);          paginate_comments_links();      This does not display any pagination links.   2. The method suggested here: Display latest comments on page with pagination              $comments = get_comments(array(         'status' => 'approve'     ));          wp_list_comments('per_page=2', $comments);          paginate_comments_links();      This doesn't either work (it shows the first 2 comments, but no pagination). Also, I cringe at `get_comments` loading _all_ comments into memory. * * * # Question: How can I paginate _all_ comments? * * * **P.S.** I'm using WordPress 3.4.1 & PHP 5.3.2.


title: Performance problem with first load

text: I'm just trying to create my blog in WordPress hosted on my GoDaddy account (Windows Deluxe plan). WordPress is installed as subsite. When I check my blog after several hours of inactivity I have to wait more than 10 seconds before site opens. I checked it in Firebug and there is 10+ seconds delay between sending request and receiving response. I guess it has something to do with loading the application in IIS. Unfortunatelly I haven't found any setting in GoDaddy's management console to keep the site running. How to deal with this problem? Is there any trick to register my site somewhere and let it regulary check my site? I expect rare traffic to my blog so it would be pretty annoying for visitors to wait for each visit. **Edit:** This is not a problem of caching or too many plugins (my blog currently have one short post, one short page and All in one SEO plugin, nothing more). It is problem of slow response especially for the first call after long inactivity. Unfortunatelly Windows hosting does not offer Cron jobs. That is the reason why I'm looking for some additional service to regulary check my site. But anyway GoDaddy looks like pretty bad choice. It was recommended to me and I liked the idea of Windows multi site hosting because I can host several apps there including .NET ones. The hosting itself and management tools look pretty good. But by simply checking the response I see that there is delay 1,5+ seconds for almost any request. If I access my test blog hosted directly at Wordpress the delay is 300ms.


title: Target a specific category from a custom taxonomy?

text:
I am trying to target a specific category from a custom taxonomy. This is for WooCommerce. So, the custom taxonomy is called "product_cat" and the category itself is called "adult-dvds". This is what I tried; however, it didn't work (nothing shows up between the comment tags):                            <?php if (is_tax('product_cat','adult-dvds')) { ?>
blah blah blah
         <?php } ?>               Is there something I missed?


title: Problem: Create a cron job to export posts to a WordPress XML file on server

text: I need a way to automatically export all WordPress posts from a specific date and have it output the file on the server that can be downloaded daily. The reason the XML format is needed is because the site is part of a large network of blogs and the parent site does not use WordPress but indexes the content in its search results. The parent company uses an XML parser that can't handle increments. It needs the full content of posts all at one time. My approach is to create a cron job using `wp_schedule_event` that fires export_wp and outputs the buffers into a file. The problem is that the file created is empty. My current code is:               register_activation_hook(__FILE__, 'c3m_my_activation');     add_action('c3m_export_daily', 'c3m_export_xml');          function c3m_my_activation() {         wp_schedule_event(time(), 'daily', 'c3m_export_daily');     }          function c3m_export_xml() {         $ob_file = fopen('server_path_to_my_file.xml','w');              $args=array(             'content' => 'posts',             'start_date' => 'october 2008',             'status' => 'published');                  function ob_file_callback($buffer)             {               global $ob_file;               fwrite($ob_file,$buffer);             }              ob_start('ob_file_callback');         export_wp($args);              ob_end_flush();     }      I have also tried it without adding any $args to export_wp but the file is still empty. I'm hoping this can be accomplished with export_wp so the whole thing doesn't have to be written from scratch.


title: Removing Line Break Tags from a Page

text: I am running the latest version of Wordpress on the Genesis Framework with the AgentPress theme. There is an annoying four line gap between the page title and the Wordpress Post Tab widget that I have installed. Using Firebug, I discovered that the gap is caused by four line break tags < br > , which seem to be automatically generated since I did not include them in the text editor. ![enter image description here](http://i.stack.imgur.com/KckUV.png)


title: Why won't wp_mail() let me set the From: header when plain old PHP mail() will?

text: When I use wp_mail( $to, $subject, $message, $headers ) (with values in place, of course), the email gets sent with a from name and email that isn't set anywhere I can find (not even in PHP or Apache settings). However, using mail( $to, $subject, $message, $headers ) instead works just fine. What could be happening with wp_mail() to cause this?


title: Is there a way to disable the sticky posts feature?

text: I want to turn this off as I have a custom ordering process using custom fields.


title: remove theme's name from dashboard .. How?

text: How are you every body how can remove name of theme in dashboard .. please .. ![enter image description here](http://i.stack.imgur.com/OCQZW.jpg) You are using K2 RC-8 theme with 10 widgets. how can remove 'K2 RC-8 theme' .. please


title: Home page is getting current-menu-item even if it's not home

text: After upgrading to 3.1 I am seeing this issue. I use custom post types and when you click on the menu items either Games, Entertainment or Tech it gets the class current-menu-item but home link still has it also. I am using the custom menu's built into WordPress and for the links and they are just custom links pointing to:   * Home: http://www.flesheatingzipper.com   * Games: http://www.flesheatingzipper.com/games/   * Entertainment: http://www.flesheatingzipper.com/entertainment/   * Tech: http://www.flesheatingzipper.com/tech/   * About: Links to page, about Here is the site: http://www.flesheatingzipper.com/


title: Why is my custom sidebar always open on the widgets screen in Admin?

text: I've created a custom sidebar with this code in my theme's functions.php:               register_sidebar(array(             'name' => __('Article - Below Content'),             'id' => 'zg-article-footer',             'description' => 'Use this sidebar to place widgets that will appear directly underneath the Article'         ));      When I navigate to Appearance > Widgets in my Admin, this sidebar is always the first one on the top of my list of sidebars, and it's always "open" (that is, you can see the description and the list of widgets attached to it). None of my other sidebars are open, and WP Admin doesn't seem to remember my last- opened sidebar. Is there an argument I should use when registering the sidebar that will tell it to default to closed? Or is there an option somewhere else entirely?


title: How to get the order attribute of a page

text: As we know we can sort pages in a query by their page order attribute, I can't figure out how to get this number to use it for a conditional and the max number listed Thanks,


title: Adjust which tempalte a page uses with a function?

text: I know if I had a page that had a permalink such as `/stories/` then I could create a page in my template called `page-stores.php` and it would load in place of the default `page.php` when that page loaded (see Template Hierarchy) What I want to know is if I had that two page templates, maybe `page.php` and `page2.php`, if I could use the `functions.php` file to specify that if a page had a permalink of `/stories/` it would use `page2.php`? I know there is an option when editing a page to let the end user choose the page template, but in this case I would like to set it specifically.


title: Make first letter of my taxonomy uppercase

text: I'm using               echo get_the_term_list( $post->ID, 'trpropcity', '', ' ', '' );      to show a taxonomy link, I'd like to make this instance of it only have the first letter capitalized, Cleveland not CLEVELAND, I realize I could just change the taxonomy, but I actually want it all caps everywhere else on the site, so I figured it would be best to just change it once. I've been playing with ucwords and strtolower but haven't had any success yet.


title: Count the posts number for every category

text: I'd like to count the number of posts created for every category, so:               12 Works (12 posts in works category)     36 Pictures (36 posts in pictures category)     17 Furnitures (17 posts in furnitures category)      How can I do that?


title: Custom Taxonomy back-end customizations

text: Using a hierarchal custom taxonomy associated with a custom post type, I need: (1) To change the admin meta-box to a drop-down menu to make sure the post has only one term associated. The drop-down menu should show just the latest children terms, so let us say, for example, I have those two hierarchical terms:   * **Zone X**    \--> **Package X** (Zone X's child)   \----> **District X** (Package X's child)        * **Zone Y**    \--> **Package Y** (Zone Y's child)   \----> **District Y** (Package Y's child) I want the drop-down to show only the latest children: **District X** and **District Y**. (2) To automatically select all parents of a selected child term when saving the post. So, let us say the user chose **District Y** in my previous example, then both **Package Y** and **Zone Y** should be selected as well, behind the scenes. Could anyone help me with that please, or point me out to any helpful reference?   Thanks in advanced,


title: Wordpress wp_head() crap

text: I know, wp_head() is important, but it inject so much crap into the header, i like to get it out... and just add manually the 2-3 line of code i need.. BUT, and there is always a but, i need the wordpress auto-generated code for :               <meta name="description" content="" />     <meta name="keywords" content="" />     <link rel='canonical' href='http://jlecologia.com/cms/' /> (why not!)     and     <meta http-equiv="Content-Language" content="fr-FR" />      How i can ask for the generation of that... ???? something like : bloginfo('name') will be fine for me Thanks


title: Creating a default Custom Post Template that a Theme can override

text: I'm in the midst of building a Wordpress Plugin that adds a custom post type, for which I'd like to include a default template to display. Essentially, this is an event management plugin, and the custom post type is for the Events. There's a handful of custom meta fields, as well as a child post type (Performances), so without a default template to display them, using it would be pretty unfriendly. But I would like theme designers to be able to create their own templates for these post types if desired. Is there a way to use the the template provided with my plugin unless the theme provides its own template? What's the best practice for doing so? **Edit:** Following the advice of Peter Rowell, I caught the template_redirect action and, if the post type was one of mine and a template for it did not exist in the current theme, defaulted to the plugin's template:               class FestivityTemplates {            public static function determineTemplate(){         global $post;         $standard_type = strpos($post->post_type, 'fest_');              if(is_single() && $standard_type !== false) {           FestivityTemplates::loadSingleTemplate($post);         }       }            private static function loadSingleTemplate($post) {         $template_name = 'single-'.$post->post_type.'.php';         $template = locate_template(array($template_name), true);         if(empty($template)) {           include(WP_PLUGIN_DIR . '/Festivity/lib/templates/' . $template_name);           exit();         }       }     }          add_action('template_redirect', array('FestivityTemplates', 'determineTemplate'));


title: Shopping Cart Integration -- Experiences with Popular eCommerce Solutions

text: Researching various shopping cart solutions for a WordPress based eCommerce website. Based on research, it seems that two plugins stand out:   * shopplugin.net    * phpurchase.com Can anyone share their experiences with these or offer some good alternatives? The list of requirements is too long to include here, but the store will be shipping goods (not digital products) and the ability to have a robust marketing/promotional campaign integrated into the shopping experience is important, as is financial reporting. Product recommendations, coupons, sale prices/discounts, email marketing and a customer database would all be nice features to have. I don't like WP-ecommerce or most of the other free options and the budget for software is as much as $1,000 (alternatively looking at shopify.com, a non-WP product). Thanks in advance!


title: how to add three default images to wordpress?

text: how to add three default images to wordpress **custom background**? ![enter image description here](http://i.stack.imgur.com/fNCQ4.jpg) now, i want to add three default images which can be selected one by the user.and it locates on the **upload Image** part.like this: the default background image: ![enter image description here](http://i.stack.imgur.com/CMlwd.jpg) how do i do thank you.


title: How to set classname for <li> tag in wordpress menu?

text: I am using.               <?php wp_nav_menu($args); ?>      for get menu from wordpress.it returns the menus with `<ul>` and `<li>` structure. In that i need to set class name for every `<li>` tag uniquely. thanks ravi


title: Add Class to Tag Cloud Links and Change Terminology

text: Is there a way to use functions.php to add a class name to all the tag cloud links? This topic does what I need, but it's not through the functions.php file. I was also hoping to change the tag cloud terminology from "2 topics" to "2 posts" for the title tag. Thank you!


title: How to get list of Scripts in Order of Dependencies

text: I was writing plugin for combining JS and CSS as three plugins I tried has not worked for me. Dependency problem is where I stopped. It look tough. Then I thought Wordpress can itself help. How to get list of files in order of dependencies? Is there any WP method for this? Can I use WP_dependency class externally? How? I am able to filter script files according to Header and Footer.


title: foreach loop displaying below content summary

text: I am trying to wrap my result with `<li>`, but when I do so as in the code, I get funny results, as the result display way below.               do_action( 'woocommerce_after_shop_loop_item' );     $value = get_the_terms( $product->id, 'pa_package');          foreach ( $value as $values ) {         echo "<li>";         echo $values->name;         echo "</li>";     }


title: Get All post that is in table

text: I have table that save in it the user id and post id. Now in some page i need to show all post for user_id (1) for example. how can i display all post that user_id is 1


title: Wordpress widget value not save?

text: all Now i create a widget plugin, here i have problem the checkbox problem, dont have save the value, then i search form Net, and found the answer, but now i dont have understand the means of `(bool)`.                       <label for="<?php echo $this->get_field_id( 'post_date' ); ?>">         <input class="checkbox" type="checkbox" name="<?php echo $this->get_field_name( 'post_date' ); ?>" id="<?php echo $this->get_field_id( 'post_date' ); ?>"  <?php checked( (bool) $instance['post_date'], true ); ?> />         <?php _e( 'Show post date' ); ?>       </label>


title: How to show only the most recent post on my custom post type archive?

text: I have registered a custom post type and inside my `archive-myCPT.php` I want to retrieve just the current published post. Here is a relevant snippet from my `archive-myCPT.php`:               <?php               if( have_posts() ){             $x = 1;             while ( have_posts() ){                 the_post();                  if ( 0 === (int) $post->post_parent ) {                     get_template_part( 'inc/post-format/content-debate');                 }      I've tried adding this : `query_posts('posts_per_page=1&order=DESC&orderby=date')` before the `if( have_posts() ){` but I'm getting the last post from the default blog posts not from my CPT and also it adds also a pagination. How can I retrieve **just** the most recent published post inside my CPT without the pagination?


title: Why on Earth am I getting "undefined_index" errors?

text:
Right, I'm banging my head against a wall here. I'm sure it's something incredibly simple but I keep getting undefined index errors on all of these variables.               function meta_genus_species() {         global $post;              if (isset($post)) {             $custom = get_post_custom($post->ID);         }              if (isset($custom)) {             $genus = $custom["genus"][0];             $species = $custom["species"][0];             $etymology = $custom["etymology"][0];             $family = $custom["family"][0];             $common_names = $custom["common_names"][0];         }              ?>     Genus:     <input name="genus" value="<?php if(isset($genus)) { echo $genus; } ?>" />     Species:     <input name="species" value="<?php if(isset($species)) { echo $species; } ?>" />
Etymology:
     <textarea cols="50" rows="5" name="etymology"><?php if(isset($etymology)) { echo $etymology; } ?></textarea>
     Family:     <input name="family" value="<?php if(isset($family)) { echo $family; } ?>" />     Common Names:     <input name="common_names" value="<?php if(isset($common_names)) { echo $common_names; } ?>" />         <?php     }      I get this for every variable: > Notice: Undefined index: genus in [...]sf-species-profiles.php on line 207 Any ideas?


title: How to Clean Options Which is Not in Use from WordPress Options Table?

text: I first time reached here /wp-admin/options.php in admin panel and not a surprise that there are so many options came from various plugins. Many plugins I am not using today. How can I delete those unused option entries? Also, it there any performance impact of those living in my options table? Just few entries itself can live easily in DB!


title: Setting Post Date Returning "Notice: A non well formed numeric value encountered"

text: I am using `wp_insert_post` to create post. While executing that function, I also set post date to schedule the post publish date using some variables. Here is the part of my code:               //Intervals     $intsecond = (isset($_POST['awpht_time_second'])) ? $_POST['awpht_time_second'] : 0;     $intminute = (isset($_POST['awpht_time_minute'])) ? $_POST['awpht_time_minute'] : 0;     $inthour = (isset($_POST['awpht_time_hour'])) ? $_POST['awpht_time_hour'] : 0;     $intday = (isset($_POST['awpht_time_day'])) ? $_POST['awpht_time_day'] : 0;     $intmonth = (isset($_POST['awpht_time_month'])) ? $_POST['awpht_time_month'] : 0;     $intyear = (isset($_POST['awpht_time_year'])) ? $_POST['awpht_time_year'] : 0;          // Blog Local Time that can be splitted          $base_year = date('Y', current_time( 'timestamp') );     $base_month = date('m', current_time( 'timestamp') );     $base_day = date('d', current_time( 'timestamp') );     $base_hour = date('H', current_time( 'timestamp') );     $base_minute = date('i', current_time( 'timestamp' ) );     $base_second = date('s', current_time( 'timestamp') );          for($i=0; $i<10; $i++ ) {          $awyear = ($i * $intyear) + $base_year;     $awmonth = ($i * $intmonth) + $base_month;     $awday = ($i * $intday) + $base_day;     $awhour = ($i * $inthour) + $base_hour;     $awminute = ($i * $intminute) + $base_minute;     $awsecond = ($i * $intsecond) + $base_second;          $postdate = date($awyear.'-'.$awmonth.'-'.$awday.' '.$awhour.':'.$awminute.':'.$awsecond);               //Check If Post Already Exist/ Prevent Duplicates     if (!get_page_by_title($awpharritle[$i], 'OBJECT', 'post')){          $awpht_the_posts[$i] = array(       'post_title'    => $awpharritle[$i],       'post_content'  => $awpht_content{$i},       'post_date'     => $postdate,       'post_status'   => 'publish',       'post_author'   => 1,     );          // Insert the post into the database     $awpht_post_id = wp_insert_post( $awpht_the_posts[$i]);     }      Each time that code is executed, it always returning a notice:               Notice: A non well formed numeric value encountered in C:\xampp\htdocs\wordpress\wp-includes\functions.php on line 4028       What's wrong with the codes above and is there any other way/s to programmatically mass schedule post based on custom interval? Please don't suggest me a plugin. Best Regards


title: How to get comments from multiple post type?

text: How can I get comments from multiple post type? I want to display 5 comments from my different post types pages.               <?php           $defaults = array(         'number' => 5,         'post_type' => array('post','authors','movies')     );     $comments = get_comments($defaults);      ?>


title: Conditional On custom field plugin metabox

text: I've trying to run a conditional on the custom field I made with the Custom Fields plugin, I made a true and false check box. I just need to check if the box is true or false really. I've tried something like this but the word hello appears even when the               <?php         $premium = get_field('premium');         if ( !isset($premium)) {             echo 'hello';         }     ?>      Basically I've trying to change the page layout if this is ticked. I'm sure this is quite easy. Thanks for any input


title: Can't open Custom Post Types Link in navigation

text:
I have a problem with the archives permalinks of custom post types: They won't open by clicking on the links in the header navigation. I am able to open the link directly in the browser by typing the url duftfaktor.de/wp/parfuemchecks. The page uses my template called archives- customposttype.php. But the link doesn't open, when I click on it in the header navigation that also uses the direct link duftfaktor.de/wp/parfuemchecks. I am not sure if it is a problem with wordpress or my own html/css style. What could be important is that I am using a z-index on the navigation area. I appreciate any help! Here is the code: The Navigation has to parts. 1) A horizontal menu when entering the page 2) A fixed menu that appears after a certain amount of scrolled pixels
                 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">                                                                    </button>

              <?php //wp_nav_menu(); ?>
Parfümchecks

Parfümwissen

Über Duftfaktor

<?php get_search_form(); ?>

             <?php //wp_nav_menu(); ?>
Parfümchecks

Parfümwissen

Über Duftfaktor

<?php get_search_form(); ?>


title: multiple values in an array for category__and does not work with WP_Query

text: So I'm looping with WP_Query and here is my code:               $country_posts = new WP_Query(get_direct_children($continent_cats));     if ($country_posts->have_posts())  : while ($country_posts->have_posts()) : $country_posts->the_post();      the get_direct_children function:               function get_direct_children($cat_name) {             if (gettype($cat_name) == 'string') : $category_id = get_cat_ID($cat_name);             elseif (gettype($cat_name) == 'integer') : $category_id = $cat_name;             endif;             $args = array('parent'   => $category_id);             $categories = get_categories($args);             $cats = wp_list_pluck($categories,'cat_ID');             $args = array (                   'category__and'                    => $cats             );             return $args;         }      $country_posts->have_posts() returns true only if 1 category gets returned from get_direct_children. This happens when I turn off all the children of $continent_cats (which is a string by the way) except 1. When only 1 child category is active:               var_dump(get_direct_children($continent_cats));      returns:               array(1) { ["category__and"]=> array(1) { [0]=> string(2) "72" } }      So yay this is what I want it to do. have_posts() is returning true and looping my 1 active subcategory. HOWEVER, when I enable another child category, have_posts() returns false(I think, it's just not posting any content). So this same function:               var_dump(get_direct_children($continent_cats));      returns:               array(1) { ["category__and"]=> array(2) { [0]=> string(2) "72" [1]=> string(2) "71" } }      when I have 2 child categories active. Since this looks like correct syntax AND category__and is taking in the correct variable type, why doesn't it loop those 2 categories? Why does it not even loop 1 category? Thanks


title: Ajax Request not coming back to class

text: I'm struggling with an ajax request. It's executed but not returning back to my class. My PHP:                   ...                 public function __construct()  {                     add_action( 'admin_print_styles', array($this, 'admin_styles') );                     add_action( 'admin_enqueue_scripts', array($this,'admin_scripts') );                     add_action( 'admin_menu', array($this, 'admin_menu' ));                     $this->dbHandler = DatabaseHandler::get_instance();                     add_action('wp_ajax_nopriv_add_vehicle', array($this,'add_vehicle'));                       add_action('wp_ajax_add_vehicle', array($this,'add_vehicle'));                   }                      public function admin_scripts( $hook ){                          wp_enqueue_script( 'admin_scripts', plugins_url( 'js/functions.admin.js', __FILE__ ), array('jquery') );                     wp_localize_script('admin_scripts', 'ajax_var', array(                           'url' => admin_url('admin-ajax.php')                         ,'nonce' => wp_create_nonce('ajax-nonce')                       ));                 }                      public function add_vehicle()                   {                       wp_die("RETURNED"); //NOT GETTING CALLED!                     $nonce = $_POST['nonce'];                            if ( ! wp_verify_nonce( $nonce, 'ajax-nonce' ) )                           die ( 'Busted!');                          $title = $_POST['id'];                     wp_die("TEST" . $title);                          exit;                   }         ...      My JS (functions.admin.js:               var addVehicle = function(){          $('.add-vehicle').click(function(){             var data1 = {                 action: 'add_vehicle',                 nonce: ajax_var.nonce,                 id: 1             };             $.ajax({                 type: "post",                 url: ajax_var.url,                 data: data1,                 beforeSend: function(jqXHR, settings){                     console.log(jqXHR);                     console.log(settings);                 },                 success: function(data, textStatus, jqXHR){                     alert('success.');                 },                 error: function(jqXHR, textStatus, errorThrown){                     alert(errorThrown);                 }             });                  return false;         });     };          jQuery(document).ready(function($){         addVehicle();     });      During execution, my AJAX Request was sent successfully. I received the success message. But my `add_vehicle` function is not called. I've checked a lot of articles, tried many different solutions, but none of them returned back to my class.


title: Only display posts with comments

text: I would like to query out only posts that have comments. So posts with comment_count = 0 won't show but anything above that will. This is what i query but it still picks out posts that doesen't have comments. Is there another way?               query_posts(array('comment_count' > 0, 'post_type' => 'letters', 'showposts' => 10, 'post_status' => array('publish'), 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1), 'meta_key' => 'letter_show_on_site', 'meta_value' => "yes"));


title: Masonry and Jetpack Infinite Scroll - overlap issue

text:
I am trying to implement infinite scroll with Masonry on my archive pages on my theme and I have a couple of issues: 1) The "Load more posts" button is hidden behind the initial posts when you first load the page, see yellow circle: ![See yellow circle here - the little grey box is the button](http://i.stack.imgur.com/yCGF8.jpg) I feel a bit stupid asking this one but I don't know how to fix this because Jetpack is loading the button in the same container as the posts, which is just the default behaviour, and all the posts are absolutely positioned because of Masonry so I can't `clear` the button against them with CSS. I want the button to be below the posts. 2) (SOLVED, SEE BELOW ANSWER) When I click the button, the new posts overlap/load behind the initial posts, see picture: ![Overlapping posts](http://i.stack.imgur.com/xyfPY.png) I can't seem to get the Masonry to trigger a relayout after the new posts are loaded. I have looked at this post http://wptheming.com/2013/04/jetpack- infinite-scroll-masonry/ and this question Jetpack Infinite-Scroll + Masonry On twenty twelve overlap but I can't seem to find a solution to my problem. The markup before the click:

....

....

....

....

....
                      ...
                     Older posts

      The generated markup after the click:

....

....

....

....

....
                      ...                      ...
....

....

....

....

....

                     Older posts

      The PHP I am using for Jetpack (the post type in question is `mytheme_portfolio`) :               function mytheme_render_infinite_scroll() {         while ( have_posts() ) : the_post();                 if ('mytheme_portfolio' == get_post_type()) :                     get_template_part( 'content', 'archive-portfolio' );                 else :                     get_template_part( 'content', get_post_format() );                 endif;         endwhile;     }          function mytheme_jetpack_setup() {         add_theme_support( 'infinite-scroll', array(             'container'      => 'content',             'type'           => 'click',             'render'         => 'mytheme_render_infinite_scroll',             'wrapper'        => false,             'posts_per_page' => 5,         ) );     }     add_action( 'after_setup_theme', 'mytheme_jetpack_setup' );      The jQuery:               (function( $ ) {              $( document ).ready(function() {                  $('#content').masonry({               columnWidth: '.grid-sizer',               itemSelector: 'article',               gutter: '.gutter-sizer'             });                  $( document.body ).on( 'post-load', function () {                 $('#content').masonry({                   columnWidth: '.grid-sizer',                   itemSelector: 'article',                   gutter: '.gutter-sizer'                 });             });              });          }( jQuery ));      The CSS (although I don't think it's the problem as the initial posts are fine)...compiled with LESS, I'm using `calc()` to make things responsive:               article,     .grid-sizer {       width: calc(((100% - (4 - 1)*1.5em)/4)*(1) + ((1 - 1)*1.5em));     }     article.featured {       width: calc(((100% - (4 - 1)*1.5em)/4)*(2) + ((2 - 1)*1.5em));     }     .gutter-sizer {       width: 1.5em;     }      Thanks so much for any help anyone can give.


title: How should I setup the "Users" area to hand over to a client?

text: We're about to hand over a Wordpress site to a client; this is the first one we've built from scratch. Our "Users" area just consists boringly of the **admin** login with my work email like so: ![enter image description here](http://i.stack.imgur.com/inpCL.jpg). What's the best way to set this up to hand over to the client? We want to retain the ability for us to login and support them and have full powers but not look like we still own it. As things stand, if we just add a couple of their members of staff to it now it'll still look like we're still the supreme user. What do agencies normally do? This isn't a big project or client. They have a main person their end and a couple of junior users to help them.


title: How to to secure WordPress file and folder permissions

text: I've read articles about protecting wp-config.php using .htaccess as well as setting the correct file permissions but I want it all in one place. What should my .htaccess file look like and what folders is it safe to have 777 vs 755 permissions?


title: How To Consistently Enforce Rewrite Rule in Plugin Development

text: Let's say I create a customer support plugin that hijacks the /support part of the URL and redirects it to an MVC framework in my app folder of my plugin folder, like so:               RewriteRule ^support(.*)$ wp-content/plugins/csupport/app/$1 [L]      I know that I can do this in a blog's .htaccess right before the RewriteBase line, but not everyone has .htaccess turned on unless they add a custom permalink. I found a technique to force custom permalinks, but that's brute force and not recommended. **What is the recommended way for plugin developers to add a rewrite rule so that they can capture a subdirectory call like /support and redirect it to somewhere else?**


title: Advanced Custom Fields Plugin: how to use a checkbox to allow a post to show up in desired "zone"?

text:
I am having issues getting the below code to work. I created an Advanced Custom Field (top_articles) with a checkbox containing three options: top_articles_left, top_middle, top_articles_right. I would it is so that when you are within a post you can check off that you want that post featured and it then shows up in the respective three zones I have designated. How could I accomplish this with ACF and have it fetch the correct post in WordPress?

Top Articles
                  <?php $articles_query = new WP_Query('category_name=main&posts_per_page=1');             while ($articles_query->have_posts()) : $articles_query->the_post(); ?>             <?php if (get_field('top_articles') == 'top_articles_left'): ?>             <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                 <a href="<?php the_permalink(); ?>">                     <?php the_post_thumbnail('large'); ?>
             <?php endif; endwhile; ?>                  <?php $articles_query = new WP_Query('category_name=main&posts_per_page=1');             while ($articles_query->have_posts()) : $articles_query->the_post(); ?>             <?php if (get_field('top_articles') == 'top_articles_middle'): ?>             <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                 <a href="<?php the_permalink(); ?>">                     <?php the_post_thumbnail('large'); ?>
             <?php endif; endwhile; ?>                  <?php $articles_query = new WP_Query('category_name=main&posts_per_page=1');             while ($articles_query->have_posts()) : $articles_query->the_post(); ?>             <?php if (get_field('top_articles') == 'top_articles_right'): ?>             <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                 <a href="<?php the_permalink(); ?>">                     <?php the_post_thumbnail('large'); ?>
             <?php endif; endwhile; ?>


title: Extract an embedded video from the content

text:
I have added a post with the post format of video and I am trying to get to video so I can display the video in one div and the text in another like
the embedded video

the content
      Is there a way in wordpress to do this?


title: Add tinymce buttons to caption textarea in media uploader

text: I want to add some basic tinymce buttons ( Bold, italic, underline ) to caption textarea in media uploader in WordPress. (Shown in attached image) I dig a little bit into wordpress core in media.php and media-editor.js file in wp-includes but not getting any hint. Please help me, how can I add it. Thanks in advance. ![enter image description here](http://i.stack.imgur.com/dN1m1.png)


title: Guest posts with author's url and twitter photo

text: There's an urgent need for my school website to allow Guest Posts for essay assignments of students. The guest posts submitted by students should provide each student with his/her own url where one could see all posts submitted by them and their biography. I was able to get guest posts working i.e students can submit their essays without login. Is there any plugin or solution that will allow these students to have separate author urls without registering where we can see all the posts by them? And is there any way to get them to upload their avatars which get displayed rather than gravatars?


title: Create citation and url in post using 3 custom fields with conditions for each field... So close!

text:
I am creating a new baseball blog. When submitting a post, I want Authors to cite their source for a news type of post. I have created a custom meta box with three custom fields:   * Source title, the title of the source. Field name - source_title   * Source URL, the URL of the source. Field name - source_url   * Source name, the name of the person or website of the information. Field name - source_name I want to display every bit of information the Author gives, so credit goes where it is deserved. The output of the code (with all fields present) will be something like:
source_title | source_name
      When the source_url is entered, but not source_title, the output should be:
source_url | source_name
      (it would be nice to trim the source_url to 25 or so characters and remove http:// if possible) Through searching and help elsewhere, this is what I have so far:               <?php      $seperator = '';          $name = get_post_meta($post->ID, 'source_name', true);     $url = get_post_meta($post->ID, 'source_url', true);     $title = get_post_meta($post->ID, 'source_title', true);          if($title != '' || $name != '' || ($url != '' && $title != '')){       $output = '
Source: ';       $output .= ($url != '' && $title != '') ? '': '';       if($title != '' && $name != '') {       $seperator = ' | ';     }       $output .=  $title;       $output .= ($url != '' && $title != '') ? '': '';       $output .= $seperator.$name;       echo $output . '
';     }     ?>      **What works:**   * When all three fields are entered everything is perfect.   * When title and name are entered, but not url everything is perfect.   * When title and url are entered, but not name everything is perfect.   * When only name is entered everything is perfect   * When only title is entered everything is perfect **The problems:**   * When url and name are entered but no title, only the name shows. In this case, I would like to display:
source_url | source_name
        * Similar is true when only the url is entered (no title or name), nothing shows. In this case, I would like to display:
source_url
      Thanks in advance for helping out this novice.


title: Find out which moderator approved comment?

text: Is there any way to find out what moderators have approved a comment, and then display that information on the front-end? e.g. John says: "This is a great article" \- Approved by Admin1


title: SELECT field options disappear when saving widget

text: I'm having an interesting problem that I can't seem to solve. While creating a widget, I have created a select field with options that can be chosen on the widget screen. It all works perfectly fine, except when I save the widget, all of the options in the select field vanish. They all come back, with my chosen option saved, as soon as I refresh. The code for each of the select options looks like this: `foreach ($posttypes as $option) { echo '<option id="' . $option->name . '"', $posttype == $option->name ? ' selected="selected"' : '', '>', $option->name, '</option>'; } ` In this case, $posttypes is an array of post types. When the select fields are rendered, they look like this: `<select name="option-name" id="option-name"> <option value="option- value">Option Value</option> <option value="option-value">Option Value</option> <option value="option-value">Option Value</option> </select>` Any ideas why they would vanish like this?


title: display jumps to the bottom, dosnt start at the top?

text: help! can anyone tell me why my blog post jumps down to the video near the bottom of the post? it does in on every browser and 2 different machines and it does it when you enter the primary domain http://rbarnes.com or the post url http://rbarnes.com/989/atlanta-bloggers-meetup/ click a link and let it fully load before you do anything, you'll see it jump I took the wistia video out and left the youtube video in and it still jumped down - then I took both videos out and it still jumps down i fixed a tag not closed - but no help... what is making it do this? big thanks if you can help. rb this theme is eleven40 child of Genisis


title: Integrate options in option page of wordress plugin

text:
To add an option page I have used this codes.But I can't integrate any custom option of my plugin here. Suppose, in my plugin there is a shortocode, here, in a section, there is a background which can be changed by custom coding. e.g. ;               extract( shortcode_atts( array(             'category' => '',             'background'=> '#333'     'border-width' => '10px;'              ), $atts, 'photo_gallery' ) );              $q = new WP_Query(             array('photo_gallery_cat' => $category, 'posts_per_page' => -1, 'post_type' => 'photo-items')             );                   $list = '

';         while($q->have_posts()) : $q->the_post();      Here, in shortcode, I can use `background="#aaa"` to change the background color. With border-width also. But I want to create a option to change this by option page. How to integrate this in option page ? Also iI need to use active functions options, e.g this:               function active_least_gallery() {?>                    I want to use this true/false options on option page. Can anyone please advise me ?


title: Combined Category+Tag Archive Page

text: I am currently developing a music blog. I am using Wordpress categories for the _artists_ and the Wordpress tags for _featured artists_. I want to combine the archive pages for artists and features into one page. For example I currently have (using Kanye West as an example): www.example.com/artist/kanye-west   For songs where Kanye West is the _primary artist_ (i.e the category) **and** www.example.com/feature/kanye-west   For songs where Kanye West is the _featured artist_ (i.e the tag) I would rather consolidate them into one page: www.example.com/artist/kanye-west   Which would show both the primary and featured songs on the same page. The problem is, when the artist exists as a _feature_ but **not** an _artist_ the /artist/ archive page 404s. For example: I have made a post with a song that _features_ Kanye West, but I have never made a post with a song that is made by Kanye West, so the page /artist/kanye- west doesn't exist (because there is no category called Kanye West, only a tag), and it just 404s. Am I able to make a page which checks the slug (i.e _kanye-west_ ) against the artist **and** feature permalinks and will show the results accordingly?


title: Category Link to Post

text: I have a website with categories X, Y, Z...with the Search Everything plugin I can search based on the category name to return all the posts within a given category. I have the search results posts linking to their corresponding category using `the_category()`, but what I would like it to do is link the post to the category page the post is actually on - is that possible? Right now everything goes to the default category page, page 1...but some of the posts are on page 3, or page 2, etc. Thanks,   Josh


title: How to add media from front-end to an existing post?

text: Golden Apples Design created (as far as I know) the media upload function that many people on WP.A and elsewhere seem to recommend. But all of the Q&As I can find on StackExchange deal with creating an entirely new post. What is the best way to get this (or another snippet) to upload media from the front-end, attach it to the current post, generate the appropriate thumbnails, and then refresh the page showing the new image in the [gallery]? Here is Than's code: In functions file...               function insert_attachment($file_handler,$post_id,$setthumb='false') {            // check to make sure its a successful upload       if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false();            require_once(ABSPATH . "wp-admin" . '/includes/image.php');       require_once(ABSPATH . "wp-admin" . '/includes/file.php');       require_once(ABSPATH . "wp-admin" . '/includes/media.php');            $attach_id = media_handle_upload( $file_handler, $post_id );            if ($setthumb) update_post_meta($post_id,'_thumbnail_id',$attach_id);       return $attach_id;      In page template header...               // set $post_id to the id of the post you want to attach     // these uploads to (or 'null' to just handle the uploads     // without attaching to a post)          if ($_FILES) {       foreach ($_FILES as $file => $array) {         $newupload = insert_attachment($file,$post_id);         // $newupload returns the attachment id of the file that         // was just uploaded. Do whatever you want with that now.       }     }      Upload form used...               <form method="post" action="#" enctype="multipart/form-data" >       <input type="file" name="an_uploaded_attachment">       <input type="file" name="another_uploaded_attachment">       <input type="file" name="yet_another_uploaded_attachment">       <input type="submit">     <form>


title: Making CURDATE() recognize current_time()

text: I'm trying to make this query pull a list of users 30 days from today that have a birthday. This query works as per below in WordPress, but excludes those who have birthdays as today. I believe the `CURDATE()` function is using the server time and not adjusting for the WordPress timezone in the Settings/General area. Any ideas for a fix?               $querystr = "     SELECT * FROM " . $wpdb->prefix . "usermeta     WHERE meta_key='bday_unix'     AND DATE_ADD(          from_unixtime(meta_value), INTERVAL YEAR( CURDATE() )          - YEAR( from_unixtime( meta_value ) ) YEAR      )     BETWEEN CURDATE() AND DATE_ADD( CURDATE(), INTERVAL 30 DAY )";


title: Wordpress best solution shared theme for consumers and businesses (two url's one instaltion)

text: What would be the best solution for a wp (cms style) site containing a sub site for consumers and businesses. I've made a wp theme and its almost finished. In essence its gives you two choice to visit as a consumers or as an business. Both have the same theme style but differ in some content used out of the wp database and some static content used. (so you've got two headers.php and different article categories for both optins) Now I've got it working by using a switch statement in the index.php in the theme file. All works fine but the url's you've get don't look very professional. I would like to have it worked like this: www.domain.com --> gives you two options one brings you to www.domain.com/consumers/ the other to www.domain.com/businesses/ I cant get this to work because for instance the articles use www.domain.com/articles/bla/etc. So what would be the best way to achieve this? I'm thinking about: -Multiple installations sharing the same database (dont like this idea because you've got more maintenance) \- setting it up in the .htaccess if this possible and how? thank you for any advice or solutions


title: need to increase pages width

text: please check out my blog http://cine-matt.com/archives/ and here http://cine-matt.com/news-and-rumors/ see the amazon ads? they cut off and the widget only comes in specific sizes. how do I increase the width of the pages so the ads don;t get cut off (i understand it can be done in css style sheets and have tried the custom css in the apperance - customize menu as well as the css jet pack editor, but i don;t know the css code i need to do what i want. can you help? thanks


title: BuddyPress Toolbar

text: Is there a way to call the toolbar or adminbar as you would a menu?               <?php          wp_nav_menu(              array(                  'container' => false,                  'menu_id' => 'nav',                  'theme_location' => 'primary',                  'fallback_cb' => 'bp_dtheme_main_nav'              )          );      ?>      I want to add the toolbar to a div within the header.php file. Currently the toolbar is being called in the footer.php and styled by the css to a fixed position in the body. Or perhaps is there a script I could run which would amend a div around the `<div id="wp-admin-bar">`? I am running the latest install of WordPress, 3.3.1 with BuddyPress as a plugin. Using a child-theme I created. I've noticed a few of the normal WordPress functions do not work well with the BuddyPress plugin.


title: Make forced line break in title of text widget

text: I am using text widget in page, my title is too long and i want to make (Br)break in particular place, but i can not. After saving (br)break is gone, also tried (nbsp) but same result came. How to overcome?