How to use if condition to change $table_prefix in wp_config.php

I am testing a very big database (perhaps `wp_posts` contains hundreds of thousands of rows). As such, the query time, especially the searching query, is extremely long. I'm thinking if there is any other way to split the WP database to multiple tables with different table prefix so that the url structure does not change compared to the original database. I tried changing `$table_prefix` in `wp_config` to `wpa_`, then i created a sample posts with post name start with `a`. Then i changed `$table_prefix` in `wp_config` to `wpb_`, then i created a sample posts with post name start with `b`. In the next step, i replace the `$table_prefix` line with               // if query for post start with a, it will go to wpa_ tables,     // if query for post start with b, it will go to wpb_ tables     $prefix = get_the_title();           if ($prefix(0) !== 'a') {              $table_prefix  = 'wpb_';          } else {              $table_prefix  = 'wpa_';          }      When i tried openning my domain, i got the error `Fatal error: Call to undefined function get_the_title() in /home/todaytra/public_html/1/wp- config.php on line 62` I really need to perform this task, usual WPMU installation generates either subdomains or subfolders and it changes the permalink structure of all posts. I tried searching a lot but cannot find any information about this.


Wordpress query portfolio posts

On my template I have this code               <div class="blog_block">              <?php wp_reset_postdata();  ?>         <?php $nbmax= 9; ?>         <?php $tarali_query = new WP_Query('posts_per_page='.$nbmax.'&ignore_sticky_posts=1&paged='.$paged); ?>         <?php while ($tarali_query -> have_posts()) : $tarali_query -> the_post(); ?>             <?php get_template_part( 'content-blog', get_post_format() );   ?>                                                       <?php endwhile; ?>         <?php tarali_paging_nav(); ?>             </div><!-- blog_block -->      Which render **ALL** recent posts of my blog. How can I modify this code to query ONLY the posts which belongs to **Portfolio Category**?


Where is the template from the_post_thumbnail()?

My content.php is used both for my front page than for my single posts. The problem is that it calls the thumbnail with "the_post_thumbnail()" and the thumbnail returns with a particular width and height (`<img width="308" height="208"...`. I need to change get a different width and height depending if is_single(). Where is the template for the thumbnail or how can I archive this?


Change image url size in post editor (when cliking on image)

So I've search during some hours how to change image size in existing post. I know that wordpress create many image with different size (acording to my theme) for each uploaded image. But he didn't create it for old image that was existing and used before the theme change. So old image didn't have many size. I've used Regenerate thumbnails to recreate it. So far so good. New post automatically display size options when uploading new image before inserting in the post. But old post didn't have changed (automatically) the image url to the large size, they still have the original size. And there are no options when opening image (by double clicking on it in the post) to change the image url/size. Do you know a way to have the same option to choose the image size when editing and not only inserting ? or anything ? There is a way to select the desired image url and edit the source url for each image but it's quiet long...


adding custom stylesheet to wp-admin

im having troubles getting my custom stylesheet work on WP-ADMIN area. `plugins_url('style.css', __FILE__) );` do i have to create folder in my plugins named css or do i just copy my `.css` to the `wp-admin/css` directory? i tried both it doesnt seem to work for me. and what values should be replaced to `__FILE__`? sorry im kinda new to these stuff.               /*ADDS STYLESHEET ON WP-ADMIN*/     add_action( 'admin_enqueue_scripts', 'safely_add_stylesheet_to_admin' );         function safely_add_stylesheet_to_admin() {             wp_enqueue_style( 'prefix-style', plugins_url('style.css', __FILE__) );         }               /*ADDS MY CUSTOM NAVIGATION BAR ON WP-ADMIN*/     add_action('admin_head', 'custom_nav');     function custom_nav(){         include('custom_nav.html');          }


Posts and Taxonomies structure

I am stuck on geo logic structure while making tourism site information structure.   Having example Countries->Resorts/Visa_rules/Flight_rules->Cities/Excursions->Regions->Hotels all of the mentioned should be custom posts type or pages because all of them have own description with long text and a lot of photos. But same time previous level is a taxonomy for children. Also if I act Country as Post how can I connect other articles/news under it as it is not category? How to organize this map correctly? Positive moment is that I can link one taxonomy to different post types. But is it possible to have separate page to describe taxonomy itself?


ajax jquery update custom field meta value front end

There is probably a much easier way to do this. After much trial and error trying to get a postid from a url, I've opted to add the id to the permalink. However I have no idea how the custom value should be updated without a page refresh. Jquery               $(document).ready(function(){          $("a").addClass("external");          $("a").attr( "target", "_blank" );      });          jQuery(document).ready(function($) {     $('.external').click(function(event) {           // had to add the post id to the permalink in loop as url to postid didn't work           var currentID = $(this).attr('id');            var data = {             action: 'my_action',             whatever: currentID         };         // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php         jQuery.post(ajaxurl, data, function(response) {                //update the custom field value without a page refresh         });         });     });      functions.php               add_action('wp_ajax_my_action', 'my_action_callback');          function my_action_callback() {         global $wpdb; // this is how you get access to the database            $whatever = intval( $_POST['whatever'] );            // get number of views if we have any            $views = get_post_meta($whatever, views, true);             // update or add post meta     if(!update_post_meta($whatever, 'views', ($views+1))) {                 add_post_meta($whatever, 'views', 1, true);             }         die(); // this is required to return a proper result     }      content.php               <a href="<?php the_permalink(); ?>" id="<?php the_ID(); ?>"><?php the_title(); ?>         <?php echo get_post_meta($post->ID, 'views', true) ?>         // update the view ?


Error when updating plugins by FTP "Unable to locate WordPress Content directory (wp-content)."

I run apache2 on Ubuntu, i'm sure there is a configuration or permission problem causing this. When I attempt to update plugins through the admin control panel, after I enter the FTP login/pass and click Proceed. I get the error "Unable to locate WordPress Content directory (wp-content)." And wp-content does exist and have proper permissions from the default install.


How to hide the Text Area in the Post Edit screen

Is there a way to hide the text area box in my custom post edit screen? All entry is done through taxonomy check boxes and a couple custom fields. I want no entry in the text area. As an alternative, how can I place a "Enter Nothing Here" text message within the text area? I know this is a little bizarre, but is it possible? Thanks -- Mike


How to use a custom field for search engine optimization

My posts (not custom) have a custom field - this has very important information. Can I use this information to submit to search engines. Note: This is something like a product site and has many posts. I am looking for an automated way to do this.


Can't seem to see images on my machine but can on the server

Hello I just started using wordpress (complete noob) but I need a bit of help. I have installed wordpress and on a linux/centos webserver and this works fine. However when I use another machine, open a web browser, type in the url, the site looks different from what it looks like on my server. (On my web server, there is a choice to use the Graphical user interface as well) The difference is the images don't appear on my machine (Looks like it can't find the media files). Also when I click on any link (the 'Hello world', login etc.), it says Firefox can't establish a connection to the server at localhost. I can see the images on the webserver and all links are fine. So I don't now what the problem Just to let you know my wordpress url is localhost and my site url is also localhost if that may help.


