title: Page reload occurs before request finishes

text:
I wrote a plugin to send an invitation to a friend and am submitting a form using AJAX and used the tips talked about in 5 tips for using AJAX in wordpress and another article referenced in the AJAX in plugins wordpress codex page. I have now got the relevant code executing and sending an email as expected however the page reloads before the AJAX call finishes. The relevant PHP code is here:               <?php     define( 'SEND_INVITATION_MIN_WORDPRESS_VERSION', '3.1.1' );     define( 'SEND_INVITATION_PLUGIN_URL', plugins_url( '', __FILE__ ) );          // Tie into WordPress Hooks and any functions that should run on load.     //     add_action( 'init', array( 'NC_SendInvitation', 'send_invitation_init' ) );          class NC_SendInvitation {         protected $nonce_name = 'send_invitation';         protected $post_url = '';              public static function send_invitation_init() {             new self;         }              public function __construct() {             $this->send_invitation_head();             $this->send_invitation_check_wordpress_version();             add_action( 'show_invitation_form', array( $this, 'send_invitation_get_form' ), 10, 1 );                  // Add AJAX actions             // Serves logged in users             add_action( 'wp_ajax_form_action', array( $this, 'send_invitation_handle_submit' ) );                  // Serves non-logged in users             add_action( 'wp_ajax_nopriv_form_action', array( $this, 'send_invitation_handle_submit' ) );         }              public function send_invitation_head() {              // Add script that for handling AJAX POST request to the head             wp_enqueue_script( 'send-invitation-ajax-handle',                 plugins_url( 'js/ajax.js', __FILE__ ),                 array( 'jquery' ) );                  // Localise script find out what this does             wp_localize_script( 'send-invitation-ajax-handle',                 'send_invitation_ajax_script',                 array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );                  // Add the script for showing and hiding the form to the head             wp_enqueue_script( 'send-invitation-js',                 plugins_url( 'js/send-invitation.js', __FILE__ ),             array( 'jquery' ) );                  // Add the CSS that styles the form to the head             wp_enqueue_style( 'send-invitation',                 plugins_url( 'css/send-invitation.css', __FILE__ ) );         }              public function send_invitation_check_wordpress_version() {             global $wp_version;                $exit_msg = 'Send Invitation requires version '         . SEND_INVITATION_MIN_WORDPRESS_VERSION         . 'or newer Please     update!';              if ( version_compare( $wp_version, SEND_INVITATION_MIN_WORDPRESS_VERSION, '<') )         {             exit( $exit_msg );         }     }              public function send_invitation_get_form($post_url) {         // TODO Try moving this into another file and include here using method above         $send_invitation_form ='
Send Invitation
         <form id="invitation-form" action="" method="post">
                 Your Email Address
                 <input type="text" name="your_email" />

                 Email Address of Recipient
                 <input type="text" name="friends_email" />

                 Subject
                 <input type="text" name="subject" />

                 Message
                 <textarea rows="10" cols="20" name="message">' . $post_url . '</textarea>
             <input type="hidden" name="nonce" value="send_invitation" />             <input type="hidden" name="action" value="form_action" />
<input id="submit-button" type="submit" value="Send" onclick="send_invitation();" />
         </form>

';              echo $send_invitation_form;     }              public function send_invitation_handle_submit() {         $success = __('OK');         $error = __('NOT OK');         if (!empty($_POST)) {             try {                 error_log('Inside if', 0);                 $to = $_POST['friends_email'];                 $subject = $_POST['subject'];                 $message = $_POST['message'];                      // TODO Suppress error message with @                 $send_result = wp_mail($to, $subject, $message);                 $feedback = $send_result ? $success : $error;             }             catch( Exception $e ) {                 $feedback = "Catch: " . $e->getMessage();             }         } else {             $feedback = "Error: " . $error;         }         echo $feedback;         exit;         // Do not forget to exit     }     ?>      The relevant javascript code is here:               function send_invitation() {         alert("got here");         jQuery.post(send_invitation_ajax_script.ajaxurl,             jQuery('#invitation-form').serialize(),             function(response) {                 alert('Response: ' + response);                 jQuery('.response-area .success').html(response);             }         );     }      Another problem I am seeing is that the POST request to the ajaxurl shows up red in firebug but it disappears quickly and I cannot see what is happening but the correct PHP functions are executing but no response comes back and all I get is page reload once the request is sent. I am not sure why this is the case but I have tried debugging this for a while and could not find a solution. Thanks in advance. nav


title: How do I add open graph tags?

text: I'm using the Wordpress CMS. I don't have access to the theme's code etc.. So how do I update the opeh graph tags? I'm mainly looking to add an image to go along with it, as it's using the default WordPress image when I share on Facebook. Thanks!


title: Reblog from Tumblr to Wordpress

text: If you have a Tumblr blog, you can 'reblog' from other Tumblr blogs, much like a trackback. I follow a couple of Tumblr blogs and sometimes want to quote from those websites. And, on these Tumblr sites, there is a 'notes' section for each post listing each 'reblog'. So my question is: is there some WordPress plugin (or some workaround not requiring a plugin) that will allow me to 'reblog' from a Tumblr site to my WordPress one and have it show up in the 'notes' section of the Tumblr blog? My site is a wordpress.org blog, if that makes a difference. And I am running WordPress 3.0.1. Thanks in advance!


title: Creating new page with pre-defined parent page

text: I have a blog with a very complex page structure (like, 4 levels of hierarchy). When creating new pages, it is very cumbersome to pick the parent page from the drop-down list, as it is constantly growing. For that reason, I would like to add a button to the frontend admin bar that points to `post-new.php`, but with a "parent page ID" parameter. Effectively, the button would allow you to navigate to the desired parent page on the front page, and then click a "add new page here" link there that takes you to the back-end with the parent page preselected. However, it seems to be impossible to add parameters to `post-new.php` and a related feature request has been closed in the WordPress trac. Does anybody know a solution that does not require hacking the core? One idea I had was hooking up to a hook that gets triggered before a new item is created, pulling the parent page from a GET parameter there, and setting it in the item-to-be. If that is a viable way, I would be grateful for a simple pointer which hook to use.


title: How can we select attachements based on Caption?

text: I am trying to select some attachements based on an attachement caption. I need to do this for a seperate download page. On the download page i want to display all attachment which caption equals "downloads". So this way i can be selective of post attachments which can and can't be downloaded At the moment i have this code to select all the attached pdf's as downloable files, but i like to select some attached images and deselect some pdf's.                   $args = array('post_parent' => $atts['product_id'],         'post_status' => 'inherit', 'post_type' => 'attachment',         'post_mime_type' => 'application/pdf', 'order' => $order, 'orderby' => $orderby);     $attachments = get_posts($args);         //print_r($attachments);             $i = 1;             foreach ($attachments as $attachment) {     ...     $attachment->guid      i am also able to select images based on there given thumbnail name with               wp_get_attachment_image($attachment->ID,'product-slider-thumbnail')      but how to select based on caption?? regards


title: wp_insert_post and title not utf8 inserts with empty title?

text: I'm using `wp_insert_post` I loop over a text file one row at a time and for each row I create a post. The text is set as the `post_title', for text that is not utf8 the post inserts but with an empty title. Why does that happen, if I'm able to create a post in the backend admin using non utf8 chars it looks like WordPress converts the encoding in the backend. How can I bypass this with `wp_insert_post` and have it insert the post title with non utf8 chars? Thanks


title: Pull post meta with post_query?

text: I'm building a custom index loop that just uses query_posts at the moment. The issue is that inside The Loop, I have to then query for the post meta data (with get_post_meta), which I believe has to query the DB each time it's called. Is there any way I can pull the meta data with the query_posts? I'd need most if not all of the meta data stored for each post. Thanks,   Max


title: Wordpress redirection to get url friendly

text: I want to get url friendly for pass data to page from other page. I explain : I have on i classic wordpress page, url like it : ( example.com/agent/name_agent ) it's url build dynamically. ( get_permalink($id_page_agent) . $name_agent ) In my loop-agent.php , i can manage $_GET['agent_name'] to make a filter. I need to build redirection example.com/agent/name_agent > example.com/agent/?agent_name=name_agent I don't know if you understand ?


title: Search/Replace for editor in HTML-mode

text: Is there a way to do a Search and Replace for the editor in HTML-mode?   Plugins I found are for the visual editor, we are working **only** in HTML- mode, therefore -not- appropriate for what we do.   I would appreciate to find a code snippet or plugin for HTML-mode (did I miss the one you found?)   Thanks in advance for time and effort.


title: query_posts doesn't order by title

text: It seems like stupid bug, but how can i order by title? It anyways orders by date! I'm using:               query_posts( array(          'post_type'      => 'page',         'posts_per_page' => -1,         'orderby'        => 'title',         'order'          => 'ASC'     ) );      I want to use this in function as SHORTCODE. What i'm trying to achieve is to create site map / index of all entries in alphabetic order. Also i'm using newest WP.


title: What is the easiest way to implement cascading database upgrade for my plugin?

text: **Lets assume following situation:** I develop a plugin. The plugin requires custom database table to store some kind of information. From month to month I release new versions of my plugin. Different versions could have their own sets of changes of the table structure and table's data. For instance:   * _version 1.0.0_ has initial setup for table structure   * _version 1.1.0_ has changes to one column type and requires to perform update operation over data of this column   * _version 2.0.0_ requires creation of two new columns, splitting data from old column to new columns and removal of old/deprecated column **The problem:** Lets consider two use cases:   1. An user downloaded version 1.0.0, skipped update to version 1.1.0 and decided to update the plugin when the version 2.0.0 was released. How to organize database upgrade process, which will handle upgrade from version 1.0.0 to version 2.0.0 including changes from version 1.1.0?   2. An user downloaded version 2.0.0 and installed it on a blank instance of WordPress. How to perform the latest version of database installation, which will include all changes from all versions compliance with DRY principles?


title: How to make website with many template that active

