title: How do I setup nested repeatable option fields?

text:
I'm trying to wrap my head around how to create a set of option fields that should be able to repeat for as many times as possible. But I'm having a hard time to figure out how to proceed. Currently I've setup the visual interface for administering the options, but I have no idea how to save them into the options on save. How would a logic look like that will be able to differentiate between different sections? Keeping each section as a separate array within the options array (I guess?) so that you're able to add as many sections that you want, with as many nested data fields as you want. The idea is quite simple      1) Click add section to create a new section ![First Step](http://i.stack.imgur.com/LwdB1.jpg) ————      2) A javascript creates the input fields for the section, where you can name.. ![Second Step](http://i.stack.imgur.com/vBfcB.jpg) ————      3) ..and associate multiple input fields to the section ![Third Step](http://i.stack.imgur.com/IRwsv.jpg) ————      4) You can also add more sections ![Fourth Step](http://i.stack.imgur.com/Czxee.jpg)         The code I have atm is: **PHP**               <?php     function rd_settings_page() {         ?>

<?php _e( 'Settings', 'blog' ); ?>
             <form enctype="multipart/form-data" action="options.php" method="POST">                 <?php settings_fields( 'rd-settings-group' ); ?>                 <?php do_settings_sections( 'rd-settings' ); ?>                 <?php submit_button(); ?>             </form>
         <?php     }          function rd_settings_api_init() {         add_settings_section(             'rd_blog_info_section',             __( 'Blog info settings', 'blog' ),             'rd_blog_info_section_callback_function',             'rd-settings'         );              if ( 1 === get_current_blog_id() ) {                     register_setting( 'rd-settings-group', 'rd_fashion_list' );             register_setting( 'rd-settings-group', 'rd_blog_description' );         }              if ( 1 === get_current_blog_id() ) {                     add_settings_field(                 'rd_fashion_list',                 __( 'Fashion Blogs', 'blog' ),                 'rd_fashion_list_callback_function',                 'rd-settings',                 'rd_blog_info_section'             );         }     }          add_action( 'admin_init', 'rd_settings_api_init' );          function rd_blog_info_section_callback_function() {         echo '
Blog info settings
';     }          function rd_fashion_list_callback_function() {         $setting = get_option( 'rd_fashion_list' );?>

                      + Add Section                       <?php     }      **JS**               $(document).on('click', '.addsection', function () {         $(this).prev('.inner-wrap').append('
'+             '<input type="text" name="rd_facebook" id="rd-facebook" value=""/>'+             ' Name for section'+             '
'+             '
'+             '<select>'+             '<option value="" disabled="disabled" selected="selected">Please select a blog</option>'+             '<option value="1">One</option>'+             '<option value="2">Two</option>'+             '</select>'+             '×'+             '
'+             '
'+             '+ Add Blog'+             '
');     });          $(document).on('click', '.addblog', function () {         $(this).prev('ul').append('
'+             '<select>'+             '<option value="" disabled="disabled" selected="selected">Please select a blog</option>'+             '<option value="1">One</option>'+             '<option value="2">Two</option>'+             '</select>'+             '×'+             '
');     });


title: How to query posts from specific authors and categories using WP_query?

text: I currently have a WP_query where I am getting posts from a specific set of authors. To this, I want to add specific categories as well.               $args = array( 'author__in' => $authors, 'posts_per_page' => 12, 'paged' => $paged );      $authors is an array containing users' ids. So, I need to query posts from both, authors and categories. I was thinking about using something like this:               'tax_query' => array(         'relation' => 'OR',         array(             'taxonomy' => 'category',             'field' => 'id',             'terms' => array ( $cat_ids ),         ),         array(             'taxonomy', => 'user',             'field' => 'id',             'terms' => array( $user_ids ),         )     )      I know user is not a taxonomy; however, I am looking for something similar that works. ## EDIT Well, I tried this and it is working so far:               $args = array(       'author__in'     => $authors,       'category__in'   => $terms,       'posts_per_page' => 12,       'paged'          => $paged     );      Is there a better way? ## EDIT 2 My previous edit is not working the way I wanted. The caveat is that when only categories are specified, no posts show up. I need an OR relation. ## EDIT 3 I havent been able to find a solution. When I use author_ _in and category_ _in for the arguments, wordpress only shows posts from authors and not both. I need to show posts from authors AND categories. What am I doing wrong here?


title: How to disable Edit Post and Allow only Custom Field?

text: What I would like to know is if it is possible to disable the edit post function in wordpress based on User's roles. I try to explain better. Let's take an 'Editor' as role example: I would like Editors, Authors.... but NOT ADMIN to be able to write posts only using Custom Fields instead of the 'classic' built in edit post function of WordPress. Is there anyone who knows how to do it (maybe it is only a sentence or 2 in functions.php) or who as/know a plugin that will let me do it? Thank you very much!


title: How to store array in usermeta in wordpress

text: I have a custom user registration form and am trying to store multiple values in the usermeta. This is a sample code I am using, however it just stores the last option selected (i.e. if I select from Volvo to Opel, it will only store Opel in the database), whereas what I am wanting is all the values selected to be stored. Im not sure what Im doing wrong. Any help would be appreciated.               <select name="test" id="test" multiple>           <option value="volvo">Volvo</option>           <option value="saab">Saab</option>           <option value="opel">Opel</option>           <option value="audi">Audi</option>         </select>              update_usermeta( $new_user, 'test', $_POST['test'] );


title: Changing Post Permalink redirect

text: I am curious about something. Recently I changed my post permalink structure in wordpress. It used to be category/postname. I have changed it to postname. It seems that if I type http://mydomain.com/category/postname, it gets redirected to the new permalink of http://mydomain.com/postname. How do I prevent this redirect of url? Is it a default wordpress setting? I am using Seo by Yoast plugin. I want to prevent it because I totally want to delete the old permalink url. My website is very new, so I am not afraid to lose traffic. Thanks in advance!


title: Fetching Post based on date

text: I am creating a website for fetching post based on date, So when the page load it display the post of current date and in that page there are two button Previous and Next so when the user click on Previous button it should display the post of previous day and when click on next it should display the post of next date on the same page


title: How to associate an existing user to a site in a multisite setup programmatically

text: In a multisite setup, you can associate an existing user in the network to a site. The standard wp_insert_user function doesn't seem to have the proper logic to handle. How would I do this for multisite? Also, is there a way to see if a given user is already associated with a particular site?


title: How to send "Location" header on plugin form submit event?

text: How to redirect to specified page after form was submitted? > Warning: Cannot modify header information - headers already sent by (output > started at `wordpress\wp-admin\menu-header.php:94`) in `wordpress\wp- > content\plugins\test\test.php` on line 16               <?php     /*     Plugin Name: TEST     Plugin URI: http://localhost/     Description: TEST     Version: 0.0.1     Author: TEST     Author URI: http://localhost/     */     add_action('admin_menu', 'test');     function test() {          add_menu_page('test', 'test', 0, 'test/test.php', 'page');     }      function page() {         if(isset($_POST['submit'])) {             header('Location: /index.php');             exit;         }         echo '<form action="" method="post"><input type="submit" value="Submit form" name="submit" /></form>';         var_dump($_POST);     }


title: Adding first and last classes to three column layout in Bones boilerplate

text:
I'm using the bones boilerplate theme in Wordpress and on the homepage am displaying a section containing three columns for the latest three posts in Wordpress. The bones theme uses the responsive 960 grid and in any grid usage, we need to add the class of `first` to the first element and the class of `last` to the last element. I've tried implementing the ability to do this from this answer at their support forum. Here is the code currently in use:-

             <hgroup class="">
What We Say
</hgroup>
                 <?php                 $temp = $wp_query; $wp_query= null;                 $wp_query = new WP_Query(); $wp_query->query('showposts=3' . '&paged='.$paged);                 while ($wp_query->have_posts()) : $wp_query->the_post(); ?>                 <?php $counter = 1; //counter tracks the number of the post we're on ?>                      <?php // This code uses the modulus operator to check the remainder of the $counter value in the current iteration and adds the 'first' or 'last' class based on either number sequence ?>                      <li class="blog-post fourcol <?php if ($counter % 3 == 0) { echo 'last';} elseif ($counter % 3 == 1) { echo 'first';} ?>">                      <article id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?> role="article" itemscope itemtype="http://schema.org/BlogPosting">
<a href="<?php the_permalink(); ?>" title="Read more"><?php the_title(); ?>

<?php printf( __( 'Posted <time class="updated" datetime="%1$s" pubdate>%2$s</time> by %3$s.', 'bonestheme' ), get_the_time( 'Y-m-j' ), get_the_time( __( 'F jS, Y', 'bonestheme' ) ), bones_get_the_author_posts_link() ); ?>

                         <?php the_excerpt(); ?>

<?php the_tags( '' . __( 'Tags:', 'bonestheme' ) . ' ', ', ', '' ); ?>

                 <?php $counter++; // This increases the value of $counter by 1 for every loop iteration ?>                 <?php endwhile; ?>                      <?php if ($paged > 1) { ?>
<?php next_posts_link('« Previous Posts'); ?>

<?php previous_posts_link('Newer Posts »'); ?>
                                       <?php } else { ?>
<?php next_posts_link('« Previous Posts'); ?>
                                       <?php } ?>                      <?php wp_reset_postdata(); ?>

      This however, is adding the class of `first` to each instead of `first` on the first (1st) column and `last` on the last (3rd) column. Can anyone see why my code may not be working as expected from the above? Thanks in advance.


title: Wordpress meta-box and checkbox-list

text: I have a trouble with a type of checkbox-list in meta-box. This is my code in **meta-box-config.php** :               $meta_boxes[] = array(     'id'        => 'poker_room_extension',     'title'     => 'Poker Room Options',     'pages'     => array( 'post', 'page' ),          'fields'    => array(              array(             'name'      => 'Sistema operativo supportato',             'id'        => $prefix . 'os_poker_room',             'clone'     => false,             'type'      => 'checkbox_list',             'options'   => array(                 'windows'     => 'Windows ',                 'mac' => 'Mac ',                 'linux' => 'Linux '             ),             'std'       => false         )     )      );      This is what I see in my post's options ![enter image description here](http://i.stack.imgur.com/teH5L.png) ![enter image description here](http://i.stack.imgur.com/G8S7u.png) Is it normal that variable omc_os_poker_room is the same? How I can show the values? Is omc_os_poker_room an array or not? I don't understand. If I run this code in my template it show only the first value (windows and not the other ones checked):               $omc_os_poker_room =  get_post_meta(get_the_ID(), 'omc_os_poker_room', true);     $conta = count($omc_os_poker_room);                  <?php if ($omc_os_poker_room != '') {                 echo '<p class="omc-info-one"><b>OS: </b>';                 for($i=0;$i<$conta;$i++) {                 echo $omc_os_poker_room[$i];                 } }?>      Can you help me? Thanks I replaced this line:               $omc_os_poker_room =  get_post_meta(get_the_ID(), 'omc_os_poker_room', true);      to               $omc_os_poker_room =  get_post_meta(get_the_ID(), 'omc_os_poker_room', false);      It's working now! ;)


title: access JSON results from wordpress database with wpdb

text: I have JSON results from Google API added to to wp_options table. At this point I just need to echo the specific elements. Namely, the coordinates. The option_name I have is py_menu_item. One of the option_value element is coords. That is what represents the JSON results. The code below yields this response: `array(o){}` The code:               global $wpdb;     $myrows = $wpdb->get_results("SELECT * FROM $wpdb->wp_options WHERE option_name = py_menu_item", ARRAY_A");     $lat = $myrows->results[0]->geometry->location->lat;    //latitude     $long = $myrows->results[0]->geometry->location->lng;   //longitude      echo $lat;     echo $long;     var_dump($myrows);      I am using this Codex page as a guide: Class_Reference/wpdb


title: How to fix thumb.php error

text: So I moved a site to a new URL and some post thumbnail images aren't showing up. What is strange is that some are pathing to the new /uploads folder without a problem. Others are producing this error > A TimThumb error has occured The following error(s) occured: You may not > fetch images from that site. To enable this site in timthumb, you can either > add it to $ALLOWED_SITES and set ALLOW EXTERNAL=true. Or you can set > ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs. Query String : src=http://community-paper.com/wp- content/uploads/2013/02/denise-head-shot.jpg&w=100&h=100&zc=1&q=90 TimThumb version : 2.8.11


title: How to configure Multisite Network with randomized hostnames?

text: I'm trying to convert a freshly-installed and functional WordPress into a multisite network. But I'm having problems because of our Apache configuration. We use Apache to randomly redirect requests for domain.com to one of two application servers: app1.domain.com or app2.domain.com. The problem is that WordPress redirects to DOMAIN_CURRENT_SITE (defined in wp-config.php) if the current browser domain differs from that. This results in a 310 redirect loop. Here's an example of what happens:   1. User requests domain.com/apps/wordpress/   2. Apache redirects to app1.domain.com/apps/wordpress/   3. Because redirect domain does not match DOMAIN_CURRENT_SITE, WordPress redirects to DOMAIN_CURRENT_SITE (domain.com/apps/wordpress/)   4. Return to step 1 and repeat What I'd like to do is set all WordPress links and URLs to **domain.com** and have WordPress ignore the fact that **app1.domain.com** or **app2.domain.com** is _actually_ being retrieved. Is this possible? Here are the relevant Apache conf files (simplified), in case I'm not being quite clear: **application_servers.conf:**               domain.com-prod-http  app1.domain.com:80|app2.domain.com:80      **httpd.conf:**               RewriteMap server rnd:conf/application_servers.conf     RewriteRule ^/apps/*([^/]*)/*(.*) http://${server:domain.com-prod-http}/apps/$1/$2 [P,L,QSA]


title: Force logged in users to still fill out name/address for commenting?

text: This is a bit of a weird request, but I'd like to force loggged-in users (one specifically) to fill out the standard not-logged-in name / email address fields before submitting a comment on the site. [EDIT: I'm realizing this is probably even more difficult than I thought. I not only don't want the comment form to show this one user as logged-in, I want it to actually submit the comment as a not-logged-in user. Ideally without logging out the user. Is there a way to remove the logged-in check altogether from the comment form and comment-form-submit code? I don't mind forcing all users to fill out a form every time they submit a comment if that's the easiest fix.] Is this possible? I would prefer not to hack core code but I'm not opposed to writing a static comment form, if that would help. I suspect not since the form-submit is still checking on logged-in status... Thanks for your help! [Edit - WHY I NEED THIS: The site is using the Member Access plugin to show select pages/posts to registered users only. However, my client didn't want anyone to actually have to register for a WordPress account - he wanted the login/signup forms to check against an external ESP to see if they were on an email list, and if so log them in automatically. From the user's perspective, they enter their email address and poof! can see the content. To achieve this, the code does the lookup againt the ESP and if the email addy exists, logs them into a dummy WordPress account I created. But once they're logged in, I want them to each be able to comment individually, not as this dummy account.]


title: How do you hide images from posts only

text: As the title says I want to keep images on pages and hide them from posts on my site . How can I do this? Thanks


title: How can one get page by pagename if it is a child page?

text:
What I want to do is to dislay a description of a country if one of the categories is a country name. It do it like that                   <?php     if(in_category('afghanistan')) {         $recent = new WP_Query("page_id=25"); while($recent->have_posts()) : $recent->the_post();?>
<?php the_title(); ?>
             <?php the_content(); ?>         <?php endwhile;     }          elseif(in_category('albania')) {         $recent = new WP_Query("page_id=26"); while($recent->have_posts()) : $recent->the_post();?>
<?php the_title(); ?>
             <?php the_content(); ?>         <?php endwhile;     }          else {         echo "Error!";     }     ?>      I would like to replace `page_id=25` with `pagename=afghanistan`. Iif I do so it works well, but if page "afghanistan" is a child of a page "Asia" it doesn't display it anymore. If I use `page_id` it works, but `pagename` stops working as soon as I create page as a child of another page. How do I get the page by name if it has a parent? :)


title: Dynamically change Custom Post Type Template OR Change Permalink?

text: I have built a plugin that uses a custom post type and a single-.php file for a template. My issue is the custom post type template needs to take on the name of the post type and I need to change that. For example if my post type is called Movies then the template I call is single-movies.php. Also the permalink would be mydomain.com/movies. I am providing a plugin options page that allows the user to change the name from Movies to say Films. What is the best approach? Initially I thought about changing the custom post type name dynamically and renaming the file with the rename(). I kept getting an error "cURL wrapper does not support renaming" I got to thinking . Is it easier to just rename the permalink with a mod rewrite and if so how would I do that. I'm trying to avoid a naming issue. If the user already has a permalink of Movies then I want them to be able to rename the post type to film or what ever they want. The default of Movies will be stored as an option upon plugin activation and displayed in the options panel. If the user decides to change to "Films" the option is updated but how to I associate it to the custom post type template? Any help on this is greatly appreciated. Phil


title: Redirect to settings page after install

text: I can't find any info on this anywhere but i'm sure iv'e seen it done before. I would like to have a user taken to the settings page for my plugin after install, so either auto-redirected or change the "back to plugins" link to a custom link. Thanks in advance **SOLVED**               function myplugin_activate() {             // TODO: Install your plugin here.              // I don't know of any other redirect function, so this'll have to do.         wp_redirect(admin_url('options-general.php?page=myplugin_settings'));exit;         // You could use a header(sprintf('Location: %s', admin_url(...)); here instead too.     }     register_activation_hook(__FILE__, 'myplugin_activate');      @Zack - Your method works great however you forgot to exit after wp_redirect. (source http://codex.wordpress.org/Function_Reference/wp_redirect) Many thanks


title: Possible to make custom role in multisite that can add sites?

text: I am creating a network on MultiSite, and am wanting to keep the Super Admin privileges very tightly locked. This setup is hosed on WPengine, and they add their plugin in the dashboard that shows the super admin a menu area that gets access to some server stuff, I obviously want that blocked from folks who may go poking around. I am using the Premium version of the plugin User Role Editor to create a custom role, call it "Sub Admin". I am trying to find out, if it is possible, to give this role the ability to add new sites? I have added the `manage_sites` capability, but the _Add Site_ menu item is not showing up. I tried also adding capabilities for `manage_network` and `manage_network_options` to test if they were somehow requisite, but no. Has anyone done this, or know if it is possible? Or do I have to bite the bullet and dish out super admin rights?


title: WordPress - admin-ajax.php returns 502 Bad Gateway

text: I'm getting a 502 Bad Gateway error for wp-admin/admin-ajax.php -- this is a WP site, hosted on WebFaction, which is using nginx. Where it most obviously crops up is when adding a new post or page, clicking on "Insert Media", nothing in the library shows up. Inspector console is filled with these:               POST http://lightuphope.org/wp-admin/admin-ajax.php 502 (Bad Gateway) load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-widget,jquery-u…:5     send load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-widget,jquery-u…:5     x.extend.ajax load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-widget,jquery-u…:5     i load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,schedule,wp-ajax-response,autosave,sug…:48     (anonymous function)


title: Enqueueing a code block from an options framework

text: I'm currently working with the Redux Framework to allow users of my theme to add additional CSS and JS code to their theme's header and footer, respectively. Redux stores this code in a global variable, so it's easy to access. However, this means I must call the global variable in the header.php or footer.php file and then echo the code from Redux there. This doesn't seem ideal. I was wondering if there is any way to enqueue these blocks of code in the function.php file rather than trying to code it directly into the template files. For example:               #header{         margin: 0 auto;     }      Is typed into my CSS box inside of Redux. I can then access it in header.php with something like:               global $redux_global;     echo $redux_global['css-block'];      ...and it'll spit out the above CSS. That's all well and good, but if I do this its not properly enqueued. Per my understanding I can only use a URL with wp_enqueue_style and wp_enqueue_script so I'm at a loss. Thank you for your help!


title: get_post_thumbnail_id() Doesn't return value

text: I'm changing a menu from a loop with `query_posts` to a "custom menu" using `wp_get_nav_menu_items`, but I can't seem to retrieve the `post_thumbnail`. The original code I had (snippet):               <?php     query_posts($args);     if (have_posts()) : while (have_posts()) : the_post();         $image = wp_get_attachment_image_src(get_post_thumbnail_id());     endwhile; endif;?>      My new code:               <?php     $menu = wp_get_nav_menu_items('Homepage blokken');     foreach($menu AS $m){          echo $m->ID; // this echoes the correct ID          $pThumbId = get_post_thumbnail_id($m->ID); // this returns empty     } ?>      Why is this not working?


title: Source code get entity escaped after migrating

text: I have a lot of posts with source code on it. After migrating my blog from wordpress.com to self-hosting, the source code all have HTML entity escaping, for example:               [code]       printf("hello");     [/code]      This causes the rendered source code become `printf("hello")` instead of `printf("hello")` I think this is because the export/import process was using xml file where all non-suitable characters get escaped. Is there anyway only normal content get escaped, but not `[code]` enclosed content when migrating wordpress?


title: Converting Menu Links to List Elements

text: I'm creating a theme from a template based on Wordpress 3.0. I've started with items like Starkers which is a completely bare theme, and even tried modifying something by default like Twenty Ten or Eleven. However, the thing that gets me is how can I adjust the css to covert a single line of PHP such as (used as default now for navigation):               <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>      Or:               <?php     wp_nav_menu(         array(             'container_class' => 'menu-header',             'theme_location'  => 'primary'         )     );     ?>      Into a stylized list element that can be adjusted to the length of the entire navigation menu? I'm not understanding how the PHP is turned into the right amount of `<li>`'s (which is the case in the generated html viewable in Firebug or another inspector) where I can modify them how I wish.


title: Is it possible to associate different kinds of custom post types one to the other?

text: I might be thinking too hard about this problem and i'm thinking the solution might be easier than we're i'm heading. Here's what i'm trying to accomplish: there a winery website built on wp and uses custom post types for "Wines" -> every wine has it's own description, picture, etc (cabarnet 2005, cabarnet 2006 etc...). Now, most wines have won medals - some of them even won up to 8 medals. i want to showcase all medal relevant to a specific wine in his specific page AND i want to have another page that showcases all medals, chronologically. I figured i might be able to accomplish this by creating a custom post type "medal" and to somehow associate the medal to the wine that won it. but can i associate the 'medal' object in a many to one relation to the 'wine' object? how can i do that? Any Ideas?


title: Site not found using subdomains

text: Hello i am having a few problems setting up subdomains on my multisite install. I was hoping someone could point out any ways that i have went wrong. Thanks. My website doesnt site on the root. Its in a subfolder public_html/onlinebanter.co.uk DNS setting- ![redirect](http://i.stack.imgur.com/1dwEw.jpg) public_html/onlinebanter.co.uk/wp-config.php               /* Multisite */     define('WP_ALLOW_MULTISITE', true);     define('MULTISITE', true);     define('SUBDOMAIN_INSTALL', true);     define('DOMAIN_CURRENT_SITE', 'onlinebanter.co.uk');     define('PATH_CURRENT_SITE', '/');     define('SITE_ID_CURRENT_SITE', 1);     define('BLOG_ID_CURRENT_SITE', 1);      htaccess               RewriteEngine On^M     RewriteBase /^M     RewriteRule ^index\.php$ - [L]^M     ^M     # add a trailing slash to /wp-admin^M     RewriteRule ^wp-admin$ wp-admin/ [R=301,L]^M     ^M     RewriteCond %{REQUEST_FILENAME} -f [OR]^M     RewriteCond %{REQUEST_FILENAME} -d^M     RewriteRule ^ - [L]^M     RewriteRule ^(wp-(content|admin|includes).*) $1 [L]^M     RewriteRule ^(.*\.php)$ wp/$1 [L]^M     RewriteRule . index.php [L]# BEGIN W3TC Browser Cache      getting a not found at this site address http://test.onlinebanter.co.uk/ Is there anything that i have done wrong? I only set up the wildcard thingy about 6hrs ago. Could it be waiting to propogate? thanks


title: Remove Post if Advanced Custom Field is checked to fix paging

text: I'm trying to setup a query that filters through posts and removes ones that have an ACF field "archived" checked. Post queries are pretty foreign to me.               query_posts("cat=10&posts_per_page=12&post_status=any&order=ASC"."&paged=".$paged);      How can I edit that string to check to see if the post has the `archived` checkbox checked? This is how I'm currently doing it, but because it's inside the loop, there are "phantom" posts that add to the pagination when they shouldn't. `if(get_field('archived')) { /* my code */ }` Thanks.


title: Why is WordPress' installer "phoning home" during the install script?

text: I noticed (using Little Snitch) that WordPress' installer calls a distant Web page when installing (`api.wordpress.org`), why is that?


title: Developing mobile version of WordPress site

text: I would like to build a mobile version of my WordPress site. To avoid the problems and costs with developing for native platforms, I'd like to go for an HTML/CSS/jQuery approach that would be accessible from the Webkit browsers. The main site is already developed in WordPress, and content can be directly taken from the CMS. I'd like the mobile version to be available from a specific URL such as www.mysite.com/mobile or mobile.mysite.com How can I set this new URL to point to this version of the site? And how will this new URL change as I browse through the mobile site? And how can I load this URL by default when a user accesses the site from a mobile device? Am I right to think that I can then develop this as I would make a normal theme for WordPress, with no other worry about this being meant for mobile devices rather than desktop?


title: Giving Wordpress it's own directory and using .htaccess Directory Index

text: Would this be a bad idea for any reason? - installing Wordpress in a sub- directory (ie: http:// example.com/wordpress) alongside the current website (ie: http:// example.com) that is not using Wordpress...and still running Wordpress from the root by Giving Wordpress It's Own Directory and using .htaccess to change the Directory Index (so http:// example.com still points to the non-Wordpress website's home page). This would allow all the content to be added to the Wordpress website and when it's ready to replace the non-Wordpress website, it's just a matter of deleting the non-Wordpress files and re-pointing the Directory Index back to the Wordpress index.php with the .htaccess. P.S. - this seems like an option for my current project because the non- Wordpress website uses different page names than we will be using with the new Wordpress website, so there will be no conflicts there. **UPDATE: Attempted this and it will not work because Wordpress returns the 404 page when trying to load the non-Wordpress pages (ie: http:// example.com/Non-Wordpress-Page)**


title: Post processing of uploaded file

text: When a file with the `.xml` extension has been uploaded on my blog (via the Add Media uploader) I would like to automatically replace some attributes. For example, if I upload a file with this content:               <content creator="foo"></content>      I would like that Wordpress modifies it automatically in:               <content creator="bar"></content>      What hook should I use and how?


title: Resize photo on wordpress

text: Based on Function add_image_resize in wordpress http://codex.wordpress.org/Function_Reference/add_image_size if i have rule in functions.php like this > add_image_size('featured-slider', 940, 260, true); It means all of image resize and hard croping to 940px (width) and 260px (height), right ? the problem is when i'am uploading an image file that have a small dimension than rule. for example i have image with 303px (width) and 405px(height) and that images have uploaded can't resize to 960px and 260px, but only 303px (width) and 260px(height). It posssible in wordpress resize image to 960px x 260px although dimension of my source image smaller than my rule ?


title: Importing demo content from plugin

text: I need to create "Import demo content" button on frontend, when the user clicks it, import demo content including attachments. What would be the best way to achieve that? Import XML somehow? Import db? Create all the content in the plugin manually? Thanks


title: Null value given when confirming email's

text: **Fixed the problem by adding`if ( 'email' == $type || 'email2' == $type ) {` to the top of the snippet below and changing the first elseif to a if statment** I have created a WordPress register form on the homepage of my WordPress but I am having a little problem with verifying the email address match. This is the code I am using to do that.               elseif ( !is_email($userdata['user_email'], true) )     $error = __('You must enter a valid email address.', 'frontendprofile');     elseif ( email_exists($userdata['user_email']) )     $error = __('Sorry, that email address is already used!',     'frontendprofile');     elseif ( !empty($_POST['email'] ) && !empty( $_POST['email2'] ) ) {         if ( $_POST['email'] == $_POST['email2'] )             wp_update_user( array( 'ID' => $current_user->id,      'user_email' =>     esc_attr( $_POST['email'] ) ) );         else             $error = __('The emails you entered do not match.  Your    email was not updated.', 'frontendprofile');     }      But I keep getting this error when I hit the register button               Warning: get_object_vars() expects parameter 1 to be object, null given in       I take it that some how the verfication process isn't working fully so it is not taking the email address and instead showing a null value in the form submit, but I can't see where this is happening.


title: Different templates for parent and children categories/taxonomies

text: I would like to know what is the best way to create a different template for parent and children categories and/or taxonomies. Example: I have a taxonomy called region, which I want to divide in countries, and cities inside countries. So, I will have a parent taxonomy term called Italy, and it's children taxonomy terms, Rome, Milan, Napoli, whatever. Is it possible to have different templates for country and city? How can I achieve this? Thanks in advance.


title: How to Make infinite loop of post

text: I am using Post contents as a slider contents, i need to make the post infinite number of loop, ie, If i view the last post after that first post should display and before first post the last post. Please suggest


title: Advanced custom fields - taxonomy terms images

text: I used the Advanced Custom Fields plugin to add a custom field to my taxonomy. That custom field is an image which is associated with the term. Now I have a page where I display a list of all terms (for example, car manufacturers):               $terms = get_terms("manufacturer_tax", array(         'hide_empty' => 0     ));     $count = count($terms);     if ( $count > 0 ){         foreach ( $terms as $term ) {             echo $term->name;             echo "<img src='" . $term->manufacturer_logo . "'>"; /* NOT WORKING */          }     }      I wish to display the image associated with each term. How can I accomplish this? **EDIT** Here is the example result for one term: `stdClass Object ( [term_id] => 5 [name] => Honda [slug] => honda [term_group] => 0 [term_taxonomy_id] => 5 [taxonomy] => manufacturer_tax [description] => [parent] => 0 [count] => 0 )` Looks like there is no image associated with this term. However, I can see the image in the backoffice.


title: Add error message on password protected page

text: I protected a page with password. I’d like to add a short error message when the inserted password is incorrect. How can I do this? I add this code to show and customize the form on my page. My `functions.php`               add_filter( 'the_password_form', 'custom_password_form' );     function custom_password_form() {     global $post;     $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );     $o = '<form class="protected-post-form" action="' . get_option('siteurl') . '/wp-pass.php" method="post">' .      '<p class="glossar-form-p">Alle weiteren Glossarbeiträge sind durch ein Passwort geschützt. </p>' .      ' <label for="' . $label . '">' . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" />     <input type="submit" name="Submit" value="' . esc_attr__( "Login" ) . '" />     </form>     ';     return $o;     }


title: Widgets in the loop if active

text: I'm trying to put a widget as "first post" if it's active.. and let the posts continue after that.. It works, but the first post disappears and the second post becomes the first in line after the widget.. Can't see what i'm doing wrong.. I already have a widget that shows in between the posts as you can see.               <?php if (have_posts()) : ?>     <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>     <?php $i=1;?>     <?php while (have_posts()) : the_post(); ?>                    <?php if ( is_active_sidebar('post_widget_area') && $i==1 ) { ?>          <?php dynamic_sidebar('post_widget_area'); ?>          <? } else { ?>               <?php the_title(); ?><br>         <?php the_excerpt(); ?>              <?php } if($i==3): ?>         <?php get_sidebar('bottom'); ?>              <?php endif; ?>         <?php $i++; ?>         <?php endwhile; ?>         <?php if($i<4): ?>         <?php get_sidebar('bottom'); ?>            <?php endif; ?>     <?php endif; ?>


title: Should a SEO plugin be necessary?

text: I'm using the All in One SEO plugin for my site. The extra fields and options it supplies seem like they could be handled via a theme, possibly negating the use for a plugin. Should SEO considerations be handled by a theme, rather than delegating the work to a separate plugin? It could reduce maintenance issues, takes up less space, and be more integrated.


title: Jquery conflict

text: I have been trying and trying to fix jquery issues. i have in my header lots of jquery. I use it for slider and other things that are built into this premade theme. I am unable to add anything that uses jquery because of conflict. i need some help. The board is www.cgwhat.com. The forgot password is jquery and the slider is controlled by jquery also. I wanted to add another plugin but can not because of the conflict. Also with the forgot password that is jquery. I need to know what is wrong and how to fix it . If i remove calls to javascript in header it is fixed. The forgot password works but everything else breaks.               <?php wp_enqueue_script("jquery"); ?>     <?php wp_head(); ?>          <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.equalHeight.js"></script>     <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/flashobject.js"></script>     <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.js"></script>     <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.jcarousel.js"></script>     <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.actions.js"></script>     <script type="text/javascript">      jQuery(document).ready(function($){     var fC=$('#features-nav .features-nav-item').length;     curS=1;     var cInt=0;         cInt=setInterval(function(){             $('#features-nav .features-nav-item:eq('+curS+')').addClass('current').trigger('click');             curS++;             if(curS>=fC) curS=0;         },10000);});          </script>                     </head>


title: What is the ideal setup to address security concerns?

text: I'm aware of the requirements WP has for certain directories and files to be writable. I'm also aware that making permissions too loose can open security holes. Finally, I know that the user that (insert your server here) runs as on Linux systems can be a factor. Security aside, I like being able to download themes and plugins to my blog, and update them when necessary. Proper permissions seem to be a bit at odds with this preference. I've collected little bits of detail here and there, but I'd like to see a more definitive answer, if there is one: what is the preferred setup with a nod to security? What permissions should be in place, what user should the site run as, etc.


title: How to get site homepage from plugin?

text: I am creating a plugin that has a preview, kind of like the theme customizer preview. It displays the users site in an Iframe. The issue is that I can't seem to be able to get the users homepage using the standard way of grabbing them, such as:               <iframe id="preview_frame" src="<?php get_bloginfo('url'); ?>">      Or:               <iframe id="preview_frame" src="<?php get_home_url(); ?>">      Can anyone shed some light on the proper way of doing this? Is their a specific way to display the site as a preview? I am using a hook to disable the admin bar in the preview, so if there is an elegant way to create a preview without the admin bar, it would be very good to know. Thanks.


title: paginate_links on custom query in admin - 'sufficient permissions' error

text: I have created a page in my admin with this custom query:               $rows = $wpdb->get_results("SELECT * FROM ej_feedback ORDER BY createdtime ASC");      I have made it successfully paginate as required in that the right amount of posts show on first page and the right amount of pagination links show up. Awesome! However when I click on one of the pagination links to go onto page 2, I get an admin error: **You do not have sufficient permissions to access this page** The url looks like this: > /wp-admin/admin.php?page=user-feedback/user-feedback.php/page/2/ I really don't know why I'm getting this error in the admin. Is it a more general issue with the admin or is it related to using pagination in the admin area? Any help would be much appreciated. The script works perfectly on the frontend - I just think Wordpress has a problem with the URL generated.


title: Removing the 1st line in a post snippit showing on homepage AND leave it on the internal post

text: I have a magazine blog where different writers of each post is credited (i.e. by Larry Hamilton, Sr. Writer). The problem that I am having is that on the homepage the snippit should look like this: (Title and 1st sentence of 1st paragraph) _**The Trouble With News_** **In today's world, we get news much faster than...** My problem is when I add the persons' name for the byline, the home page snippet looks like this: _**The Trouble With News_** **by Larry Hamilton, Sr. Writer** This leaves out the first sentance. No one wants to read a title and the byline. How do I remove the byline ONLY from my Homepage snippit and leave the byline in tact on the post/page?


title: flush_rewrite_rules not working on plugin deactivation, invalid URLs not showing 404

text:
i'm just about to release a community plug-in and have a few last anoying issues. First, whenever i visit a page that would not be valid for the plugin, www.mydomain.com/forms/tester it will take me to a different page. What should happen, is the plugin code try and use the path 'tester', find there is no such file, and then return a page not found error. Second, i am using AskApache RewriteRules viewer plugin to see my rules, and can see that even though i have deactivated my plug-in, rewrite rules remain 'index.php?formid=$matches[1]'. I cant understand as i am flushing rewrite rules on plugin deactivation, and i know the function is being called. This gives the same affect as above, with incorrect URLs not going to 404 but instead going to other pages. Is there anyway to fix this, so that if a wrong page is visited, 404 are thrown? Code is currently hosted here: . http://www.unifiedmicrosystems.com/products- and-services/software-development/wordpress/jformer-for-wordpress/. I am just waiting for wordpress.org access to upload the source there for general use. I have tried to copy a cut down version with relevant parts below. Many thanks in advance, Chris               class JFormerForWP     {     static $errors = false; /* for debugging */     static $pluginPath;       static $pluginUrl;            public static function makeFormFactory($id,$class)     {         $classPath = self::$pluginPath . "/forms/{$class}.php";         require_once $classPath;      }          /* called each request */     public static function init()     {         self::$pluginPath = dirname(__FILE__);  // Set Plugin Path           self::$pluginUrl = WP_PLUGIN_URL . '/jformer-for-wp/'; // Set Plugin URL                self::addRewriteRules();         add_filter( 'query_vars', array(__CLASS__, 'addQueryVars'));         add_action( 'template_redirect', array(__CLASS__, 'formDisplay'));              add_action('wp_print_styles', array(__CLASS__, 'styles'));         add_action('wp_print_scripts', array(__CLASS__, 'scripts') );         add_shortcode('jformer', array(__CLASS__, 'shortcodeHandler'));              add_action('wp_ajax_nopriv_jFormerForWp', array(__CLASS__, 'ajaxHandler'));         add_action('wp_ajax_jFormerForWp', array(__CLASS__, 'ajaxHandler'));         self::$errors = new WP_Error();     }          public static function ajaxHandler()     {            $formID = $_POST['jFormerId'];         echo self::getForm($formID);     }          public static function shortcodeHandler($atts, $content)     {         extract( shortcode_atts( array(         'id' => '0',         'class' => '',         'text' => ''         ), $atts ) );              // echo 'dumping shortcode values. content: ' . $content . ', id: ' . $id . ', class: ' . $class . '
';              $options = self::getOptions();         $permastructString = $options['url_string'];     }          public static function getOptions()     {         $options = get_option('jformer_options',array('url_string' => 'forms'));         return $options;     }          public static function addRewriteRules()     {         $options = self::getOptions();         add_rewrite_rule( $options['url_string'] . '/?([^/]*)','index.php?formid=$matches[1]', 'top' );      }          public static function addQueryVars($vars)     {         $vars[] = 'formid';         return $vars;     }          public static function formDisplay()     {     }          public static function activate()      {         if (version_compare(PHP_VERSION, '5', '<'))         {             deactivate_plugins(basename(__FILE__));         }              self::addRewriteRules();         flush_rewrite_rules(true);     }          public static function deactivate()     {              delete_option('jformer_options');         //$wp_rewrite->flush_rules(true);           flush_rewrite_rules(true);     }          public static function addAdminPage()     {         add_options_page( 'jFormer', 'jFormer Plugin', 'manage_options', 'jFormerForWP', array( __CLASS__ , 'displayAdminPageHtml' ));     }          public static function adminInit()     {         register_setting( 'jformer_options', 'jformer_options', array(__CLASS__,'validateOptions') );         add_settings_section('jformer_main', 'jFormer Settings', array(__CLASS__,'sectionText'), 'jformer_main_options');         add_settings_field('jformer_url_string', 'Rewrite String', array(__CLASS__,'displayUrlStringSetting'), 'jformer_main_options', 'jformer_main');         add_action('admin_notices', array(__CLASS__,'displayAdminNotices'));       }          public static function sectionText()     {         echo '
Main description
';     }          public static function displayUrlStringSetting()     {         $options = self::getOptions();         echo "<input id='jformer_url_string' name='jformer_options[url_string]' size='40' type='text' value='{$options['url_string']}' />";     }          public static function validateOptions($input)     {         $input['url_string'] = trim($input['url_string']);              if(!preg_match('/^[a-z0-9]{1,}$/i', $input['url_string']))         {             add_settings_error('jFormerForWP', 'url_string_error', 'Invalid URL string, please fix ensure string consists of alphanumeric characters only and is at least 1 character long', 'error' );         }         else         {             // add_settings_error('jFormerForWP', 'url_string_updated', 'String updated', 'updated' );             $validatedOptions['url_string'] = $input['url_string'];         }              return $validatedOptions;     }          public static function registerAdminSettings()     {             register_setting('JFormerForWPSettings', 'JFormerForWPSettings_option1');          }          public static function displayAdminPageHtml()     {            ?>

jFormer for WordPress Plugin Options
             Options relating to the Custom Plugin.             <form action="options.php" method="post">                 <?php                    settings_fields('jformer_options'); ?>                 <?php do_settings_sections('jformer_main_options'); ?>                 <input name="Submit" type="submit" value="<?php esc_attr_e('Save Changes'); ?>" />             </form>
         <?php     }          function showMessage($message, $msgclass = 'updated')     {           echo "
$message
";       }            public static function insertSettingsLink($links)     {         $settings_link = ''.__('Settings','JFormerForWP').'';           array_unshift( $links, $settings_link );           return $links;      }          public static function styles()     {                wp_enqueue_style('jformer', self::$pluginUrl. 'css/style.css');     }          public static function scripts()     {         wp_enqueue_script('jformer', self::$pluginUrl . 'jFormer/jFormer.js',array('jquery'));     }     }          register_activation_hook(__FILE__, array('JFormerForWP','activate'));     register_deactivation_hook(__FILE__, array('JFormerForWP','deactivate'));     add_action('init', 'JFormerForWP::init');     add_action('admin_init', 'JFormerForWP::adminInit');     add_action('admin_menu', 'JFormerForWP::addAdminPage');     ?>


title: Can't see where my get_posts custom post type query is wrong

text:
Can someone please help point out how I need to correct my post_type query here? I've searched all around for an answer and I can't get it right. It's driving me crazy! Thank you...               function get_related_author_posts() {         global $authordata, $post;              $authors_posts = get_posts( array( 'author' => $authordata->ID, 'post_type' => 'webarticle', 'post__not_in' => array( $post->ID ), 'posts_per_page' => 5 ) );              $output = '';         foreach ( $authors_posts as $authors_post ) {             $output .= '
' . 'ID ) . '">' . apply_filters( 'the_title', $authors_post->post_title, $authors_post->ID ) . '' . '
' ;         }         $output .= '';              return $output;     }


title: How to make a call to DO_ACTION on Select List Change

text: Within a wordpress page (that is using a default template), I have a select/drop-down field that, when the user selects an item, I would like to somehow have it trigger a do_action call, right at this point, but unsure how to do this/approach? Any help would be great. Thanks.


title: Does all editing of Wordpress occur within the dashboard, or can we use our own text editor?

text: I've recently ventured into the world of CMS, and I'm used to editing everything by hand with an editor like Sublime Text 2, my personal favorite. Do we do this in Wordpress, if I wanted to customize a theme? Or do we do it all through the Dashboard?


title: How to limit character length in BuddyPress function output

text: BuddyPress has a function (bp_member_profile_data) that pulls profile data into a members loop which looks like this:               <?php     bp_member_profile_data( 'field=Organization' );     bp_member_profile_data( 'field=Brief Biography' );            /***     * If you want to show specific profile fields here you can,     * but it'll add an extra query for each member in the loop     * (only one regardless of the number of fields you show):     * bp_member_profile_data( 'field=the field name' );   */      ?>      I'm wondering how to limit the echoed length of Brief Biography. I've looked at the Bavatosan example and substr but they're kind of beyond me at this point in terms of knowing where to modify them.


title: WP_Query with "post_title LIKE 'something%'"?

text: I need to do a `WP_Query` with a `LIKE` on the `post_title`. I started with this regular `WP_Query`:               $wp_query = new WP_Query(          array (             'post_type'        => 'wp_exposants',             'posts_per_page'   => '1',             'post_status'      => 'publish',             'orderby'          => 'title',              'order'            => 'ASC',             'paged'            => $paged         )     );       But what I actually want to do looks like this in SQL:               $query = "             SELECT      *             FROM        $wpdb->posts             WHERE       $wpdb->posts.post_title LIKE '$param2%'             AND         $wpdb->posts.post_type = 'wp_exposants'             ORDER BY    $wpdb->posts.post_title     ";     $wpdb->get_results($query);      The output prints the results i'm excpecting, but I use the regular `<?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>` to display the results.   And that is not working with `$wpdb->get_results()`. How can I achieve what I described here?


title: Building a store locator with google maps

text: I have a business site hosted on wordpress. Now, we are planning to have a store locator page. We are looking to build something similar to Apple store locator. My question is how do we go about creating this? Should I build a plugin or is it possible to embed a php application and have the same "look & feel" as the site? Or can I make use of custom post types? Please note that, the address info, working hours and images will be stored on the DB.Ideas and suggests are welcome. Thanks in advance.


title: How to migrate a WordPress installation from one site to another, including all images?

text: I need to move a WordPress site hosted on Dream Host to the companies servers. To do so I used the built in import and export feature that comes with WordPress (using a WordPress export file). However, it did not copy over images from the site, and didn't preserve the featured images. Using import/export, is it possible to copy over the images and featured images as well? If not, is there another method I could use?


title: How do i put a per page theme in a special box/div?

text: I am using 20-11 theme and i have the sidebar on the left, the main content center and now i would like to edit a php file (or not) to make a 3rd div to the right of the content. I'm unsure how i'll edit/style that. But my bigger question is after i get that part done, how do i say on this page use this image in that box? For some reason i suspect i specify the image on a per page bases so i may can this feature. Do you guys have any ideas? (i dont know what to tag this so feel free to change/fix it)


title: how to get shortcodes to work inside the text of custom fields

text: I am building a learning management system using Wordpress, custom fields, and various plugins, especially SIMPLE FIELDS by Par Thernstrom. My shortcode plugins, such as Shortcode Exec PHP and Custom Field Value, work fine in the main editing box, but if I put any of my course information shortcodes into a custom field, they don't work in the custom field. I know that prevents "circular reference" problems, but it also prevents me form building a more streamlined system. Do you know of any workarounds that would allow plugins to operate on the contents of custom fields, so that custom fields could contain shortcodes? The specific configuration that I most need is for shortcodes from Shortcode Exec PHP to work on the wysiwyg textarea input boxes of SIMPLE FIELDS. The problem is that right now, the custom field text managed by the SIMPLE FIELDS plugin is not evaluated by Wordpress for the presence of shortcodes of any sort, or for the presence of PHP code, as far as I can see from my experiments. Just as you might want to put shortcodes for teacher-name or text-book1 in the main edit box, one might also want to insert such local or global data strings into one or more custom fields. There are a variety of text replacement plugins available, and so far as I can see they all work fine in the main edit window or a page or post, and none of them work if inserted into the text of a custom field.


title: How to end the excerpt with a sentence rather than a word?

text: Here is the excerpt of the post on my home page. I want to end the excerpt with a sentence. In this case it is ' opportunities. '. I know how to modify the length but it won't do what i want. ![enter image description here](http://i.stack.imgur.com/5vtS0.png) Here is excerpt from other website. Here you see excerpt ending with a proper sentence unlike the above which ends with the first word of next sentence 'Proactively'. ![enter image description here](http://i.stack.imgur.com/6WlbL.png) **After Implementing thesolution by G.M. :-** ![enter image description here](http://i.stack.imgur.com/DgEaT.png)


title: Query and get meta as object(stdClass) on wp postmeta table?

text: I want to get a groups of data from postmeta table. The postmeta table have 4 colums, meta_id, post_id, meta_key,meta_value. Each post_id has a list of meta_keys. I want to run a query and get a result of               arry(number of results)(                           [0]=>object(stdClass)#1(                                                  [post_id] => 123,                                                  [key1]    => x,                                                  [key2]    => y,                                                  [key3]    => z                                                  )                           [1]=>=>object(stdClass)#2(                                                  [post_id] => 456,                                                  [key1]    => x,                                                  [key2]    => y,                                                  [key3]    => z                                                  )                           )      How to do it?


title: What is the best method to close off the backend?

text: **The goal** : Completely remove the ability to access the WordPress backend on the production domain. Ex. return a 404 for http://example.com/wp-admin **Purpose** : I don't want any possibility of WordPress' backend being accessed across the Internet. Instead, it will only be accessibly via VPN on an internal domain (i.e. http://example.internal/wp-admin. _This ensures that no one could ever brute force attack the login page._ I could restrict logins to a given IP address, but I don't want to keep up with a list of IPs. I'd prefer to use the security my VPN already offers. Consider that `wp-admin` still has to be accessible in some fashion because there could be resources that the frontend calls. Are there any solutions beyond redirecting `wp-login.php` somewhere else?


title: Reordering Buddy Press profile navigation

text: I am using this code to reorder the positions of the menu items for BuddyPress profile. I am using the xprofile (not sure if that makes a difference). Here is the code that I am trying to use:               <?php     /*     Plugin name: BP custom     Plugin URI: http://pittbullweb.com     Description: Customs for Buddy Press     Version: 0.1     Author URI: http://pittbullweb.com     */          function bbg_change_profile_tab_order() {     global $bp;              $bp->bp_nav['profile']['position'] = 10;         $bp->bp_nav['activity']['position'] = 20;         $bp->bp_nav['blogs']['position'] = 30;         $bp->bp_nav['friends']['position'] = 40;         $bp->bp_nav['messages']['position'] = 50;         $bp->bp_nav['groups']['position'] = 60;         $bp->bp_nav['settings']['position'] = 70;     }     add_action('bp_setup_nav', 'bbg_change_profile_tab_order', 999 );     ?>      I am going by the instructions given here to be able to do this. However when I go to activate the plugin i get a fatal error: **Fatal error:** Cannot redeclare bbg_change_profile_tab_order() (previously declared in /var/www/vhosts/giftcardswapping.com/demo/wp-content/plugins/bp- custom.php:11) **in /var/www/vhosts/giftcardswapping.com/demo/wp- content/plugins/bp-custom.php on line 20** I have also tried renaming the function as well and still receive the same fatal error. I do not understand how it is redeclared anywhere. I would appreciate any help to figure this out. Thank you.


title: Wrong page displays as home page

text: My website www.makowerarchitects.com loads up 'something' (for lack of a better word), whereas the correct Home page that needs to show upon visiting the site shows under www.makowerarchitects.com/website...which is the folder where my wordpress installation is. I'm using a template and I never went into changing anything on the template, except add two additional pages (different from the Home Page, which is there by default from the template I'm using). My `.htaccess` file looks like this:               RewriteEngine on     RewriteCond %{HTTP_HOST} ^(www.)?makowerarchitects.com$     RewriteCond %{REQUEST_URI} !^/website/     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule ^(.*)$ /website/$1     RewriteCond %{HTTP_HOST} ^(www.)?makowerarchitects.com$     RewriteRule ^(/)?$ /website/index.php [L]      I'm sure it's just something wrong with some redirecting somewhere, just don't know where. Please help. Thanks.


title: How can I make my custom posts appear in their assigned category url?

text:
I am trying to solve this problem: I created new custom post types. When I create a post and assign a category (lets say category-1) to it, and when I try to visit the category-1 url, it appears "There has been an error." I tried solving the issue based on the Michal Mau post (How to display regular posts & custom post types that fall under a category using just the generic category template?). My edited code after adding Michal Mau suggestion looks like this:               <?php if (have_posts()) :     global $wp_query;     $args = array_merge( $wp_query->query, array( 'post_type' => 'any' ) );     query_posts( $args );          while (have_posts()) : the_post(); ?>       <article id="post-<?php the_ID(); ?>" <?php post_class('post-holder'); ?>>         <?php if(has_post_thumbnail()) {                     echo '
';                     echo the_post_thumbnail();                     echo '
';                     }                 ?>      **The problem wasn't solved. I don't know if there is a mistake pasting the code or any other mistake.**


title: Active theme responds to theme change request to alert user

text: I'm trying to intercept the install themes routine in order to alert the user from the active theme. I'm cobbling together a crude javascript alert below. What are some other options?               if ( is_admin() && $pagenow == 'theme-install.php' && $_GET['tab']=="upload"){     ?>     <script type="text/javascript">         alert('Message here');     </script>     <?php     }      The reason for this is to make sure that the user is not attempting to install my theme's upgrader.zip upgrade file as a theme (which results in a broken theme).


title: I'm trying to use the Group Extension API in BuddyPress but keep getting a fatal error

text: I'm trying to use the example code found at http://codex.buddypress.org/developer-docs/group-extension-api/ to use in a plugin, but when I try to use it I keep getting the following error: Fatal error: Class 'BP_Group_Extension' not found in /home/httpd/html/wearewomenmarch.net/public_html/wp- content/plugins/buddypress-group-documents/index.php on line 53 The line 53 in question is as follows:               class BP_Group_Document_List_Extension extends BP_Group_Extension {        And the whole chunk of code I'm trying to use is               class BP_Group_Document_List_Extension extends BP_Group_Extension {       var $visibility = 'private';     var $enable_create_step = false;     var $enable_nav_item = false;     var $enable_edit_item = false;          function bp_group_document_list_extension() {             $this->name = 'Documents List';             $this->slug = 'group-document-list';                  $this->create_step_position = 21;             $this->nav_item_position = 31;         }              function create_screen() { }              function create_screen_save() { }              function edit_screen() {  }              function edit_screen_save() { }              function display() {             display_group_document_list();         }              function widget_display() {  }     }     bp_register_group_extension( 'BP_Group_Document_List_Extension' );      Groups are active on the site, and the BP Group Calendar plugin is active. I see it uses the Group Extension API as well and it works, so I'm sure I'm making some mistake. I'd appreciate any advice on where to go from here so I can resolve that fatal error.


title: Contact form do not find submit.php file

text: I added a contact form to the footer. Apparently it works fine in the main page, but if I go to any of the categories, lets say myblog.com/category/, the contact form is looking for submit.php at myblog.com/category/submit.php. Where I should put physically submit.php in order for contact form to find it in any category page?


title: Admin: Custom Query Returning Permissions Error

text: Our current WordPress install has a few custom tables we've placed into the WP database that hold misc. information. We've created custom option pages for the WP admin panel for our WP admin users to be able to access the information from the DB through the admin. One option we want is for users to be able to delete some of these records through the WP admin panel, so I've initially setup a custom query to just UPDATE or DELETE the records from the table. However, when I try to submit the query, WP returns the error: "You do not have sufficient permissions to access this page.". Should I be avoiding the MySQL query "UPDATE table_name... etc."?


title: How do you get thumbnails to show up in the admin edit post?

text: I tried to add thumbnail support to my theme               add_theme_support( 'post-thumbnails' );     set_post_thumbnail_size(133, 133, true);     add_theme_support( 'post-thumbnails', array( 'post' ) );     add_theme_support( 'post-thumbnails', array( 'page' ) );      So this isnt working, or at least I'm not sure how this should work, help!


title: Anyone know why wordpress converts some html entities to their numeric equivalents?

text: Does anyone know why wordpress converts some html entities to their numeric equivalents? I've found that in some posts, where a non-breaking space ` ` entity would be appropriate, wordpress uses ` ` instead. Seems to me that using the symbolic version of the entity would be better than a numeric version. The routine that this is being done in (appears to be) ent2ncr in wp- includes/formatting.php. When I converted my blog from a single site to multi-site (different install & database), the numeric entities were not converted properly (possibly due to a database difference). Had the symbolic entities been used, I doubt this would have been a problem.


title: redirect users to the login page

text: I create a template page as seen below to check if user is logged in or not. If user is not logged in, I want to redirect user to first login page and after login I want him to redirect previous page. With the code below, Login redirection function redirects to login page again after user login. How can I fix that code? In my template page :                   <?php         if(!is_user_logged_in())          {              wp_redirect( 'http://....../wp-login.php', 302 );         }         else         {              wp_redirect('----------otherpage---',302 );           exit;         }         ?>      in functions.php :                   function directtorequest( $redirect_to, $request, $user )         {             // instead of using $redirect_to we're redirecting back to $request             return $request;         }         add_filter('login_redirect', 'directtorequest', 10, 3);


title: New Topic in bbPress

text: How can I create a new topic from PHP or from a URL Post? I need to post some topic from a mobile app. I am a newbie and don't know much about bbPress API.


title: How to use github to update my plugin

text: I am trying to use github for my plugin updates, i have looked around I found this WordPress-GitHub-Plugin-Updater. I am now stuck and cannot get it to work. I have created the simplest plugin to test it and to see how it works before I add it to my plugin but I cant get it to work. The plugin I have put together to test this is here I would really appreciate it if anyone could have a look and let me know what I am doing wrong.


title: Make next post button link to random post

text:
The normal behavior of this code is move to next post in order by id. Need to change this ascendent order to go instead to a random post (published).
             <?php if (!empty($prevID)) { ?>
                 <a href="<?php echo get_permalink($prevID); ?>"                     title="<?php echo get_the_title($prevID); ?>">Previous
                 <?php }                 if (!empty($nextID)) { ?>
                     <a href="<?php echo get_permalink($nextID); ?>"                         title="<?php echo get_the_title($nextID); ?>">Next
                     <?php } ?>


title: Theme Functions run a function upon activation or preview

text: My theme currently has the following line in the function.php file: ` if ( $_GET['activated'] == 'true' || $_GET['preview'] == 1 )` If this statement is true the code runs a function. I am getting a php error that says Notice: Undefined index: activated in and Notice: Undefined index: preview in. I am sure in wordrpess there is another way to do this "if statement" to prevent the Undefined index: error I am getting. Any suggestions? Thank you! Here is the full code:                  //ADD OPTION PAGE                              add_action('admin_menu', 'ddthemes_admin');                                    //UPON ACTIVATION OR PREVIEWED           if ( $_GET['activated'] == 'true'  || $_GET['preview'] == 1 )      { ddthemes_setup(); } function ddthemes_admin() { /* PROCESS OPTION SAVING HERE */ if ( 'save' == $_REQUEST['action'] ) { if ( $_REQUEST['savetype'] == 'header' ) { update_option( 'ddthemes_header', $_REQUEST['ddthemes_header']); } } /* SHOW THEME CUSTOMIZE PAGE HERE */ `add_theme_page(__('Logo Options'), __('Logo Options'), 'edit_themes', basename(__FILE__), 'ddthemes_headeropt_page');} ` `


title: Internal Server Error 500 with Custom PHP file

text:
I am trying to create a gallery with multiple sortable albums since there are so many pictures. I am doing this by enabling categories on media items, looking up a specific category, gettings all the appropriate IDs, and loading the images into 's. The issue is when I try getting my php file. When I setup the php as an different file Firefox reports... "HTTP/1.1 500 Internal Server Error" However, when the php is inline with the page it works fine. So this leads me to believe that it simply is having trouble getting the file. However I am at a loss as to how to remedy that. Here are my files. All of which are in my theme folder page-gallery.php               <?php get_header(); ?>

          <?php get_footer(); ?>                gallery-loader.php               <?php     $term = get_term_by('slug', 'category-to-look-for', 'category');     $id = $term->term_id;     $images = get_objects_in_term( $id, 'category' );          $gallery_content = '
';     foreach ($images as $image){         $gallery_content .= wp_get_attachment_image( $image, thumb);     }     $gallery_content .= '
';     echo $gallery_content;          ?>      And the jQuery to activate the gallery-loader.php                 $.get("gallery-loader.php", function(data){             alert("got the gallery!");         $("#content").html(data);       });


title: Multiple Queries and Loops within CPT Archive

text: I have a Custom Post Type called 'properties', and have set up an Archive page to display posts within that category. Essentially, the Archive page needs to contain 3 different query types; the first to display search results of posts within the CPT, the second to make results sortable (queried through a drop-down menu that interrogates Custom Field meta values), and the third to display all posts within the CPT. I'm not sure how to structure the queries and loops though - all the queries work individually, but I'm struggling how to set up the If/Else statements to make them work within one archive page, so would be grateful for any advice you might have! **Query 1: Search Results**               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;              $args = array(              'post_type' => 'properties',         'meta_query' => array(         'relation' => 'AND',         array(             'key' => 'property_size',         'value' => $_GET['size'],         'compare' => '>='         ),         array(             'key' => 'property_rent',         'value' => $_GET['budget-from'],         'compare' => '>=',         'type' => 'NUMERIC'         ),         array(             'key' => 'property_rent',             'value' => $_GET['budget-to'],         'compare' => '<=',         'type' => 'NUMERIC'         )                 ),        'paged' => $paged           );          $query = new WP_Query( $args );      **Query 2: Sortable Posts within CPT**               if($_POST['square-sort-select'] == 0):          $select = $_POST['square-sort-select'];     $query = new WP_Query(array(         'post_type'=> 'properties',         'post_status' => 'publish',         'meta_key' => 'property_rent',         'orderby' => 'property_rent',         'order' => DESC     ));          ; elseif($_POST['square-sort-select'] == 1):              $select = $_POST['square-sort-select'];         $query = new WP_Query(array(         'post_type'=> 'properties',         'post_status' => 'publish',         'meta_key' => 'property_rent',         'orderby' => 'property_rent',         'order' => ASC     ));          ; elseif($_POST['square-sort-select'] == 2):              $select = $_POST['square-sort-select'];         $query = new WP_Query(array(             'post_type'=> 'properties',         'post_status' => 'publish',         'order' => DESC     ));      **Query 3: All Posts within CPT**               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $query = new WP_Query();     $query->query('post_type=properties&posts_per_page=6&paged='.$paged);


title: Multiple domains for multiple single installs

text: I've done my share of searching, but apparently my search-fu is failing me, because I haven't found anything that really seems to fit my circumstance. **Also, I don't want to just try random solutions and end up bricking everything.** I have a client who has previously managed her site and installations herself and has now hired me on to take things over. Currently there is **one hosting account** with **two domains**. **The host is GoDaddy. It's a Deluxe linux account.**   * There is a Wordpress installation in the root directory of the account, currently serving **domain1.com**   * There is a **second Wordpress installation** in a directory (domain1.com/domain2). This install is suppose to be serving **domain2.com**. Which it does, but it's also posing a bunch of problems. Under the installation for domain2.com ( installed in domain1.com/domain2 ), I **can't change the permalink settings** to anything but default with out breaking the entire site.   * **Changing the permalink settings** results in the warning that Wordpress can't write to .htaccess. **Despite** the .htaccess permissions being set to 644 (I even tried 777).   * So I **manually edited** the .htaccess file to Wordpress's generated content.   * **This results in the site 'breaking'**. The front page shows some default content that I don't recognize and none of the links result in pages being loaded. Just the default 'page not found'. Under the General settings the install is set to:               WordPress Address (URL) : http://www.domain1.com/domain2     Site Address (URL) : http://www.domain2.com      **IS it possible to successfully run two separate domains from two separate Wordpress installs, under the same hosting account, with out switching everything over to a network?**


title: Show snippets in a category feed but full post in other feeds

text: Is it possibile to have different feed settings for my main RSS feed and the feed for a category? For example, I want to have a category `foo` that shows only snippets and the post's featured image (using the Featured Image in RSS Feed plugin). I also want to have a feed for all posts, including `foo`, that shows the full content of each post. How can this be accomplished?


title: Add blog languages to blog-name inside my-site-list in admin-bar

text: I would like to add the language of every blog to the blogname inside the my- site-list inside the admin-bar. The result should look like this: ![enter image description here](http://i.stack.imgur.com/siKuI.jpg) For adding the languages to to the site-name in (1) I use this code:               add_action('wp_before_admin_bar_render', 'add_language_to_blog_name');     function add_language_to_blog_name( $wp_admin_bar ) {              global $wp_admin_bar;              $wp_admin_bar->add_menu( array(             'id'    => 'site-name',             'title' => get_bloginfo( 'name' ) . ' | ' . get_bloginfo( 'language' ),         ) );          } How can I edit the blognames inside the my-site-list?


title: Strip $before & $after strings from a page title

text:
So I have plugin that pulls remote data (real estate listings) into a wordpress site. I have been asked by a client to allow the page title for each listing to be set based upon that information and formatted the way they want. I can use the_title filter to change the content of the title easily enough, but I am running into a problem with the $before and $after elements impacting the formatting. For example, twentyfourteen uses this to output a page title:               the_title( '
', '
' );      So if I run the_title filter and do something like this (greatly simplified):               add_filter( 'the_title', 'fls_mls_listing_title_filter', 30, 2 );     function fls_mls_listing_title_filter( $title, $id ) {        if ( in_the_loop() ) {           $new_title = 'Something:
Main Title

Subtitle
'           return $new_title;        }           return $title;     }      I end up with this:
Something

Main Title

Subtitle
           But I would like to end up with this:               Something
Main Title

Subtitle
      Obviously this is not a very logical example, but I wrote it just to keep it simple. I need to do this from within the plugin and without creating a custom page template so it will work with any theme if possible. Any insights would be greatly appreciated.


title: Custom Meta Boxes and Fields Multicheck Issue

text: I'm using Custom Meta Boxes and Fields by Justin Sternberg and its pretty great, however there's been a huge issue with using the multicheck checkbox options for me. This is what the plugin's code returns:               '_cmb_seostats_multicheckbox' =>          array (size=22)           0 => string 'alexa_tr' (length=8)           1 => string 'alexa_bl' (length=8)           2 => string 'google_pr' (length=9)           3 => string 'google_bl' (length=9)           4 => string 'indexed_x' (length=9)      How do I test those checkbox options within an if statement?


title: All images from posts of specific category

text: I'm photographer and am developing my own portfolio, it's in the final stage. I'm trying to get all images from posts in a specific category. I can actually get all images from all posts, but they just grab everything, published posts, drafts, private etc. And from all categories. And then I could loop in every post attachment to check if it feeds my conditions, but I think it's resource consuming to later discard more than half of the results. So I guess the best option would be the SQL JOIN, which I always get confused. If anyone can provide me some help on this, the logic is as follows:   * Category wanted: Portifas.   * **$wpdb->terms** is the table where I get the Portifas category's ID, 79. But it can be a defined value in my SQL query, so I don't need to open this table for the query.   * **$wpdb->term_relationships** is the table containing six posts with category Portifas. This gotta be dynamic so I can post more stuff inside the category.   * With these results (six now), I gotta loop inside **$wpdb->posts** to check every post inside Portifas category, see if it's published to, finally...   * Loop inside **$wpdb->posts** again and grab all the attachments (images) inside each post that is published inside Portifas. I just can't construct the SQL query to do all of this. All help will be appreciated. Thanks!


title: Can I have two different theme for two different language?

text: I have to develop a multilanguage website using WordPress (Italian and English) and I want to know if I can have a theme for the Italian version and a differen theme for the English version. Can I do this thing? Tnx Andrea


title: problem loading stylesheets to wp_head dynamically

text: I'm trying to create a wrapper shortcut function to register and load stylesheets in the header. currently, the function loads this css file src:               http://my.test/wp-content/theme/css/.css      I, obviously want it to pass the parameter given. The problem is, the new function definition within the new function definition doesn't seem to be taking the parameter even though my #4th argument for add_action was 1 (parameter passable to function). What am I doing wrong?? Please help :)               <?php //Registering stylesheets          load_stylesheet_like_a_boss('my-style.css');          function load_stylesheet_like_a_boss($filename){         echo 'parent:'.$filename; //should return 'parent: my-style.css'             add_action('wp_head', 'stylesheet_registration', 5, 1);                   function stylesheet_registration($filename){             echo ' / child:'.$filename.'<br>'; //should return ' / child: my-style.css'             $name = str_replace('.css','', $filename);                  wp_register_style($name, get_bloginfo('template_directory').'/css/'.$name.'.css');             wp_enqueue_style($name, 10);         }     } ?>


title: TinyMCE in a div / textarea on frontend?

text: I have a post on my frontpage and I want to add the TinyMCE editor to it and could not make it work. **I've tried these guides without any luck**   * http://stackoverflow.com/questions/2855890/add-tinymce-to-wordpress-plugin   * http://keighl.com/2010/01/tinymce-in-wordpress-plugins/ The guides are for making it work on backend. **I guess I need to find out how to do these things...**   1. Add some Javascript with wp_enqueue_script.   2. Add some inline Javascript settings within script-tags.   3. Add a textarea or a div with a specific name, class or ID. Help me in any way, code, links to guides, advice, anything.


title: Wordpress plugin archive

text: I need to find an archive of some Wordpress plugins. Previous webmaster of the site installed some plugins and then made modifications to some of them. He did not document these modifications in any way, so I have no idea what was changed and where. There's also no contact with him. And now I need to upgrade Wordpress and its plugins - there's a security update released. I could compare installed plugins to originals but I can't find an archive of old versions of these plugins anywhere. Is there any?


title: Application form plugin with payment gateway

text: I'm working on a site for a small business academy. We're trying to create an application for potential students to fill out to apply for the school. The form needs to be able to have multiple long-form questions, (paginated would be nice for each), and before the application is submitted, the students would have to pay an application fee. Does anyone know of any application form plugins that support these features: paginated questionnaire and payment gateway for application fee? TIA


title: Best way to execute custom page-specific mysql queries

text: I would like to query a secondary mysql database (not the Wordpress mysql database) with page-specific queries. I've seen many answers / tutorials on setting up a secondary mysql database, like:               $newdb = new wpdb('my_user_name', 'my_password', 'my_database', 'my_host');     $newdb->show_errors();      But I haven't seen tutorials on how to execute individual page-specific (not template, so varies from page to page) queries to that database. What is the best way to achieve this?


title: javascript is not working on Event Submission?

text: I am using Events Manager Plugin Javascript is not working on **Submit Events** Page . I found the reason behind this , that was, I have written a line of code in functions.php to call jquery file. `wp_enqueue_script('jquery-1.7.2',get_template_directory_uri().'/js/jquery-1.7.2.min.js');` When I remove this line of code then javascripts start working fine on Event Submission Page but this file is important for me because I am using this file at many places too so I can not remove this. For Example I have a line of code which generates error.Line is : `var p_option = $('input[@name="p_option"]:checked').val();` . This line is written in **'wordpress_1/wp-content/themes/my- theme/sidebar.php'** I also asked this question on plugin support but no reply from there. Thanks in advance!!!


title: Index page and random posts needs a forced refresh in order to show new content

text: I have this weird problem with both on desktop and mobile, which requires a manual refresh in order for the index-page to show new posts. It also appears as if the user is not logged in. Basically, I have a custom login function with wp_signon. The user logs in and get redirected to their "account" page. Here they are shown as logged with the appropriate menu for logged in users. If I click that "Star" menu-button, which take me back to the homepage, the user suddenly appears to be logged out. When I press a post, the user is logged in again. But on some posts, they appear to be offline. Even if I change the custom login function to redirect to the homepage instead of the account page, it's the exact same problem. Even on the homepage the user is now shown as logged in, but if you press start or type in the website url: www.blabla.com, the user is suddenly shown to be logged out. When I refresh the homepage everything is as it should. This is an extremely annoying problem. Can it be some sort of a database problem?


title: Difference Between Filter and Action Hooks?

text: I have been looking at the plugin API a bit more in depth recently and I was wondering **what real differences there were between action and filter hooks**. They both are events that receive data as a parameter and they seem to both be able to do the same things. Obviously I see that actions are called when actions take place and filters are called when data is manipulated, but it seems to just be a semantic naming difference. Besides semantics and what they are used for, what real differences are there between them?


title: Problems with autoloading classes via sp_autoload_register / maybe interfering WP-specific autoloader

text: I'm working on a plugin in which I do the following for autoloading classes:               function TFSLAutoload($class) {         $classfile = dirname(__FILE__).'/includes/'.strtolower($class).'.php';         include $classfile;     } // function TFSLAutoload     spl_autoload_register('TFSLAutoload');      In the plugin (classes) I can instantiate classes (e.g., use `$myClassXYZ = new MyClassXYZ();`) as well as use static functions (e.g., `MyClassXYZ::my_static_func();`) without including/requiring the file defining the very class. In short, everything is working as expected. However, when having `WP_DEBUG` set to true, I do get the following warnings:               Warning: include(/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/wp_atom_server.php): failed to open stream: No such file or directory in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31      Warning: include(): Failed opening '/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/wp_atom_server.php' for inclusion (include_path='.:') in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31      Warning: include(/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/Recursive_ArrayAccess.php): failed to open stream: No such file or directory in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31      Warning: include(): Failed opening '/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/Recursive_ArrayAccess.php' for inclusion (include_path='.:') in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31     Warning: include(/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/WP_Session.php): failed to open stream: No such file or directory in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31      Warning: include(): Failed opening '/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/WP_Session.php' for inclusion (include_path='.:') in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31      I then changed my autoload function to check first if the file exists:               function TFSLAutoload($class) {         $classfile = dirname(__FILE__).'/includes/'.strtolower($class).'.php';         if (file_exists($classfile)) include $classfile;         else echo "File »$classfile« does not exist.".PHP_EOL;     } // function TFSLAutoload     spl_autoload_register('TFSLAutoload');      Now, only my own plugin class files are loaded by the autoloader, as they are the only files loacted in the pre-defined folder. However, if the three mentioned WordPress classes are still being 'sent' through my autolaoder class, are they even(tually) loaded correctly by WP? Or is my autoloader competing with the built-in autoloader of WP? How can I check that? Or: Am I doing the whole autoloading stuff the wrong way? And why are these three classes sent to my autoloader? Are they the only ones to be load after the plugins are loaded?


title: Posts not working on windows after changing permalinks

text: I recently started learning wordpress. Out to curiosity of changing settings, I changed permalinks to Month and Name. After that all my posts and pages have stopped working and show me a 404 Error. I am not being able to figure out why is it happening.   I even tried posting new posts and even they doesnt work.   Please suggest any solution. I am using WP 3.7 on windows machine with wamp.


title: List posts in a category grouped by other categories?

text: I have posts of stores and restaurants in my area. Each post is marked by category of type (e.g. Restaurant, store) and town. What I am trying to do is create a page for each town (with intro text and photos enter into the page ui) and then a loop of Posts in that town's category grouped by the other categories. Ideally, I'd like to get the current page's slug, or last part of the url to use for the post query: as in "http://mysite.com/towns/mayberry" would display all posts in the mayberry category grouped by the other tags. So my page is Mayberry some content Listings: Restaurants (in mayberry only) - item - item Hotels (in mayberry only) - item - item Is this possible?


title: Custom Structure permalinks error 404

text: i have changed the wordpress custom structure permalink to `/%post_id%/%postname%/` and get this error : **404 Not Found The requested URL /mysite/blog/1/hello-world/ was not found on this server.**   * wordpress version **_3.1.7_**   * site address: **localhost/mysite/blog** i'v changed this function in **misc.php** and saw the error again!               function got_mod_rewrite() {         //$got_rewrite = apache_mod_loaded('mod_rewrite', true); //old line with false negative;         $got_rewrite = true;//force the response to true as we know mod_rewite is installed;         return apply_filters('got_rewrite', $got_rewrite);     }


title: What can be the reasons that breadcrumb in a site is malfunctioning?

text: A WordPress site is using **Breadcrumb NavXT** plugin to show the site's navigation flow. But in some pages it's malfunctioning -- showing wrong post title to the breadcrumb. I tried disabling the plugin and used a custom function: **Adding WordPress breadcrumbs without a plugin** to show breadcrumb. But it's still showing the wrong title on some posts. I checked the malfunctioning post ID, slug, title, excerpt, URL -- everything seems to OK, but the breadcrumb's post title. I drafted (unpublished) the particular post, that's displaying into the breadcrumb's post title - then found that, the breadcrumb is still malfunctioning but this time it's taking another post title of the same category. I ...   refreshed the browser cache -- not worked.   refreshed the permalink -- not worked.   changed to permalink from `/%post_name%/` to `/%post_id%/%post_name%/` -- not worked. I can't figure out what other possibilities there might be that can malfunction the breadcrumb-- only the breadcrumb.


title: MS Access to manage WordPress Database

text: Now I don't believe this is practical or possible without a large amount of development. My client's old site used MS Access to manage the user's profiles on his old website. His new site uses BuddyPress to manage user profiles, his old site was a bespoke WordPress members system. I'm just trying to get a concrete answer from someone who knows - is it practical or possible to manage users from MS Access or is it more hassle then it's worth. Cheers!


title: Getting a user role from the user login name

text: The question might be simple. Since I need to fix it soon I had to ask. Currently I am modifying a free plugin. In that I am having the _user login_ string. How can I get the role for that login? I'm using WordPress 3.8.


title: How to serve different thumbnails/images depending on users browser/platform

text: This is a general question to discuss approaches to filtering WordPress image sizes based on the browser/platform (such as a smart phone or netbook or desktop). The idea being that on a mobile we don't want to force people to download a 100kb image when a 20kb one would be big enough for their screen, thus saving them and yourself, bandwidth. The outcome would be to make using CSS media queries a viable alternative to a separate theme for a mobile version of a site. There are a few points to consider: ## User Interface What would be the best way to allow a user to control the thumbnail and medium image sizes etc... for different platforms or indeed just for different screen sizes? ## Device Detection What would the best way to detect the device/UA's screen capabilities on the server side. Are there any plugins that do this already? ## Implementation How would you go about writing the code to create the different thumbnails, and then to alter WPs output according to the device / screen size? Ideally this would be theme agnostic so a call to `the_post_thumbnail('medium')` would return the appropriate size of image for the device/platform.


title: Wordpress overriding actual subdirectories

text: I have a site driven by Wordpress and a few custom directories that I've got at the top level. Some of these top-level directories work and the content inside of them are being read as expected. However, I've just created a new folder directory with an index.html inside and when I try to visit it, Wordpress is overriding it and displaying a 404 error (since that directory structure doesn't exist in the Wordpress database). I've disabled the W3 cache and I've checked the .htaccess file in the event that I put in a redirect in the past, but nothing that would indicate a redirect back to Wordpress.


title: Free paypal cart solution

text: Does someone some good & free paypal cart solution for wordpress? I was looking at phpurchase.com, that looks good but I don't want to buy it since it's for a test project.


title: Is there an easy way to get a list of Category IDs?

text: I'm working with a couple of plugins that ask for a list of category IDs to include/exclude. When I go to the categories section and select "Edit" I don't see an ID field listed on the page, though I see all the other details. Since I will be relaying this information onto other users, how can I find the category ID for them?


title: post_tag tanonomy with custom post type

text: I'm looking all over google but doesn't find the way to do it. i've declared a custom post type (let's say 'job') with a custom hierarchical taxonomy ('activities'). I would also like to assign "normal" tags to my custom post type (if i have a tag 'full employment' for my classic posts, i want to assign to my job posts also). how can i achieve that ? i managed to have a custom taxonomy on several post types, but i don't know how to target post_tag and add him a post type. for example :               register_taxonomy( 'seasons', array('job', 'post'), $args );        make seasons appear on classic posts and also on job posts. I would like to have 'tags' available for my job posts. am i clear ? thanks,