How to get the post publish date outside the loop?

I need to pull out the post publish date in order to make the post post auto expire. The thing is I can't get the right publish date. Here is my code:                global $wpdb;          $post_ids = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_status ='publish'" );          foreach($post_ids as $id){                $postdate = get_the_date("Y-m-d",$id ); //here is what I can figure out            .......           ......etc     }      When I echo the $postdate, it come out with a wrong date. Not the date that exist in the wp_posts table. How can I get the date properly?


add_image_size() zoom-crop

I've set up a bunch of additional image sizes in my functions.php theme file, with the crop parameter set to true. However, the images are resized but not cropped.                   if (function_exists('add_image_size')) {             add_image_size('frontpage_a-la-une_thumb', 400, 215, true);             add_image_size('single_thumb', 320, 9999, false);             add_image_size('category_a-la-une_thumb', 280, 215, true);                  add_image_size('xxs-square-thumb', 60, 60, true);             add_image_size('xs-square-thumb', 70, 70, true);             add_image_size('s-square-thumb', 98, 98, true);             add_image_size('square-thumb', 130, 130, true);             add_image_size('l-square-thumb', 198, 198, true);                  add_image_size('landscape-thumb', 150, 98, true);             add_image_size('portrait-thumb', 98, 145, true);         }      The GD library is installed, so is imageMagick, but no dice. What am i missing? UPDATE: Problem arises with images that are smaller than the set image size: i was expecting WP to create image versions by scaling them up, but it doesn't. So, my bad, sorry for getting that point wrong.


Getting page ID inside loop

I have a page template which has a loop to show blog posts. Inside the loop, there is `get_template_part('content', 'custom')` function to include the template (content-custom.php) which shows blog post content. Is it possible to get current page ID inside `content-custom.php` file?


My post titles is getting mashed up with my blog title

I installed the all in one seo pack plugin and after enabling it my post titles get "stuck" with my blog title without a space in the title. As you can see the post title is: `******.blogg.no` And my blog title is: `Sp**set Blogg` The title is now `*******.blogg.noSp**set Blogg,` I can't figure out how I can get these to separated. My all in one seo pack settings is`%post_title%` on the posts.


How do i remove all Bit.ly shortened links from site?

Bit.ly have black listed one site which i linked to which produces a warning. I have removed this link but want to remove all links which i have shortened using Bit.ly Is this possible?


Is sanitize_title enough to generate post slugs?

I want to generate slug for some strings without going through WordPress slug generation flow. Therefore, I want to know which functions it calls to get a neat slug. I tried sanitize_title() but it leaves %c2 %a0 in result.


Custom Meta Box calling JS function twice

I have a plugin adding a custom meta box to the comments editing page:               function on_admin_init() {     add_meta_box(      'commentrating',     __( 'Voto recensione', FB_DT_TEXTDOMAIN ),     array( &$this, 'meta_box_voto' ),     'comment', 'normal', 'high'     );     }     function meta_box_voto($data) {     ...     ?>     <script>     jQuery(document).ready(function() {              alert("ah!");            });     </script>     <?php     } ...      But the alert is called twice! Is this a WP or jQuery bug? Am I making any mistake? Thanks! P.S. If I put the alert into the first function it is only called once...


How to enable automatic search results in WordPress

I'm trying to find way to enable automatic search in WP. For example, I have a page `mysite.com/some-thing`. Within that webpage, I also want to display the content of the page `mysite.com/?=some+thing`. I don't want to use an `iframe` because I want the content of the second page (the search page) to be in the HTML source code of the first page. Is this possible to achieve? I'm thinking about using WP web scraper plugin, but it is difficult to implement the selector :-( Does anyone have any advice?


If meta_key has value = 6 | Change the wp_posts.post_date to current date

I have three sections: 1-New posts 2-Trending posts 3-Hot Posts I'm using a Vote plugin and i sort every section like this: New Posts:               $args = array(       'meta_query'=> array(         array(           'key' => '_wti_like_count',           'compare' => '<=',           'value' => 5,           'type' => 'numeric',       'posts_per_page' => 5     ) ) );     query_posts( $args );      * * * The result of this is: > SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts JOIN wp_postmeta ON > (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND wp_posts.post_type = > 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = > 'private') AND wp_postmeta.meta_key = '_wti_like_count' AND > wp_postmeta.meta_value <= '5' GROUP BY wp_posts.ID ORDER BY > wp_posts.post_date DESC LIMIT 0, 100 On this section only the posts from 0 to 5 Votes are displaying. Once it Reach 6 Votes .. It goes to the Trending section ->               $args = array(       'meta_query'=> array(         array(           'key' => '_wti_like_count',           'compare' => '>=',           'value' => 5,           'type' => 'numeric',       'posts_per_page' => 5     ) ) );     query_posts( $args );      * * * Where posts between 5 or more... are displaying an so on... My problem its that i ORDER them BY wp_posts.post_date and once an old posts get more votes than a new one it goes from News Posts to Trending Posts but it doesn't display on TOP of the Section... It goes below.. I wan't to be able to do something like this..               $args = array(       'meta_query'=> array(         array(           'key' => '_wti_like_count',           'compare' => '<=',           'value' => 5,           'type' => 'numeric',       'posts_per_page' => 5     ) ) );     query_posts( $args );      when it reach to 6 votes... I want to be able to update the wp_posts.post_date to current so like that every time an old post receive more than 5 votes .. it shows first in the trending section... not below something like _if 'value' = 6 update wp_posts.post_date to current_?


When I click on Add Product in woocommerce plugin, I get a blank white page

I just installed the woocommerce plugin into wordpress. When I click add product in the admin, nothing loads. It is a blank white page. Wordpress version is 3.4.2. Do I need to upgrade wordpress? This function works on another domain running the same theme and same version of wordpress.


Paging doesn't work?