text: I want to make a website with wordpress engine but with some features. One website has 3 template and every template is active because I want to make 1 website that has 3 sub categories such us blog, portfolio, and photo gallery but with different templates and fitur in every sub-category. Anyone knows how to do that, please ? Thank you very much in advance.


title: Wp-Admin FTPS Connection Error unlike Filezilla

text: My wordpress website is just moved FTP to FTPS protocol. When I tried to make a connection with FileZilla, the connection is successful. There is nothing wrong with my FTPS connection. ![enter image description here](http://i.stack.imgur.com/Y4emW.png)               Status: Connecting to 88.247.100.147:16666...     Response:   fzSftp started     Command:    open "sonergonul@88.247.100.147" 16666     Command:    Trust new Hostkey: Yes     Command:    Pass: **************     Status: Connected to 88.247.100.147     Status: Retrieving directory listing...     Command:    pwd     Response:   Current directory is: "/home/sonergonul"     Command:    ls     Status: Listing directory /home/sonergonul     Status: Calculating timezone offset of server...     Command:    mtime "sonergonul_net"     Response:   1326036705     Status: Timezone offsets: Server: 7200 seconds. Local: 10800 seconds. Difference: 3600 seconds.     Status: Directory listing successful      But in my wp-admin, when I tried to update my wordpress version auto, these informations are not accepted. ![enter image description here](http://i.stack.imgur.com/fZUxO.jpg) Error code means: > There was a problem connecting to the server, please check the connection > settings. My all files under the `88.247.100.147:16666/home/sonergonul/sonergonul_net`. All tried to connect all the possibilities in my Server name (88.247.100.147, 88.247.100.147:16666, sonergonul.net) but no one was accepted. I think I miss some point but couldn't find it. Doesn anyone have an idea for this situation?


title: Why is the server response time slowing my site down?

text: My site is www.phoenixwave.com When I use Pingdom speed test and Google's speed test both give me the conclusion that my server response time is ridiculously slow...I'm using a Rackspace server. I'm just trying to get a general direction where I need to start troubleshooting. Should I look into different hosting? Am I having a server problem or a DNS problem? Thanks for any and all help provided from the community. See the result picture from Pingdom below: ![Pingdom Test of Phoenixwave.com](http://i.stack.imgur.com/oJry6.jpg)


title: Adding custom fields to images

text: I want to show sources under my every images. So basicly I want to add a simple custom field. I added this code to my function.php               add_filter('attachment_fields_to_edit', 'edit_media_custom_field', 11, 2 );     add_filter('attachment_fields_to_save', 'save_media_custom_field', 11, 2 );     function edit_media_custom_field( $form_fields, $post ) {         $form_fields['custom_field'] = array( 'label' => 'Custom Field', 'input' => 'text', 'value' => get_post_meta( $post->ID, '_custom_field', true ) );         return $form_fields;     }     function save_media_custom_field( $post, $attachment ) {         update_post_meta( $post['ID'], '_custom_field', $attachment['custom_field'] );         return $post;     }      It is ok so far.But then things getting messy. Now my problem is where I can add this second calling code, I meant which .php               get_post_meta( get_the_ID(), '_custom_field', true ) );


title: Wordress debug log is not working

text: I have tried all recommendations from here but none solves my issue. I have a couple of wordpress installations on a local machine running Win 7 and wamp 2.4 and none of them writes in the debug.log file or even display the errors in the page. I have set the following in the wp-config.php:               define('WP_DEBUG', true);     define('WP_DEBUG_LOG', true);     define('WP_DEBUG_DISPLAY', false);      I have manually created an empty file named debug.log in the wp-content directory with full permissions for everyone. My php.ini settings are:               error_reporting = E_ALL     display_errors = On     display_startup_errors = On     log_errors = on     log_errors_max_len = 1024     ignore_repeated_errors = Off     track_errors = On     html_errors = On     error_log = "C:/wamp/logs/php_error.log"      The only way to debug is to use one of the available plugins but they are useless when I'm getting the white screen.


title: Custom post type page for authors

text: I've got 30+ users and several custom post types.   * Classes   * Downloads   * Parties   * Events   * etc At the moment, I'm using `author.php` to display all these custom posts for **that** user, each post type in a loop, each hidden in a tab format. `http://www.websites.com/members/steve` I've been asked if there's a way of having each post type on it's on URL `http://www.websites.com/members/steve/classes` `http://www.websites.com/members/jean/parties` `http://www.websites.com/members/peter/events` Can this be done?


title: Registering Class methods as hook callbacks

text: I'm not sure if I have done this correctly. As I understand it: if I have a class foo and a static method bar I can register that as the callback by passing the array `array("foo","bar")` as the function name. If I have an instance of a class in $foo and want to call the method bar I pass the array `array($foo,'bar')`. If I need to register an action inside the class itself would it work with `array($this,'bar')`?


title: Dynamically Create Terms in Taxonomy when Custom Post Type is Published. Almost There!

text: I'm trying to automatically create terms in a certain taxonomy when a certain custom post type is published. The newly created term must be the name of the post that was published. Example: I have a custom post type "country" and a custom taxonomy "country_taxo". When I publish a country say "Kenya" I want a the term "Kenya" to be automatically created under the "country_taxo" taxonomy. I have accomplished this using the "publish_(custom_post_type) action hook", but i can only get it to work statically. Example:               // This snippet adds the term "Kenya" to "country_taxo" taxonomy whenever      // a country custom post type is published.          add_action('publish_country', 'add_country_term');     function add_country_term() {         wp_insert_term( 'Keyna', 'country_taxo');     }      Like I mentioned above I need this to dynamically add the post title as the term. I tried this, but it doesn't work:               add_action('publish_country', 'add_country_term');     function add_country_term($post_ID) {         global $wpdb;         $country_post_name = $post->post_name;         wp_insert_term( $country_post_name, 'country_taxo');     }      Does anyone know how I would go about doing this? Any help is greatly appreciated.


title: How can I query for all values of a custom taxonomies?

text: Suppose I have a Custom Taxonomy "Fruits". I want to query for all the values available eg. Oranges, Apples, Mangos etc. How can I do that?


title: Custom Loop, Match Category with Page: How to display post featured image?

text:
I found this answer. It saved my day, but could you tell me how to display featured image of the post with the following code? When I'm using               <?php echo $cpost->post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>      An image does not show up... Code below:               <?php if(is_page()) : // check we are a page ?>         <?php global $post; $cposts = get_posts("numberposts=-1&category_name={$post->post_name}"); if($cposts) : ?>                      <?php foreach($cposts as $cpost) : ?>

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

<?php echo $cpost->post_content; ?>
                          <?php echo $cpost->post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>
                   <?php endforeach; ?>                               <?php endif; ?>             <?php endif; ?>      Could you tell me how the correct code should work?


title: Custom taxonomy for Media Library

text: I am trying to create a custom taxonomy for the Media Library called "Reference Type" When I add the following content to functions.php               function wptp_add_reference_type_taxonomy() {         $labels = array(             'name'              => 'Add Reference Type',             'singular_name'     => 'Reference Type',             'search_items'      => 'Search Reference Type',             'all_items'         => 'All Reference Type',             'parent_item'       => 'Parent Reference Type',             'parent_item_colon' => 'Parent Reference Type:',             'edit_item'         => 'Edit Reference Type',             'update_item'       => 'Update Reference Type',             'add_new_item'      => 'Add New Reference Type',             'new_item_name'     => 'New Reference Type',             'menu_name'         => 'Reference Type',         );              $args = array(             'labels' => $labels,             'hierarchical' => true,             'query_var' => true,             'rewrite' => true,             'public' => true,             'show_in_nav_menus' => true,             'show_ui' => true,             'show_admin_column' => true         );              register_taxonomy( 'reference_type', 'attachment', $args );     }     add_action( 'init', 'wptp_add_reference_type_taxonomy' );      Options to add and modify items in that taxonomy show in the admin panel. However, when I got a page like http://sitehere.com/reference_type/sample-item I get redirected to a Page Not Found in index.php and not the custom page I have set up for this taxonomy in taxonomy.php In addition, when I add a reference type "sample item" to a media item it will show up in the Library tab, but in the Reference Type tab, it will say there are 0 items under "sample item". In general, when i try to print a list of items in this taxonomy it does not show up (I am using code suggested in the WP codex). **SOLUTION** Adding `'rewrite' => array('slug' => 'reference_type', 'with_front' => false)` fixed my issue of not being able to view individual item pages. Adding `'update_count_callback' => '_update_generic_term_count'` fixes my issue with the count not updating


title: Changing permalink name redirects to another template?

text: I'm creating a template with a few templates with names `page-contact.php`, `page-portfolio.php` and `page-blog.php`. The problem is that when I select a **Defaul Template** for a page (I expect it to open `page.php`) and rename the page permalink to **sitename.com/contact** the page starts using the `page-contact.php`.. Why is that, why is the URL telling WordPress what template to use if a Default one i chosen? Is this intended behavior?


title: Sorting search results

text:
I am trying to develop a better way of searching my website. I want:   * Results to be displayed by relevance   * Pages to be listed first, posts should be listed after pages   * Searched terms to be highlited in post excerpts. This is a list of requirements from the most important to the least important. I am not sure how I can modify my code to fulfil those requirements Could you please help me with at least first two of them? Here is a piece of code which performs the searching:
                 <?php                      $s = get_search_query();                     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                          // CHECK IF FILTERS ARE APPLIED                     if (isset($_GET['filter'])) {                         $filter = $_GET['filter'];                         if($filter == 'pages')                             $searcharray = array( 'page' );                         elseif ($filter == 'posts')                             $searcharray = array( 'post' );                         else                             $searcharray = array( 'post', 'page' );                     } else {                         $searcharray = array( 'post', 'page' );                     }                          echo '
Filters:
                         Display posts                         Display pages                         Display posts and pages                     ';                                            $newsposts = new WP_Query(                     array(                         'post_type' => /*array( 'post', 'page')*/  $searcharray,                         'posts_per_page' => 10,                         'paged' => $paged,                         's'=>$s));                     if ($newsposts->have_posts()) : while ($newsposts->have_posts()) : $newsposts->the_post();                  ?>

