Combining / Merging two queries?

So I am working on an isotope filtered portfolio page that pulls any attachment tagged with the term "digital-interactive". Each attachment is also linked to a custom post_type called "work". On one of my portfolio pages I use a WP_Query and target the "work" custom post type, but for this page I need to query the post_type => "attachment" instead. Each image has a container that wraps around it and has a class that is generated with the tags for that particular post in my custom post type of work. I am having some difficulties trying to get 2 queries together on my new portfolio page to query the "attachment" post type but still be able to call those tags from my "work" custom post type. Any help would be great. Code for work custom post type:                           $all_work = new WP_Query(array(                     'post_type' => 'work',                     'tax_query' => array(                         array(                             'taxonomy' => 'type',                             'field' => 'slug',                             'terms' => array('case-study', 'portfolio')                         ),                     ),                     'posts_per_page' => '20',                     'orderby' => 'title',                     'order' => 'ASC',                     'paged' => $page                     )                 );      Code for attachment query portfolio page:               <?php         $args = array(             'post_type' => 'attachment',             'post_parent' => null,             'tax_query' => array(                 array(                     'taxonomy' => 'post_tag',                     'field' => 'slug',                     'terms' => 'digital-interactive'                 ),             ),             'posts_per_page' => -1,             'orderby' => 'title',             'order' => 'ASC'         );              $images = get_posts( $args );         if ( $images ) {             foreach ( $images as $image ) {                 // Get the parent post ID                 $parent_id = $image->post_parent;                 // Get the parent post Title                 $parent_title = get_the_title( $parent_id );                 // Get the parent post permalink                 $parent_permalink = get_permalink( $parent_id );                 // Get image caption                 $logoimg = wp_get_attachment_image( $image->ID, 'Work Gallery' );             }         }              $attachment_id = $image->ID;         $attachment = get_post( $attachment_id );         $image_title = $attachment->post_title;         $image_alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);         $src = wp_get_attachment_image_src( $image->ID, 'full' );         $src = $src[0]; // Grabs only the URL ($src[1] = width of image, $src[2] = height of image)          ?>      Code for container that wraps around the image (and other information being pulled from the image):               <aside class="work_item <?php $posttags = get_the_tags(); if ($posttags) { foreach ($posttags as $tag) { echo str_replace('-','_',$tag->slug . ' '); } } ?>" data-id="id-<?php echo $parent_id; ?>">

                         <?php echo $logoimg; ?>

<a href="<?php echo $parent_permalink; ?>"><?php echo $parent_title; ?>

<?php echo gds_get_excerpt($image->ID); ?>

<a href="<?php echo get_field('attachment_website', $image->ID); ?>" target="_blank">View Website

                Now on my portfolio page that is querying the Work custom post type (first code sample) the class is generating all of the tags as expected. For my second code sample where I query the attachment post_type it does not. And I believe this is due to the fact the query is for the attachment post_type and the tags are associated with the work post_type. Can anyone help me with combining the work & attachment query together so I can retrieve the tags from the work post_type on my portfolio page that is querying the attachments? Thank you!


building a site with mostly custom styled, static pages.. advice needed

I'm putting together a site that will be compromised mostly of static pages with some dynamic content as well as a blog page. In terms of naming files, what would be the best way to achieve this? My first thought was to simply use about.php, services.php, etc. but I'm sure that doesn't jive well with WP's system.


Allow Access To Subfolder Of HTML For Logged In Visitors

I have a WordPress site installed in the root folder. Beneath the root is a /docs folder with a bunch of older html files. I'd like to allow only logged in WordPress users to be able to have access to those /docs html pages (not to be confused with WordPress 'pages'). I created a WordPress 'portal' page which displays links to the /docs pages if the visitor is logged in. I would also like to put in a textual search function (which I know how to do) so logged in visitors can get a list of relevant /docs html pages What I _don't_ know how to do is prevent _not_ logged in visitors from direct access to the /docs pages for both links and searches? I know I could do these if I converted the html pages to php and checked a referer. But I don't want to have to redo all the old html if possible (if I have to do _that_ I'll just import them into a WordPress taxonomy -- but I hope to avoid that!) I looked at .htaccess and I was hoping to perhaps set an ENV variable or use REFERER, but I keep reading that such things are not reliable. Ideas?


<!--More--> not functioning

I have the following blog template with the the_content outputted. I have placed `<!--more-->` However it does not appear to be functioning, http://www.milknhny.co.uk/DVine/?page_id=19 Is there anything that needs to be included within functions for this to function? **Code Of my Blog Template**               <?php     /*     Template Name: Blog Template     */      ?>          <?php get_header();?>     <?php echo get_the_post_thumbnail($post->ID, 'single-post-thumbnail'); ?>
     <?php query_posts('showposts=5'); ?>     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php echo get_the_date('j'); ?>    <?php echo get_the_date('M'); ?>

<?php echo get_the_title(); ?>

     Written by <?php the_author_posts_link() ?> in <?php the_category(); ?>     <?php the_content('read more...'); ?>

       <?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
     <?php endif; ?>
     <?php get_footer(); ?>      **EDIT** I have found this within the Twenty Twelve theme and ive tried to adapt this to my own however the - errors the actual code...               function DTheme_excerpt_length( $length ) {     return 40;     }     add_filter( 'excerpt_length', 'DTheme_excerpt_length' );          if ( ! function_exists( 'DTheme_continue_reading_link' ) ) :     /**      * Returns a "Continue Reading" link for excerpts      *      * @since Twenty Ten 1.0      * @return string "Continue Reading" link      */     function DTheme_continue_reading_link() {     return ' ' . __( 'Continue reading →', 'DTheme' ) . '';     }     endif;          /**      * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_continue_reading_link().      *      * To override this in a child theme, remove the filter and add your own      * function tied to the excerpt_more filter hook.      *      * @since Twenty Ten 1.0      * @return string An ellipsis      */     function DTheme_auto_excerpt_more( $more ) {     return ' …' . DTheme_continue_reading_link();     }     add_filter( 'excerpt_more', 'DTheme_auto_excerpt_more' );     ?>      Is it a case i would need to adapt the above for this to work? **EDIT** Hi all, this appears to be part working after amazing help below, however it is still not displaying within the content wrap and also images for example are resizing... please see my code now and also screenshot               <?php get_header(); ?>
     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php echo get_the_date('j'); ?>    <?php echo get_the_date('M'); ?>

<?php echo get_the_title(); ?>

     Written by <?php the_author_posts_link() ?> in <?php the_category(); ?>     <?php the_content(); ?>

       <?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
     <?php endif; ?>
     <?php get_footer(); ?>      ![Screenshot of further info on click](http://i.stack.imgur.com/e7cat.png)


How can I set full width page layout in a default post page?

I want to set up my site so that when I go to any post then it should show full width page. This theme already has a full width page but I wanted it to show in the default width page. How can I accomplish this? My website link is - http://techjagot.com The code in single.php is :-               <?php get_header(); ?>     <?php               setPostViews(get_the_ID());     ?>              <?php         global $wp_query;         $postid = $wp_query->post->ID;         if ( get_post_meta( $postid, 'post_featpages', true ) == "Yes" ) { ?>             <?php include (TEMPLATEPATH . '/featured-pages.php'); ?>         <?php } ?>              <?php if ( get_post_meta( $postid, 'post_featcontent', true ) == "Full Width Featured Content Slider"  ) { ?>             <?php include (TEMPLATEPATH . '/featured-wide.php'); ?>         <?php } ?>

                      <?php if ( get_post_meta( $postid, 'post_featcontent', true ) == "Narrow Width Featured Content Slider" ) { ?>                     <?php include (TEMPLATEPATH . '/featured-narrow.php'); ?>                 <?php } ?>                      <?php if ( get_post_meta( $postid, 'post_featgalleries', true ) == "Yes" ) { ?>                     <?php include (TEMPLATEPATH . '/featured-galleries.php'); ?>                 <?php } ?>                      <?php if ( get_post_meta( $postid, 'post_featvideo', true ) == "Yes" ) { ?>                     <?php include (TEMPLATEPATH . '/featured-vids.php'); ?>                 <?php } ?>
                          <?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('
','
'); } ?>                          <?php include (TEMPLATEPATH . '/banner468.php'); ?>          <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                          <div class="post" id="post-main-<?php the_ID(); ?>">

<a href="<?php the_permalink() ?>" rel="<?php _e("বুকমার্ক", "solostream"); ?>" title="<?php _e("Permanent Link to", "solostream"); ?> <?php the_title(); ?>"><?php the_title(); ?>
                                  <?php include (TEMPLATEPATH . '/postinfo.php'); ?>                                  <?php if ( get_post_meta( $post->ID, 'video_embed', true ) ) { ?>
                                     <?php echo get_post_meta( $post->ID, 'video_embed', true ); ?>
                             <?php } ?>                                  <?php the_content(); ?>

                                  <?php wp_link_pages(); ?>                                  <?php if(function_exists('the_tags')) { the_tags('
'. __('ট্যাগসমূহ', "solostream"). ':  ', ', ', '
'); } ?>
<?php _e('বিভাগ', "solostream"); ?>: <?php the_category(', '); ?>

                              <?php include (TEMPLATEPATH . '/auth-bio.php'); ?>                              <?php include (TEMPLATEPATH . '/related.php'); ?>                              <?php comments_template('', true); ?>
                          <?php include (TEMPLATEPATH . "/bot-nav.php"); ?>
      stylesheet.php code /* ---------[ Full-Width Layout Styles ]--------- */               .fwidth #page {}          .fwidth #contentleft {         width: 100%;         float:none;         }          .fwidth #content {         width: 908px;         }      If anybody demands any other code for more info then please tell me. I will provide you guys with it.


My blog has a design issue.

My blog has been getting a good visitors these days. I have used linkwithin add ons to show related posts. But the problem is it is showing related posts in even homepage. Is there any way to not to show it in homepage?


call coupon press advanced search widget anywhere in theme?

I am working on a parent child Coupon Press Wordpress Website. I am able to call it's New Advanced Search Widget in sidebar but I want to call it anywhere in the website like I have created a page (Advanced Search) and I want to call that widget on this page rather than in sidebar. I searched on internet and found `the_widget` but it's not working and also I don't know the actual name of "New Advanced Search" Widget.


Enqueueing Script to footer puts it at the very bottom

So I've got a bit of an issue, and not sure what the problem is. I'm trying to enqueue javascript in the footer of my Wordpress site. The footer looks like this:                   </footer>     </div>          <?php wp_footer(); ?>          <script>         jQuery(document).foundation();     </script>     </body>     </html>      So the enqueued script SHOULD be put in the wp_footer call, putting the script just above where I actually call it. But looking at the source code of the file, I get this:               </footer>     </div>                                        <script>     jQuery(document).foundation();     </script>     <script type='text/javascript' src='http://www.thetestsite.com/wp-content/themes/cornerstone-4.3.1/js/foundation.min.js?ver=4.3.3'></script>     </body>     </html>      For some reason, the script in question is being placed RIGHT BEFORE the closing body tag. I verified the wp_footer is in the correct place, so I'm not sure what would cause this to happen. If I enqueue the script to the head, it works just fine, but I'm just curious as to why this behavior is happening. UPDATE (NEW CODE): Sorry for the confusion. Here's the functions.php portion of the script enqueue method:               function load_cornerstone_scripts() {         wp_enqueue_script(             'foundation_js',             get_template_directory_uri() . '/js/foundation.min.js',             array('jquery'),             '4.3.1',             true         );          }          add_action('wp_enqueue_scripts', 'load_cornerstone_scripts',0);      So to be clear..the original two blocks of code are showing 1) What the php file footer.php looks like, and 2) what the source code is rendered as.


Wordpress blog not loading articles

I have set up a static website with basic information pages such that all of the static pages fall into one level and in that directory there is directory "blog" which contains a Wordpress 3.5.1 install. This gives me the following directory structure:   * index.php   * blog.php   * /blog      * all of my Wordpress crap I have recently been suffering from an issue that constantly re-directs me to my homepage when you try to navigate to a blog post but you are able to navigate to blog.php and it seems to be working correctly. I think something might be wrong with my .htaccess but I do not know enough about them to say. I have included both of my .htacess files below in the hopes that someone can see what is going on and help me to correct this problem. **root directory**               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      **/blog/ directory**               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /blog/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /blog/index.php [L]     </IfModule>          # END WordPress      The website in question can be found at R2 Consultants Ltd.. Any help that you could provide would be very appreciated and if I have not provided enough information for you to be able to help me please just request what you need and I will get it for you ASAP. Thank you in advance for your assistance. Mat


Query multiple tables at once?

I want to query all of the posts in my WordPress multi-site set-up looking for a certain string. This is only being done in Sequel Pro (on the command line) for my own inquisitive purposes but there has got to be a better way than copying and pasting the same query over and over again and just changing the table prefix... Let's say I have 3 sites, I want to find all of the posts that contain the word foo in them:               SELECT * FROM wp_1_posts WHERE `post_content` LIKE '%foo%';     SELECT * FROM wp_2_posts WHERE `post_content` LIKE '%foo%';     SELECT * FROM wp_3_posts WHERE `post_content` LIKE '%foo%';      I don't want to have to run 3 queries and concat the results somehow. What I really want to do is               SELECT * FROM wp_1_posts, wp_2_posts, wp_3_posts WHERE `post_content` LIKE '%foo%';      but that seems to only be meant for joining. Is there any way to do what I'm trying to do?


change the Theme dynamically

Is there some way to change the page template dynamically using just a url I wanna use it in a demo theme, so for example when the user enters a particular URL ending with for example ?custom_page_template it changes the template on the fly? Could this technique be used to change the theme (or maybe a child theme) on the fly just for demo purpose?


WooCommerce - how to display product category above product with full details

i'm new in wordpress so please suggest me. i'm selling ring, earings, chains, ect. ring, earings "catogry" and ring-1, ring=2 product. so i want to show on shop page my catogry and on click catogry my products will show


Nav Menu Display

Hi I'm wanting to create a custom navigation menu that will require creating 2 `div` containers to hold the SUB-MENU set. In other words I want to do this:

       I'm doing this because I'm using about 3 different background images. How would I go about adding this into the wp_nav_menu function? Do I add a filter in functions.php, or do I create a separate PHP file to do this? Any helpful suggestions would be greatly appreciated.


Wordpress SQL - How to Check for Category?

I'm using the following SQL (wrapped in php) to find posts in a wordpress database:               $sql = "         SELECT             p.*         FROM             {$wpdb->prefix}most_popular mp             INNER JOIN {$wpdb->prefix}posts p ON mp.post_id = p.ID         WHERE             p.post_type IN ( $holder ) AND             p.post_status = 'publish'         {$order}         LIMIT %d     ";      And I want to add an additional condition that the post be in a specific category. Any thoughts?


Exclude One Category and its Subcategories using WP_LIST_FILTER

I need to exclude a category and its subcategories in posts. This is the code I'm working on and it works:                       <?php             $categories = wp_get_post_terms($post->ID, 'category');             $categories = wp_list_filter($categories, array('slug'=>'regione'), 'NOT');             $categories = wp_list_filter($categories, array('slug'=>'lazio'), 'NOT');             $categories = wp_list_filter($categories, array('slug'=>'rm'), 'NOT');             if (!empty($categories)) {                 ?>
                     <?php                     foreach ($categories as $category) {                         $cat = get_category($category);                         echo '
' . $cat->name . '
';                     }                     ?>
      Although, the category 'regione' has more than 20 subcats and each subcat has 5 to 10 other subcats: any suggestion on how to exclude in a better way the main category and its children?


What defines a post as portfolio page content?

I have three types of content, Posts which I have defined as Blog and categorise accordingly, Slider Images defined by a specfic category, and Pages. I want to have content as portfolio on a profolio page similar to a blog. My theme allows it, under the new page editor I have options to have a portfollio template. ![enter image description here](http://i.stack.imgur.com/daU5E.jpg) I have chosen that template but I cannot point a post or other piece of content to appear here. How do I choose a post to sit under this page? For information I am using this theme


Pagenavi pagination via wp-query in functions.php showing same content for each page

I've recently had a lot of help creating an upcoming events list (see here Showing upcoming events including todays event - StackOverflow), as a result my pagination using `wp_pagenavi()` is broken. At the moment, when you click on page 2 it just shows the same posts as page one. Although the URL does actually change to page/2 page/3 etc. I have this in my `functions.php` file:               function filter_where( $where = '' ) {     $where .= " AND post_date >= '" . date("Y-m-d") . "'";     return $where;     }          add_filter( 'posts_where', 'filter_where' );          $query = new WP_Query(         array(             'post__not_in' => array(4269),             'paged' => get_query_var('paged'),             'post_type' => 'whatson',             'exclude' => '4269',             'post_status' => 'future,publish',             'posts_per_page' => 20,             'order' => 'ASC'         )     );          remove_filter( 'posts_where', 'filter_where' );      My loop is then as follows:               <?php while ( $query->have_posts() ) : $query->the_post(); ?>     // content     <?php endwhile; // end of the loop.  ?>     <?php if (function_exists('wp_pagenavi')) { wp_pagenavi( array( 'query' => $query ) ); } ?>      Doing `print_r ($query);` before removing the filter produced this: ![enter image description here](http://i.stack.imgur.com/2G6aam.png)


images within style sheet

I hope someone will be able to help me with this, because it's starting to freak me out. Have been searching hours to find a way to put image paths in my stylesheet, but have not been able to. The path must not be absolute or "theme dependant". The only way I have been able to fix my issue, is to do add the following within my html file:               <style type="text/css">         #menu .menu-drop .menu-label {             background: url(<?php echo get_template_directory_uri()."/admin/images/drop1.png"; ?>) no-repeat right;         }         #menu li:hover .menu-drop .menu-label {             background: url(<?php echo get_template_directory_uri()."/admin/images/drop2.png"; ?>) no-repeat right;         }         #menu .menu-sub li:hover {             background: #2a2a2a url(<?php echo get_template_directory_uri()."/admin/images/select.png"; ?>) no-repeat 10px;         }     </style>      As you can see, I simply add the background image "manually" in the html file after including the stylesheet in the header. Any idea how to transfer the above to a stylesheet, or is that not possible?


Show recent posts in a table format

In the index.php template I want to display posts in 3columns in a table format. How can I do this? I don't want a list format cause I have variable hight image sizes


Accept code input into Options Framework

I'm using Options Framework for a theme. I'd like to add a theme option to add Google Analytics code to the front end's `<head>` section. What is the options.php code to create an input box which won't strip `<script>` from the input?


Enclosing Shortcode not working in a Template

I've use the following code for an enclosing shortcode and it works perfectly in the posts.               function date_code($attr, $content)     {        return '<h3>' . $content . '</h3>';     }          add_shortcode('datecode', 'date_code');      But when I try to use it in a page template using http://codex.wordpress.org/Function_Reference/do_shortcode it's not working. I've use the following code in my template:               echo do_shortcode( '[datecode]' . $content . '[/datecode]' );      **Please help me since the non-enclosing shortcode works fine with do_shortcode.** And, I'm ignorant with regards to using enclosing shortcode in a page template. I want to display the shortcode in the page template like in the posts. Thanks in advance.


woocommerce: change default setting > is_sold_individualy function

In woocommerce/classes/abstracts/abstract-wc-product.php on line 338. The is_sold_individualy function is default "false". Is there a way to set this default option to "true"? So in de Wordpress back-end the checkbox is checked by default?                function is_sold_individually() {         $return = false;                if ( 'yes' == $this->sold_individually || ( ! $this->backorders_allowed() && $this->get_stock_quantity() == 1 ) ) {              $return = true;          }                return apply_filters( 'woocommerce_is_sold_individually', $return, $this );       }      Thanks in advance, Mirjam


Woocommerce: Remove Woocommerce default address fields

I am trying to remove / hide some default address Fields like as the Postcode (Zip-code) field in Cart Shipping Calculator / Whole Woocommerce ? Is there a function for this? I found in shipping-calculator.php               <?php if ( **apply_filters( 'woocommerce_shipping_calculator_enable_postcode', true )** ) : ?>                      <p class="form-row form-row-wide">                     <input type="text" class="input-text" value="<?php echo esc_attr( $woocommerce->customer->get_shipping_postcode() ); ?>" placeholder="<?php _e( 'Postcode / Zip', 'woocommerce' ); ?>" name="calc_shipping_postcode" id="calc_shipping_postcode" />                 </p>                  <?php endif; ?>      I tried to put in fuction.php some code               apply_filters( 'woocommerce_shipping_calculator_enable_postcode', false )      or               // Hook in     add_filter( 'woocommerce_default_address_fields' , 'custom_override_default_address_fields' );          function custom_override_default_address_fields( $address_fields ) {          unset($address_fields['shipping']['shipping_postcode']);               return $address_fields;     }      but impossible Please Help. Thank you very much!


Can I create permalinks like this: /%post_type%/%postname%/

I've been learning about custom post types from Morten Rand-Hendriksen's great tutorial on making a WordPress portfolio theme on lynda.com. He demos how to set up a custom taxonomy for "recipes" and create links like domain.com/?recipes=post-title. I think this is really cool because you get a post-title with the contextual clue of "recipes" without being stuck with a bunch of nested hierarchical subdirectory archives that may be boring to look at and contain repetitious content. For a large, multifaceted domain, I think it would be neat if there is a way to make a site behave as it has a permalink structure like this: domain.com/%post_type%/%postname%/ for posts and custom post types, while staying with domain.com/page-name for pages. I'm thinking of domain.com/blog/post-name for anything in the blog, though domain.com/?blog=post-title would still work. What do you think, and what is the most practical way to go about this?


Previous and Next posts

I use the following code for displaying the previous post thumbnail with links:               <?php            $prevPost = get_previous_post(true);            $prevThumbnail = get_the_post_thumbnail($prevPost->ID, array(150,150) );           previous_post_link( '%link', $prevThumbnail );      ?>      The problem is that I get the correct link for the previous post but the thumbnail that is displayed is of the current post and not of the previous post. I am using this for a single template of a custom post type.


Merge page with custom post type

This may be a weird scenario, but...I have a custom post type called Resources. When visiting /resources/ I get the archive as expected. What I want is a text describing this post type. Therefore I've made a page with the exact name and path. If I now go to /resources/ I still get the archive page, which is good. So, I created a custom template (archive-resources.php) and from there I searched pages with the same path and then I find my page and is able to write out the text before listing the archive. What I want to know is that, is this a good way to solve my problem? if not, how can I make it better?


Loop doesn't work in single-product.php page but works at normal page

I'm outputting a list of categories with the posts inside the ul. This works fine on a normal pages but not on the single-product.php page. It breaks on the single-product.php page with the line have_posts. What is the problem?                 <?php         $post_type = $wp->query_vars["product"];       $tax = 'product_category';       $tax_terms = get_terms($tax,'hide_empty=0');            if (is_array($tax_terms)) {         foreach ($tax_terms  as $tax_term) {           $args=array(             'post_type' => $post_type,             "$tax" => $tax_term->slug,             'post_status' => 'publish',             'posts_per_page' => -1,             'caller_get_posts'=> 1           );           $my_query = new WP_Query($args);           if ( $my_query->have_posts() ) {             echo "

$tax_term->name
";             echo "
";             while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php  $delta_article_number = get_post_meta( get_the_ID( ), 'delta_article_number', true );  echo $delta_article_number;  ?> <?php the_title(); ?>
               <?php             endwhile;             echo "

";           }              }       }       wp_reset_postdata();  wp_reset_query();       ?>


Moved my Wordpress site and now it can't read the theme

I moved my Wordpress website on Friday (so DNS propagation should be long finished) and now the site has no theme. I spent time yesterday re-installing the theme and Wordpress but to no avail. It won't recognize any theme, even Wordpress default http://inspiringtravellers.com Any ideas? I have deactivated all plug-ins and this didn't fix it. I believe it to be a permissions issue somewhere and others have also pointed to a .css file appearing missing though when I look at the ftp it is there. I spent ten hours on this yesterday trying everything and am starting fresh today. Many thanks in advance for your help


Hide extra menus from Wordpress Dashboard

How can hide extra menus from Wordpress dashboard. That is some plugins gives plugin settings menu may under Settings or anywhere else, how we can hide all this type of extra menus while plugin active


Only show content slideshow if "slideshow" custom field exists

I am developing a theme for general release and there is a large content slideshow on the homepage. I have included a checkbox meta box in the post edit screen that allows users to determine which posts are featured in the slideshow but I can't figure out exactly how to create a query for this. The checkbox relates to a custom field called "slideshow" Here is my slideshow code so far;

             <a href="<?php the_permalink('');?>"><?php the_post_thumbnail('slideshow-thumb');?>

<?php $category = get_the_category(); echo 'cat_ID).'">'.$category[0]->cat_name.'';?>

<a href="<?php the_permalink('');?>"><?php the_title('');?>
                 <?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,70);?>

      Any help would be greatly appreciated.


Create a list of recent Custom Post Types posts

I've been using this snippet to generate a list of recent posts from particular categories in a widget. I'm currently restructuring the site using custom post types and taxonomies and want to generate a list of recent posts from 3 custom post types, taxonomies and categories don't have to be part of the query at this stage but would be nice to know how to include them. Bit of a PHP novice, can't seem to find a solution to this.
     <?php     $recentPosts = new WP_Query();     $recentPosts->query('showposts=10&cat=-4,-30,-19,112,137,125,128');     ?>     <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?>
     <?php endwhile; ?>
      Ok, seem to have solved it with this               $recentPosts = new WP_Query();     $recentPosts->query(array('showposts' => 9, 'post_type' =>     array('mycustomposttype1',      'mycustomposttype2','mycustomposttype3')));      but still not sure if this is the best method so any feedback appreciated.


How to require users to login when not logged in

I am trying to develop my first WordPress site, its going to be a school site, I develop sites normally, but this is my first time of using a CMS to do that. The school site is supposed to display the homepage of the school when users view the site, but then, it is supposed to also show a `login link` to users when they are not logged in, and if they are logged in, it is supposed to show extra items on the menu bar. I do not see how to achieve this without some conditional statements in place, but I really hope there is a way to get there without coding, I am new to wordpress and I have not really gone deep into knowing much of its classes and functions, so most preferable I would like to achieve this without coding using plugins or maybe specific themes (if possible), and if not, I would still like to know how to go about it. I hope my question is not too ambiguous. I would really appreciate all answers. Thanks...


Search XML file from within Wordpress?

We use Jira internally for an defect mgmt system.   We want to provide defect tracking to our clients. We cannot expose Jira to the web, but we do have our main site hosted on WP 3.2.1 I can export a XML file from Jira of the defects and plonk this under our Wordpress site. I was thinking that I could come up with a basic page within Wordpress to allow our users to filter this XML list down. i.e. Search on a reference number of keywords from the title or description nodes. I was hoping to spot a good Jira/WP plugin but no luck. The answer I am looking for, is: \- Is this achievable through WP \- What would be the best approach to go about this? \- Any links to similar attempts would be also beneficial. Let me know if u need more info via the comments.


Can't update WordPress, need to reboot the VPS

After I moved to a new VPS (Ubuntu), I can't update the WordPress. When I click on the "Update Now" button, it shows upgrading progress messages and it shows "Welcome to WordPress 3.9" (Now I'm on 3.8.3), but after refresh the page, nothing happens. Again, I'm on the WordPress 3.8.3. Then I deactivated all the plugins and again, I re-update the Wordpress. But nothing happened. I can only fix this issue after reboot the VPS. After the reboot VPS, when I log-in/visit the WP dashboard, it only shows upgrade message. However I can successful update plugins without rebooting. My VPS running nginx, APC, pagespeed mod, Ubuntu 12.04. What could be the reason for this matter? Thanks!


subcategories inside div tag

I'm trying to style subcategories separately. I tried to put them into divs, but it doesn't work. Any ideas?               <?php     // get the term id     $category = get_queried_object();          // Get categories     $hird_categories = hird_get_subcategories( $category->term_id );          if (!$hird_categories ) {      $herd_products = hird_get_products( $category->term_id );     }     get_header();     ?>
     <?php       if ( function_exists('yoast_breadcrumb') ) {         yoast_breadcrumb('
','
');       }     ?>
<?php echo $category->name ?>

 Select Category

<?php echo category_description( $category->term_id ); ?>
            <?php if ( $hird_categories ): ?>              <?php foreach ( $hird_categories as $key => $category ): ?>
           <a href="<?php echo get_bloginfo('url') .'/products/'. $category->slug?>">

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

       <?php endforeach ?>       <?php elseif( $herd_products  ): ?>                       <?php foreach ($herd_products  as $key => $product): ?>
             <a href="<?php echo get_permalink( $product->ID );  ?>">              <?php if ( get_the_post_thumbnail( $product->ID ) ) : ?>                <?php echo get_the_post_thumbnail( $product->ID, 'hird-category-image' ); ?>              <?php else: ?>                <img src="<?php echo get_template_directory_uri(); ?>/images/hird_placeholder.png">              <?php endif ?>

<?php echo $product->post_title; ?>

         <?php endforeach ?>       <?php else: ?>          There are no items to show!       <?php endif ?>


Where can I find admin-header.php file online?

I am using Wordpress for my website. I was working on CPANEL yesterday and was browsing `public-html/wp-admin folder` under the `File manager`. There were many files and I accidentally deleted the `admin-header.php` file. Where can I get an another copy of that file so that I can upload it to the same folder from where it got deleted?


Edit tags page for hierarchical taxonomy doesn't show taxonomies at all depths

I created a taxonomy called "portfolio categories" for my portfolio custom post type. They're hierarchical and supposed to be behave like categories. when i'm editing a single portfolio post... i have a metabox where i can assign the proper portfolio category. It shows all categories at all the depths. ![unlimited hierarchy](http://i.stack.imgur.com/bSVmK.png) but when i am on the Taxonomy page (edit-tags.php?taxonomy=portfolio- cats&post_type=portfolio) then it only shows top level categories and their immediate children... and no further. so grandchild-level categories are missing even though there are portfolio pieces assigned to them. ![limited hierarchy](http://i.stack.imgur.com/m3n3z.png) is this default behavior? b/c i can see unlimited depths on the regular Categories page. should a hierarchical taxonomy behave the same?               /*      * Builds the a tag taxonomies      */          function create_portfolio_taxonomies() {     // Add new taxonomy, make it hierarchical (like categories)       $labels = array(         'name' => _x( 'Portfolio Categories', 'taxonomy general name' ),         'singular_name' => _x( 'Portfolio Category', 'taxonomy singular name' ),         'search_items' =>  __( 'Search Portfolio Categories' ),         'all_items' => __( 'All Portfolio Categories' ),         'parent_item' => __( 'Parent Portfolio Category' ),         'parent_item_colon' => __( 'Parent Portfolio Category:' ),         'edit_item' => __( 'Edit Portfolio Category' ),          'update_item' => __( 'Update Portfolio Category' ),         'add_new_item' => __( 'Add New Portfolio Category' ),         'new_item_name' => __( 'New Portfolio Category Name' ),         'menu_name' => __( 'Portfolio Categories' ),       );                  register_taxonomy( 'portfolio-cats', array('portfolio'),              array(                  'hierarchical' => true,                  'labels' => $labels,                  'rewrite' => array( 'slug' => 'portfolio','with_front' => true, 'hierarchical' => true  ),             ) );              //preset some categories         my_add_term($postID,'portfolio-cats','Print');           my_add_term($postID,'portfolio-cats','Digital');          }     add_action( 'init', 'create_portfolio_taxonomies', 0 );                    function my_add_term($id, $tax, $term) {              $term_id = intval(term_exists($term));         if (!$term_id) {             $term_id = wp_insert_term($term, $tax);             $term_id = $term_id['term_id'];         }         $result =  wp_set_object_terms($id, array($term_id), $tax, FALSE);              return $result;     }


Script not working correctly produce error: An unidentified error has occurred

I am developing a wordpress theme while adding a category from admin panel it doesn't show the category until I refresh the page and when I delete the same, it produces an error: _An unidentified error has occurred._ And when I refresh the page it's been deleted.


Second foreach loop breaking (Posts2Posts)

I've read about a couple of similar issues that Google gave me (1 & 2), but I can't quite get to the bottom of this problem. Using Posts 2 Posts, I'm building a table of posts and their related posts on a Discography Template on a music site. I need to use `each_connected` twice to show the relationship between Albums > Artists and Albums > Producers. My main loop calls the album CPT. The issue I'm having is the second `foreach` loop which always returns an `invalid argument supplied foreach...`. I've tried changing the order in which everything is called, I've used `global $post;` just before my main loop, nothing has worked. At this point, I hope it's not something stupid I've done! Here's the code:                               <?php                     $args = array (                         'post_type'              => 'hhie_albums',                         'post_status'            => 'publish',                     );                               $query_albums = new WP_Query( $args );                     p2p_type( 'albums_to_artists' )->each_connected( $query_albums, array(), 'artists' );                     p2p_type( 'albums_to_producers' )->each_connected( $query_albums, array(), 'producers' );                               if ($query_albums->have_posts() ) { ?>                             <?php while ($query_albums->have_posts() ) { $query_albums->the_post();  ?>
                                         <a href="<?php the_permalink() ?>" rel="bookmark" title="Album: <?php the_title_attribute(); ?>"><?php the_title(); ?>	                                                                           <?php foreach ( $post->artists as $post ) : setup_postdata( $post ); ?>                                     <a href="<?php the_permalink() ?>" rel="bookmark" title="Artist: <?php the_title_attribute(); ?>"><?php the_title(); ?>                                     <?php endforeach; wp_reset_postdata(); ?>                                 	                                              <?php foreach ($post->producers as $post) : setup_postdata( $post ); ?>                                     <a href="<?php the_permalink() ?>" rel="bookmark" title="Producer: <?php the_title_attribute(); ?>"><?php the_title(); ?>                                     <?php endforeach;                                     wp_reset_postdata(); ?>                                 	                         <?php } ?>
                          <?php } else {                          }                               wp_reset_postdata();                     ?>


Exclude posts with specific meta_value while sorting by a separate meta_value

I am trying to exclude posts with a specific meta_value with a specific meta_key while also sorting the posts by a meta_value with a different meta_key. This is my current code for the WP_Query class:               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;          $args = array(          'posts_per_page' => '50',         'meta_key' => 'release_date',         'orderby' => 'meta_value_num',         'order' => 'ASC',         'paged' => $paged     );     $the_query = new WP_Query($args);      the sorting by a specific meta_value part is working fine but I am not sure what to add to get it to exclude posts with a specific meta_value with a different meta_key than the one used for sorting. Any advice / help is very much appreciated. **I got this working with the code below:**               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;          $args = array(          'posts_per_page' => '50',         'meta_key' => 'release_date',         'orderby' => 'meta_value_num',         'order' => 'ASC',         'meta_query' => array(             array(                 'key' => 'undetermined_date',                 'value' => 'TBA',                 'compare' => '!=',                 'type' => 'CHAR'             )         ),         'paged' => $paged     );     $the_query = new WP_Query( $args );      I have changed the custom field type to check-boxes which returns true or false instead of a text box. How would I change this code for use with a check-boxes? Here is the code I have tried:               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;          $args = array(          'posts_per_page' => '50',         'meta_key' => 'release_date',         'orderby' => 'meta_value_num',         'order' => 'ASC',         'meta_query' => array(             array(                 'key' => 'undetermined_date_toggle',                 'value' => 'true',                 'compare' => '==',                 'type' => 'CHAR'             )         ),         'paged' => $paged     );     $the_query = new WP_Query( $args );


Wordpress website homepage (only) stuck in maintenance mode

My website only shows the "Briefly unavailable for scheduled maintenance. Check back in a minute." message only on the homepage. Been stuck for two days, don't really know how to fix it. What did I already do. 1\. Search for the .maintenance file (there is no, even hidden files) 2\. Remove the update plugin folder 3\. Create a fake maintenance mode and remove it 4\. Update other plugins to see if the website would have been back to normal What's also strange is that other people can perfectly see the website homepage and I can't from my ipad, iphone, mac. I Don't really understand what's happening. What should I try to be able to fix it now ? Any ideas ? Thx you guys.


Password protect some uploaded files, so only logged-in users can view them

I would like to protect some uploaded files, so that they are not publicly accessible (they are not accessible without a login). I'm uploading some PDF files, and I'd like to mark some of them as protected, so they can't be accessed without a login on the Wordpress web site. I'm currently using the Member Access, which lets me mark some posts and pages as protected (so only logged-in users can view them). This is great. However, it does not provide any way to protect media uploads (i.e., attachments). Note that I do not want to protect all uploads, only some of them. Some uploads need to be accessible to the public, while others should only be accessible to logged-in users. I'd prefer to do this through the Wordpress administration interface (not a hairy .htaccess file that has to be manually administered). I want something that is actually secure, not just security- through-obscurity. How do I do this? (I've read How to Protect Uploads, if User is not Logged In?, but it concerns methods to protect all uploads, not just some of them. I've read How to restrict access to uploaded files?, but it focuses on security-through- obscurity. This is close to simple solution for restricting access to (some) uploads/downloads, but I'd prefer a solution that can be administered through the web interface if possible.)


Using IDX feed to display agent's and listings with agent's info associated for Real Estate Website

Trying to figure out how to get a user/agent to be associated with their IDX/mls number. Have been trying to find a way around this since Diverse Solutions does not give a feed for agent's info, only REIN(Virginia's MLS) has the agent's photo and listings associated. No real estate themes have the main search function pulling properties/agents from an IDX feed. Many themes say they are integrated with this functionality but I have purchased about 10 of them even after asking and then am told otherwise after purchasing. For now I am just trying to be able to have a custom HTML widget for each user on my site http://erarepros.com/author/bjill/. How can I add a custom widget for each agent/user? Diverse Solutions provides a way to get a feed for each agent using their MLS ID http://erarepros.com/idx/?idx-q-ListingAgentID%3C0%3E=7994 \--where 7994 is the agent's REIN ID number


Why does querying on post_tags (which has been applied to custom post types) only return posts?

So I've created a little jquery cycle based feature rotator that pulls from the post_tags. I added the post tags to my other custom post types like this:               register_taxonomy_for_object_type('post_tag', 'reviews');     register_taxonomy_for_object_type('post_tag', 'interviews');     //...      When I add a 'featured' tag to one of my reviews and one of my interviews, and query for it thusly:               $query = new WP_Query( array( 'post_tag' => 'featured' ) );      I get two random posts instead of the two expected results. Any ideas?


add_action() in switch statement

I'm using the approach of having all of my single-views in one `loop- single.php` and thus have a simple switch statement that will render each single-view based on the post type:               switch($post->post_type) {              do_action('basey_loop_single');              default: ?>                  <?php echo apply_filters('basey_page_title_news', __('
News
','basey')); ?>             <?php /* Start loop */ ?>             <?php while (have_posts()) : the_post(); ?>                 <?php basey_post_before(); ?>                     <article <?php post_class() ?> id="post-<?php the_ID(); ?>">                         <?php basey_post_inside_before(); ?>
<?php the_title(); ?>
                                 <?php basey_entry_meta(); ?>
                                 <?php the_content(); ?>
                                                              <?php wp_link_pages(array('before' => '
' . __('Pages:', 'basey'), 'after' => '
' )); ?>
                                     <?php echo __('Posted in ','basey'); the_category(', '); ?>
                                 <?php $tag = get_the_tags(); if (!$tag) { } else { ?>
<?php the_tags(); ?>
<?php } ?>
<?php comments_popup_link( __( ' 0 Comments', 'blank' ), __( ' 1 Comment', 'blank' ), __( ' % Comments', 'blank' ), 'comments-link', __('Comments closed', 'blank')); ?> <?php if ( comments_open() ) : ?>| <a href="<?php the_permalink(); ?>#respond" title="<?php echo __('Add a Comment','basey'); ?>"><?php echo __('Add a Comment','basey'); ?><?php endif; ?>
                                                      <?php basey_post_inside_after(); ?>                         <?php comments_template(); ?>
                 <?php basey_post_after(); ?>             <?php endwhile; /* End loop */ ?>          <?php }      You can see at the top that I've included a `do_action()` call for what I hope can be an extendable area (that can be plugged-into via other plugins or theme functions I write). While this is also part core PHP question --> is there a way to plug into a switch statement the same way you would an array (like so):               function add_extra_fruits($fruits) {          $extra_fruits = array(         'plums',         'kiwis',         'tangerines',         'pepino melons'     );          // combine the two arrays     $fruits = array_merge($extra_fruits, $fruits);          return $fruits;     }     add_filter('add_fruits', 'add_extra_fruits');


Preloading custom pages in cache using WP Super Cache

I am developing Exposure Inc. Co and am using the RB-Agency plugin for modeling database. The plugin is not very well architected and makes a ton of HTTP queries resulting in high latencies. When a page is cached, it's all good and load times are around a second. I am using the WP Super Cache Plugin. The profiles that RBAgency generates are not standard WordPress pages or posts but are dynamically generated from profile information (http://exposureinc.co/profile/walter-coppage/).   Thus, WPSC's preloader doesn't identify and cache them. Once they are loaded for the first time, they are cached and subsequent load times are good. Is there some way to cache all these pages? The profile IDs are saved in the table `wp_agency_profile` in column `profile_gallery`. Could WPSC be made to reach out to the table and cache the found pages?


Filter post listing by meta value which is a date

This question is almost what Im trying to achieve. Create a filter for posts based on a custom field. My custom field is a date and I would like to create a date filter (monthly) based on this custom field for the post listing admin screen. I'm not using the normal date as this is an historical website I'm creating and some posts are from many years ago.


How pull wordpress blog data using Blogger API using python

Wordpress mentioned that it supports Blogger API (link). So, can anyone tell me how to use Blogger API (using python) v3 to pull wordpress public blogs data. Or, is there any wordpress API to pull public data from its blogs? (Lang: Python). Any useful documentation that clearly explains the procedure would also be appreciated.


How to Create a Repeatable Meta Box

I would like to know how to create repeatable meta-boxes like in this video: http://www.screenr.com/a17s [starts at around 40 seconds]. I saw an answer on how one creates a repeatable section within a meta-box, but I want to know how to repeat the entire box (as seen in the video).


How to return multiples lines in a shortcode?

I found this example of a shortcode on the Internet:               function project_shortcode( $atts, $content = null ) {         extract( shortcode_atts( array(             'class' => '',             'id' => '',             ), $atts ) );                  return '
' . $content . '
';          }     add_shortcode('button', 'project_shortcode');      This is the output I want:

                 <img src="<?php bloginfo( 'template_url' ); ?>/images/studyatbest.png">

BEST LANGUAGE CENTER

BEST Language Center is an educational establishment in Taichung, Taiwan. I was asked to build and design a website they could use to offer classes, programs and display photos online.

ROLE

Design, HTML/CSS, JavaScript

YEAR

2010

WEBSITE

studyatbest.com

      But I'm not sure how to do it so that I can return multiples lines in the shortcode (in order to keep the code clean). Any suggestions?


MySQL query to set wp_postmeta using term_taxonomy_id value

I have a need to set the `wp_postmeta` value (in table: `wp_postmeta`) on every post that has a specific `term_taxonomy_id` (in table: `wp_term_relationships`): Specifically:   * run a query against every `post_ID` that has `term_taxonomy_id` value of 18   * if the `wp_postmeta` for that `post_ID` doesn't contain the key of `_category_permalink_` then add it with the value set to 18, otherwise ignore it My MySQL foo is poor, so apologies if this makes no sense or I have got tables, names around the wrong way. **UPDATE:** In relation to answers/comments below by @deadlyhifi and @Jot I have the following:               function cleanup_permalink() {         static $fnCount = 0; //to run only once         if ($fnCount) return;         $fnCount++;         global $wpdb;         $results = $wpdb->get_results("SELECT `object_id` FROM $wpdb->term_relationships WHERE `term_taxonomy_id` = 18");         foreach ($results as $result) {             add_post_meta( $result, '_category_permalink_', '18', true);         }     }     add_action('init','cleanup_permalink'); //i'm assuming init is the best place?


Error establishing database connection on app engine after deploying wordpress. I got an error Notice: Undefined property: batcache::$query in /base/data/home/apps/s~project-id/wp1.xxxxxxxxxxx/wordpress/wp- content/advanced-cache.php on line 388 Can’t select database We were able to connect to the database server (which means your username and password is okay) but not able to select the wordpress_db database. Are you sure it exists? Does the user root have permission to use the wordpress_db database? On some systems the name of your database is prefixed with your username, so it would be like username_wordpress_db. Could that be the problem?


How to configure Buddypress Activity Plus to work with front end posting?

I would like to use the feature of Buddypress Activity Plus on the front end posting code by Voodoopress. This plugin supports automated rich media embed (when a user posts a link on the activity stream). I want that rich media support on the front end posting page. I have no idea how to attach the button set (which appears under the activity stream) to the form. Please help.


Display tags in list without link

This seems like it should be something that's really simple to do, however it's apparently not. I don't want tags to be links, but I want them to display in an unordered list, with each tag inside an `<li>` get_the_tags allows you to echo them without the associated link, but I have no idea how to wrap them in li's.                <?php     $posttags = get_the_tags();     if ($posttags) {       foreach($posttags as $tag) {         echo $tag->name . ' ';        }     }     ?>


Storing Options in a Shortcode

I am creating a Wordpress plugin. I want to create 1 single shortcode that changes output based on the settings changed by the user on the admin settings page. So for starters, I have something like this below:               add_shortcode( 'my_shortcode', 'my_shortcode');       function my_shortcode($atts) {         $atts = shortcode_atts (       array (       'display' => get_option('setting_1'),       'toolbar' => get_option('setting_2'),       'branding' => get_option('setting_3')       ), $atts);          }      What do I need to do next in order to store these settings into a single shortcode that keeps it's name despite the settings changing?


How to add paging to query

In the script below, I'm calling out from archive.php to functions.php to retrieve a list of posts that have been flagged in a category reserved for my "blog" posts. I'm listing these posts in summary with the count determined by an option called "blog_count". I need to add paging to this function so that the blog_count determines the initial page count, not the total number of blog posts returned. What changes do I need to make to the get_posts() call to include this paging? I've tried adding 'offset' => 3 for example, but it only list the offset posts, not the previous.               //called from archive.php to handle posts placed into "blog" category     if(is_category())     {         if(get_option('inner_blog') && (get_query_var('cat') == get_option('blog_cat')))         {             //call function to output posts as in a blog format             get_blog_links();         }          else          {              //just a standard summary listing of posts in this category             get_category_links();         }     }?>                //function inside functions.php      function get_blog_links(){         $hasChildCats = get_term(get_query_var( 'cat' ), 'category');         if($hasChildCats->count <= 0) return;         global $post;         $cat = get_query_var( 'cat' );         //set the target category and initial page post count         $args = array('cat' => "$cat",'post__not_in' => get_option('sticky_posts'),'numberposts' => get_option('blog_count'));         $myposts = get_posts($args);echo '

';               //loop over the resultset         foreach($myposts as $idx=>$post){ ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
         <?php          setup_postdata($post);         echo '<address>Posted on: <time datetime="'.get_the_time('Y-m-d').'">'.get_the_date().'</time> By: '.get_the_author().'</address>';         if(has_post_thumbnail() && get_option('cb2_show_thumbs')) the_post_thumbnail('thumbnail', array('class' => 'alignright', 'style' => 'margin:10px;'));              get_blog_excerpt();              if(has_post_thumbnail() && get_option('show_thumbs')) echo '

';?>
         <?php } echo '

';         ?>
             <?php next_posts_link('« Older Entries') ?>             <?php previous_posts_link('Newer Entries »') ?>
         <?php      }


Add file name column to media library

I've migrated hosts for a WordPress site, and a lot of my images have the same title. I am trying to pinpoint one media file by the file name, but file name is not a column listed in Media Library. I don't want to have to wade through dozens of images with the same title trying to find the problem file name, so I can find the correct URL to this image. **How can I add file name to the list of columns in Media Library?** I can't search the media library by file name either.


Changing MySQL password via WHM - does this affect WordPress?

For security, I changed the CPanel password for an account via WHM. There's a checkbox option that says "Sync MySQL password with account password." If I go ahead and change the password, does that create a problem for WordPress that's installed on that domain?


Adding JS function as third parameter in do_action

I have this JS function named as "myjsfunction()".               function myjsfunction() {          jQuery('#html_admin_show').hide();     jQuery('#html_admin_edit').show();          }      One limitation is that I cannot edit the original JS function like to put some PHP tags, etc. How is it possible to call this JS function inside a Wordpress do_action hook? I'm preferring to add it as third parameter because I'm already using the second parameter, so something like:               do_action('myhelp', 'mysecondfunction', 'myjsfunction');      But it is not showing the element #html_admin_edit when the page runs. Any ideas how to call this function? Thanks.


Is there a plugin to help with translation of other plugins?

I remember seeing a plugin that helps with the translation of other plugins. Anyone remember the name of that plugin? Thanks.


WAMP vs XAMPP pros/cons - for running a local testing server?

What are the major pros/cons that can help in deciding which of the two to choose: WAMP vs XAMPP for running a local testing server for WordPress? p.s: I now see stackoverflow had a discussion about it.


How can I get the page or post language when I use wpml?

I'm using WordPress MultiLanguage Plugin and I want to know what is the language of a specific element, page or post. I do have the `id` but I want to obtain the language.


Including php files within template

Let's say in my theme functions.php file, I included a php file that's only accessible in the admin control panel and named theme-options.php.               require_once ( get_template_directory() . '/theme-options.php' );      As I said, this file is accessible in the admin control panel only with this basic structure into it:               function my_theme_init(){         register_setting('my_theme_group', 'my_theme');     }     add_action( 'admin_init', 'my_theme_init' );          function theme_page_function() {         add_menu_page( 'My New Theme', 'mynewtheme', 'manage_options', 'mynewtheme', 'theme_options_do_page');     }     add_action( 'admin_menu', 'theme_page_function' );          function theme_options_do_page() {         ?>         <div class="content">         <!-- options content -->         </div>         <?     }      My questions is, does this file get executed when browsing from the front end? The file is included in the public functions.php file but the functions works only in the admin control panel. I'm asking this question because the theme-options.php file I'm creating would contain alot of mysql queries and I don't want it to be run everytime a normal visitor visits the website.


Best practice for including plugins as part of a theme?

I'm working on a theme that includes some functionality I've developed as separate plugins (as I'm hoping to release them independently). I'd like to include these plugins as part of the theme core and I've noticed that some developers include plugins as files or subdirectories along with their theme, but over time that can ultimately lead to maintaining two versions of the same plugin - one for the plugin repository, one for the theme - but I'd like to avoid that, if possible. What's the best practice for including plugins as part of a theme?


User bar above logotipo?

I am looking for a simple example on how to create a user bar or a simple theme with it that can serve me as example. What I meant is something like we have here on Wordpress Answers if u get above the logo you have a userbar with information when user is logged in and options to login/register when user is not logged in. I did a small search around here with the terms navigation bar and user bar but didnt find anything for the header.


How to add a description to Widgets?

The codex doesn't seem to say how one would go about adding a description to a custom widget registered with `wp_register_sidebar_widget()`. The default description seems to be the name of teh widget itself.               function myFunc(){       /* widget code */     }     wp_register_sidebar_widget( 'wdgt1', 'Site Map', 'myFunc', array() );      ![alt text](http://i.stack.imgur.com/9raIo.jpg)


What are the advantages of WordPress over other systems?

I've tried to explain the benefits of WordPress to others; comparing it to static sites is easy, as (most) everything can be done online with WP. I have more difficulty comparing and contrasting with other content management systems such as Drupal. I realize that there is no perfect system for every use, but what features - if any - of WordPress would you point out as being easier or more useful, compared to other tools? I am particularly interested in features regarding use of WP as a CMS, not just a blog.


Extend the Admin Post/Edit page

I want to create a plugin that will place a few elements on the post edit page. How do I do this? Is there an action that is run after before the post_edit page is loaded?


How to hide/redirect the author page

I have a website where I let people subscribe. I would like to only show the author page for actual authors who have written a post. I wrote this code that checks for post the problem is I can't use a `wp_redirect` or include a template that uses it because then I get everyones favorite "cannot redifine headers header" message. I could display a "User has no post message but I think redirecting them to the main author page is a better option.               if ( is_author() ) : ?>              <?php $id = get_query_var( 'author' );              $post_count = get_usernumposts($id);         if($post_count <= 0){                       //This line could also be wp_redirect                       include( STYLESHEETPATH .'/author-redirect.php');                      exit;           }     endif;?>      Thanks


current_user_can on WordPress 3.1.1

I just upgraded to WordPress 3.1.1 and suddenly I'm getting the following error: `Fatal error: Call to undefined function wp_get_current_user() in /home/arisehub/arisehub.org/wp-includes/capabilities.php on line 1028` I've narrowed it down to my usage of "current_user_can" Example: ` if ( !current_user_can('manage_options') ) { add_action('admin_init','customize_page_meta_boxes'); }` Removing that reference to current_user_can removes the errors. Any ideas?


Minifing js files with w3 total cache and expiring the combined file

I'd like to clarify several details about how w3 total cache works. I'm using w3 total cache to combine multiple js files into one. I'm also setting expires headers from the browser tab to twenty days. Garbage collection interval is set to one day. When the combined file is rebuilt due to garbage collection will the combined file name change if the js files haven't been changed? I guess it will not change as otherwise users won't be able to use the cached one. If I modify one of the files will w3tc automatically detect it or do I need to clear the minify cache? To sum up I am interested in which cases the combined file name changes and do I have to worry about clients using older version do to expires headers and how w3tc manages it.


Qtranslate not working on wordpress loop read more link

I have a multilingual website (English and Welsh) and I am using the qtranslate plugin. Everything works OK however I cant seem to get the 'Read more' permalink to change to the corresponding language in my wordpress loop. My code is the below:               <?php     //...     $output .= '
';     $output .='
'.get_the_title().'

'.$short_excerpt.'

 Read More

';     ?>      I've tried [:en] and [:cy] before the readmore text, but still can't seem to get it to work. Does anybody have any ideas on how to get it to work? Any help would be greatly appreciated :)


Built-in spell checker not working in Wordpress 3.3.1

I am using WP 3.3.1 and have noticed that the built-in spell checker (ABC button) does not work, even when there are mis-spelt words. I have read a number of forum posts that essentially recommend using a standalone plugin to handle spell checking, however is there a fix for the built-in spell checker? Or am I resigned to installing another plugin?


Advice on setting up a site with front end registration

I have been tasked with creating a site for a large audience, and many of the audience will require some sort of sign up. They may require certain account controls (visual things, like theme colours for colour blind people) but largely it will just be a way to monitor the use of the contact features (so users can monitor their previous interactions like a ticket system) My question really is simply, where do I start? Is Wordpress the right tool for this job? If not, what is? If so, what methods should I be looking into to start the research going? Sorry for the broadness of the question, but I feel a little lost at the moment.


Total Count of Posts NOT in Selected Categories?

I need to get the total number of posts that are not in selected categories. I have category IDs of the categories that I want to exclude from count (in the variable `$folio_cat_ids`) So far I have this code which is not working,               $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts        WHERE post_status = 'publish'          AND post_type = 'post'          AND post_name NOT LIKE '%revision%'          AND post_name NOT LIKE '%autosave%'          AND post_category NOT IN($folio_cat_ids)");      Please help.


Auto login users after registration and email confirmation

I'm using the UPME plugin for user registration and it auto sends the email confirmations to users. Then users go to a "confirm your email" page. This is my code at functions.php               function auto_login_new_user( $user_id ) {     wp_redirect( "http://example.com/page/" );     // wp_set_current_user($user_id);     // wp_set_auth_cookie($user_id);      }      If I put the commented code, they are logged in as they go to the page. This is my activation link sending code:                       if (!empty($activation_status) && 'INACTIVE' == $activation_status) {                  $current_option = get_option('upme_options');             $link = get_permalink(8042);                  $query_str = "upme_action=upme_activate&upme_id=" . $user_id . "&upme_activation_code=" . $activation_code;             $activation_link = upme_add_query_string($link, $query_str);                            $message = sprintf("Dear %s %s", get_option('first_name'), get_option('last_name')) . "\r\n\r\n";                   $message = sprintf(__(" Someone (hopefully you) has used this email to register at %s :",'upme'), get_option('blogname')) . "\r\n\r\n";             $message .= __('Please click the link below to verify your ownership of this email:','upme') . "\r\n\r\n";             $message .= __('You will not be able to log in to use your account until you do so:','upme') . "\r\n\r\n";             $message .= sprintf(__('%s'), $activation_link, $activation_link) . "\r\n\r\n";             $message .= __('Thanks','upme') . "\r\n";             $message .= sprintf(__('%s'), get_option('blogname'),'upme') . "\r\n";                  /* UPME Filter for customizing new user activation email content for users  */             $message  = apply_filters('upme_new_user_act_content',$message,$user_login,$user_email,$activation_link);             // End Filter                  $subject = sprintf(__('Re: Please Confirm Your Email Address for %s','upme'), get_option('blogname'));                                 /* UPME Filter for customizing new user activation email content for users  */             $subject  = apply_filters('upme_new_user_act_subject',$subject);             // End Filter                  wp_mail(                     $user_email,                     $subject,                     $message             );         }      }          }      How can I make a user auto log in after clicking the activation link from their mail?


Problem with WP_Query sort

I have the following custom query written for a page- ` $menu_loop = new WP_Query( array( 'post_type' => 'page', 'posts_per_page' => 50, 'post_parent' => 616, 'order_by' => 'post_title', 'order' => 'ASC' ) ); while ($menu_loop->have_posts()) : $menu_loop->the_post(); ` The problem is, when the content is output to the page, it is NOT in alphabetical order by post_title. This has really been mystifying me because if I manually query the DB with- ` SELECT * FROM wp_2_posts WHERE post_type = 'page' AND post_parent = 616 ORDER BY post_title ASC ` then the results are returned correctly. Further, I print_r($menu_loop) and one of the array entries is the actual query sent to the DB and it is wrong and showing- ` [request] => SELECT SQL_CALC_FOUND_ROWS wp_2_posts.* FROM wp_2_posts WHERE 1=1 AND wp_2_posts.post_parent = 616 AND wp_2_posts.post_type = 'page' AND (wp_2_posts.post_status = 'publish') ORDER BY wp_2_posts.post_date ASC LIMIT 0, 50 ` which if you look you'll see the ORDER BY statement is sorting by the post date, not the post title. What am I doing wrong here?


Adding a blog details item to an IF statement

I need to add the blog ID to an IF statement within a theme. I have the following code which works fine as is:               <?php global $blog_id; $current_blog_details = get_blog_details( array( 'blog_id' => $blog_id ) ); echo $current_blog_details->blog_id; ?>      But I am trying to add this to an IF statement:               }else if(isset($_FILES['photo'])) {                       $file = &$_FILES['photo'];             $allowedExt = array('jpg', 'png', 'jpeg', 'gif');             $destination = RBISTA_IMAGES.DS. 'photo.jpg';      The $blog_id needs to in front of photo.jpg - so it would result in 3photo.jpg. Can anyone help with this please?


Malware installation during plugin update?

I update my wordpress blog daily (current version: WordPress 3.5.2). Today I installed an update of "Search everything". After that, my webspace was infected by malware. Interestingly, my blog is hidden using .htaccess, and I'm the only one using it. My provider emailed me, that the infection took place via wordpress. How can I find out I the plug-in contains the malware? Is there a list with the latest security issues?


how to make social media buttons start only from under a photo/post?

this is the website http://filldevoid.com/test/ i want the social buttons from under the post to start everytime under the photo, not on the right of the photo (cause it does that, where it has enough space) so like in first photo, not like in second. what kind of condition or what could i use? i tryed br and p, adding them into the beginning of the share, or the end of the post.. but with no effect.


Add custom menu item using wp_nav_menu_items filter

I have added a snippet to add a "Profile" link to my website navigation menu. My code:               add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link');     function my_nav_menu_profile_link($menu) {           if (!is_user_logged_in())              return $menu;         } else {              $user_data = bbp_get_user_profile_url( get_current_user_id() );              $profilelink = '
Profile
';              $menu = $menu . $profilelink;              return $menu;         }     }      This code correctly display profile link in my menu, but now I want to move this "profile" link as sub menu of another main menu. My Menu structure is as follows: > Home | My Account | Categories I would like to add "profile" link under "My Account". Any suggestions to solve this problem?


Force Wordpress to Show Pages Instead of Category

I am trying to create a SILO structure on one of my WordPress site. I have always checked this option on Yoast SEO plugin "Strip the category base (usually /category/) from the category URL." So my category pages have this URL: sitename.com/apple/ (where "apple" is the category page) Now I want to create a new "page" with the same slug, apple. I can create a new "apple" page easily, however, when I go to sitename.com/apple/ the category page is displayed -- instead of the newly created page. My question: Is there a way to "override" the default priority of category over a page? I'd like to show page because I will have control over it -- I can customize, add more content, and change them easily (plus, pages are going to help me structure my site better) Appreciate your help!


Buddypress - adding profile fields to Group > Members directory

I'm trying to add custom profile fields to the member profiles that show on the Group > Single template but `bp_member_profile_data` doesn't seem to return anything. This works fine when added to the members-loop.php:               <?php if ( bp_get_member_profile_data( 'field=Profile:' ) ) : ?>       <?php echo '
Profile: '; ?>       <?php bp_member_profile_data( 'field=Profile:' ); ?>     <?php endif; ?>      But when I add it to `groups/single/members.php` it doesn't return anything. Is there something special I need to add to make this function work in members.php? **UPDATE** The solution offered below works to get the profile data showing in on the group members loop, but it's showing the data of the last member for all members, I tried adding `<?php $user_ID = get_current_user_id(); ?>` and I also tried `<?php echo xprofile_get_field_data( 'Profile:', $bp->displayed_user->id ); ?>` but no change, how would I pass the relevant user ID into that function? Also, it seems the profile fields are only showing for logged in users.


If I want social media icons that link to my site's corresponding accounts, is that better to do with a plugin, or manually?

I feel like it's simple enough that coding it in would be beneficial, but I'm not sure.


How to Translate Contact Form 7 using qTranslate?

I'm using Contact Form 7 for my forms and also qTranslate to translate my website. I would like to translate all my fields and for that I used:               <!--:en-->First Name (required)<!--:--><!--:ru-->Фамилия (обязательно)<!--:-->      But it display this:               First Name (required)Фамилия (обязательно)      What should I use to make it work?


Force the_content() to show full post in RSS feed

I'm making a custom RSS feed where I want the full article to display. The problem is that when I use the_content() to output the article, it will only show the excerpt if there is a 'more' tag in that article. How do I force the_content() to output the full article, or is there another function that will achieve this?


Make theme editor to show all theme's files

Is there a way to make all files (also in subfolder) in my theme directory visible in the theme editor? I need a way to edit themes without having to upload a new one every time. Thanks!


Upload file inside plugins options page

I want to upload images in my custom plugin options page.               <form action="?page=slideshow_options" method="post">         <input type="file" name="async-upload" id="async-upload">         <input type="submit" name="html-upload" id="html-upload" class="button" value="Upload">     </form>      If I try to check wether submit button was clicked with isset I get some weird errors. How can I get it to call a function uploadimages() for example?


Permalinks break every day

I have critical problem! My Wordpress Blog has the permalink structure `/%category%/%postname%/`. **The problem is that very often the permalinks break so I get a lot of 404-Errors.** I can fix it refreshing the links by saving the permalinks options again in the admin panel. This seems to be a knows problem. I find out that some wordpress users got the same problem, but only one! After a refresh all works. For me it breaks after some hours again. Sometimes I noticed that while working on my blog and most times I noticed it by checking the links in the morning. That's why a lot of users leave the site after seconds, so sadly I loose a lot of traffic... **Further Informations** I activated the plugin `WP No Category Base`, this could be the problem. But on another blog this plugin worked for months without trouble. I can tell you everything about my server configuration (cheep virtual server from xenonserver.de) you need to help me. There is enough memory available. Installing a plugin, the install dialog freezes, so I waited some secs and then went back to the plugin overview. But every plugin is listed there and works fine.


Changing Header Image Every N Minutes/Seconds

I am trying to change the header image every "n" second/minutes. Have looked at a number of solutions on the web and am at present using the PHP code fragment below available at http://ma.tt/scripts/randomimage/: It still only changes the image on a page reload not every 'n' minutes. I have also seen the post at: How to rotate the header image per day? However, I do not know how to adapt it to do what I want. Could you please lend me some pointers on how to go about it as I am very new to PHP. Moreover, would this be better done in JavaScript of PHP? Thanks in advance.


How can I display a buddypress group name in the header.php so that it shows when viewing each single group?

I tried the code below but it doesn't do anything when place in the buddypress default header.php file. Ideally I'd like to have the group name display to the right of the logo in the bp default theme when visiting each group. Thanks for any help.               <?php bp_group_name(); ?>


I want to extend the current themes' single.php to display the meta fields of my CPT

I am developing a plugin, which registers a role, a CPT and some metaboxes. I am now at the point where I included as well a single-mycpt.php into my plugin. Here's my current issue: I can't simply assume they will be using twentyforteen, so I cannot copy paste that single and extend it to my needs. Is there an established best practice to retrieve and extend the currently used single.php of the currently used theme? At the moment I register* a copy of the single.php of my current theme, but I would love it to be generally more usable. *               /* Filter the single_template with our custom function */     function add_mycpt_template( $single ) {         global $wp_query, $post;              /* Checks for single template by post type */         if ($post->post_type == 'mycpt') {             if(file_exists(dirname( __FILE__ ) . '/templates/single-mycpt.php')) {                 $single_template = dirname( __FILE__ ) . '/templates/single-mycpt.php';             }         }         return $single_template;     }     add_filter('single_template', 'add_rechungs_template');


How to handle core code throwing notice on valid input?

I have combination of valid input with native WP function throwing PHP notice. In this specific case it is image without extension with `image_resize()`. This is usually suppressed by WP, but it still has me worried because it runs in feed and such things can explode XML to pieces. If I can neither change core or input then what should I do? I suppose I could try to explicitly suppress error output around there. Or should I just ignore the possibility as edge case?


wp_query with parameters

I have a custom search page via which I select:               One or ALL categories     One or ALL tags     One or ALL authors     A search string or no search string      On the results page, wp_query works when I have selected values. But how do I instruct to set some param as ALL? How do I set "search ALL categories" for example? Maybe I need to break my args and add to them only when I got values? But how would I do that? Thanks. # EDIT I modified the wp-query and now stands as follows. All works great but I do not have paging!               $args = array( 'order' => 'DESC', 'orderby' => 'date',  'posts_per_page'=> 10 );      if ( '0' != $category ) { $args['cat'] = $category; }      if ( '0' != $tag ) { $args['tag'] = $tag; }      if ( '0' != $author ) { $args['author'] = $author; }      if ( '' != $search ) { $args['s'] = $search; }      $the_query = new WP_Query( $args );     while ($the_query-> have_posts()) : $the_query->the_post();     ....     endwhile;     wp_pagenavi( array( 'query' => $the_query ) );


Making Comments Editable?

How would I make my WordPress Comments Editable? I tried using an Ajax plugin that take them to another screen, but it's not as nice as I would like. For example, I just want it to re-open the initial comment box and allow them to edit their comment for at least 30 minutes after a post.


Update field in Theme Customizer via Javascript

I am working with the Customizer and I have made some custom controls which is cool. Now I'm trying to create a relationship between two controls whereas the input of one control passes through some javascript, provides a result and updates another control input field. Lets say I have two controls called control_one and control_two BTW I found this post quite helpful, enabled me to grab the value of control_one. This saved a number of hours fumbling around. > Is it possible to get a theme customizer setting from wp.customize using > jquery? I can now do something with it in JS, and console.log the output. Which works great. Now I need to put the output back into control_two. But for the life of me I can't seem to do this. When I use firebug in firebox - I can punch in..               var steven = 65.4; // random number!     wp.customize._value.control_two(steven);      and the field updates, however inside my script this is not the case. My script looks something like this..               wp.customize('control_one', function(value) {         value.bind(function(color) {          // do stuff         var color = 'now_equals_this';              wp.customize._value.control_two(color);              });     });      I would appreciate a step in the right direction. Regards Steven


Add Option if Not Exists

I need to see if an option, and if does, get the value. If not, I need to add it. The Codex provides:               <?php     $option_name = 'myhack_extraction_length' ;     $new_value = '255' ;     if ( get_option( $option_name ) != $new_value ) {     update_option( $option_name, $new_value );     } else {     $deprecated = ' ';     $autoload = 'no';     add_option( $option_name, $new_value, $deprecated, $autoload );     }     ?>      Which supposedly **updates the option name myhack_extraction_length with the value 255. If the option does not exist then use add_option and set autoload to no.** However, it seems to me that the second half could be called in two ways, if the option does not exist OR if the new value==the option Is this correct?


Where does the uploaded image go?

add_action( 'customize_register', 'boilerplate_customize_register' );     function boilerplate_customize_register($wp_customize) {         $wp_customize->add_section( 'themename_color_scheme', array(             'title'          => __( 'Color Scheme (sect!on name)', 'themename' ),             'description'    => "This changes color scheme",             'priority'       => 135,         ));         $wp_customize->add_setting('themename_theme_options[image_upload_test]', array(             'default' => 'image.jpg',             'capability' => 'edit_theme_options',             'type' => 'option',         ));         $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'image_upload_test', array(             'label' => __('Image Upload Test', 'themename'),             'section' => 'themename_color_scheme',             'settings' => 'themename_theme_options[image_upload_test]',         )));     }      This adds a section in Theme customization page and in it, an image upload dialog. Where does this image go and how can I refer to it?


My first WP development project - am I envisaging this right?

I've been asked by my friend to recreate his travel site, CMS style, in Wordpress. His layout is something like this: Home   About Us   \-- Country landing page (with a featured tour, then links to the subpages below) \----- Tailor Made Tours landing page (landing page, then underneath, an overview of all tours in this country with "read more" links, each clicks thru to tour page)   \--------- Individual Tour page   \--------- Individual Tour page   \--------- Individual Tour page   \----- Group Tours landing page (landing page, hen underneath, an overview of all tours in this country with "read more" links, each clicks thru to tour page)   \--------- Individual Tour page   \--------- Individual Tour page   \--------- Individual Tour page   \----- Special Interest Tours landing page (landing page, then underneath, an overview of all tours in this country with "read more" links, each clicks thru to tour page)   \--------- Individual Tour page   \--------- Individual Tour page   \--------- Individual Tour page   \----- Hotels in this country landing page (landing page w/overview of all hotels in this country with "read more" links, each clicks thru to tour page)   \--------- Individual Tour page   \--------- Individual Tour page   \--------- Individual Tour page   Contact Us   Request a Brochure   Customer Care   There will be about 10 countries each with subsections as above. Each landing page would list all the individual tour pages, with a thumbnail image and a link to take you to the corresponding tour page. The tour and hotel pages would need to be added by his staff via the Wordpress dashboard/cms. I am only just familiarising myself with Wordpress development and this is the way I see it: \- each country landing page would be a static page with links to Group Tours, Special Interest Tours and Tailor made tours. \- each of those tour landing pages (Group Tours, Special Interest Tours and Tailor made tours) would list posts within a corresponding category, for example China > Group tours would list all posts categorised under "China group tours". \- This list would be formatted to include the tour posts' featured image and a link to read the full tour post \- Each tour page would be a post - it would have a dedicated layout with custom taxonomies for including things like price. It would have dedicated places for the cms user to assign photos. \- There would also be a category for "China featured tour" and the cms user could choose a tour for this category which would appear as the country landing page's featured tour. Is this the simplest way to go about doing that?? As I said, new to wp development, this would actually be my first project.. so just trying to get peoples input about how i'd go about it?? The actual site is here: www.sanyachinatravel.com


Making my plugin translation ready. Poedit not working

I'm building a plug-in which is going great so far. I want to start making it localization ready. I don't know what is going wrong, but it's bugging out on me when I try to load it in Poedit. So let's do this step by step as multiple tutorials show me to. So in myplugin.php I load the following to tell WP where my language files are (after actually creating the folder).               function ap_action_init()     {     // Localization       load_plugin_textdomain( 'myplugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );      }          add_action('init', 'ap_action_init');      Then I adjust all strings that need translation in my file (which is in the admin folder).
<?php _e('MyPlugin Settings', 'myplugin'); ?>
     <?php _e('Element Width', 'myplugin'); ?>     <?php _e('This defines the default width of your Elements', 'myplugin'); ?>      So far so good, I would think. But then I open Poedit. I tell poedit to save the `myplugin-nl_NL.po` in the languages folder in my plugin. I tell the base path to be `../` And I tell my paths to be either `./admin` or `admin` (if I give it `/admin`, or something else, it gives me an error the folder doesn't exist. So I'm assuming it finds my folders). I tell poedit to look for the keywords `__()` and `_e()`. And then I press ok! Every single time (whatever I seem to try) It doesn't show me any strings to translate, where as I import a normal .po it does show me alot. So. Is anyone seeing where it's going wrong here? P.S: Maybe an important notice. If I try to manually create my own .po file, it does show me strings in POedit. But if I put this on my website and change WordPress it's language it doesn't change anything. So my guess is I'm doing something wrong in my WP files. Hope anyone can help :)


Customising wordpress search and using $_GET["s"]

My theme's `search.php` currently has a few "IF" statements to deal with the different types of search that my website uses. I have a site-wide search, a species (custom post type) specific search and an advanced species search. For the "species" search, I've simply added an input akin to `<input type="hidden" name="type" value="species" />`. This search uses a single input field to search my species custom post type. Users would likely opt to use this search if they were looking for the common or scientific name of a fish. For the "advanced species" search, I'm using 12 different inputs (pH, size, temp, etc). I'm building an $args array for `meta_query` in the `WP_Query` class with this data, i.e: `array( 'key' => 'genus', 'value' => $_GET["genus"] )` As a result however, the generic `<input name="s">` isn't being used, and as such, the form action isn't working (just loads the index page without searching). Is there a better way of doing this? I could obviously just send "s" as a hidden input with a generic value, but that's a cheap and ugly way of going about things. Maybe this should be a page separate to our search page? I'd prefer to do it in `search.php` though or there will be some redundant copying of HTML structure etc for no real reason. Thanks in advance,


Custom JSON feed rewrite

I'm trying to implement a feed of information from an Event custom post type in JSON format, to be used in a FullCalendar implementation, pretty much as described here. The one thing I wanted to change was to create an actual WordPress feed to generate the JSON output, to avoid the hack of looking for wp-load. This is the code: https://gist.github.com/1600619 I manage to get the valid output if I go to example.com?feed=json, but I think that the querystring is preventing FullCalendar from actually parsing it. I was hoping that having the feed with a proper URL like example.com/feed/json would fix it, but that gets me just a 404.


how to display the wordpress login and register forms on a page?

I have a wordpress site. Which has the built-in login form with the url http://domain/wp-login.php and register page http://domain/wp- login.php?action=register. As these pages have no sidebar and headers, therefore I want to display these forms on a page which I have created from the backend. Is it possible and how will I do this?


Wordpress multisite install on two subdomains, each belonging to a separate domain

I would like to do a WordPress Multisite install on two subdomains. I can't use the main domains as they both have other sites running on them. But when these two are done they will need to be redirected. Setup is:               new.site1.com -> will become site1.com when done     new.site2.com -> will become site2.com when done      Can I do this with this plugin or otherwise? The DNS looks like it screws up, saying it can't find NS####.new.site1.com. Or should I do a multisite in this case? I thought it'd be better for the client if there was a central admin so he doesn't have to log into two sites, but if it can't be done maybe I'll have to go with two sites.


Custom fields 'for' custom taxonomy?? Can someone explain why?

I'm implementing various custom taxonomies for my project and I came across the concept of custom fields for custom taxonomies, which baffles me. I though custom fields where just custom fields associated to posts and not a taxonomy. Can someone explain this relationship and how it is used? Thanks!


wp_get_attachment_image_src() with advanced custom fields returning empty

I am using the advanced custom fields plugin to upload images for an image gallery. I am attempting to retrieve the different sizes of images that are saved in the uploads folder and having problems. $image = wp_get_attachment_image_src(get_sub_field('image'), 'full'); When I echo out the results of this I get nothing. I know that the images are being saved as different sizes because I can see them in the uploads folder and the get_sub_field('image') is returning the proper image src. Is there anything else I need to do to get this to work?


Adding thumbnails independent of images in blog posts

Is it possible to add thumbnails to blog post listings independent of images in a blog post -- e.g. if there is no image in the blog post, can I add a thumbnail image?


How to make thumbnail images click into blog posts

How do I make it so the thumbnails in the list of blog posts on my blog are clickable, so that when the user clicks the thumbnail image, the blog post opens up? If it helps, this is the blog: http://wordfruit.com/blog


Need a function for changing saved post_date or post_date_gmt to relative time in wordpress

I am working on a plugin and want to change the default post date to something like 'posted one min ago' OR 'posted 1 hour ago', OR 'posted on month ago'.


How to generate CSS from a shortcode within a plugin

I'm struggling to generate CSS 'on fly' from a shortcode that is within a plugin using class. Here is the shortcode function:               public function shortcode($atts, $content = NULL) {                  $data = shortcode_atts (                  array(                     'id'    => '',                     'img'   => '',                     'speed' => '5',                 ), $atts              );                  $id_tmp = $data['id'];                  $src = wp_get_attachment_image_src( $data['img'], 'full');             $image_url =  $src[0];                  return  '
' .do_shortcode($content). '
';         }      What I'm trying to do is to get the `id` and `image_url` values and put them into a CSS file to create something like:               #intro01 <-- THE ID SHORTCODE VALUE {             background: url(../images/fly.jpg <-- THE $image_url VALUE ) 50% 0 fixed;     }      This is a public (front-end) css.