I have my own custom post type, and 15 items there. This code shows all the items:               <?php   $loop = new WP_Query( array( 'post_type' => 'my_post_type', 'posts_per_page' => 15 ) );       while ( $loop->have_posts() ) : $loop->the_post(); ?>     (...)      When I change posts_per_page to "5" there should be 3 pages, but it displays only 5 items and there are no other pages (or at least I don't know how to access them). This code displays nothing:               <?php if (  $wp_query->max_num_pages > 1 ) : ?>       {menu or any html code}     <?php endif; ?>      Maybe I do something wrong? I have the whole code/loop in page-myposttype.php file. I've tried this code:                  $temp = $wp_query;         $loop= null;         $paged = get_query_var('paged') ? get_query_var('paged') : 1;         $loop = new WP_Query( array(          'post_type' => 'my_post_type',            'paged' => $paged,          'posts_per_page' => 2 ) );             while ( $loop->have_posts() ) : $loop->the_post(); ?>      But no luck... When I type wordpress/my_post_type/page/2 (page/3 etc.) manually I see other pages and they work & look fine. But I'm unable to echo the default navi... :(


Why would it take four reset password attempts to finally get the e-mail?

Following up from Locked out of my own blog and password reset not working: After posting the question I decided to give the password reset route one last try and this time the e-mail did come through and I was able to get back into the blog. It took me a total of four attempts to reset the password before it finally worked. Given that the first three e-mails were apparently sent but didn't arrive and the last one arrived very quickly, what should I be looking for in my set up that would cause this feature not to work? Or is this just a feature of e-mail that I must live with? There's been no indication that the e-mails were bounced by my ISP or that they've been marked as spam. My ISP is also my web host and domain name registrar. I'm still running Wordpress 2.9.2 (as I said before it's a very infrequently updated blog and the next task is to upgrade to 3.0.4), but I do remember having this problem before with previous versions.


Anonymous Postings

This is a repost of a question asked on stackoverflow, and was referred to this site: My client wants to create a form on his new WP site that when filled out and submitted will be submitted to his admin post queue to approve and if he approves gets posted on his site in the "blog" (which is actually a bunch of guitar like tabs). The form would be custom and have custom fields. Below is the form, but in the old design before I did a refresh on it. So, how hard would this be? He does not want it in the WP admin panel which i began to do, but outside in a page like /contribute ![](http://i.stack.imgur.com/LKgdM.png)


Listing all slugs?

I have a number of slugs and items in my custom category: SLUG - number video - 5 items music - 5 items [no-slug] - 5 items empty - 0 items blabla - 0 items I want to list all non-empty slugs (otpionally with number of items next to them), like: [ video (5) ] [ music (5) ] [ other (5) ] (empty and blabla omitted) Anyone knows how to do that? All I know is how to get a slug for particular item:               <?php $slug = $terms[0]->slug; ?>      ## UPDATE My taxonomy registration: ### functions.php               register_taxonomy("op", array("portfolio"), array(       "hierarchical" => true,        "label" => "Categories",        "singular_label" => "Category",         "rewrite" => true,     ));      ### page-portfolio.php               $taxonomy = "op";     function get_taxonomy_list_html($taxonomy) {       $term_links = array();       foreach(get_terms('Category') as $term) {         if (!empty($term->slug) && $term->count>0) {           $link = get_term_link($term,$taxonomy);           $term_links[] = "[ {$term->name} ({$term->count}) ]";         }       }       return implode(' ',$term_links);     }      Displays nothing :(


Locked out of my own blog and password reset not working

I have my own Wordpress installation for my infrequently updated blog. I have a habit of forgetting my password so have to request a new one and reset it every two to three months. I've done it again today and got the "Password Reset" e-mail (which arrives within seconds of requesting it). Following the link to actually reset the password gives me the "Check your e-mail for your new password." page but that e-mail never arrives. I've checked my spam folder and there's nothing in that. What's the quickest way of resetting my password and getting back into my blog? Do I have to go via the database? If so what do I need to reset there? I should add that the blog hasn't been hacked - I've checked the pages and they're all OK. No spurious links or content vandalised.


TinyMCE custom stylesheets for different post types

I use a custom stylesheet for TinyMCE, by placing custom styles in `editor- style.css` in my theme's directory. I am trying to figure out how to use a different stylesheet depending on what post type we are editing. One way of getting different styles in TinyMCE is to toggle a class in the TinyMCE iFrame's `<body>` tag. I have seen this in the New York Times' ICE editor plugin, a javascript version of Microsoft Word's "track changes" functionality that can be used with TinyMCE. That's how it toggles visibility of edits without changing the post's HTML. Here's a self-contained example of this:               var toggleBodyClass = function() {              var ed = tinyMCE.activeEditor;         var body = ed.getBody()         var cm = ed.controlManager;              if(ed.dom.hasClass(body,'code-view')) {             ed.dom.removeClass(body, 'myCustomClass');         } else {             ed.dom.addClass(body, 'myCustomClass');         }              ed.execCommand('mceRepaint');     }      This doesn't allow me to use a separate stylesheet per se, but I can use `.myCustomClass` to create alternate all the alternate styles I want in `editor-style.css`. The thing is, I'm not sure how I could set up something like this to be conditional on post type. Is there something I can add to `functions.php` to achieve this?


Get sidebar parameters (before_widget, before_title, etc.) from within a widget

Is it possible to dynamically get sidebar parameters from within a widget? That is, I am trying to access the `before_widget`/`after_widget`/`before_title`/`after_title`/`name` parameters of the containing sidebar. Suppose we have a sidebar registered like so:               register_sidebar( array(         'name' => "Homepage Sidebar",         'id' => 'homepage-sidebar',         'before_widget' => '
',         'after_widget' => '
',         'before_title' => '
',         'after_title' => '
',     ) );      How would I access those values from inside my widget's `widget()` function? Like, how would I do something like this:               public function widget( $args, $instance ) {         // outputs the content of the widget         if ($someCondition)             echo $sidebar->before_title . 'My widget title' . $sidebar->before_title;         echo 'You are looking at ' . $sidebar->name;     }      Is this possible?


Front end post editing using a form

I have a custom-post type with the standard meta boxes and some custom fields. How could I edit a post through a form in the frontend?


Possible to combine two custom post types?

I have a Roster page which contains two sections. The first section contains the artist with their pictures, short bios, and website links; and the second section contains the combined videos of every artist in the roster. Similar to this: ![roster](http://i.stack.imgur.com/X9tER.jpg) Normally, I'd create two separate post types; one for 'artist' and another for 'artist videos' but I was wondering if there was a way I can somehow combine the two? So in the admin panel, it would look something like this: ![admin](http://i.stack.imgur.com/DRVf5.jpg) If possible, how would I go about doing this? Or am I over-thinking this (as I often do) and is there an easier way?


Count how many posts have a custom field set

I've added some code to my templates which automatically adds custom fields to cache some data that each post pulls in. Is there a way that I can track how many posts have had this custom field set?


Problem with running javascript in a shortcode

I am trying to create this plugin for my site that will allow create short codes to pull data from the iTunes Search SDK. I already have the iTunes Search SDK javascript plugin working that pulls the data from the search SDK but I am running into an issue with placing the required javascript into the shortcode. The code I have looks like this:               <?php     add_action('init', 'peb_init');          function peb_init() {         add_action('admin_head', 'peb_admin_head');     }          function peb_admin_head() {         echo '<script type="text/javascript">';         require_once('https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.js');         require_once('js.php');         echo '</script>';     }               add_filter('widget_text', 'do_shortcode');          add_shortcode('appPrice', 'appPrice');     function appPrice($atts)      {         $atts = shortcode_atts(             array(                 'id' => '',                 'class' => '',                 'container' => ''         ), $atts);         return '              <script type="text/javascript">         $(document).ready(function() {             var url = 'iLookup.php';                      query = $id;                      $.getJSON(url, {id:query}, function(json) {                 $('#results').html('Price: '+json.results[0].price+'<br/>');                 });              });     </script>              ';               }      If anyone has any ideas as to why this doesn't work I would be very appreciative. If there is not enough info given I will be glad to provide more. NOTE: There is no error message it just doesn't work. I have tried using the console log and it still doesn't work. The rest of the plugin works fine with the exception of the script.


How to change a user's password programatically

I am trying to create a totally different profile page (not the one provided by Wordpress), since the layout and feel of the default profile page is too "Wordpress" for the users. Now I am successful in being able to present a page that can modify user meta data like firstname, lastname, city, zip code, etc. Now what stumped me is changing the password of the user. Is there any built- in wordpress function, say change_user_password($user_id, $new_password)? I'm surprised that I can't look for anything that does this. Worse comes to worst I'm doing an `UPDATE wp_users SET user_pass = md5($new_password) WHERE ID = $user_id`, but I would be really amazed if there is no function for this one.


Adding metadata to user generated taxonomy terms

I need to add some data to _user generated_ custom taxonomy terms and expose the settings to the user. I planned to use dynamically generated **submenu pages** , **tabbed navigation** or **sections** to create a logical division per term. However, as you probably know, there's no _core_ way of passing arguments into _add_menu_page_ , _add_submenu_page_ and _add_settings_section_ so I can't generate them. Managing text fields was easy:   * I generated terms using _get_taxonomies_ and looping trough them adding fields   * added some HTML to make this handful of fields look like they were _divided into sections_ ,   * saved them into options as an array with respectively named keys for easy access from inside the theme So far, so good. But I need to add images and having only **one form** to send multiple images forces me to use _name=array[]_ attribute. It makes them loose their connection to _the term_ and renders them useless inside a loop. Am I missing something (besides years of WP Plugin development experience)? RtL


Need small coding with Custom Fields Search

WP Custom Fields Search is a great plugin but I've a problem regarding the plugin returning results using the homepage. When I click the submit button, results are shown on the homepage instead of the search.php page! Searching on the web, I've read that the plugin should output search results on the search page template or, if search.php is missing, on the homepage. My theme has search.php but the plugin is not using it: **I need to force the plugin to output search results in the search results page**. Looked at the plugin's code and quite sure that some code should be changed in the “extra_search_fields.php” file but I'm not sure where and how to force the results to output on the search template instead of the homepage. Guess that at about line 230 is where to hack the code:               function renderWidget($params=array(),$p2 = array()){         $title = $this->getTitle($params);         $inputs = $this->getInputs($params);         $hidden = "<input type='hidden' name='search-class' value='".$this->getPostIdentifier()."'/><input type='hidden' name='widget_number' value='".$p2['number']."'/>";         $formCssClass = 'custom_search widget custom_search_'.$this->nameAsId();         $formAction = get_option('home');         if(function_exists('locate_template'))             $formTemplate = locate_template(array('wp-custom-fields-search-form.php'));         if(!$formTemplate) $formTemplate = dirname(__FILE__).'/templates/wp-custom-fields-search-form.php';              foreach($inputs as $k=>$v){             if($v->isHidden()){                 $hidden.=$v->getInput(false);                 unset($inputs[$k]);             }         }         include($formTemplate);     }          function isPosted(){         return $_GET['search-class'] == $this->getPostIdentifier();     }     function getPostIdentifier(){         return get_class($this).'-'.$this->id;     }     function isHome($isHome){         return $isHome && !$this->isPosted();     }     function rewriteHome($homeTemplate){         if($this->isPosted()) return get_query_template('search');         return $homeTemplate;     }      Can someone please help me?


Image media upload problem in page editing modus?

I can't figure this out, uploading an image when i am editing or adding a page doesn't work correctly. During upload i get a http error. Debugging shows async-upload.php gives a 500. The funny thing is the image is uploaded. When i refresh the page and hit "add media" i can see the image in the library, but without the important "meta" data as ATTACHMENT DISPLAY SETTINGS >> size. And i notice size should be defined for the gallery to work properly. How can i fix this?


Are there any plugins yet that support Facebook Like, Google +1 and allow Social Interaction tracking on Google Analytics

I know that Google +1 is quite new (at time of writing), but I wondered if there were any plugins that support these. By "Social Interaction tracking on Google Analytics" I mean - that use this code - http://code.google.com/apis/analytics/docs/tracking/gaTrackingSocial.html?utm_source=helpCenter&utm_medium=helpCenter&utm_campaign=social&utm_content=socialPluginTracking The alternative is to find a plugin that supports the first two and add my own analytics, but I wondered if someone had done it already.


How do i schedule cron in wordpress for each second?

I want to schedule a cron job in Wp3.5.1 to sending email to those customer whose appointment is pending. here some code am trying: **For the testing am scheduling corn for each second to insert row in table.**               // insert row every second     add_action('wp', 'my_activation');     function my_activation() {         if ( !wp_next_scheduled( 'my_event' ) ) {             wp_schedule_event( time(), 'hourly', 'my_event');         }     }          add_action('my_event', 'do_this_event');     function do_this_event() {         global $wpdb;         $wpdb->query("INSERT INTO `wordpress-testing`.`wp_test` (`id`, `text`) VALUES (NULL, 'b');");     }          wp_get_schedules('my_event');          //custom recurrence     add_filter( 'cron_schedules', 'cron_add_every_sec' );     function cron_add_every_sec( $schedules ) {         $schedules['hourly'] = array(             'interval' => 1,             'display' => __( 'Do Secondly' )         );         return $schedules;     }      May am going wrong to do this. So please help me through. **Is cron run automatically after activation once OR its need to recurring visit after scheduled time past?**


Exclude a custom category from a list

I have some code that is generating a list of custom categories for a custom post type. This is the code:                   $html .=    '

view more:
';         $k = 0;         foreach ( $terms as $term )         {             $terms = get_the_terms( $post->ID, $taxonomy );             $k++;             if ($term->name != "") $html .= '
slug . '" class="' . $term->slug . '">' . $term->name . '
';         }              $html .= '
';      Any idea how I might go about tweaking this to exclude specific custom categories from the list? I'm thinking I need a line before the foreach to tell it to skip certain category ID's? Many thanks, Paul


Count widgets in position and set class

(Please be gentle, I'm transitioning from Joomla development.) I am using Twitter Bootstrap for this client and I would like the "bottom" widget position to work "automatically" for my client as I am used to in Joomla where if there are 2 modules published in a position, then the appropriate classes will be added on each div to make multiple columns. (Ex: each module would be wrapped in a ".col-md-6", if there are three, then there will be 3 columns because the module would be wrapped in ".col-md-4" etc.) I see that I could make a bottom1, bottom2, and bottom3 position and do it that way, but it adds extra confusion for my client. Especially, when I need to have a lot of these positions. I know Wordpress must be able to do this, but I can't seem to figure it out. (I would use Joomla! but they would like to have a blog for their website and need a custom content types as well.) Any help would be appreciated. Below are the "bits" I have gathered but aren't making sense how to put them all together. Thank you. I have this function to register my widget in **functions.php** :               function my_widgets_init() {         register_sidebar( array(             'name' => 'bottom',             'id' => 'bottom',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));     }     add_action( 'widgets_init', 'my_widgets_init' );      and this function that does the calculation (found this on Stack Overflow) in **functions.php** :               function count_sidebar_widgets( $sidebar_id, $echo = true ) {         $num_widgets = wp_get_sidebars_widgets();         if( !isset( $num_widgets[$sidebar_id] ) )             return __( 'Invalid sidebar ID' );         if( $echo )             echo count( $num_widgets[$sidebar_id] );         else             return count( $num_widgets[$sidebar_id] );     }      My html that displays the widget in **index.php** :               <?php if( is_active_sidebar('bottom') ) { ?>
             <?php dynamic_sidebar('bottom'); ?>             <?php count_sidebar_widgets( 'bottom' ); ?>
     <?php } ?>      Thank you for your time and attention.


Display Referring Category on single post?

My site is built in such a way that every single post (in a custom post type) is accessed via a category archive (custom taxonomy). Every post may have more than one category assigned, but I want to display only the category from the archive that came previously. Lets say post "Bob Brooks" is assigned cat apple, banana and carrot. I browse to site.com/category/carrot/ and click on the result "Bob Brooks". on site.com/bob-brooks/, I want it to show "carrot" in a subheader on the template, but not the other categories. And I obviously want it to show the correct cat dynamically. How do I do that?


Change Wordpress url for newly formed posts or pages

We have website which uses wordpress and have around 2000 posts. The format for url we choose was http://www.abc.com/xyz/post-title but not we want to change it to http://www.abc.com/abc/post-id/post-title something like stack stackexchange, but since we do have a decent google juice for the existing urls we don't want to loose that. I know some people told me we can use Permanent redirect and the juice will flow with it. but i am not very confident on that. Is there a way we can customize wordpress so all future posts follow the new url pattern and past pages remains the same. Any solutions to this is greatly appreciated.


Trying to regain access to a wordpress based website

My Dad has a website based on wordpress, he went into the wordpress dashboard and modified the home page incorrectly appending an extra level to it, then when he exited it made changes resulting in website being messed up and more importantly the login to wordpress has disappeared not allowing him to change it back. I manually fixed the url to display the wordpress dashboard login, yet even when login it doesnt work, it takes be back to the wrong page. I don't currently have access to the wordpress database but I do have access to the files generated from the database so my plan was to edit the correct file to set the home page path back to what it should be, hoping that will then allow me to get into Wordpress dashboard. But I have very little knowledge of Wordpress, anyone help me here please.


How to get excerpt of the recent posts

Right now, i am using code below to show title and its link of recent posts from my custom post category, but for one of my category i want to show excerpt, how can i achieve that. CODE i am using to display title:               <?php         $recent_posts = wp_get_recent_posts(array('post_type'=>'jokes'));         foreach( $recent_posts as $recent ){             echo '
' .   $recent["post_title"].'
 ';         }     ?>


How to disable the main wordpress stylesheet and enable another one

I'm trying to disable the main stylesheet of my site using a plugin to replace `style.css` with `style_pink.css` or `style_blue.css` So if an user clicks on `pink button` the `style_pink.css` should be activated and `style.css` should be deactivated and so on. I'm trying to use `wp_deregister_style( $handle )`. Please suggest an appropriate handle and a way to achieve this.


Advanced Custom Fields - disable radio buttons checked before

and at the beginning my apologizes for my language skills On my webpage, i created Taxonomy field with single available value (radio buttons) and related with pages. For example when i'm creating a new page( or editing existing one ) i've got list simillar like below   * Category 1      * Subcategory 1     * Subcategory 2   * Category 2 And now my question: is it possible that block( disable ) somehow checked earlier categories ( and subcategories ), to block possibility of choosing two the sames categories ? Thank you in advance! Update: I just wrote checkbox instead of radio buttons, sorry for mistake.


Add filter on certain thumbnail sizes only

How to run this filter only on some specific registered thumbnail sizes '$size' ? like 'large' , 'medium' ....               add_filter( 'wp_get_attachment_image_attributes', 'wpse8170_add_lazyload_to_attachment_image', 10, 2 );     function wpse8170_add_lazyload_to_attachment_image( $attr, $attachment ) {     $attr['data-original'] = $attr['src'];     $attr['src'] = 'grey.gif';     return $attr;     }      Thanks


change the post time on multiple posts

I have about 60 posts queued and ready to post on specific dates, but I forgot to set the post time. I really don't want a bunch of posts posting at 3AM, so I need to change the times on all these posts. Is there any way to do this, programmatically or with a plugin?


How to change the thumbnail size to a specific category?

I am using thumbnail on my blog posts. I added the following code in my **functions.php** for that purpose               add_theme_support('post-thumbnails');       set_post_thumbnail_size( 328, 228, true );       It's working fine and all thumbnails are **328 x 228** Now I want to change the thumbnail size only for a specific category **ID is 9.** Post under category ID 9's thumbnails must be **100 x 150.** how can I do that?


cat_is_ancestor_of() for custom taxonomies

I'm trying to use cat_is_ancestor_of() for custom taxonomy categories but it's not working. Is there any other way to check if a category is child of another?


How can I query all post with currrent taxonomy term?

I created the taxonomy 'machine types', and added several terms to it, like 'cranes' for example. The url to that term now looks like this: domain.com/machine-types/cranes How can I make this url query for only posts with the term cranes? And the same for all other terms, without creating a template for each term. I think I must ask for the current term and store it in a value, and query for that, right? How?


Get all pages to display at once

I'm doing a theme that is supposed to be ease to create, but I have now reached a standstill and need to get past this. Is there a way to display/show all pages at once? Or can I create a custom query to display all the pages with templates and not only the content? ## Something like this:               -------------     | 1 | 2 | 3 |     -------------      Number represents the page which is shown in fullscreen mode and when the pagelink is clicked we slide to the page.


Can we create a child theme for a premium child theme built on Genesis framework?

I have a child theme from Genesis framework. How can I create a child theme of it. Actually I need to do some changes, so if I'm changing in my child theme, then if any future updates comes I can not update. Is there any way?


Cancel post save

I need to abort the post saving process when the post content contains a specific string and then display a message to the user. I found a method to display the message but didn't find a way to refuse post saving. So far here's what i've done                add_action( "pre_post_update", "checkPost");      function checkPost($post_ID) {           $post = get_post($post_ID);                $postContent = $post->post_content;                if ( wp_is_post_revision( $post_ID  ) )                return;                if(preg_match("/bad string/", $postContent) == 1) {                     //                // cancel post save                //                     // then                add_filter("redirect_post_location", "my_redirect_post_location_filter", 99);           }      }           function my_redirect_post_location_filter($location) {           remove_filter('redirect_post_location', __FUNCTION__, 99);           $location = add_query_arg('message', 99, $location);           return $location;      }           add_filter('post_updated_messages', 'my_post_updated_messages_filter');      function my_post_updated_messages_filter($messages) {           $messages['post'][99] = 'Publish not allowed';           return $messages;      }


PHP Notice error (when on 404 page)

I have a `404.php` template for my theme. I also have `WP_DEBUG` in wp- config.php set to `TRUE`. Consider this 404 template:               get_header(); ?>
         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
             Whatever.

          <?php get_footer(); ?>      I get the following error: **Notice** : Trying to get property of non-object in **.../path/post- template.php** on line **30** Now I know the error is caused by the call to `the_ID()` on line 4. And the easiest solution would be for me to just remove it in the template. However, there are places in other template parts, `header.php` for instance, that either calls the same function or uses `$post->ID`. An example would be `$project_meta = get_post_meta($post->ID, 'show_project_meta', true);`. This is shared and works fine in any other template, i.e where the page has a post/page ID. What can I do for the 404 page? Is there a way to fix this? Thanks.


How to troubleshoot 404s in Wordpress admin

There are several threads on Wordpress.org about this problem, but none with solutions. I just went from localhost (MAMP) to a live server (Dreamhost) and I'm getting constant 404s when submitting actions (such as changing a title) or trying to load pages in the admin (such as post/page/cpt lists). The problem is WP is running up against memory limits (see support message below). What is the best systematic way to evaluate/troubleshoot memory use in the WP admin? Plugins tend to be implicated in this sort of problem; are there any other usual suspects?               `I've checked into why you've     been receiving these 404 errors, and it seems your scripts have been     getting automatically killed by our Process Watcher script due to your     site(s) going over Memory limits on the shared server.          2011-07-08 08:53:59 procwatch2 INFO: Process(pid=12921, name='php5.cgi',     uid=_, tty=None, cpu=17.5, rss=155764.0, vsize=264456.0): kill     for total RAM     2011-07-08 08:54:19 procwatch2 INFO: Process(pid=13248, name='php5.cgi',     uid=_, tty=None, cpu=29.8, rss=197348.0, vsize=305212.0): kill     for total RAM     2011-07-08 08:54:40 procwatch2 INFO: Process(pid=13253, name='php5.cgi',     uid=_, tty=None, cpu=39.9, rss=197376.0, vsize=305188.0): kill     for total RAM`


Conditional wp_mail statement on post

I am currently posting from the front end using a similar model as http://voodoopress.com/2011/03/review-of-posting-from-front-end-form/. I want to send an email to certain addresses based on the value of the "problem_type" field. This is what I have so far. This does not send anything at all, but I am at a dead end. Ideas? I only need 3 different emails. 1 if value is computers, 1 if value is phones, and every other value can be sent to a 3rd email address.               function new_post_creation_email($pid) {         $problem_type = get_post_meta($pid, 'problem_type', true);         $description = 'post_content';              if ($problem_type == 'phones') {             $to = '1st email here';         } elseif ($problem_type == 'computers') {             $to = '2nd email here';         } else {             $to = '3rd email here';         }              $subject = "New Ticket in ' . echo get_post_meta($pid, 'problem_type', true) . ";         $message = "A user profile has been updated\n\n";         $message .= print_r($description,true);         @wp_mail( $to, $subject, $message);     }          add_action('wp_insert_post','new_post_creation_email');      Obviously the "1st email here" etc have been replaced with text email addresses in the real code.


Use rich text editor in comments?

I've been trying to get the TinyMCE editor working in the comments field but I've been unable to do so. Another suggestion I found was http://nicedit.com, the editor is working but the comments are not saved in rich text. TinyMCEComments seems to do it but hasn't been updated in a while, it's not working for 3.2. Did anybody got this working? Thanks!


Advenced custom fields auto fill problem

I need help. I am using advanced custom fields and by using them i am making a new post. But something went wrong when i enter the site where are my end forms there is filled out information. If i enter a new user there are the same information in those forms. Can someone help me ? Maybe something have stuck in my data base ? I am using this code to create new post. code here 2x files. http://pastebin.com/4yRRy9Nv


Prevent the Editor From Moving My

I know variations on this have been asked all over the WordPress world, but I can't seem to find what I'm looking for. I have HTML that looks like this:                My Section Title      I find that if the anchor tag is empty, browsers tend not to scroll precisely to it when the name fragment is added to the URL. So, I want to have the mark up shown above. The problem is that when I enter that markup into the "Text" tab of the editor and switch to "Visual" mode, TinyMCE changes it to this:                My Section Title      I have a filter on `tiny_mce_before_init` similar to the one shown here where I set the `entities` key to allow for ` `, but I have no idea why it's moving the space outside of the anchor tag. I tried using the `extend_valid_elements` setting like this: `'a[name|class|id|text|href|style|target|rel|#text]'`, but that only made things worse (two ` ` where added after the anchor and it was still emptied). Any help is greatly appreciated.


My website resets when accessing the index page

So my wordpress theme and website is on a stage server, since it's under production. And this issue happens once in a while. Basically, if I log in as a user, and when I enter the index page, the site resets (front end). It appears as if I'm logged out, and some of the changes on the actual index page (including the header and footer) are not being shown. This only happens when clicking on the index page, either view a link or typing the actual address. If I click on another link, or access another page, suddenly everything is back to normal. But then if I enter the index page again, the same problems occurs. Anyone got any ideas? I'm using W3 Total Cache. Can it be a cache issue or a cookie issue? I'm clueless since the problem only seems to occur randomly, and sometimes completely disappear. The only error I get is: [11-Feb-2014 13:07:24 UTC] PHP Notice: Undefined variable: raw_welcome_message_text in /storage/content/40/10769050/stage.12345.com/public_html/wp- content/themes/stage.12345.com/index.php on line 29 I just solved this with the php empty. I doubt that this has anything to do with the actual problem though.


Search should search all posts under the category searched for

I have a situation where I want all posts to be retrieved from the category list. A proper explanation can be: - If I searched for "garden" - it should get all posts from the category garden. - I am close to it, but not able to modify the pre_get_posts to get it done. Here is my code:               $keywords = explode( ' ', $_GET['s'] );                  $cats = get_categories( array('taxonomy' => 'sector', 'hide_empty'=>'0') );             //print_r( $cats[0] );             foreach($keywords as $keyword ) {                                            foreach ($cats as $cat) {                     if (                          (strpos($cat->cat_name,$keyword) !== false)                          OR (strpos($cat->slug,$keyword) !== false)                         OR (strpos($cat->name,$keyword) !== false)                          OR (strpos($cat->category_nicename,$keyword) !== false)                      ) {                         $cat_IDs[] = $cat->cat_ID;                         $cat_slugs[] = $cat->cat_name;                     }                     //$idObj = get_category_by_slug($keyword);                           }             }             // $cat_IDs and $cat_slugs - now have categories I want to search                 // I was trying this query->set, but it gives no result            $taxQuery = array(                     array(                             'taxonomy' => 'sector',                             'field'    => 'id',                             'terms'    => array( $cat_IDs[0] )                         )                     );             $query->set( 'tax_query', $taxQuery );             $query->set('s', '' );      The above code is part of my pre_get_post filter. I am not familiar to advanced queries using meta_query or tax_query. Someone experienced, must be knowing what I am doing wrong. The link is here: http://www.ourlocalmag.com/superdev/listings Custom Post Type: listings Custom Taxonomy: sector $cat_IDs is being populated with correct category IDs. (confirmed) If you try searching for "garden" or "health" - it founds no post. I am confused with this. Please help. Thanks.


WordPress User Roles, Custom Post Types, and Admin views

My friend mentioned that there is a simple way to modify what users see in the admin sidebar based on their user role. I have a large number of custom post types, one for each user, and I need to limit these users (currently given the role 'author') access to only their own post type and the Posts (not even Pages). I also want to hide Widgets from them. Is there a bit of PHP I can stick in my functions.php file to accomplish this easily?


Theme's text domain & language.PO file not working

I can't get my translations to work in my theme. Here is what I have In functions.php, I have:               load_theme_textdomain( 'transparent', get_template_directory_uri() .'/languages' );      I have > .../theme/languages/transparent-en_US.po, which contains:               # English translations for Transparent package.     # Copyright (C) 2014 Steven Doig     # This file is distributed under the same license as the Transparent package.     # Automatically generated, 2012.     #     msgid ""     msgstr ""     "Project-Id-Version: my-pluginname 1.0\n"     "Report-Msgid-Bugs-To: \n"     "POT-Creation-Date: 2012-08-06 13:46-0400\n"     "PO-Revision-Date: 2013-03-21 11:20+0400\n"     "Last-Translator: Automatically generated\n"     "Language-Team: none\n"     "MIME-Version: 1.0\n"     "Content-Type: text/plain; charset=utf-8\n"     "X-Poedit-SourceCharset: iso-8859-1\n"     "Content-Transfer-Encoding: 8bit\n"     "Plural-Forms: nplurals=2; plural=(n != 1);\n"     "X-Generator: Poedit 1.5.4\n"               #: header.php:58     msgid "thanks-for-visiting"     msgstr "Hello!  Thank you for visiting.  Take a look around and subscribe to the "          #: header.php:60     msgid "subscribe-by-email"     msgstr "subscribe by email"          #: header.php:62     msid "for-updates"     msgstr "for updates."      In header.php, from line 58 I have:
<?php echo __("thanks-for-visiting", 'transparent'); ?><a href="<?php bloginfo('rss2_url'); ?>" title="<?php bloginfo('name'); ?> RSS feed">RSS feed          <?php if (of_get_option('feedburner', '') !== '') {?>             or <a href="http://feedburner.google.com/fb/a/mailverify?uri=<?php echo of_get_option('feedburner', 'no entry');?>&loc=en_US" target="_blank"><?php echo __("subscribe-by-email", 'transparent'); ?>          <?php } ?>         <?php echo __("for-updates", 'transparent'); ?>
      In my style.css I have the following               /*     Theme Name: Transparent     Theme URI: http://websitetechnology.com.au/category/themes/transparent/     Description: Transparent responsive two-column theme.     Tags: green, two-columns, right-sidebar     Author:Steven Doig     Author URI:http://tech.doig.com.au     License: GNU General Public License v2 or later     License URI: http://www.gnu.org/licenses/gpl-2.0.html     Version:1.2     */      However, on the front end, I see: > thanks-for-visitingRSS feed for-updates Can you see why this translation is not working?


'wp' hook supposed to trigger when editing a post?

I'm trying to figure out if this is by design, a bug or a feature I should try to request. I created a plugin and added the following code:               function test_wp() {         echo '
It worked
';     }     add_action('wp', 'test_wp');      I'm essentially looking for instances where the 'wp' hook does/doesn't get triggered. It doesn't load on the admin dashboard, which is obvious since it's not loading any single WP object. Whenever I click into "All Posts" it does appear to get triggered. Which is what I expected to happen. Now, when clicking edit on any existing post, it appears 'wp' hook is not getting triggered on the post editor pages. It seems to me that the 'wp' hook should be getting called here, since it's loading a post and it's respective data directly onto this page. Yet the trigger doesn't seem to load. Am I missing some logic behind it not loading here? I am able to trigger the 'posts_selection' hook, which according to the Action Reference list happens right before 'wp' hook runs. That said, I have no idea what 'posts_selection' is actually doing, since the documentation for it is empty. I am currently running WordPress 3.6.1 and had the same issue in 3.6.0. I haven't tried any versions prior to 3.6.


Why in this page can't use this CSS class also if the .css file is correctly imported?

I am not so into HTML and CSS and I am finding some problem with this WordPress theme that I am developing using _BootStrap*_ CSS framework. If you open this page you can easily understand what is the problem: http://lnx.asper-eritrea.com/diritti-umani/ As you can see in the previous page there is an immage (named **Hum_righ_big.jpg** ). I have to aligne it at the center of the page (and not on the left as it is at this time) and to do it I use **Tiny MCE** (that is a visual editor) in the backend of my website.

      So as you can see this img tag have the following class associated: **aligncenter** that have the following CSS code:               .aligncenter {         display: block;         margin-left: auto;         margin-right: auto;     }      As you can see in the previous page these are the imported CSS styles files:               <link rel='stylesheet' id='bootstrap-css-css'  href='http://localhost/wordpressAsper/wp-content/themes/AsperThemeV2/assets/bootstrap/css/bootstrap.css?ver=all' type='text/css' media='all' />     <link rel='stylesheet' id='fancybox-css-css'  href='http://localhost/wordpressAsper/wp-content/themes/AsperThemeV2/assets/plugins/fancybox/jquery.fancybox.css?ver=all' type='text/css' media='all' />     <link rel='stylesheet' id='flexslider-css-css'  href='http://localhost/wordpressAsper/wp-content/themes/AsperThemeV2/assets/plugins/flexslider/flexslider.css?ver=all' type='text/css' media='all' />     <link rel='stylesheet' id='customstyle-css-css'  href='http://localhost/wordpressAsper/wp-content/themes/AsperThemeV2/assets/css/stili-custom.css?ver=all' type='text/css' media='all' />      Now I have a strange behavior. If I put this CSS class code:               .aligncenter {         display: block;         margin-left: auto;         margin-right: auto;     }      into the **stili-custom.css** file I obtain no result and my immage still remain on the left but if I put this CSS class into the **bootstrap.css** file it work fine (the immage is aligned on the center). Why if I put it into **stili-custom.css** (and not **bootstrap.css** ) I can't use this CSS class in the previous page? What am I missing? How can I solve this issue? (I want put this class into **stili-custom.css** because this is a custom style and not belong to bootstrap framework)


custom theme's search not working

I've created a custom theme. It's pretty simple. However, the search function is not working. Does the search results page not use the theme's `page.php`?


get_the_tag_list() returns bad links

I have created a custom post type named 'portfolio' and assigned the default 'post_tag' taxonomy to it. In single-portfolio.php template I'm using the following code to view each post's tags:               echo get_the_tag_list('
Tags: ',', ','
');      The problem is that the link of each tag is not correct and finally redirects into a 404 page. The link that `get_the_tag_list()` returns looks like: > http://www.mywebsite.com/?tag=web-design but in order to work properly it should be something like: > http://www.mywebsite.com/?tag=web-design&post_type=portfolio Any suggestions on how to fix this?? **Note:** I have also tried get_the_term_list() function but it works the same way...


Menu is not visible in appearance

I have added following code to my `function.php`               function register_my_menu() {        register_nav_menu('header-menu',__( 'Menu' ));     }     add_action( 'init', 'register_my_menu' );      And here is my code where menu is located.               wp_nav_menu( array( 'theme_location' => 'header-menu' ) );      What might be the issue ?


Nice permalink for search results with NiceSearch plugin

I'd like to know how I can rewrite a search results URL that also contains a ".html" into the end of URL. I have taken the code from the Nice Search plugin which works fine to change http://example.com?s=key+word into http://example.com/search/key-word:               function txfx_nice_search() {         $change = array('+',' '); //tanda plus dan spasi         if ( is_search() && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === false && strpos($_SERVER['REQUEST_URI'], '/search/') === false ) {             wp_redirect(get_bloginfo('home') . '/search/' . str_replace($change, '-', str_replace('%20', '-', get_query_var('s'))));             exit();         }     }          add_action('template_redirect', 'txfx_nice_search');      Is there a way to add ".html" in a search results permalink? So the result in permalink URL will be hxxp://example.com/search/key-word.html and the page result will be contain the "key word".


WP Cron and wp_insert_post

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


Permalink broken for pages after adding rewrite rule

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


How to manage ajax calls and JSON in wordpress

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


WP Theme Development, Adding Content Areas to Custom Page Template

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

        Content brought in by admin

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


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

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


Add array of post id's to a category?

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


Highlight a Featured Post?

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


Archive sorting functions by custom fields (front-end)

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


Most Flexible Photo Gallery Plugin?

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


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

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


Wordpress problem with htmlentities

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


Is it possible to determine proxy based comments?

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


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

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


Customize WooCommerce Error Message

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


wp_editor removes HTML and inline styles

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


Automatically Query Parent Taxonomy

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


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

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


Redirect loop error on wordpress landing page on localhost

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


Limit the number of pages created by the paging

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


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

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


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

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


Do not allow to search certain words

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


Getting an extra post's meta data?

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


Possible to filter custom post type with multiple meta data?

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


getting id of page

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


Pass additional parameter in the URL

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


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

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

...

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


I cannot log into my site

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


Use shortcode as parameter for another shortcode

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


wp custom field image and text multiple time

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


How to make a Post Tag primary?

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


Wordpress Custom Post Type Admin Page really slow

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


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

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


Remove "Published On" inside wp-admin

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


Posts archive index pagination in a static page custom query

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

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

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

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

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


Add existing images from Media Library in to custom gallery

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


anyone can help me to know whats going wrong?

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


Move WordPress site from one domain to another

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