<a href="<?php echo get_permalink(); ?>"><?php the_title(); ?>
                                  <?php $category = get_the_category();                                       ?>                             <a href="<?php echo get_category_link( $category[0]->term_id ) ?>"><?php echo $category[0]->name; ?>
                                 <?php the_excerpt(); /* the excerpt is loaded to help avoid duplicate content issues */ ?>                                 <?php echo ''.$langOptions['more'][ ICL_LANGUAGE_CODE ].'';?>


title: jquery not working correctly in plugin options page?

text: I have created my own plugin which has a custom script attached to it. I have added this in the correct manor like this:               add_action('admin_enqueue_scripts', 'add_search_script');     function add_search_script() {         wp_register_script('search', plugins_url('search.js', __FILE__) );         wp_enqueue_script('search');         }      If i add an alert to the top of the .js file, and then refresh the plugin page the alert appears. Simple alert like this:               alert ('test');      However if i try and hide something with js, noting happens? I target a class like this:               $(".simple").hide();      Which has no effect? I have also tried:               jQuery(".simple").hide();      Which again has no effect? Any ideas on what could be the problem?


title: Wordpress page content outside Wordpress

text: I have a strange request. Is it possible to load the content of a Wordpress page in a normal PHP page? For example I want to display the content of the wordpress page 4 in a PHP page that is on the same domain but is not a part of the wordpress installation? How? Thank you in advance


title: List Taxonomy terms along with their posts

text: I am trying to make a list of all my posts in a custom post type by the taxonomy term e.g. Term name 1 - post 1 - post 2 - post 3 Term name 2 - post 1 - post 2 - post 3 Term name 3 - post 1 - post 2 - post 3 I have found the function which lists the terms (get_terms) but can't work out a way to list the terms but also list the posts. Any help is appreciated


title: Debugging upload problem: What part of WP does actual image-resizing?

text: I have a problem when uploading large images: images larger then (approx) 2000x2000 aren't generating thumbnails. The file is uploaded fine, but no resized version are generated. No errors are shown. If I upload a smaller one, everything works fine and smaller sizes are generated (ex: `test-100x100.jpg`) I've contacted my hosting support because I thought this would be a `php-gd` problem, but support said everything was fine. Here what we have ruled out:   * Permission problems   * Out of disk space   * Out of memory (works fine on a server with half the amount of memory)   * Max upload limit (in WP and on server) We even tried another server with the exact same setup, and everything works fine here.   * I use a clean copy of the latest version WP. no plugins activated   * I've tried plugins which regenerates thumbnails, but even here all processes end successfully without errors, but no resizing was done. So I'm no trying to manually debug WP, and I'm having trouble finding the exact file where uploaded files are handled and resized. If found some classes in `/wp-includes`:   * `class-wp-image-editor.php`   * `class-wp-image-editor-gd.php` But it seems none of them are used during an upload. ( I've put `die()` in various functions)


title: Duplicate use of Wordpress plugin

text: I am stuck in a website and searching for someone to help me. I am using "Awesome Filterable Portfolio" plugin. I have to use it for different pages like Logo Design, Website, Print Graphics etc and other each page there will be some categories. So How I can use the plugin more than once? I have tried to change the name and everything, but when I install it shows one single menu in Dashboard with two plugins menu. Please help me: How i can use a plugin more than one time?.


title: How to prevent people from seeing certain articles in menus?

text: I found several plugins that prevent people from seeing certain widgets and posts. However, the posts I restrict still show up in all the places where you can see posts. They show up in search menus as well. I'd like to have several groups, as is native to WordPress, who can only see articles for them. For example, general consumption posts such as 'how to set up email' can be seen by everyone who has an account, but have other posts such as 'how to use a unix terminal' accessible to a certain level of account holder. Right now, people in the first group cannot read articles from the second group, but the title shows up on the posts page, so the first group knows they're being blocked, and they have a lot of titles that clutter their interface which they can't access. How can I prevent certain groups of users (say "readers") from even knowing that certain posts exist? I was thinking about copying widgets and pages and making a unique one for each group, but I was wondering if there was a better way.


title: How to change the image size in new Media Uploader (ie use medium vs thumbnail)

text: Is it possible to change the image size of the thumbnails in the new media uploader? For example images are currently displayed using the "thumbnail" image crop size and I would like them to be the "medium" image crop size.


title: How to prevent Wordpress from loading the jQuery library at the top of the page

text: I am developing a site that must be HTTPS secure and Wordpress is loading `<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>` at the very top of my page, before `<html>` and giving me an insecure error. I cannot find where this is being loaded from to prevent it from loading. Unfortunately I cannot show the site as it's a federal credit union site and it would be against our contract agreement for me to present this site publicly before it is complete. Here's a screenshot of the issue via Chrome web dev tools. http://oi50.tinypic.com/wjtchi.jpg


title: How to output taxonomy term (incl. link to archive) on author.php?

text: I have used the excellent tutorial of Justin Tadlock on Custom user taxonomies in WordPress to add a Blog custom taxonomy to both my Posts post_type as well as the user object_type. In his tutorial Justin then outputs a list of users that share the same (profession) taxonomy. I on the other hand would like to output the specific term of my Blog taxonomy on the `author.php` archive, together with some other user_meta-fields I already have added to the User Profile. How would I be able to accomplish this? Ideally it not only outputs the taxonomy term, but also a link to the term archive.


title: Custom Rewrite Rules

text: I am developing a plugin, the goal of which is to allow for a bookmark-able, pretty permalink search engine on a single page. To do so, I am using WP's rewrite rules to allow for the searching/permalinks. I need a structure as follows: http://example.com/courses/nc/charlotte Where /nc/ (or whatever is inputted/sent) would be accessible as a state variable later on, and the same for /charlotte/ as a city. My code so far is as follows: http://pastebin.com/PNHudKg5 (updated to include suggested code from below, which did not stop the query vars from being stripped). Currently, the `echo '<h2>'.$course->post_title.'</h2>';` works as it is outputted before the rest of WP loads. However, if I move the code from the query parse function to a shortcode, the query params /nc/charlotte disappear off of the url and are inaccessible by my shortcode. Am I missing some function that will keep the query parameters so I can use them on page? It seems like when the page loads, it strips the url, but before the page loads, they are still accessible. Or maybe I'm doing it wrong altogether? I've found so many different ways of using WP's rewrite rules that my head is spinning. WP provides documentation on the functions, but not how to hook them all together to build something with them. Also, I'm using Jan Fabry's Rewrite Analyzer plugin. When I type in http://example.com/courses/nc/charlotte, I get the correct match in the window below. So I know I've got _something_ right. **Updated info:** the shortcode was just a temporary means of executing code on the page. I actually need the page to utilize it's normal query in that it pulls the regular page content. The search results are supposed to be appended after the page content (hence the shortcode, or probably later - a page template). Therefore, I cannot REPLACE the query, I am building a new one, and adding the matched posts to the page in the area designated (again, currently a shortcode in the content; later will be a page template). My setup works awesome currently as I have it setup to use typical GET requests - like example.com/courses/?state=nc&city=charlotte The above url gets posts with meta where custom fields (in this case, state and city) match the city and state in the GET request. My goal is to move this functionality to WP Rewrite rules, like I mentioned above. Hope that makes it more clear.


title: How to "Global Ignore" / "Hell Ban" someone, restrict post visibility to the author only?

text: I'm looking for a way to deal with trolls by making any post they make invisible to everyone except them. This is known as a number of names "Global Ignore", "Hell Ban", "Troll Hack", "Tachy Goes to Coventry". How can I do that?


title: Rewrite vs Redirect from ?p={ID}

text: WordPress does a 301 from `http://example.com/?p=100` to `http://example.com/post-title/`, but I thought a URL rewrite was different from a redirect and therefore this wouldn't result in a 301. Can anyone clarify?


title: How to include DW Question & Answer plugin in front page template?

text: I tried using a shortlink code, but only the link is displaying and it isn't working either.               <?php the_shortlink('http://abc.com/?p=52'); ?>      I am using **DW Question & Answer** plugin and want to show question answer page in my blog. How to do it?


title: Get Taxonomy Term Title by it's URL

text: I have a URL - `http://localhost/products/product-name/` and I want to use this URL to retrieve the title `Product Name` This is out of loop, so the URL provided is all I have to work from. `Product Name` is obviously the name of the term, which has the URL `http://localhost/products/product-name/` I just need it so I can print it out on a particular place on the website. The url above denotes the taxonomy as `products` but this is a rewrite of `product_type` - I'm not sure if this'll affect the solution.


title: How to display only an excerpt of the content with custom post types?

text:
<?php     /*     Template Name: second     */     ?>               <?php get_header(); ?>               <?php query_posts(array('post_type'=>'event')); ?>         <?php if(have_posts()) while(have_posts()) : the_post(); ?>         <div id="post-<?php the_ID(); ?>" class="entry">
<?php the_post_thumbnail('full'); ?>

<?php the_title(); ?>

                 <?php the_content(); ?>                 <?php wp_link_pages(array('before' => '
'.__('Pages', 'cpotheme').':', 'after' => '
')); ?>

         <?php endwhile; ?>               <?php get_sidebar(); ?>     <?php get_footer(); ?>      The page acts like an index.php What should I amend in order to make the title as the link to the full page and make display only an excerpt of the content?


title: How to Save Different Settings Options Using Settings API and/or the Theme Optimizer

text: I would like to allow users to save different versions in the options panel using the Settings API and/or the Theme Optimzer. For instance, imagine that I have styled my site using via an admin panel or the theme optimizer. I like how it looks, but I want to experiment with a different look. The problem is that I don't want to lose the work that I have done. What I would like to be able to do is to name and save these styles and be able to reload them later on and use or edit them. Is that possible vis-a-vis the Settings API and/or the Theme Optimizer - and, if so, how could I do that?


title: Matrix problem with MathJax plugin

text: My code LaTex matrix is as follows: [latex]\begin{matrix} জাহাঙ্গীর খান\\ কালা জাহাঙ্গীর\\ ৩২\\ বাদল খান\\ নোয়াপুর \end{matrix}[/latex] But the output says: > >     Formula does not parse. >   Even following code is not working. [latex]\begin{matrix} নোয়াপুর \end{matrix}[/latex] I have used Unicode Bangla here as matrix elements.


title: Wordpress site not redirecting properly

text: We have developed a wordpress site recently, if i just type http://example.com in browser i will get the site, but if i type www.example.com it is not displaying anything, what happened to it, is there any problem to my htaccess? My site url and homeurl is http://example.com, i have tried with different options in my htaccess badluck, i just want to redirect the www.example.com to http://example.com.


title: Custom post class, generate unique id from 1 to x depending on amount of posts?

text:
I am building a custom post type, where I have a little trouble generating the ID:s the way I want to. The idea of the post class is to generate a table with ID and post title. I wonder if it is possible to generate unique ID depending on the amount of posts in the class, starting from 1. My plan with the post class or type is that it will be used as a FAQ where the title launches a boostrap modal with the answer. Here is the relevant code:               function cptModal_frontend($atts){     $id = rand(0, 999); // use a random ID so that the CSS IDs work with multiple on one page     $args = array( 'post_type' => 'cptModal', 'orderby' => 'menu_order', 'order' => 'ASC');     $loop = new WP_Query( $args );     $modals = array();     while ( $loop->have_posts() ) {         $loop->the_post();         if ( '' != get_the_title() ) {             $title = get_the_title( get_the_ID());             $content = get_the_excerpt();             $modals[] = array('title' => $title, 'content' => $content);         }     }     if(count($modals) > 0){         ob_start();         ?>

                 #	                 Fråga:

             <?php foreach ($modals as $key => $title) { ?>
               <?php echo $id;?>	               <a href="#cptmodal_<?php echo $id; ?>" data-toggle="modal"><?php echo $title['title'];?>
             <?php } ?>

                   <?php foreach ($modals as $key => $title) { ?>     <div id="cptmodal_<?php echo $id; ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<?php echo $title['title'];?>

<?php $title['content'] ?>

     <button class="btn btn-custom" data-dismiss="modal" aria-hidden="true">Stäng</button>

     <?php } ?>              <?php }     $output = ob_get_contents();     ob_end_clean();          // Restore original Post Data     wp_reset_postdata();              return $output;      Complete code:               // Custom Post Type Setup     add_action( 'init', 'cptModal_post_type' );     function cptModal_post_type() {     $labels = array(         'name' => 'Modals',         'singular_name' => 'Modal',         'add_new' => 'Add New',         'add_new_item' => 'Add New modal',         'edit_item' => 'Edit modal',         'new_item' => 'New modal',         'view_item' => 'View modal',         'search_items' => 'Search modals',         'not_found' =>  'No modal',         'not_found_in_trash' => 'No modal found in Trash',          'parent_item_colon' => '',         'menu_name' => 'FAQ Modals'     );     $args = array(         'labels' => $labels,         'public' => true,         'exclude_from_search' => false,         'publicly_queryable' => false,         'show_ui' => true,          'show_in_menu' => true,         'query_var' => true,         'rewrite' => true,         'capability_type' => 'page',         'has_archive' => true,          'hierarchical' => false,         'menu_position' => 21,         'supports' => array('title','excerpt', 'page-attributes')     );      register_post_type('cptModal', $args);     }          // FRONT END          // Shortcode     function cptModal_shortcode($atts, $content = null) {     // Set default shortcode attributes     $defaults = array(         'backdrop' => 'true',         'keyboard' => 'true',         'show' => 'true'     );          // Parse incomming $atts into an array and merge it with $defaults     $atts = shortcode_atts($defaults, $atts);          return cptModal_frontend($atts);     }     add_shortcode('FAQ_modal', 'cptmodal_shortcode');     // Display latest WftC     function cptModal_frontend($atts){     $id = rand(0, 999); // use a random ID so that the CSS IDs work with multiple on one page     $args = array( 'post_type' => 'cptModal', 'orderby' => 'menu_order', 'order' => 'ASC');     $loop = new WP_Query( $args );     $modals = array();     while ( $loop->have_posts() ) {         $loop->the_post();         if ( '' != get_the_title() ) {             $title = get_the_title( get_the_ID());             $content = get_the_excerpt();             $modals[] = array('title' => $title, 'content' => $content);         }     }     if(count($modals) > 0){         ob_start();         ?>

                 #	                 Fråga:

             <?php foreach ($modals as $key => $title) { ?>
               <?php echo $id;?>	               <a href="#cptmodal_<?php echo $id; ?>" data-toggle="modal"><?php echo $title['title'];?>
             <?php } ?>

                   <?php foreach ($modals as $key => $title) { ?>     <div id="cptmodal_<?php echo $id; ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<?php echo $title['title'];?>

<?php $title['content'] ?>

     <button class="btn btn-custom" data-dismiss="modal" aria-hidden="true">Stäng</button>

     <?php } ?>              <?php }     $output = ob_get_contents();     ob_end_clean();          // Restore original Post Data     wp_reset_postdata();              return $output;     }          ?>


title: update post meta front end

text: Why doesent this work?! I want to update my postmeta "doors" from frontend               <?php     if ( isset( $_POST['submit'] ) )         { //if nonce check succeeds.             global $post;             $postid = $post->ID;             $data = $_POST['doors'];             update_post_meta($postid, 'doors', '2' );             echo self::$auto_id. 'doors'.'2';             echo $postid;          }               $doors = get_post_meta($auto->ID, 'doors', true);     ?>          <form method="post" action="">        <input type='text' name='doors' value='<?php echo $doors ?>' />        <input type='submit' value='save' />     </form>      This code display the door value in my input but if i write something else there then click save nothing happends... it doesent save my new value. Why?:(


title: Wordpress Domain Mapping shows new domain in place but takes me to the sub domain

text: I have multiple domains that run on the same IP address in media temple. I input this IP "8.5.06.06" into the "domain mapping" server ip. I then set up the "domains" section and selected the "id" of my subdomain "demo.abc.com" I would like mapped and put in my domain "cba.com" and deselected "primary" It displays the domain "cba.com" the subdomain "demo.abc.com" is mapped to, but when I go to "visit site" it takes me to the subdomain "demo.abc.com" I clicked on and not the mapped domain "abc.com" This is driving me crazy! Am I missing something? Thanks for your patience, I am a complete noob at this


title: Order posts by separate menu order for different sub-categories

text: My scenario is as follows: **Categories:**                1. Category A          - Sub-Category A1          - Sub-Category A2          - Sub-Category A3      2. Category B          - Sub-Category B1      3. Category C      4. Category D      The **Category** template has a list of all posts that belong to that relevant **Category** and are ordered by **Menu_Order**. My problem is that if a single Post happens to fall under multiple categories ( _Sub Category A1 and Category C_ ), I can only set a generic menu_order in Wp-Admin and it is not **Category** specific. I would like a **Post** to be ordered something like this: Single Post               - Category A: Menu_order 3     - Category A2: Menu_order 2     - Category C: Menu_order 11      Is there a way for me to set the menu_order for a post when it's under **Category A1** and then another menu_order for **Category C**? I've read this: Different post sort order within different categories and I think this may help, but I'd like to know if there is a quicker and simpler way. I'm using the latest WordPress 3.8, Advanced Custom Fields 4.2.2 (to populate post content) and I've created a CPT in my functions.php. **Edit:** I've begun constructing the custom fields in my **Category** Edit screen as suggested in the first answer. Currently it is a jQuery sortable ul list of Post titles, each with the relevant **post_ID** as the id of the li I think the best approach for me now would be to have an AJAX call after every jQuery re-sort that sends an array of post_IDs to a function that will write to the DB. **Edit 2:** I've successfully managed to store the sortable order in a database using a function. My next step is to look into WP_Query and seeing if we can use an array of posts to determine an output order.


title: Problems with permalinks (.htaccess not working)

text: I would like to use permalinks but they are not working. Whenever I use permanlinks like /%postname*/ are something else that differs from the default ... I get an 404-error. Calling php_info I can see that Loaded Modules contains mod_rewrite.               # BEGIN Better WP Security     Options -Indexes          <files .htaccess>     Order allow,deny     Deny from all     </files>          <files readme.html>     Order allow,deny     Deny from all     </files>          <files readme.txt>     Order allow,deny     Deny from all     </files>          <files install.php>     Order allow,deny     Deny from all     </files>          <files wp-config.php>     Order allow,deny     Deny from all     </files>          <IfModule mod_rewrite.c>     Options +FollowSymLinks     RewriteEngine On          RewriteRule ^wp-admin/includes/ - [F,L]     RewriteRule !^wp-includes/ - [S=3]     RewriteCond %{SCRIPT_FILENAME} !^(.*)wp-includes/ms-files.php     RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]     RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]     RewriteRule ^wp-includes/theme-compat/ - [F,L]          RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK) [NC]     RewriteRule ^(.*)$ - [F,L]          RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(bash|git|hg|log|svn|swp|cvs) [NC,OR]     RewriteCond %{QUERY_STRING} etc/passwd [NC,OR]     RewriteCond %{QUERY_STRING} boot\.ini [NC,OR]     RewriteCond %{QUERY_STRING} ftp\:  [NC,OR]     RewriteCond %{QUERY_STRING} http\:  [NC,OR]     RewriteCond %{QUERY_STRING} https\:  [NC,OR]     RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]     RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [NC,OR]     RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>|ê|"|;|\?|\*|=$).* [NC,OR]     RewriteCond %{QUERY_STRING} ^.*("|'|<|>|\|{||).* [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(%24&x).* [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(%0|%A|%B|%C|%D|%E|%F|127\.0).* [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(request|select|concat|insert|union|declare).* [NC]     RewriteCond %{QUERY_STRING} !^loggedout=true     RewriteCond %{QUERY_STRING} !^action=rp     RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$     RewriteRule ^(.*)$ - [F,L]          </IfModule>     # END Better WP Security          # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>     # END WordPress      Whenever I change the permalink-structure a 404error occurs. The apache's error_log shows no errors regarding this problem. The OS is an Suse Linux. Apache/2.2.12. In the httpd.conf there are the following relevant entries:               # forbid access to the entire filesystem by default     <Directory /srv/www/htdocs>           Options +FollowSymLinks           AllowOverride All           Order deny,allow           Deny from all     </Directory>          <Directory />         Options +FollowSymLinks         AllowOverride All         Order deny,allow         Deny from all     </Directory>          # use .htaccess files for overriding,     AccessFileName .htaccess     # and never show them     <Files ~ "^\.ht">         Order allow,deny         Deny from all     </Files>      Does someone know what I could check to get the permalinks running? I cannot find out what I am missing.


title: What is the wordpress Git hub Repo master on beta?

text: I am fairly new to Wordpress and have started checking out the latest version from Github. I assumed that the latest version would be master but it seems the latest is 3.9-branch   1. Is the 3.9 branch the correct one to use?   2. Can I revert to the production version if I have installed beta on a site?   3. Is the Github version of Wordpress always up to date?


title: List all posts types in admin edit.php

text: I am trying to show a list of all posts types in the admin. For now i can only show a list of particular post type, for example: wp- admin/edit.php?post_type=video , but how can i show a list of all posts types (preferably using the "url filter", for example : wp- admin/edit.php?post_type=video&post_type=music (not working). I tried bunch of different variations : ?post_type=video&post_type=music and ?post_type=video&music, ?post_type=video;music , ?post_type=video,music none of those worked... Is there a way to do that? Will appreciate your help.


title: multisite - move main site to subdomain

text: I just started using Wordpress multisite. I have a development site set up on the main domain which I want to now move to a subdomain. How do I go about doing this? Ie. I need domain.com to become staging.domain.com, so I can set up a new main site. Any pointers would be a great help, thanks!


title: wordpress powered site's google search excerpt showing casino links

text: I have wordpress blog i just checked Google search result of my site, they are showing excerpt containing text like below > "best site should try out for demo mode of gaming variants to adopt good > gaming Participate in casino games online to take gamble online and increase > your ..." When I visit site page source shows nothing related to casino.I then used google structured data testing tool in Google Webmasters and checked Page Html it has that malicious code containing casino links .That Malicious code is attached here in following link. **Link to the malicious code** I do not know programming. Please help me get rid of this problem.


title: <!--nextpage--> assumed as comment line

text: I created very simple php loop which generates image links for given number. This is the code               <?php $im = stripslashes(get_option('tm_alim'));     for ($i=1; $i<=im; $i++)       {       echo "<img alt='' src='http://sitename.com/"  . $i . "/00"  . $i . ".jpg' />      <!--nextpage-->";       }     ?>      As you can see i am trying to print code right after every image which will make pagination. Each image will be shown in a page. This code is in a page template and the page is attached to that template. But the problem is code is assumed as comment line and it is not showing even in html page source. Is there anyway to fix this or any alternative would be great Or is there any way to tell wordpress total number of pages should be the $im or count the images and create pagination for each. i am sure there would be various ways to do it. thanks


title: How do I list custom taxonomy terms without the links?

text: I've searched far and wide to try and find an answer to my question. I'm hoping I can get help here. Here goes... I'm currently retrieving the terms of my custom taxonomy using: `<?php echo get_the_term_list( $post->ID, 'skills', '<ul><li>', '</li><li>', '</li></ul>' ); ?>` What I'm trying to do is retrieve these same post-specific custom taxonomy terms in a list without them being output as links. I've tried all of the following "solutions," but none of them work. Any help would be appreciated. **Returns the post-specific terms in one long string that can't be put in a list:** `$terms_as_text = get_the_term_list( $post->ID, 'skills', '<ul><li>', '</li><li>', '</li></ul>' ) ; echo strip_tags($terms_as_text);` Returns a list of all the terms used across all the custom post types: `<ul> <?php $args = array( 'taxonomy' => 'skills', 'orderby' => 'ID', 'order' => 'ASC' ); $categories = get_categories( $args ); foreach($categories as $category) { echo '<li> '. $category->name . '</li>'; } ?> </ul>` Returns nothing: `<?php $args = array('orderby' => 'name', 'order' => 'ASC', 'fields' => 'all'); wp_get_object_terms( $post->ID, $skills, $args ); ?> ` I've even tried get_the_terms, get_terms, and get_categories to no avail. I'm strugglin' here. Any help would be appreciated. Thanks in advance.


title: Custom Post Type Category Link

text: I have a loop of posts for a custom post type I built. How can i call the link of the category/taxonomy for each post? Thanks


title: attach CPT data to a taxonomy

text: I'm trying to create a site where a 'Game' has a set of information (im thinking it will be a custom post type, with a 'link' field, 'developer' as a taxonomy, 'price', 'release date' and some other information. I want to be able to make a post, in a category (such as 'reviews') which links to the relevant game and can pull some of this metadata into a template. SO... the review is it's own post, it has it's own info, tags etc. BUT. is linked to the 'Game' so i can pull in the 'price', 'developer' information etc. AND when i go to the game page, i should be able to find the articles linked to it via the taxonomy. Is there a way to do this? I have given it some substantial googling to no avail. Any ideas, thoughts or links would be greatly appreciated.


title: Insert taxonomy slug into loop class

text:
I am a loss here since I have looked at dozens of tutorials and posts all over the internet on how to get the slug for a taxonomy and nothing I try seems to work. The taxonomy shows up fine when I want to edit the post and everything seems to be working fine, however I cannot seem for the life of me to get Wordpress to give me the slugs I want. I am really frustrated and irritated on how complicated the process of saying "for the array of posts you already have, include the taxonomy for each one". _sigh_ In reality, all I want is to get the custom taxonomy slug that has been selected for each post. I have a portfolio page that I want to make interactive with jquery and I am trying to use the taxonomy slug as the anchors for the jquery script. All I need from Wordpress is to see the post it's already giving me all of it's information and to include the taxonomy it has been already linked to. Then echo that slug into the class of the LI tag. Here is the code:
         <?php         $post = 'project'; // custom post type         $i=1;         query_posts("post_type=$post&showposts=-1&order=asc");         $post_count = wp_count_posts();         while(have_posts()) : the_post();         $myExcerpt = get_the_excerpt();         $tags = array("
", "
");         $myExcerpt = str_replace($tags, "", $myExcerpt);         $terms = get_the_terms( $post->id, 'project-type' ); // get an array of all the terms as objects.              $terms_slugs = array();              foreach( $terms as $term ) {             $terms_slugs[] = $term->slug; // save the slugs in an array         }     ?>         <li class="project <?php echo $terms_slugs[$i]; ?>">             <a href="<?php the_permalink(); ?>" id="project_<?php echo $id; ?>" class="project_frame">                 <?php the_post_thumbnail('full', array('class' => 'project_img')); ?>
<?php the_title(); ?>
<?php echo $myExcerpt; ?>

         <?php              $i++;         endwhile;         wp_reset_query();     ?>
      Hopefully someone can help me with this. UPDATE: Figured it out. Here is the corrected code.
                         <?php                             $post = 'project'; // custom post type                             $i=0;                             $counter = 0;                             query_posts("post_type=$post&showposts=-1&order=asc");                             $post_count = wp_count_posts();                             while(have_posts()) : the_post();                             $myExcerpt = get_the_excerpt();                             $tags = array("
", "
");                             $myExcerpt = str_replace($tags, "", $myExcerpt);                                  $slugs = get_terms('project-type');                             foreach($slugs as $slug) {                                 $slug_array[$i] = $slug->slug;                                 $i++;                             }                         ?>                         <li class="project <?php echo $slug_array[$counter]; ?>">                             <a href="<?php the_permalink(); ?>" id="project_<?php echo $id; ?>" class="project_frame">                                 <?php the_post_thumbnail('full', array('class' => 'project_img')); ?>
<?php the_title(); echo $i;?>
<?php echo $myExcerpt; ?>

                         <?php                             $counter++;                             endwhile;                             wp_reset_query();                         ?>


title: Wordpress wp_redirect error

text: I am trying to redirect this page if the user is logged in or not be i keep getting this error               Warning: Cannot modify header information - headers already sent by (output started at /home/*******/*********.com/wp-content/plugins/graph2.php:54) in /home/*******/*********.com/wp-includes/pluggable.php on line 934      Im using this redirect method               <?php if ( is_user_logged_in() ) {              echo '';          }              else {          wp_redirect( 'http://www.example.com' );             }      ?>      I cant seem to figure out what is wrong. :) thanks


title: just show the field comment by clicking button

text: when we open a post, we at the bottom of the page field to post a comment   I would like to hide this field.   if there are comments, usually shows them   however to leave a comment, click a button   with this, the field appears to leave a comment      Anyone have a clue how to do this?   Through either normal or ajax


title: Unable to pass variable

text: I am trying to pass number of post show from widget.I stored it as $entry my code               <?php query_posts( array('post_type' => array('post'),'order' => 'DESC','posts_per_page' => '.$entry.') ); ?>      Thanks


title: I Made Wordpress Multisite. And Now Everything Doesn't Display Properly

text: I installed Ubuntu 10.4 then I installed Bitnami LAMP stack then I installed bitnami wordpress module then I tried to make the site into a multisite by following these instructions: http://wiki.bitnami.org/Applications/BitNami_WordPress_Multisite#How_to_add_several_WordPress_Multisite_blogs_with_different_domains.3f AND http://wiki.bitnami.org/Applications/BitNami_WordPress_Multisite I can elaborate if needed: I enabled multisite in my `wp-config.php` file. Then I created a network using the wordpress dashboard. I was given two blocks of text to copy and paste 1 block into my wp-config.php file and one into my `.htaccess` file. I did that and now I get this: When I go to my `mywebsite.com` I get this (this was there before I switched to multisite): ![before switch](http://i.stack.imgur.com/no2A9.jpg) If I go to `mywebsite.com/wordpress` I get this (this used to be a functioning wordpress theme): ![/wordpress](http://i.stack.imgur.com/Bbg65.jpg) If I click on "My Blog" it redirects to 1mywebsite.com (where the "1" came from I have no idea) If I try to login by going to `mywebsite.com/wordpress/wp-login` I get this: ![wp-login](http://i.stack.imgur.com/H5AcO.jpg) and if I enter my user and password it redirects me to mywebsite.com/wp- login.php and gives me "Not Found" The requested URL `/wp-login.php` was not found on this server.               NameVirtualHost *:80         <VirtualHost *:80>         DocumentRoot /opt/lampstack-5.3.16-0/apps/wordpress         ServerName mywebsite.com         ServerAlias www.mywebsite.com     </VirtualHost>


title: Page comes up blank using w3 total cache

text: Im using the W3 Total Cache plugin on my site, and I made page using the wp_list_comments and for some reason the page keeps coming up blank, it comes back after I disable the plugin but when i enable it everything goes blank again does anyone have a suggestion on how iI can fix this, im new to this plugin. thanks


title: Parent pages not found with pretty permalinks

text: I'm building a site and for some reason all the parent pages are 404ing, only sub-level pages are displaying with pretty permalinks. If I use default permalinks, everything works fine. I've tried disabling all the plugins & deleting htaccess and having Wordpress recreate the file, nothing works. Any ideas? Here's the site: http://www.855gotclog.com


title: How to stop comments widget conflicting with theme comments

text:
I have a widget that retrieves and displays the latest comments for a WordPress site. It displays the comment author, Gravatar, comment and date / time. The function to display the comments is in a class. The issue that I am having is that whenever i display this widget it messes up or conflicts with the number of comments that are returned for my WordPress theme. Example. In the widget choose to display 5 comments. On a page on the site I have a post that has 8 comments. When the widget is enabled only 6 of those 8 comments are displayed. If I disable the widget, all the comments display. This is the function to display the comments               /**          * Retrieves the latest comments          *          * Shows a list of latest comments ordered by the date added          *          * @param int $limit - The number of posts to display          * @param int $chars - The number of characters to display for the post body          * @param int $size - Size of the comment Gravatar          * @param boolean $displayCommentsIcon - Whether to display the comment Gravatar          *          */          public function aaw_get_latest_comments($display_comments_icon = true, $comments_icon_size = 50, $comments_amount = 5, $comments_chars = 35, $display_comments_date = true) {             global $comments;                  $com_excerpt = '';                  $aaw_comments = get_comments(array('number' => $comments_amount, 'status' => 'approve'));                  if($aaw_comments){                 foreach((array)$aaw_comments as $aaw_comment){                     if($comments_chars > 0) {                         $com_excerpt = self::aaw_snippet_text($aaw_comment->comment_content, $comments_chars);                     }                          echo '
';                              if($display_comments_icon == 'true'){                             echo 'comment_ID) ).'" title="'. __('Commented on: ', $this->hook). $aaw_comment->post_title.'">';                             echo get_avatar($aaw_comment, $comments_icon_size);                             echo '';                         }                         echo '
';                         echo 'comment_ID) ).'" title="'. __('Commented on: ', $this->hook). $aaw_comment->post_title.'">';                             echo ''.strip_tags($aaw_comment->comment_author).': '.strip_tags($com_excerpt).'...';                         echo '';                         if($display_comments_date == 'true'){                             echo ''.get_comment_date('j M Y',$aaw_comment->comment_ID).' '.__('at', $this->hook).' '.get_comment_date('g:i a',$aaw_comment->comment_ID).'';                         }                         echo '
';                     echo '
';                      }             } else {                 echo '
'.__('No comments available', $this->hook).'
'."\n";             }                   }      This is how I call the function:               <?php $advanced_activity_widget->aaw_get_latest_comments($display_comments_icon == 'true' ? 'true' : 'false', $comments_icon_size, $comments_amount, $comments_chars, $display_comments_date == 'true' ? 'true' : 'false'); ?>      At first I thought is was the Gravatar causing the conflict however I removed it and it didn't make a change. Any help would be greatly appreciated. Thanks


title: wp_get_attachment_url not working

text:
I have a template file which shows the posts of a category called downloads. for each posts i have attached a pdf file. I have given a link to download the pdf file on the page. But when i click the download link it goes to the post page and from there i have to click to download the file. Is there any way to directly download without going to the post. ? I have tried using wp_get_attachment_url as the hyper-reference.but it is not working.The code that i have used is below:               <?php /*     Template Name: Downloads Template     */     ?>     <?php get_header(); ?>     <?php      $recent = new WP_Query("cat=7&orderby=title&order=ASC");      while($recent->have_posts()):$recent->the_post();     $desc_values = get_post_custom_values("description");     ?>     <div id="download_featured_image" class="<?php the_ID(); ?> download_image_title_desc">              <a href="<?php the_permalink() ?>" rel="title">         <?php             if ( has_post_thumbnail() )  {                  the_post_thumbnail();             }         ?>       <?php if ( is_user_logged_in() ) {             echo "Download";          }?>          <?php if( !(is_user_logged_in()) )         {             echo "Please signup/login to download this file";         }         ?>
             <?php                  if( is_array( $desc_values ) )                 {                     foreach($desc_values as $key => $value );                     echo "$value</n>";                  }             ?>

     <?php endwhile ?>     <?php get_footer(); ?>      I want to give the link to the uploaded pdf in the href which i have left blank. Can someone help me?


title: Hook into the loop via a plugin, and output something after every X post?

text: I have a plugin where I want to output ads after X number of posts on the home page. The home page is step 1, but things like archives should be possible too once I get the code for the home page. How do I hook in to post loops and say something like "after every loop, increment a counter, and then if the counter = my number, output an ad". I can write all the logic for this code myself, but where to hook/implement my code is confusing.


title: Restrict Search Results to Post Author

text: Is there a way to restrict search results to only those posted by the logged in user? I have a front-end form the user fills out. Every user has a front-end dashboard and is able edit their own post. Since they may have many posts I would like them to be able to search for their own posts, but not display posts from other authors (this would only complicate things) Is there a way to do this?


title: Script loaders vs wp_enqueue_script

text: My Wordpress theme has a lot of .js scripts running and it takes plenty of time to load them all one by one. I would love to use a script loader like HeadJS or yepnopejs to speed things up. But... what about wp_enqueue_script? I'm using it to load every single script (and I believe that's the BEST & ONLY way to go?). Won't loading scripts using script loader instead of wp_enqueue_script create any conflicts with plugins, widgets etc.? What about enqueuing the script loader itself?


title: Can a shortcode included in post content add styles to the <head>?

text:
I have a shortcode that iterates through a list of custom post types and, as part of displaying them, creates a block. In HTML5, it is illegal to have a style block outside the header (maybe in other versions too, but we are using HTML5). I am looking for a way that my shortcode can insert its block into the head. Any suggestions? This is the page: http://2011.solarteam.org/sponsors/gift-recognition/view-of- living-room The shortcode is called twice on a page.   Once like this `[interactive slug='sponsor-map-living-room' show="image"]Select an item to learn more about its sponsor.[/interactive]` to make the image.   Once like this `[interactive slug='sponsor-map-living-room' show='list' headertitle='WaterShed Featured Sponsors: Living Room' /]` to make the list at the bottom. I can't put it in the template because the template does not know which `slug` goes on which page. * * * Here is a simplified version of the shortcode processing code:
<?     foreach($map->points as $point){         $result = "";         if(!in_array($point->pointer_type, $all_styles['regular'])){             $all_styles['regular'][$point->pointer_type] = "                 .pointer_style_" . $point->pointer_type . " {                     width: " . $point->pointer_width(). "px;                     height: " . $point->pointer_height(). "px;                     background: transparent url('/images/interactive/pointers/" . $point->pointer_URL() . "');                 }             ";         }         ob_start(); ?>         <li class="tag_point sponsor_data_point pointer_style_<?php echo $point->pointer_type?>" id="point_<?php echo $point->ID ?>" data-in="#point_<?php echo $point->ID ?>_info" data-hover-style="pointer_s_style_<?php echo $point->selected_pointer_type?>" style="left:<?php echo $point->x - ($point->pointer_width()/2) ?>px;top:<?php echo $point->y - ($point->pointer_height()/2)?>px;">         <div class="tag_info" id="point_<?php echo $point->ID ?>_info">
<?php echo $point->contribution ?>

<?php echo $point->description ?>

         <?         $result .= ob_get_clean();         $result .= "
\n";         echo $result;     }     ?>
           The `<style>` tag is not allowed there in HTML5, so I want to get it into the head of the page.


title: Retrieve or Query Pages by ID

text:
I have a problem with my code, I want to display 3 specific pages on my homepage but my code is not working.. here's the code..               <?php $args = array(                           'post_type' => 'page',                           'post__in' => array(3,5,7)                           );                         query_posts($args);                         while (have_posts()) : the_post();                         $do_not_duplicate = $post->ID; ?>

<?php the_time('M j, y');?>

<a STYLE="text-decoration:none" href = "<?php the_permalink();?>"><?php           the_title();?>
                              <?php the_excerpt();?>                              <?php endwhile; ?>


title: Show Social Sharing Buttons And Facebook Comments In Lightbox Modal Dialog (Image Overlay)?

text: I would like to show Facebook comments and share buttons in the lightbox modal dialog (image overlay) that pops-up when I click on an image in gallery. A lot like what they have done on this website for instance (if you click on one of the thumbs nails you will see what i mean.) How do I do it?


title: Is it bad to use a lot of Custom Meta Fields?

text: I am curious without doing a ton of benchmarks, how others feel about using several custom meta fields on a blog post? I am talking strictly performance wise, does it slow things down a lot if using a lot of fields, should we try to keep them to a minimum? Currently for a regular blog post, I have a custom meta field for...   * Title: Used for page title   * Description: Used for meta description and social share description/text for Facebook and Twitter shares   * Keywords: Used for meta keywords So I have 3 extra meta fields which are used so every article will have relevant SEO meta, also for when a user shares the article on Social networks, I can set the title and description easily. I am wanting to add another field for Twitter #hashtags which I can then insert on Twitter shares, these will be similar to my articles tag taxonomy but may differ some so that is why I am thinking a custom meta field is the way to go. I am also in the process of doing a custom post type for a portfolio which would also in addition to the above custom meta would add several more meta fields for this post type. That is why I am curious about the performance impact of adding several meta fields? Please share your thoughts


title: Add /demo/ slug with rewrite rule

text: > **Possible Duplicate:**   >  Add extra parameters after permalink? I need to add a slug to every post. **Current permalinks** http://www.my-domain.com/2012/01/01/my-post-title/ or   http://www.my-domain.com/my-post-title/ **Rewritten permalinks** http://www.my-domain.com/2012/01/01/my-post-title/demo/ or   http://www.my-domain.com/my-post-title/demo/ **Additional information**   * My demo-page should not return a 404-page.   * I should be able to get the current ID of the post "my-post-title" from my demo-page.


title: Using redirection plugin to pass URLs as lowercase to wordpress

text: have been experiencing a problem yesterday. My site is in Hebrew language. MY site is built on Wordpress. The problem is related to escaped encoded posts URL only. IF the post URL has escaped encode in uppercase it works, if in lowercase, it returns 404. I want both to pass without a problem. For example: http://domain.com/%d7%9e%d7%a6%d7%9c%d7%9e%d7%95%d7%aa/ (this is what my site have) Google crawled it as: http://domain.com/%D7%9E%D7%a6%D7%9C%D7%9E%D7%95%D7%AA/ (this returned 404) Is there any option to use the REDIRECTION plugin for wordpress to PASS (not redirect) the URLs o wordpress will see them as lowercase?


title: Can you have seperate sidebars for multiple taxonomy archives?

text: I have a site that uses multiple query taxonomy archives. i.e www.sitename.com/taxonomy1/taxonomy2/taxonomy3 Is there a plugin or method to create a dedicated sidebar for each queried taxonomy archive? Essentially, there will be 1000 or so archives and i would like to be able to create a unique sidebar for each. Is this possible? Thanks in advance Paul


title: Activate blog hook

text: I want to hook a function upon activation of a blog in wordpress multisite. I have this,               add_filter( 'add_signup_meta', 'custom_add_signup_meta' );          function custom_add_signup_meta ( $blogmeta = array() ) {                  $the_country = $_POST['country-origin'];             $d_currency = $_POST['user_currency'];             $d_zone = $_POST['state-origin'];                  $blogmeta['countries_id'] = $the_country;             $blogmeta['default_currency'] = $d_currency;             $blogmeta['zone_id'] = $d_zone;              return $blogmeta;          }          add_action( 'wpmu_activate_blog', 'insert_custom_datas1', 10, 3 );          function insert_custom_datas1($blog_id, $blogmeta) {             global $wpdb, $blogname, $blog_title, $errors, $domain, $path;             $wp_blogs = $wpdb->base_prefix . "blogs";                  $wpdb->query("UPDATE `" . $wp_blogs . "` SET `countries_id`='".$wpdb->escape($blogmeta['countries_id'])."', `default_currency`='".$wpdb->escape($blogmeta['default_currency'])."', `zone_id`='".$wpdb->escape($blogmeta['zone_id'])."' where `blog_id` = '" . (int)$blog_id . "'");          }      However, its not working.. what suppose to be the problem? Thanks.


title: Displaying only posts from a certain category on my custom page template

text:
I want to create proper pages for my post categories, rather than just a default category page. So for example, I'm going to create a Video page and have a load of information about my videos, and then below this info, bring in the loop of posts that appear in the Video category. So I'm attempting to do the following:   * Copying my themes page.php and calling it page-categoryname.php and adding a title to the new page template.   * Finding the loop and limiting the categories that can display in that loop. Does that sound like the right way to go about it? And how exactly would you edit the loop in the below page code to only display posts from a certain category id?                  <?php get_header(); ?>     <?php while ( have_posts() ): the_post(); ?>          <div class="main group <?php echo wpb_option('general-sidebar','sidebar-right'); ?>">

                 <article id="entry-<?php the_ID(); ?>" <?php post_class('entry group'); ?>>                          <?php get_template_part('partials/page-image'); ?>                     <?php get_template_part('partials/page-title'); ?>
                         <?php the_content(); ?>

                      <?php comments_template(); ?>

                <?php get_sidebar(); ?>

          <?php endwhile; ?>     <?php get_footer(); ?>      Any help would be great. R


title: ACF Gallery & mqTranslate, Title and Description not displaying in other languages

text:
I am using mqTranslate and ACF Gallery to build a gallery. Below is the code.               <?php $images = get_field('home_slides', 'options'); ?>

             <?php foreach( $images as $image ): ?>
                     <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php echo $image['title']; ?>

<?php echo $image['description']; ?>

             <?php endforeach; ?>

      How can I display Title and Description in other languages? Since both [:en] and `<!--:en-->Title<!--:-->` are not working.


title: alternating classes on wp_list_pages

text:
I'm trying to have alternating classes on the list created by wp_list_pages. Currently I have extended the Walker_page class updating the start_el function as follows:               class Sidebar_walker extends Walker_page {          var $alternate = 'background_1';          function start_el( &$output, $page, $depth, $args, $current_page = 0 ) {         if ( $depth )             $indent = str_repeat("\t", $depth);         else             $indent = '';              extract($args, EXTR_SKIP);         $css_class = array('page_item', 'page-item-'.$page->ID);              $alternate = ($alternate != 'background_1') ? 'background_1' : 'background_2';         $css_class[] = $alternate;              if ( !empty($current_page) ) {             $_current_page = get_post( $current_page );             if ( in_array( $page->ID, $_current_page->ancestors ) )                 $css_class[] = 'current_page_ancestor';             if ( $page->ID == $current_page )                 $css_class[] = 'current_page_item';             elseif ( $_current_page && $page->ID == $_current_page->post_parent )                 $css_class[] = 'current_page_parent';         } elseif ( $page->ID == get_option('page_for_posts') ) {             $css_class[] = 'current_page_parent';         }              $css_class = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );              $output .= $indent . '
ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '';              if ( !empty($show_date) ) {             if ( 'modified' == $show_date )                 $time = $page->post_modified;             else                 $time = $page->post_date;                  $output .= " " . mysql2date($date_format, $time);         }     }     }      Only background_1 is printing. how do I get $alternate to actually update.


title: How do I pass data from page content to the underlying PHP template

text: Pretty much all of the content on the site is going to be dynamically generated (php + db backend) What is the preferred "wordpress way" of passing data to a php template (set up as a template in a wordpress theme) So the template would be something like               <?php          generate_content_based_on_this_variable(page);          ?>      and I'd need to be able to pass it `page` for each different page * * * Edit 1 So I have a page that, for simplicity, looks something like this > Hi everyone, this is page X The content here is generated from a db call: > > SELECT * FROM db WHERE page=X > > [Spit out db resultset here] and the template would be something like               <?php          the_content()          $query='SELECT * FROM db WHERE page=X'     $result=$db->execute($query)     foreach($result as $row){     echo $row     }          ?>


title: How do I change the author of a custom post type?

text: I have made a custom post type and need to be able to create posts and assign them to authors. It is easy to do this with posts as you can go to the bulk edit screen and immediately change the author. However, when I try to do this with my custom post type the author box is not there. How do I add the functionality to change the author of my custom post type? EDIT: I found a solution, see answer below.


title: WordPress Multisite Question

text: I want to add a subdomain to all my WordPress sites in a WP MU. For example, I have: `example.com`. When adding a new site to be: `demo.example.com/newsite1` I don't want to create a new user or WordPress Installation. Is this possible?


title: Error when using plugin QuickCache with plugin Mobile Smart ?

text: When I using 2 theme(`theme_1 for PC, theme_2 for mobile`), when run as PC is theme is `theme_1`, but when run as mobile is theme is `theme_1`, I think this error plugin `Quick Cache`, When I setting plugin Quick Cache, I find this row: ![Quick Cache](http://i.stack.imgur.com/tfWAm.png)               => How to fix this row to when run as mobile is theme_2, when run as PC is theme_1


title: Problems with pagination for a custom post type

text:
My pagination links are failing for a custom post type here http://mjw.view- wireframes.com/about-us/press/ the page reloads http://mjw.view-wireframes.com/about-us/press/page/2/ but this has no effect on the displayed posts. Flushing the permalink structure has no effect so my guess is the problem is in the query.               <?php      $paged = (get_query_var('paged')) ? get_query_var('paged') : 10;     $temp = $wp_query;     $wp_query= null;     $wp_query = new WP_Query();     $wp_query->query(array( 'post_type' => 'press',                                     'orderby'   => 'post_date',                                     'posts_per_page' => $paged,                                     ));     while ($wp_query->have_posts()) : $wp_query->the_post();                         // The following determines what the post format is and shows the correct file accordingly         $format = get_post_format();         get_template_part( '/lib/includes/post-formats/'.$format );              if($format == '')         get_template_part( '/lib/includes/post-formats/standard' );          endwhile;               global $wp_query;          $big = 999999999; // need an unlikely integer          echo paginate_links( array(         'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),         'format' => '?paged=%#%',         'current' => max( 1, get_query_var('paged') ),         'total' => $wp_query->max_num_pages     ) );          $wp_query = null; $wp_query = $temp; ?>       Pagination function               <?php $wp_query = null; $wp_query = $temp;?>           function pagination($pages = '', $range = 4)     {          $showitems = ($range * 2)+1;                 global $paged;          if(empty($paged)) $paged = 1;               if($pages == '')          {              global $wp_query;              $pages = $wp_query->max_num_pages;              if(!$pages)              {                  $pages = 1;              }          }                  if(1 != $pages)          {              echo "

Page ".$paged." of ".$pages."
";              if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "
« First
";              if($paged > 1 && $showitems < $pages) echo "
‹ Previous
";                   for ($i=1; $i <= $pages; $i++)              {                  if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))                  {                      echo ($paged == $i)? "
".$i."
":"
".$i."
";                  }              }                   if ($paged < $pages && $showitems < $pages) echo "
Next ›
";              if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "
Last »
";              echo "

\n";          }     }


title: Linking to Post Types from wp-admin

text: Morning all, I'm having a bit of trouble finding a function I can use to link to a post type from the admin area. I'm actually using something as simple as: `<a href='edit.php?post_type=slides'>Slides</a>` in another area, but didn't know if there was a better way of handling it (since I'm still technically hardcoding in the first part of the URL). The post type name being hardcoded isn't the issue, really just generating that first part of the URL. Thanks!


title: Wordpress members-only page with link visible only to members

text: How to achieve Wordpress members-only page functionality with a link in the primary menu visible only to members? Is there a plug-in for that? The Wordpress version is 3.2.1. It is self hosted.


title: How to display custom content in post with category XXX

text: Let’s say I have one post with tittle "Dummy one" and that post is filed under "Category one" and i have other post eg : "dummy two, dummy tree, etc" and category two, category three etc. and now I create other post with title "helper for category one" how to display permalink to "helper for category one" in all post with "category one" I want to put it under `the_content();` in `single.php`. Let’s say my `single.php` is like this               if( have_post()):     while( blah blah ):     the_content();     endwhile;     endif;      i want to like this.               if():     while():     the_content();     if(category == "category one"):     display_helper_for_category_one     else:     display_nothink     endif;     endwhile;     endif;      How can I do that?


title: Search another database with wp_query using new wpdb

text: I currently have a simple `wp_query` search working on my wordpress site. I now want that same search to look for results in it's own database and another one on same server. I found that I could use `new wpdb()`and then `$mydb->get_results()` to get the posts. I managed to pull a title of one of the posts but now I want to integrate this into my `wp_query`. Is this even possible? Here is a breakdown of the code:               $args = array(     'post_type' => 'post',      'show_posts' => '10',      'paged' => $paged     );          $the_query = new WP_Query($args);           // Testing the new wpdb instance (RESULT: title echoed out. Working)     $mydb = new wpdb('USR','PSWD','DB','localhost');     $rows = $mydb->get_results(" SELECT * FROM wp_posts WHERE id = '5509' ");     foreach ($rows as $obj) :         echo $obj->post_title;     endforeach;     // So now, how do I use my wp_query to get these results too?          // Loop     if ($the_query->have_posts()) : while ($the_query->have_posts()) : $the_query->the_post();


title: W3 Total cache "empty all caches" and no stylesheets render

text: I have the w3 Total cache plugin installed and so far its been great as I'm sure you will all agree, so thanks to the author for an amazing plugin. However, I used the "empty all caches" button on the general settings page and when the plugin is activated none of my stylesheets are loading so the page appears without any styling? I have to deactivate the plugin for the stylesheets to load. How can I reactivate W3 so that the stylesheets all render properly again?


title: Get a sidebar at the top of the page

text: I want to get a sidebar ( `get_sidebar( 'mySidebar' )` ) at the top of the page, so I can't call it after `get_header()` in the content template. How could I do it?


title: Cannot Search | Featured | Popular | Newest | Favorites in wordpress working

text: I am working on a Wordpress 3.8 site hosted by Parallels and uploaded via the plex panel. When I want to search, featured, popular, newest favorites a new plugin, I get an error message saying > Warning: An unexpected error occurred. Something may be wrong with > WordPress.org or this server’s configuration. If you continue to have > problems, please try the support forums. (WordPress could not establish a > secure connection to WordPress.org. Please contact your server > administrator.) in /var/www/vhosts/fixskinproblems.com/httpdocs/wp- > admin/includes/plugin-install.php on line 77 I had spent 2 days on googling with this issue.


title: Best way to allow manageable social media URLS?

text: I am working on a site and it is possible that the site will have a number of pages which feature links to the client's social networking sites (Twitter, Facebook, LinkedIn...). Now I know that the URLs to their profile shouldn't change too often, but they would like the option to update the URLs if they ever needed to. My question is what the best method would be to allow my client to simply visit one page in the Admin area where they can copy and paste the new URLs into the fields for each social media site? I thought about using Custom fields, but I guess there must be a way I can create a small widget that just allows me to echo whatever has been placed in the fields for each social media site. That way I can just echo that particular widget in the 'href' of the social media button and I can use it anywhere I want in my theme files. Problem is, I don't delve much into custom widgets yet and I am not sure whether 1) it's the best way to achieve this and 2) Whether you can create a widget that simply allows you to echo whatever has been place in that field (almost just like a custom field). Any clarification would be greatly appreciated. Thanks,


title: Custom fields won't update

text: I have a small problem with custom fields. This is what I am trying to do:   * Whenever a new post is added, I check what category is selected, grab the sub categories and create custom fields with a "0" value based on the sub categories.   * On each post I grab the sub categories, put them in a form and create checkboxes for each. If the checkbox is checked when the submit button is pressed, the value of the custom field is changed to "1". So I basically toggle the 1 and 0. If the value is 1, I use that particular custom field as a title and add some data to the post, and it also adds `checked="yes"` to the checkbox. Everything works great. The only problem I am facing is for custom fields with more than one word. Ex. "Firefox" works, but if the custom field is "Firefox Browser" it won't update. If I manually edit the post and add "1" to the "Firefox Browser" custom field, the checkbox is checked and my div shows up with the "Firefox Browser" title. Unchecking the checkbox and hitting submit changes the value to "0" but checking the checkbox won't change value to "1". Does anybody have any ideas why this happens? Thank you! This is my code:               <?php      //Get the first category of the post     $post_category = get_the_category();     $args = array('parent' => $post_category[0]->cat_ID, 'hide_empty' => 0);     $categories = get_categories( $args );            <form action="http://mysite.com/checkform" method="post">               foreach($categories as $category) {     $chkchk = get_post_meta($post->ID, $category->name, true);     if ($chkchk != "0"){$i = 'checked="yes"';}else{$i = "";}     echo '<input type="checkbox"' . $i . 'name='.'"'.$category->name.'"'.'value=""  />'.$category->name;          }          <input type="hidden" name="post_id" value="<?php echo $post->ID; ?>">     <input type="hidden" name="post_cat" value="<?php echo $post_category[0]- >cat_ID; ?>">     <input type="submit" value="Submit" />     </form>     ?>      * * *               <?php      //Get hidden     $post_id = $_POST['post_id'];     $post_cat = $_POST['post_cat'];                //Get current custom field values     $post_catt = get_the_category();     $args = array('parent' => $post_cat, 'hide_empty' => 0);     $cats = get_categories( $args     );               foreach($cats as $cat) {     $checkthis = get_post_meta($post_id, $cat->name, true);          if (isset($_POST[$cat->name])) {     if($checkthis != 1){     update_post_meta($post_id, $cat->name, 1);}     }else{     if($checkthis != 0);{     update_post_meta($post_id, $cat->name, 0);}     }}`     ?>      * * *               <?php             foreach($categories as $category) {                     $dropthis = get_post_meta($post->ID, $category->name, true);                     //echo $category->name;                     //echo "=";                     //echo $dropthis;                     $abcd = str_replace (" ", "", $category->name);                     $cat_php = strtolower($abcd);                 if($dropthis != 0){                     include 'drops/'.$cat_php.'.php';                 }              } ?>


title: How do i replace the sidebar to use pages instead of blogs?

text: I want to use wordpress as a CMS and not as a blog. I am using the default twentyeleven theme and i would like to remove 'archive' (the blog ToC) and 'Meta' (login) and replace it with a sidebar seen on a traditional site. The part i am having trouble is how do i do it in a way were i can add pages to the sidebar from within the admin area rather then hardcoding in php? I also would like it to be in the format below where the heading is not clickable and the entries i can add/remove from the admin area. # About person one   person two # Services Service A   Service B


title: Get next post when using pagination with WP_Query?

text: How do i specify which "page" to get when using WP_Query? I'm using pagination and i only display three posts per page, but i need to manually set which page to get, because Wordpress doesn't do that by default it seems. Is there an argument i can send with `WP_Query()` to get a specific page?


title: Want to use credit card in wordpress, paypal is working fine

text: I m using wp-ecommerce plugin in which paypal is working fine by developer's account. i want to integrate credit card in wp-ecommerce is any service offers developer credit card testing like in sandbox in paypal?


title: display only the wp_nav_menu, which has the current-menu-item

text: i have a problem displaying only the menu with wp_nav_menu, in which the _current-menu-item_ is in. Heres what i got:               function register_menus() {       register_nav_menus(         array(           'sidebar-menu' => __('Sidebar Menu'),           'first-menu' => __('Menu 1'),           'second-menu' => __('Menu 2'),           'third-menu' => __('Menu 3')         )       );     }     add_action('init', 'register_menus')      and on the page.php i'm doing               <?php wp_nav_menu(array('theme_location' => 'first-menu')); ?>     <?php wp_nav_menu(array('theme_location' => 'second-menu')); ?>     <?php wp_nav_menu(array('theme_location' => 'third-menu')); ?>      when i now open up a page, which is in Menu 2, i can style it with _.current- menu-item_ - so no problem here. but i want to display only the one menu, which has the _.current-menu-item_ in it (Menu 2). the other ones (Menu 1, Menu 3) should be _display: none;_ is there a way to accomplish that? i thought of a walker, a filter or a simple if-statement, which checks for the menu, which has the _.current-menu-item_ but i can't handle it myself :-( thank you very much