title: Custom post type, permalink, add query variables problem

text: Doing something wrong, can't figure out what..Any help is highly appreciated for sure! I have a custom post type which I want to add query vars to in permalink structure.. So far so good.... This is wordking right: http://allehondenrassen.nl/kennel?artist=queen&genre=pop This is not working: http://allehondenrassen.nl/kennel/queen/pop/ **in my archive-kennels.php I added:**               echo get_query_var('artist');     echo get_query_var('genre');      **In functions.php I added:**               add_filter('page_rewrite_rules', 'dvd_rewrite_rules');     function dvd_rewrite_rules($rules)     {     global $wp_rewrite;     // custom post type name     $dvd_post_type = 'kennels';     $dvd_rule = array(         // Custom Rewrite Slug = kennel         'kennel/(.+)/(.+)/?' => 'index.php?post_type=' . $dvd_post_type . '&artist=$matches[1]&genre=$matches[2]'     );     return array_merge($dvd_rule, $rules);     }               add_filter('query_vars', 'dvd_query_vars');     function dvd_query_vars($vars)     {     $dvd_vars = array(         'artist',         'genre'     );          return array_merge($dvd_vars, $vars);     }      Playing with this for hours but can't see the problem... Thanks in advance! Bas


I wrote my plugin. How to display the result of the plugin's function to sidebar (widget?)?               <?     function register_form () {         global $post;         $test = "testesttest";         var_dump("testtest");         return $test;     }     add_action( 'get_header', 'register_form' );     ?>      How to display the sidebar this text via the admin panel of wordpress? get it done through a widget? need to create a widget?


title: Custom query works but returns "Undefined Offset: 0"

text:
My custom query works, except when debugging it throws off an error: > Undefined Offset: 0 in /wp-includes/query.php This is what my query looks like :               <?php $loop = new wp_query('post_type=car&category_name='.get_the_title());?>          <?php if( $loop->have_posts() ) : ?>
             <col style="width:35%">             <col style="width:30%">             <col style="width:20%">             <col style="width:15%">

                         Name	                         Style	                         ABC	                         Rating

                     <?php while( $loop->have_posts() ) : $loop->the_post(); ?>
                         <a href="<?php the_permalink(); ?>"><?php the_title(); ?>	                         <?php $style = get_post_meta( get_the_ID(), 'style', true); echo $style; ?>	                         <?php $abc = get_post_meta( get_the_ID(), 'abc', true); echo $abc; ?>	                         <?php $rating = get_post_meta( get_the_ID(), 'rating', true); echo $rating; ?>
                     <?php endwhile; else: endif; ?>

      I've looked up Undefined Offset: 0, but I can't seem to figure out what I'm missing here. What could be wrong?


title: Permalinks problem with custom theme

text: I am pretty much learning by doing a custom theme from scratch (not a child theme), and have had much trouble with permalinks. In the permalinks settings page on the wp-admin, if I put any option either than the default linking system, all my links result in 404 page not found errors. I'm not sure if this even exists, but I haven't built a permalink handler function per se. My knowledge of web development (pre-wordpress) makes me want to think that it should though.


title: Change permalinks for posts but not for custom post types

text: Currently my permalink structure for posts is               domain.com/post-title      I'm using a static front page and a "blog" page for posts. I'd like to to change the permalink structure for posts, tags and categories to               domain.com/blog/post-title      I can easily add /blog/ in the permalink structure but the catch is that my custom post types also get this modified permalink structure and that is not the desired result. Thanks in advance!


title: Undefined offset: 0 in > [...] /wp-includes/capabilities.php on line 1067

text: Hey i get this error messages on my localhost setup, but only with the genesis framework enabled, wordpress twentyeleven works fine. This does happen when i want to create a new post. If i refresh the page the error will repeat but the post itself gets crated and it seem everything goes fine. Does anyone know what causes this? Look here for full error messages. http://tinkerbin.com/77zcKciY 1 > Notice: Undefined offset: 0 in /var/www/secret/htdocs/wp- > includes/capabilities.php on line 1067 2 > Notice: Undefined offset: 0 in /var/www/secret/htdocs/wp- > includes/capabilities.php on line 1067 3 > Warning: Cannot modify header information - headers already sent by (output > started at /var/www/secret/htdocs/wp-includes/capabilities.php:1067) in > /var/www/secret/htdocs/wp-includes/pluggable.php on line 876 its a newly install unmodified genesis framework


title: Keep featured content post in homepage with original order

text: I'm searching how to keep the featured post in my blog homepage without excluding it from query post. My blog uses the Twenty Fourteen theme. I found this solution. Open the **featured-content.php** from your theme's inc folder, and look for the following code (line 269 in our case).               $query->set( 'post__not_in', $featured );      Simply comment out this line, by adding two slashes in front of it, to get this:               // $query->set( 'post__not_in', $featured );      But the file doesn't have that line and the child theme cannot override the parent theme's inc folder. I have found another solution and it works, but, the problem is this code show the featured content post not in their original order. When old content post - I'm using sticky post to make featured post - become featured, the featured content post will become the first order then the other post. I have try using conditional tag like this.               function show_featured_content_on_home() {     if ( !is_home() ) {     remove_action( 'pre_get_posts', array( 'Featured_Content', 'pre_get_posts' ) );         }     }     add_action( 'init', 'show_featured_content_on_home', 31 );      The second page and so on okay - show the featured posts in order - but the homepage still have problem. Any suggestions?


title: Limit the number of child pages

text:
I have this html structure:               <home>     <Web>        <web 1>        <web 2>        <web 3>        <web 4>        <web 5>        <web 6>        <web 7>      </web>     <Print>        <Print 1>        <Print 2>        <Print 3>        <Print 4>        <Print 5>     </print>     <Art>        <Art 1>        <Art 2>        <Art 3>        <Art 4>        <Art 5>        <Art 6>     </art>     </home>      I use this to display the grandchildrens content while hiding its parent               <?php $counter = 1 ?>
          <?php      if ( have_posts() ) {     while ( have_posts() ) {         the_post();              $args=array(                 'orderby' => 'menu_order',                 'order' => 'ASC',                 'posts_per_page' => -1,         'post__not_in' => array(4,368,358,354),                 'post_type' => 'page',                 'post__in' => $pageIDs         );              $childpages = new WP_Query($args);              if($childpages->post_count > 0) { /* display the children content  */             while ($childpages->have_posts()) {                  $childpages->the_post(); ?>
                     <?php                  echo "
".get_the_title()."
";                         echo the_content();              ?>
         <? if ($counter % 3 == 0): ?>

             <?php endif; ?>         <?php $counter++; ?>                 <?php }         }         wp_reset_query();     }     }          ?>
      At the moment all grandchildrens are displayed, how do I limit the number of grandchildrens to be 3 per type (3 for the print, 3 for the web and 3 for the art)?


title: Custom permalink to make a page respond properly

text: I've built a complete MVC framework that integrates perfectly well into Wordpress. This framework also provides a simple to intermediate implementation of a ReST interface (the real one with hypermedia formats and links between answers and pages, not just the GET/POST/PUT/DELETE part) I created a custom post type that when created automatically binds to my framework and all urls to access the REST interface work fine until i have to get out of the traditionnal page based url. For example:               GET http://mysite.com/json/order/2/      That one works fine because the %page% variable gets the 2 into it because it fits the normal permalink structure wordpress uses. Where it starts to get complex is when i want the following url to respond:               GET http://mysite.com/json/ticket/32jrfks923841j3k/      This time around, the 32jrfks923841j3k is not a number thus the permalink with the %page% variable is not triggering. My goal isn't all that complicated, i just don't know how to make it work but i want that my pages (The json custom post type only preferably) allow the second url to work. I don't care where this data is going as i have my own custom facility to read URLs in my framework and i will extract it by myself... It's very important that i do not get redirected, thus mod_rewrite or the rewrite api can probably not be used, this is because ReST by default uses the METHOD to detect what to do, if someone POST to an url, it has to stay like that and respond, not get redirected or else the POST gets lost... Thanks


title: Can Settings API setting generate other settings?

text: I have a Settings API field for an address. The address is stored this form: "Address, City, Country". Is there any way of creating / generating other options based on the one above? When I save the option I want it to generate and save latitude and longitude variables because I need them in order to display the address on the front-end (Google Map)? Any ideas how to resolve that? I could do that on front-end but then I will have to request the data for every user, not only once and I don't want to do that (performance & there's 25k/monthly limit of requests). I don't want to create additional Settings API fields neither.


title: Website Visible only to Registered users

text: How can I disable access non registered users? If the user is not logged in I would like to redirect them to a custom registration/login page. Is it possible this using below code as I dont want to use plugin.               <?php     if ( is_user_logged_in() ) {         echo 'Welcome, registered user!';     } else {         echo 'Welcome, visitor!';     }     ?>      Thanks.


title: Displaying a Static Html Homepage while working in WP Admin?

text: I would like to create a static "Site Under Maintenance" homepage while I login to WP admin and work on the website however, when I create an index.html on my server at GreenGeeks Hosting I can no longer get to either the index.php page to view the site or the WP Admin page to login? John


title: chosen jquery library not loading - is not a function error

text: I am trying to load the chosen library: http://harvesthq.github.com/chosen/ I am enqueuing a .js file as below:               wp_register_script( 'js_custom', plugin_dir_url( __FILE__ ) . 'js/jquery.js', false );     wp_enqueue_script ( 'js_custom' );      Inside the .js file I loading chosen like this:               jQuery(document).ready(function($){       $('.chzn-select').chosen();     });      But I keep getting this error: TypeError: Result of expression 'jQuery(".chosen").chosen' [undefined] is not a function.


title: Is it possible to set a option, and then redirect to another page directly from a admin notice link?

text: I like to execute a update_options() and stuff and then redirect to another plugins page? Directly after the user clicks a link in a Admin notice. How would i do that? Ajax? Is that even possible?


title: Why do the Roots theme CSS files not load (404)?

text: I've set up my new shiny 3.5.1 WordPress using Git, following these instructions: http://clintberry.com/2011/speed-up-your-wordpress-development- cycle-with-git/ (stopping after step 2; I've not created the child theme yet). I would expect the Roots theme to work by itself) What I basically have is the same as the author's Git project: https://github.com/clintberry/WordPress What I've ended up with is tags in the head section like:               <link rel="stylesheet" href="/assets/css/app.css">      I've checked in Chrome using the Web Inspector, and it tries to load               http://antonyh.co.uk/assets/css/app.css       and returns a 404 file not found. Why do these files not work? Is there some magic I need to inject somewhere to make it load the CSS from the themes folder (which has roots/assets/css/app.css)? I've not activated the theme yet, as I don't want a broken site. I could fix this with rewrite rules but that somehow feels wrong. Any help or clues would be appreciated.


title: Automatically create child pages when saving a (parent) page

text: I have a bit of a tricky one... I have a hierarchical Custom Post Type ('shows') that represents events. Is it possible for the user to create a new page (ie show), save the page and for Wordpress to automatically create a defined set of child pages with defined names? Ideally each child page would have a specific Custom Taxonomy applied to it automatically as it is created. The icing on the cake would be if those child pages were saved as drafts and not published at that point. Note that the number of child pages, their names and the taxonomy applied can be hard coded and won't change. Here is what I need:               //Save parent page     London 2013          //Children automatically created     London 2013         -About (taxonomy: about)         -Visitor Info (taxonomy: info)         -Exhibitors (taxonomy: exhibitors)         -Sponsors (taxonomy: sponsors)         -Press (taxonomy: press)


title: How do I get rid of the vertical bar in the url

text: I was wondering how to get rid from the vertical bar in the browser url, see image. I thought it was wp_title and set it too false like: `<?php wp_title(false); ?>` but doesn't work. How can I solve this? Thnkx ![enter image description here](http://i.stack.imgur.com/dUVYL.png)


title: Links in nonalphabetic order

text: On wordpress.barrycarter.info, the links sidebar is in alphabetical order by category ("My ... Stuff"), which looks weird for "My other stuff". How can I order the link categories myself?


title: Comments turned off, but 'Leave a reply' link still there

text: On my site, commenting is not enabled. But at the top of each blog post (except for one, strangely), there's a 'Leave a reply' link. (the link doesn't do anything -- but the words 'leave a reply' sitting there obviously make it look like you can leave a reply...) I don't see any 'discussion module' in my edit-post page. Here's an example page with a 'Leave a reply' link, just under the post title: http://richardclunan.com/blog/i-bet-these-12-questions-can-help-you-sell-more- helpful-copywriting-ideas/ I'm on Mac Chrome -- in case it's a small browser-related bug...


title: Styling images coming from another blog

text: I had asked a question earlier, on getting post-thumbnails from another WP- site. There, the awesome Mike coded a SQL query whose results are then passes on to a PHP array. The piece of code from that answer that I want to modify is this.               $post_urls = $wpdb->get_col($sql);       if (is_array($post_urls))         echo implode("\n",$post_urls);      Now the array holds values in the form of `<img src="/link/to/image.jpg"/>`. Now how do I..   1. Call the WP `image_resize` function on each image URL?   2. Apply my own CSS class to each image? **UPDATE:** Thanks to Jan for the tips on optimizing the SQL query. Now the `$post_urls` array will hold only plain URLs to the images. Can someone show me how to loop through each URL in the array and add prefixes (like `<img src="`) and suffixes (like `" class="awesome-image"/>`) to each of them?


title: Change the default data installed when setting up WordPress

text: Is there documentation somewhere on how to change the default data that is entered into the WordPress database when setting up a new database? I want to change the default category and add a couple others. Change the default post. Set a different theme, activate a couple plugins all by default. All of this to make it easy for setting up multiple sites that are all similar.


title: Custom post type functions.php if statement on action

text: I am using developing a child theme for Woothemes' Canvas. I am trying to use functions.php in the child theme to only use actions on my custom post type. This code doesn't seem to be working:                add_action( 'woo_post_inside_after', 'my_geo_mashup' );     function my_geo_mashup() {            echo GeoMashup::map();         if ($post->post_type == 'listings') {             //My function            }     }          add_action( 'woo_post_inside_before', 'listings_nivo' );     function listings_nivo() {     echo do_shortcode('[nivo source="current-post" ]');      if ($post->post_type == 'listings') {             //My function            }     }      So, I'm unsure how to get the above to work properly and only show these items on the custom post type, or only for the custom post type template single- listings.php (as I only want the map and slider to show on the actual post, not on the blog page (archive.php)


title: Why function hooked using object are executing at all time?

text:
I tried to use class and object in plugin. I made a simple function with a `shortcode` but it is executing the function without pasting the shortcode to any page/post.               class example{          function ex_funct(){           ?>
Hello
           <?php     }          }     $obj = new example();     add_shortcode('examp_code',$obj->ex_funct());      Why it is showing Hello at admin as well front end header without pasting the code `examp_code` ? What is happening here?


title: Display image in post

text: I use next code to upload an image in frontend, but I don't know how I can show it in a post.                   if ( $_FILES ) {     $files = $_FILES['upload_attachment'];     foreach ($files['name'] as $key => $value) {         if ($files['name'][$key]) {             $file = array(                 'name'     => $files['name'][$key],                 'type'     => $files['type'][$key],                 'tmp_name' => $files['tmp_name'][$key],                 'error'    => $files['error'][$key],                 'size'     => $files['size'][$key]             );                  $_FILES = array("upload_attachment" => $file);                  foreach ($_FILES as $file => $array) {                 $newupload = insert_attachment($file,$post_id);             }         }     }          }      and function.php                   function insert_attachment($file_handler,$post_id,$setthumb='false') {            // check to make sure its a successful upload       if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false();            require_once(ABSPATH . "wp-admin" . '/includes/image.php');       require_once(ABSPATH . "wp-admin" . '/includes/file.php');       require_once(ABSPATH . "wp-admin" . '/includes/media.php');            $attach_id = media_handle_upload( $file_handler, $post_id );            if ($setthumb) update_post_meta($post_id,'_thumbnail_id',$attach_id);       return $attach_id;     }      How can I do that?


title: Display post thumbnail in foreach loop

text:
I am trying to display a thumbnail in a foreach loop. The thumbnail is a new image size I have added called "plant-thumb". I have all the desired elements displaying properly except for the thumbnail. Here is my code:                     foreach ( $posts as $post ) {                    echo 'ID.'" >';            echo get_the_post_thumbnail($thumbnail->ID, 'plant-thumb'); //Here is where I'm trying to output the bespoke thumbnail            echo '';                      $faq .= sprintf(('
ID.'">%1$s
%2$s
'),                     $post->post_title,                     wpautop($post->post_content)                      );                 $faq .= '
'; //Close the container                 }                  return $faq; //Return the HTML.     };


title: Jquery is not working in wordpress php file

text: I am trying to use jQuery to scroll the div content vertically. I have used the following line of code in `function.php`               add_action( 'wp_enquque_scripts', 'my_script_enqueue' );          function my_script_enqueue() {         wp_enqueue_script( 'my-jquery', '/wordpress/wp-content/themes/MyTheme/js/jquery-1.9.0.js', array( 'jquery' ) );     }      then i have included a JS file in my PHP file as follows:               <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/dw_scroll_c.js"></script>      In that JS file I am just displaying as alert as follows:               jQuery( document ).ready( function( $ ) {         alert('hi');     });      But it's not working.


title: Frontpage Admin Bar Disappeared

text: I am on a multisite network. Recently my frontpage admin bar dissappeared but continued to show at backend. I disabled all the plugins, changed theme to twenty ten and twenty twelve also, but no success. But it starts showing when i change name of plugins folder to something else, but it doesn't when i network deactivate all plugins without changing name of plugins folder. I think network disabling all and/or changing plugins folder name is same thing so it should work by both ways. But admin bar only shows hen i change plugins folder name to something else, but not by disabling all plugins network wide. Please help ASAP.


title: making posts linked outside of Wordpress still use the same header and footer

text: I set up my blog so that some of my posts get linked to a page outside of Wordpress. For these posts that get linked outside of Wordpress, I'd like to still include my header and footer so the page looks like it's still a part of my site. What would be the best way to do this? I tried adding `<?php include("/path/to/header.php"); ?>` and `<?php include("/path/to/footer.php"); ?>` but obviously it wouldn't work since my header and footer files contain Wordpress conditional tags.


title: Remove duplicate images from media library.

text: I recently used an image importer that has duplicated all the images. They are attached to the right posts and the posts are fine (not duplicated). How do I run through my media library deleting duplicate images?


title: Change page title from page using php via php executed from page/post itself

text: I am running a plugin from a WP page to execute PHP and it works great. I'd like to edit the page title and description based on POST data. I am already using POST data in the PHP code to alter the page output and it works great but if I try to insert POST data in the following function to alter the page it doesn't do anything. I just need to be able to change the meta description and page title on the fly with POST data. This code exists in the PHP on my page:               add_filter('wp_title', 'set_page_title');          function set_page_title($orig_title) {          return 'Modified ' . $orig_title;     }


title: How do I make the sidebar bigger in twenty twelve?

text: I am new to WP with little knowledge of code. I am using Twenty Twelve and have managed to create a child theme (minus the header image for some reason). One of my widgets does not fit into the sidebar area so I would like to make it bigger.


title: Pulling RSS from site and display it in posts

text: I'm trying to pull rss from sites similar to this: http://andreabadendyck.blogg.no/ I have several posts with the URL in the title, so I can pull the URLS from here and hardcode the rss reader in the theme. I want to display the recent posts like this (under "Siste innlegg"): http://blogglisten.no/blogg/andreabadendyck.blogg.no Is it any available plugins for this? I have tried RSS Feed Reader for WordPress with no luck.


title: Comment_Reply_Link Not Showing?

text:
When I use the following code, everything shows _except_ the reply link! Anybody know what I've done wrong? I'd like the link to show up with the word 'Reply.' Live example: http://themeforward.com/demo2/?p=1948#commentlist In my header:               <?php     if ( is_singular() && comments_open() && get_option('thread_comments') )       wp_enqueue_script( 'comment-reply' );     ?>      In comments.php:               <?php if($comments) : ?>           <?php foreach($comments as $comment) : ?>               <li id="comment-<?php comment_ID(); ?>">                   <?php if ($comment->comment_approved == '0') : ?>
Your comment is awaiting approval
                   <?php endif; ?>     <?php if(function_exists('get_avatar')) { echo get_avatar($comment, '60'); } ?>     <?php comment_author_link(); ?> on <?php comment_date(); ?> at <?php comment_time(); ?>     <?php echo comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth'])); ?>                 <?php comment_text(); ?>
           <?php endforeach; ?>       <?php else : ?>
No comments yet
       <?php endif; ?>


title: Saving custom data via ajax with nonces

text: I'm trying to securely save custom data to database from plugin backend via ajax. JavaScript code that runs after clicking save button:               $.ajax({         url: ajaxVars.ajaxurl,         type: 'post',         data: {             action : 'myPluginDataSave',             someData: 'blabla',             myPluginNonce : ajaxVars.nonce         },         complete: function(data) {                       console.log('finish',data.responseText);         }     });      PHP code (some parts are missing), ajax_save_data function receives data from JS code:               add_action( 'wp_ajax_myPluginDataSave', array(&$this, 'ajax_save_data') );     wp_enqueue_script( 'my-plugn-js' );     wp_localize_script( 'my-plugn-js', 'ajaxVars', array(                         'ajaxurl' => admin_url( 'admin-ajax.php' ),                         'nonce' => wp_create_nonce( 'myPluginNonce' ),                               ));           function ajax_save_data() {         if ( !isset($_POST['myPluginNonce']) || !wp_verify_nonce( $_POST['myPluginNonce'], 'myPluginNonce' ) )              die ( 'you cant do this' );               echo 'here data gets saved to DB' . $_POST['someData'];              die();     }      Hooks are added only in admin (inside `is_admin()` if statement). Save button can be clicked multiple times (without page refresh). Code works. But, my question: is this correct way to do this? Do I need nonce there? Thank you for advice.


title: How can I make image linking to attachment page (rather than a direct link)?

text: I currently have the Modern Style Theme installed. If you click on an image on my page, it links directly to the highest resolution version of that image. (Example post with one image) I would rather like it to link to an "attachment page", where the description of the image is also showen. How can I do that?


title: get_post_meta in sitewide tags plugin fails to return value for custom fields

text: Here's another conundrum that I'm toying with. There's a routine within the **sitewide tags pages plugin** which takes a list of custom fields (entered in the admin settings) and then uses these as keys to read a post and output the keys and values in an array. I have not been able to see it working and therefore I am trying to determine why. Here's the routine within `sitewide-tags.php`: http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/               *** line 369 in Version: 0.4.1.1 of sitewide-tags.php ***          $meta_keys = apply_filters( 'sitewide_tags_meta_keys', get_sitewide_tags_option( 'tags_blog_postmeta', array() ) );         $global_meta['DEBUG TEST1'] = $meta_keys;         $global_meta['DEBUG TEST2'] = $post_id;     if( is_array( $meta_keys ) && !empty( $meta_keys ) ) {         foreach( $meta_keys as $key )                 $global_meta['DEBUG TEST3'] = 'custom loop';                  $global_meta[$key] = get_post_meta( $post->ID, $key, true );     }     unset( $meta_keys );      I have added a small amount of markup to reveal what is happening at each step. For my test case, post_id #1121, there is one custom field which sits in the `wp_9_postmeta` table has one meta_key `image` with a corresponding meta_value `http://newsite.com/files/2011/05/alfaP.jpg` However the routine returns no value within the function. Here's what each of the debug tests shows;               DEBUG TEST1:          a:7:{i:0;s:11:"video-embed";i:1;s:9:"image-url";i:2;s:8:"link-url";i:3;s:10:"quote-copy";i:4;s:12:"quote-author";i:5;s:9:"quote-url";i:6;s:9:"audio-url";}          DEBUG TEST2: 1121     DEBUG TEST3: Custom Loop      So the first test (#1) shows that all the custom fields are being returned from the `'get_sitewide_tags_option'` on line 1. The second test (#2) confirms it's looking at the correct post_id and the third test (#3) that it reaches the foreach loop and therefore passes the conditional clause. EDIT: One further test is to check within the foreach loop and see what value is contained in `$key` - what I found is that `$key` contains the `meta_key` names (image, video-embed...) that should (in theory) be successful when used to retrieve the associated value using `'get_post_meta'`. I'd love to know why it doesn't - any ideas or suggestions?


title: How to integrate Amazon SES Account with MailChimp STS plugin?

text: I'm trying to set up the plugin MailChimp. I have uploaded the plugin and installed it. (https://wordpress.org/extend/plugins/mailchimp-sts/) The directions tell me I will need   1. MailChimp account and API key (done)   2. Amazon SES account with production access (I have signed up with Amazon)   3. Verified email address to sue as sender (got it) The only place on the form to do anything is the blank next to "API key". I've cut and pasted in the key number given me. Now all I get is "API error. Please setup the integration first". How do I go about setting up the integration? I hope you can help. Thanks a lot!


title: Submenu opened problem

text:
I am trying to fix a problem with a submenu. I have coded (as you can see on jsfiddle: http://jsfiddle.net/8899x/87/ ) my horizontal menu and the submenu. I would like to leave the submenu opened when I am in the selected child page; for example if I click on "Gallery -> Photogallery 1", I'd like that the submenu and the "Photogallery 1" will stay opened and highlighted. Obvious the same if I click on "Photogallery 2" and so on. Any help please? **UPDATED** : Here is the example of my header.php:               <!DOCTYPE html>     <html <?php language_attributes(); ?>>          <meta charset="<?php bloginfo( 'charset' ); ?>" />     <meta name="viewport" content="width=device-width, initial-scale=0.1, maximum-scale=1.0"/>     <title><?php     global $page, $paged;          wp_title( '|', true, 'right' );          // Add the blog name.     bloginfo( 'name' );          // Add the blog description for the home/front page.     $site_description = get_bloginfo( 'description', 'display' );     if ( $site_description && ( is_home() || is_front_page() ) )         echo " | $site_description";          // Add a page number if necessary:     if ( $paged >= 2 || $page >= 2 )         echo ' | ' . sprintf( __( 'Page %s', '_s' ), max( $paged, $page ) );          ?></title>          <link href='http://fonts.googleapis.com/css?family=Open+Sans:800,400,600,700' rel='stylesheet' type='text/css'>               <link rel="shortcut icon" href="<?php bloginfo('template_url'); ?>/favicon.ico" type="image/vnd.microsoft.icon"/>     <link rel="icon" href="<?php bloginfo('template_url'); ?>/favicon.ico" type="image/x-ico"/>                         <?php wp_head(); ?>                    <body <?php body_class(); ?>>

<a href="<?php bloginfo('url') ?>">Home

<a href="<?php bloginfo('url') ?>/?page_id=258"             <?php              if ( is_page('258') || is_page('300') || ( !is_home() && in_category('5')) || ( !is_home() && in_category('58')) )             {              echo " class=\"selected\"";             }             ?>>Gallery

<a href="<?php bloginfo('url') ?>/?page_id=258">Photogallery 1

<a href="<?php bloginfo('url') ?>/?p=256">Photogallery 2

<a href="<?php bloginfo('url') ?>/?page_id=300">Photogallery 3

Events

Blog

Personal

Dev

About

Page 1

Page 2

      And some lines of the singlecustompage.php:               <?php get_header(); ?>


title: How to pull a number posts from a specific Taxonomy within a Custom Post type

text: Wondering if anyone can help. I'm putting together a site which features music reviews, amongst other things. The set up is built on a custom post type and a number of associated taxonomies. **Post type:**   * my_albumreviews **Taxonomies:**   * artist   * label   * release date On a page displaying an album review ( `my_albumreviews` post type ), under the main content I need a section which shows **"Other reviews from this artist"**. I think I'm along the right lines with this but just can't get it to work.               $artistname = get_the_terms($post->ID, 'artist');             $args = array(             'post_type'=>'my_albumreviews',             'tax_query'=>array(array('taxonomy'=>'artist',                         'field'=>'id',                         'terms'=> '$artistname'                         ))             );     $artist_reviews = new WP_query($args);      This is then followed by..               while ($artist_reviews->have_posts()) : $artist_reviews->the_post();      ..which returns nothing to the page. Any help would be much appreciated.


title: images gallery attached to a post as a subfolder of the same post

text: I would like to know how can I set the Lazyest gallery or other gallery plugin in order to add many pics to a post and the URL's pics to appear as a subfolder of URLs' post? For better understand please find the bellow example: Urls's post:   `example.com/this-post-url/`   I want that the gallery atached to appear this way:   `example.com/this-post-url/first-picture/`   `example.com/this-post-url/second-picture/`


title: How to create import option for xml

text: I want to put in theme admin page an option for _demo content_ XML. This option should offer the possibility to switch between Demo Content and Default WordPress installation content. If I select _demo_ , I want to show Demo content from my XML file. If select _default_ I want to show what I have already posted, not the imported XML content.


title: Showing posts from 2 categories only on category.php

text:
got myself in a bit of a pickle. I want to display posts on category.php from the categories 'latest news' and 'custom models' only. The other category, 'press releases' is shown in a separate column. I've the following code - hashed together from misc articles I've read - but it's showing ALL the posts rather than just my 2 chosen categories. Perhaps the easiest way would be to show all posts apart from 'press releases'... Can anyone help?

           <?php single_cat_title() ?>
         <?php $posts = get_posts('category=Latest News,Custom Models'); foreach($posts as $post) { ?>

<a href="<?php the_permalink(); ?>">             <?php     // Must be inside a loop.          if ( has_post_thumbnail() ) {         the_post_thumbnail('size-2');     }     else {         echo '';     }     ?>

<a href="<?php the_permalink(); ?>">             <?php the_title(); ?>

             <?php the_time('F jS, Y') ?>
           <?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>">Read more

         <?php } ?>

             <?php posts_nav_link('','< Recent entries','Older entries >'); ?>


title: Add Custom Fields to Custom Post Type RSS

text: I'd like to add custom fields in my custom post type to the RSS feed for that post type located at http://example.com/feed/?post_type=my_custom_post_type I've seen info on doing this for the regular feed but nothing for how to rewrite the custom post type feed. I'll need to add 10 - 15 items to the feed (1st act, 2nd act, 3rd act, price, purchase link...)


title: Parse a text area custom meta box and assign as value to existing meta keys

text:
I built a post interface to accept specific data in the form of custom meta boxes [rant]but now the end user says it's too much work to cut and paste 4 times[/rant]. So now (completely out of original scope) I need to parse the data entered into a new text area meta box and assign each line as a value to 2 existing keys, the_tile and a substr 'd excerpt. (see image) Actually it really doesn't need to use the existing keys. It can use new ones or just be assigned to a new $variable (I would rather parse on save than on query). The meta boxes are built using a class that handles the saving and updating, I just need to know how to split of the new field. I also have to conditionally determine if they used the individual boxes or the new text area box. One of the meta boxes is for an external url. I have to check if it exists. If it's null the the template uses the permalink. ### The use case is very specific as all the data is output in specific places on various sized boxes. See below: ![enter image description here](http://i.stack.imgur.com/ahlxw.png) The order I need to parse the data: title `<\---- I'm saying this one is optional (They still have to enter a post title)` source `<---- meta_key is $prefix.'article-source' excerpt `<\--- the_excerpt but can be a new key` It can only output 115 characters to avoid breaking the layout. We also have to check if anything was entered into the real WordPress excerpt box before we decide to do any of this. click-through-url `<\--- meta_key is $prefix.'external_link` ### All this code works fine. Just adding it to show how the data is used.               while ($box_query->have_posts()) : $box_query->the_post(); global $post; global $prefix;              $box_size = c3m_get_field( $prefix.'box_size', FALSE );         $box_image = c3m_get_field( $prefix.'post_box_image', FALSE );         $overlay_class = c3m_get_field( $prefix.'overlay_class', FALSE );         $ad_code = c3m_get_field( $prefix.'ad_code', FALSE );         $source = c3m_get_field( $prefix.'article-source', FALSE );              if ( c3m_get_field($prefix.'external_link', FALSE) ) {         $post_link = c3m_get_field($prefix.'external_link', FALSE) ;         } else                 { $post_link = post_permalink();          } ?>                     <li class="ui-state-default <?php echo $box_size;?>">                  <article <?php post_class() ?>>             <?php   if ( $ad_code ) { ?> <div class="ad-box <?php echo $overlay_class;?>"> <?php echo $ad_code; } else {                   echo  ''; ?>                              <div class="post-box <?php echo $overlay_class;?>">                              <?php if ( c3m_get_field( $prefix.'text_display', FALSE) ) {  ?>
<a href="<?php echo $post_link?>"><?php the_title();?>

<?php                                  if ( $source ) { echo '(' .$source. ') '; }                                 if ( $box_size == 'double-single' ) { echo substr( $post->post_excerpt, 0, 300) .'...'; ?>
 <?php                                 } else {                                 echo substr( $post->post_excerpt, 0, 115) .'...' ; ?>
 <?php } ?>                                  <?php } ?>                                  <?php } ?>      So the question is How do take 4 cr break lines pasted into 1 meta box and assign a variable to each line. Thanks and I'll hang up and listen. ## Edit: The information pasted will be 4 lines First Line: Title Second Line: Source Third Line: Short excerpt Fourth Line: Link Url ### Example: > After 4 Years, Egypt Reopens Its Border With Gaza Strip > > New York Times > > Hundreds of Palestinian residents of the Gaza Strip arrived here by the > busload Saturday to pass through the reopened border into Egypt. > http://www.nytimes.com/2011/05/29/world/middleeast/29egypt.html?_r=1&hp ![enter image description here](http://i.stack.imgur.com/xgHSQ.png) That input will look like this on the front end. The title links to the link url: ![enter image description here](http://i.stack.imgur.com/Ms50k.png)


title: handling csv data with a custom post type

text: I have a custom post type which represents a 'race' and there are meta fields for 'distance' (5km,10Mile) and 'type' (track,road,crosscountry). We get the race results as a csv file which contains the positions and times etc of the runners, each runner is linked to a wordpress user. The intention is to process the csv data and insert it into a custom database table. The results are then displayed via a WP_Table_List. My question is how i should best save the csv data so that it can be processed, the two options as i see are 1 - Save the csv data into the post content section. I'd then add a custom action 'Process Content CSV' which reads the content and processes the rows inserting into the database. 2 - As a custom meta field 'csv_results' which is setup to accept a file_upload. Once the file is uploaded and the post save, the content of the file is then processes and inserted into the db. With option one i'd be worried that wordpress will filter out my delimiter char and option 2 seems too complicated. Which approach and what issues would you watch out for?


title: How can I change Max Embed Size in WordPress 3.5?

text: after updating to WordPress 3.5 my automatic embeds are limited to a width of 500px, and the settings for this size have been removed with WordPress 3.5 Also, I can't find the Values in the `wp_options` table. Does anyone know how to change them again? Cheers, fischi


title: How to configure WordPress + plugins to support these commenting features

text: Is it possible (and if so, how) to configure WordPress blog to support these feature for user comments? I want to use built-in comments, not 3rd party services like Disqus. If something cannot be achieved by configuring WordPress itself please suggest plugins that can achieve the following: **1 + 2)** Every user that would like to leave a comment must be authenticated. Supported authentication methods must be Google, Twitter and Facebook auth, no other (e.g., it must be impossible to log in using generic OpenID provider or the built in WordPress authentication etc.) **3)** If a visitor provides an email address, they can check a checkbox to be notified of new comments **4)** Comments should be flat (not visually nested) but should allow references to other comments. **5)** If there are too many comments, they should be loaded dynamically as user scrolls down (i.e., similarly how Twitter or Facebook work). Can this be achieved using WordPress built-in comments plus some plugins?


title: How can I add inline CSS for each image?

text: Is there a filter or hook that I can use for uploaded media? I need to use it for custom CSS properties based on the media's description. It will be like:                     or                     Media description screenshot: ![Edit Media screenshot](http://i.stack.imgur.com/KtDTt.png)


title: custom XMLRPC method plus authentication of user & WooCommerce order

text: I'm working with a custom XML-RPC method to capture some information for a plugin I am building. When activated the user has to authenticate themselves by entering there user/password given to them when purchasing the plugin on my WP site. The plugin uses this code:               if ( isset( $_POST['username'] ) && isset( $_POST['password'] ) ) {                  /* check against remote server */             require_once( ABSPATH . WPINC . '/class-IXR.php' );             $this->client = new IXR_Client( trailingslashit( CUSTOMLOGIN_UPDATE_API ) . 'xmlrpc.php' ); //*/                  $url = ( ( is_multisite() ) ? network_site_url() : site_url() );                  $client_request_args = array(                 'username'  => $_POST['username'],                 'password'  => $_POST['password'],                 'plugin'    => CUSTOMLOGINPRO_BASENAME,                 'url'       => $url             );                  if ( !$this->client->query( 'thefrosty.is_user_authorized', $client_request_args ) ) {                 add_action( 'admin_notices', array( $this, 'error_notice' ) );                 return false;             }                  $this->settings = get_option( CUSTOMLOGINPRO . '_settings', array() );             $this->settings['api-key'] = $this->client->getResponse();             update_option( CUSTOMLOGINPRO . '_settings', $this->settings );             header( 'Location: ' . admin_url( 'options-general.php?page=' . CUSTOMLOGINPRO ) );             die();              }       The form submits and looks like its kinda working, getting a 200 error when working locally, but tested with another plugin that send same error code, but is sending responses from host (no worries yet). What I am stuck on is the back end code. I've created a class in a core plugin on my WP install. I am assuming this is where it needs to be. I am missing some fault code and error message responses, not sure how to do those. Just looking for a little push in the right direction.. As you can see I am also testing the user against a WooCommerce order (code from WC, should be good) but then trying to update the order meta meta might need to fixes to save the users URLs.               class frosty_core {          function __construct() {         add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) );     }          /**      * Create our custom XML-rpc method.      * @ref http://kovshenin.com/2010/04/custom-xml-rpc-methods-in-wordpress-2151/      */     function xmlrpc_methods( $methods ) {         $methods['thefrosty.is_user_authorized'] = array( $this, 'thefrosty_plugin_callback' );         return $methods;     }          /**      * XML-prc mothod      */     function thefrosty_plugin_callback( $args ) {              // Parse the arguments, assuming they're in the correct order         $username       = $args[0];         $password       = $args[1];         $plugin_name    = $args[2];         $url            = $args[3];              global $wp_xmlrpc_server;              // Let's run a check to see if credentials are okay         if ( !$user = $wp_xmlrpc_server->login($username, $password) ) {             return $wp_xmlrpc_server->error;         }              if ( !class_exists( 'woocommerce' ) ) return 'error, please try again later';              /* Get the user ID by name */         $current_user_id = get_userdatabylogin( $username );              /* woocommerce/shortcodes/shortcode-my_account.php */         $args = array(             'numberposts'     => -1,             'meta_key'        => '_customer_user',             'meta_value'      => $current_user_id,             'post_type'       => 'shop_order',             'post_status'     => 'publish'          );         $customer_orders = get_posts( $args );               $match = false;              foreach ( $customer_orders as $customer_order ) :             $order = &new woocommerce_order();             $order->populate( $customer_order );                  $status = get_term_by( 'slug', $order->status, 'shop_order_status' );             if ( 'completed' !== $status->name ) return; //error, order not completed //*/                  if ( $plugin_name !== $order->items->name ) return; // you have not purchased this plugin //*/                  $match  = true;             $apikey = $order->order_key;         endforeach;              if ( isset( $match ) && $match ) {             /* woocommerce/admin/writepanels/writepanel-order_data.php */             add_filter( 'update_order_item', create_function( '$order_items', '                 $new_meta   = &new order_item_meta();                 $meta_name  = "active_urls";                 $meta_value = esc_url( $url );                      $new_meta->add( $meta_name, $meta_value );                 return $order_items["item_meta"] => $new_meta->meta;' ) );                  return $apikey;         }         else return false;     }      }


title: Hook for page Request?

text: I want to run a function that looks at the current url params of the page that is requested and sets a cookie based on those params. So, I guess I'm looking for:   1. The Wordpress Hook that allows me to do this before the page is even loaded   2. A way to get the requested URL


title: Need To Resize Images Exactly Without Losing Image Details

text: I am working on a Wordpress site that heavily uses image uploading and whatnot, I have defined the image sizes in my functions.php and I have hard crop mode turned on which ensures that my images are always cropped to the exact size that I want. The problem with hard cropping is that peoples faces in images and other artefacts are cropped out and the images look ridiculous. Is there a way to have soft cropping mode turned on and have images always be an exact size? I find that when I use soft cropping mode, images vary in height and width. So an image I want to be 110x110 in soft crop mode can vary and sometimes be 110x96 or whatever and because that makes the layout look crappy and some photos look landscape, what is the best way to solve this issue?


title: Single Page Design, Storing in Theme Options

text: So I'm developing a theme where essentially all content will be displayed on a single page (index). Well, the content isn't exactly conventional. In other words, it's not just a title and body, maybe a few custom post fields. It's very different from section to section. What I was thinking of doing was just creating all of the content fields using the Theme Options API. So, instead of editing a page, you just go into the theme options area and fill in the content for each section. My main question is... is there a limit to how much data should be stored as "theme" options? Or, after understanding what I'm doing, is there a better way of accomplishing this?


title: A question about add_action()

text: I was following this ( http://codex.wordpress.org/Plugin_API ) tut on codex. The part where a class is created and is called in add_action. No argument was passed to `emailer::send` ? Why? It was required in the function definition.


title: Custom avatars in wordpress comments?

text: I'm looking for a way to let people connect with facebook when posting comments, and to use their facebook avatars as the avatar for the comments. How can this be done? Do I need to create a seperate user account for those people, or is their a way to simply store an avatar url for each comment that's posted?


title: Output JSON and no theme

text: I would like my plugin to create a url which only outputs JSON. The JSON feed contains settings and other info about this plugin. I would like to know how my plugin registers a url which only outputs JSON data using Wordpress function. For example: the user goes to example.com/pluginfeed This is a JSON Feed containing posts, settings and more


title: Error uploading plugin zip file

text: I have a question here and hope you guys can help me with that. Couldn't find the exact answer from search and I am not a coder myself. I was given the instruction (to change plugin name) by my previous coder before he handed the plugin to me. He said if I want to change the plugin name, all I need to to is go to popups.php and change the first line, which is `Plugin Name: xxx`. So I extracted the folder, change the name and and zipped the whole folder again. When I tried to install it through wordpress, it says installation failed. Did I miss out any step here? Here is the error message: > Unpacking the package… > > Installing the plugin… > > The package could not be installed. No valid plugins were found. > > Plugin install failed.


title: Custom pagination code is not working

text: I am using the below code for pagination. However, it is not working. It's showing all of the pages numbers nicely, but when I click on a page number the first page is always displayed.               global $wp_query;       $total_pages = $wp_query->max_num_pages;       if ( $total_pages > 1 ) {           $current_page = max( 1, get_query_var( 'paged' ) );           echo paginate_links( array(               'base' => get_pagenum_link( 1 ) . '%_%',               'format' => '/page/%#%',               'current' => $current_page,               'total' => $total_pages,           ) );       }      My permalink settings are set to: > localhost/my-blog/sample-post/ And query post: > $args = array( 'post_type' => 'post', 'posts_per_page' => 2); If i change the format to > '/page=%#%' its providing me 404 error. anybody please give me idea what to do next for working this pagination.


title: Pods cms and "advanced custom fields" plugin

text: We are planning to build a quite big database to store data for our 5000 yearly subscribers association. We were considering pods cms for our needs since it permits a good flexibility in building a complex website and is performance aware while managing the database. But recently I red on the pods cms website that they're having some funding problems, so they're struggling reaching the 2.0 milestone. We're afraid that the development could stop. On the other side we found "advanced custom fields" that also seems a good alternative. Furthermore it has a stronger business model. So what would you suggest me to do?


title: password recovery key is invalid on custom reset

text:
I am trying to use a custom password recovery form instead of the default WP. The url link for resetting the password is returning 'invalid key' error. Does anyone have any help with where the problem is?               <?php     global $wpdb, $user_ID;          function validate_url() {         global $post;         $page_url = esc_url(get_permalink( $post->ID ));         $urlget = strpos($page_url, "?");     if ($urlget === false) {         $concate = "?";     } else {         $concate = "&";     }     return $page_url.$concate;     }          if (!$user_ID) { //block logged in users          if(isset($_GET['key']) && $_GET['action'] == "reset_pwd") {         $reset_key = $_GET['key'];         $user_login = $_GET['login'];         $user_data = $wpdb->get_row($wpdb->prepare("SELECT ID, user_login, user_email FROM $wpdb->users WHERE user_activation_key = %s AND user_login = %s", $reset_key, $user_login));          $user_login = $user_data->user_login;     $user_email = $user_data->user_email;          if(!empty($reset_key) && !empty($user_data)) {         $new_password = wp_generate_password(7, false);         //echo $new_password; exit();         wp_set_password( $new_password, $user_data->ID );         //mailing reset details to the user         $message = __('Your new password for the account at:') . "\r\n\r\n";         $message .= get_option('siteurl') . "\r\n\r\n";         $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";         $message .= sprintf(__('Password: %s'), $new_password) . "\r\n\r\n";         $message .= __('You can now login with your new password at: ') . get_option('siteurl')."/login" . "\r\n\r\n";          if ( $message && !wp_mail($user_email, 'Password Reset Request', $message) ) {         echo "
Email failed to send for some unknown reason
";     exit();     }     else {         $redirect_to = get_bloginfo('url')."/login?action=reset_success";         wp_safe_redirect($redirect_to);         exit();     }     }      else echo "
Not a Valid Key
";     exit('Not a Valid Key.');          }     //exit();               if($_POST['action'] == "password_reset"){     if ( !wp_verify_nonce( $_POST['password_nonce'], "password_nonce")) {         exit("No trick please");     }       if(empty($_POST['user_input'])) {         echo "
Please enter your Username or E-mail address
";     exit();     }     //We shall SQL escape the input     $user_input = $wpdb->escape(trim($_POST['user_input']));          if ( strpos($user_input, '@') ) {         //$user_data = get_user_by_email($user_input);//deprecated         $user_data = get_user_by('email', $user_input);         if(empty($user_data) || $user_data->caps[administrator] == 1) { //delete the condition $user_data->caps[administrator]     == 1, if you want to allow password reset for admins also         echo "
Invalid E-mail address!
";         exit();         }     }     else {         //$user_data = get_userdatabylogin($user_input);//deprecated         $user_data = get_user_by('login', $user_input);         if(empty($user_data) || $user_data->caps[administrator] == 1) { //delete the condition $user_data->caps[administrator]     == 1, if you want to allow password reset for admins also         echo "
Invalid Username!
";         exit();         }     }          $user_login = $user_data->user_login;     $user_email = $user_data->user_email;          $key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login    ));     if(empty($key)) {         //key(array)         $key = wp_generate_password(20, false);         $wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login));      }          //mailing reset details to the user     $message = __('Someone requested that the password be reset for the following account:') . "\r\n\r\n";     $message .= get_option('siteurl') . "\r\n\r\n";     $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";     $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n";     $message .= __('To reset your password, visit the following address:') . "\r\n\r\n";     $message .= validate_url() . "action=reset_pwd&key=$key&login=" . rawurlencode($user_login) . "\r\n";          if ( $message && !wp_mail($user_email, 'Password Reset Request', $message) ) {         echo "
Email failed to send for some unknown reason.
";     exit();     }     else {         echo "
We have just sent you an email with Password reset instructions.
";     exit();     }     } else {      ?>          <form class="user_form form" id="wp_pass_reset" action="" method="post">              <input type="text" class="text" name="user_input" value="" />
         <input type="hidden" name="action" value="password_reset" />         <input type="hidden" name="password_nonce" value="<?php echo wp_create_nonce("password_nonce"); ?>" />         <input type="submit" id="submitbtn" class="reset_password" name="submit" value="Reset Password" />               </form>      Thanks to Kannan at http://www.tutorialized.com/tutorial/Create-a-Wordpress- Custom-Password-Reset-Page-Template/76026 for this tutorial.


title: Dealing with variables with gettext function

text: I've found tweaking some of the text in WordPress to be pretty easy by adding in the following function (in lieu of using a separate plugin):               add_filter( 'gettext', 'of_site_translations', 9999, 2 );     function of_site_translations( $translation, $text ) {     if ( $text == 'Posts' )             return 'News Posts';     return $translation;     }      The issue I'm running into is (in my above example) while it will change `Posts` to `News Posts` in the WP Sidebar - areas that are dynamically created based on the post type labels; when you click on `Posts` from the sidebar and it leads you to a page that says `Posts`. Is there a way to override post type labels using this method? If so, any pointers that could push me along a bit? Really appreciate it, thanks!


title: How can I display a link to a post's (Word doc or pdf) attachment?

text:
I'm using the code below to first grab the post's attachments (if they're either a Word doc or pdf file), then echoing the url of said attachment. This works great on the first post on a page. However, on each subsequent post the same attachment url is echoed, even if that post doesn't have an attachment. How can I keep that from happening?               $args = array(                     'post_type' => 'attachment',                     'post_mime_type' => array('application/doc','application/pdf'),                     'numberposts' => 1,                     'post_status' => null,                     'post_parent' => $post->ID                 );     $attachments = get_posts( $args );     foreach ($attachments as $attachment) {         echo 'ID ) . '">Download Spec  Sheet';         echo '
';     }


title: Why did a WordPress plugin vanish from the WordPress repository?

text: An old client just contacted to find out why his plugin vanished from the WordPress Plugins repository. I was able to find it's review page but nothing else. Do you know why the plugin might have disappeared?


title: Why does wordpress still strip my query var?

text: Im trying to pass a query var to a custom page template with pretty permalinks. So basically i have a page called "albums". And i want to pass a query var to that page called "type". So the non-pretty version would be mywebsite.com/index.php?p=97&type=vinyl the "pretty" version would the be mywebsite.com/albums/vinyls And the template need to then retrieve that variable (i.e. vinyls) I have read a lot on this all day, but still cant get it to work. So i was hoping some kind soul here would help me out. So first im adding the rewrite to my functions.php:               function addrewrite() {         add_rewrite_rule( '^albums/([^/]+)/?$',         'index.php?p=97&type=$matches[1]',         'top' );     }     add_action('init', 'addrewrite');      This seems to work as i can see it turn up if a get a var_dump of all the rewrites. Now if i do a test and type mywebsite.com/albums/vinyl into my browser wordpress strips the last bit "vinyl" away. I read a couple of places that this is because i need to register the query var too. so i did that with the following code:               add_filter('query_vars', 'add_my_var');     function add_my_var($public_query_vars) {       $public_query_vars[] = 'type';       return $public_query_vars;     }      Then i flushed the permalinks by pressing save in the **settings** -> **permalinks** , yet wordpress still strips my url. What am i missing here?


title: Is there an easy way to download all plugins from the repo?

text: I want to do some Scans and Stats and would like to download every plugin in the WP Plugin Directory. Is there an easier way to do this, other then clicking the download button 27k times? What would be my best option for doing this?


title: Wordpress general content best pratices

text: Im trying to figure out howto structure general content that should be easy to import in a page template. Lets say for example i have some contact details and i want to include this content on multiple pages. One way i tried was to create a custom post type and just add posts for   * Email   * Phone   * Address I would then simply read the ID's of those posts and in my template hardcode the ID's into some get_post() calls, to extract the content. The problem with this approach is   1. im hardcoding ID   2. lets say my Address needs different input fields like "Street" / "City" "Zipcode". Then i would need to create multiple custom post types, because i cant just add it to the same because it would make no sense for a email to have a zipcode field. I hope to get some pointers to how i would structure content like this. I guess i could write a custom plugin, but then i would miss out on all those features post's has like a rich text field and gallery support, and the support for adding more fields etc.


title: Autoembeds don't work with paragraphs

text:
I'm writing the below pieces of code in "Text" mode of the posts editor. Does work:               http://www.youtube.com/watch?v=xxxxxxxxxxx      Does work:
test     http://www.youtube.com/watch?v=xxxxxxxxxxx     test
      Doesn't work:
http://www.youtube.com/watch?v=xxxxxxxxxxx
      The last link isn't converted to the YouTube video. I'm wondering if anyone noticed that too and if there's any known fix to that?


title: Next/previous a-like single navigation

text: I have on the site navigation menu which uses next/previous functionality to navigate through the site. Currently it is a hard coded image map with related links on each page. I know how to get next/previous functionality from breadcrumbs to work for sub-pages following code from here , but I have no idea how to get that functionality to work between parent (top) menus, when there is no sub-pages or to jump to next parent (top) menu when landing page is a last sub-page. Any tips? Thanks


title: Loading wordpress stuff on laravel site

text: I not sure why i failed to load the wordpress site on the laravel site. the following code, i tested on plain php without any framework - it work! but if i call from the file within laravel framework - it failed!!               <?php      define('WP_USE_THEMES', false);          require('./wordpress/wp-blog-header.php');      wp_nav_menu(array('theme_location' => 'primary',         'container' => false,         'menu_class' => 'menu',         'menu_id' => '',         'fallback_cb' => false     ));       i not sure what's the problem and the following is the trace catch from the error: > **array_key_exists() expects parameter 2 to be array, null given**               function mo_get_theme_option($option_id, $default = null, $single = true) {         global $mo_theme;         global $options_cache;              if (array_key_exists($option_id, $options_cache))             return $options_cache[$option_id];


title: Redirect from the dashboard to edit.php if wp_is_mobile() is true

text: Looking for a way to redirect the user from the dashboard straight to `edit.php` if `wp_is_mobile()` is true. This is what I've tried:               function redirect_if_mobile() {         $screen = get_current_screen();         if($screen->base == 'dashboard') {             if ( wp_is_mobile() ) {                 $url = admin_url( 'edit.php' );                 wp_redirect( $url );             }         }     }     add_action( 'admin_menu', 'redirect_if_mobile');      The problem is that `get_current_screen()` isn't defined in either `admin_init` or `admin_menu` (if you hook onto `admin_head` instead it's too late and headers have already been sent). Ideas?


title: function to return comma separated list of meta values

text: I'm customizing the admin edit.php screen and I have a column that displays a meta key `$gear`. But it only lists the first value instead of returning a list of all the values. Here's the bit that matters:               add_action( 'manage_artists_posts_custom_column', 'manage_artists_columns', 10, 2 );     function manage_artists_columns( $column, $post_id ) {         global $post;         switch( $column ) {             case 'gear' :             $gear = get_post_meta( $post_id, 'gear', true );                  if ( empty( $gear ) )                     echo __( '' );                 else                     printf( __( '%s' ), $gear );                      break;                  default :                 break;         }     }      I use a similar `get_post_meta()` call on the front end that uses               if( $gear = get_post_meta($post->ID, 'gear')      echo implode( $gear, ', ' );      but I couldn't get it to adapt to this application. How do i get printf to output all values?


title: using wp_cache in plugin

text: I have a results set being returned from the database. How can I use wp_cache to speed this up?               function bb_attachments_cache() {         global $wp, $bp, $wpdb, $posts, $bb_attachments, $bb_attachments_cache, $bbdb;                   $all_posts_query = "SELECT `post_id` FROM $bbdb->posts";         $posts = $bbdb->get_results( $all_posts_query );         foreach ($posts as $post)  {             $bb_attachments_cache[$post->post_id] = array();         }              $sql = "SELECT              bba.id,             bba.time,             bba.post_id,             bba.user_id,             bba.user_ip,             bba.status,             bba.downloads,             bba.size,             bba.ext,             bba.mime,             bba.filename         FROM bb_posts bbp         JOIN bb_attachments bba         ON bba.post_id = bbp.post_id         ORDER BY id DESC";              $attachments = $wpdb->get_results($sql);              if ($attachments){                  foreach ($results as $result){                 $bb_attachments_cache[$result->post_id][$result->id] = $result;             }             unset($attachments);              }          }      I want to set the cache object if there has been any updates to the attachments table. Im using wordpress 3.1 and have a caching plugin installed and working.


title: Site is setup statically - how to make it content managable?

text: This is probably quite a basic question, but I have my site setup statically in WordPress, all I am trying to figure out now is how to add a new section to the WordPress backend where all the content of the site can be edited but I can't seem to find the right information, can anyone point me in the right direction?


title: Wordpress Rewrite Rule

text: I have a standard page setup at `http://mysite.com/mypage/` I'd like to setup a rewrite rule in my theme functions that takes any URLs such as: `http://mysite.com/mypage/helloworld/` <-- Currently shows "Not Found" And translates it into: `http://mysite.com/mypage/?var=helloworld` <-- Currently shows the standard page NOTE ADDED: "helloworld" is an unknown variable value, so I want ALL "/mypage/" urls to rewrite back, for example: `http://mysite.com/mypage/abc/` `http://mysite.com/mypage/1231241/` `http://mysite.com/mypage/sdfasfdadsf/` Will all rewrite back to `http://mysite.com/mypage/?var={path}`


title: I would like to use create a function in my custom plugin to tell WP to use a different header

text: I am well aware of the use of child themes for this. I know about get_header($name). I already understand the use of conditional tags. I want my plugin to remove the function:               function get_header( $name = null ) {     do_action( 'get_header', $name );     $templates = array();     if ( isset($name) )     templates[] = "header-{$name}.php";     $templates[] = 'header.php';     // Backward compat code will be removed in a future release     if ('' == locate_template($templates, true))     load_template( ABSPATH . WPINC . '/theme-compat/header.php');     }      and the replace get_header() with:               function get_header( $name = null ) {     do_action( 'get_header', $name );     $templates = array();     if ( isset($name) )     templates[] = "header-{$name}.php";     $templates[] = 'header.php';     // Backward compat code will be removed in a future release     if ('' == locate_template($templates, true))     load_template( MY PLUGIN PATH/header.php');     }      php.net told me to use runkit_function_remove() but the website I am working on says this is an undefined function. Any help would be much appreciated. Leon


title: Strange characters appeared in header

text: ![enter image description here](http://i.stack.imgur.com/2tBUo.png) Hi everyone! I have a problem with my website. There are strange characters in the header and I couldn't find any file with hardcoded characters like this. So I don't know how to fix this. The same characters I noticed in the admin panel. Any suggestions how to fix this problem ?? ![enter image description here](http://i.stack.imgur.com/rKVRv.png)


title: Pagination options using xml data instead of database?

text: Working on a custom plugin. I have an XML file containing over 500 items I need to make available for posting at the client's discretion. The client wants to share this plugin among a small group of peers, with no access to a central database, hence the XML file. We've done something similar in the past using data stored in a MySQL table and WP_List_Table for display and pagination, but I'm unsure about how to proceed using XML. I'd prefer we create all posts as drafts that they can publish as desired, but for reasons I don't quite comprehend, that's not an option. Basically, they want to see a list of all available items where they can simply click to publish individually or check multiple items and publish in bulk. Does that make sense?


title: Customize Breadcrumbs - home -> page -> childpage -> post

text: I use this snippet for breadcrumbs, and it works well, but not as i need it.                   function test_breadcrumbs() {         if(!is_front_page()) {         echo '';         echo 'Home/';         if (is_category() || is_single()) {             the_category(' / ');             if (is_single()) {                 echo ' / ';                 the_title();             }         } elseif (is_page()) {             echo the_title();         }         echo '';     }     }      It shows this: Home->Childpage->Post I use not the index.php for blogpostings, i use for all pages own templates. This works so far. But my nav-structure is a bit different as the breadcrumbs shows: Home -> Page -> Childpage -> post The posts on childpages are all in one category. I.e:   * home      * page 1        * childpage1.1 (template cat.1) [displays all posts from cat.1] -> Single Post cat.1       * childpage1.2 (template cat.2) [displays all posts from cat.2] -> Single Post cat.2       * childpage1.3 (template cat.3) [displays all posts from cat.3] -> Single Post cat.3 i need breadcrumbs they show it like this: Home -> **Page** -> Childpage -> Post not like this (how its now): Home -> Childpage -> Post How can we do that?


title: get_post_gallery_images returns thumbs . I want full size

text:
I have the following code on my site.               <?php // image gallery content      if( has_shortcode( $post->post_content, 'gallery' ) ) {                              $gallery = get_post_gallery_images( $post->ID );                   $image_list = '
';                                foreach( $gallery as $image ) {// Loop through each image in each gallery             $image_list .= '

';         }         $image_list .= '
';                              echo $image_list;                            }                              ?>      My problem is that get_post_gallery_images returns thumbs files instead of fill size so Im using the str_replace function to solve it. How can I make to retrieve the full size urls? Thanks


title: Home in page/post not refer to homepage

text: I really need help. I'm using Private Lawyer theme, and I'm having this problem, Eg: Home >> Photo Gallery the "home" not refer to my homepage. when I click it, it refer back to photo gallery page. I view the source code behind and yes, it did not link to homepage. how to change it back to homepage? anyone please help, thankyouuu! *it is not the home in main menu above.


title: Pretty URLs and rewrite

text: I'm trying to get to where I can create a pretty URL for a custom post type (The end goal being to add a unique value to the query string so I can leverage page caching). So for example the original developer has `/boats/page/1/` working fine and via `add_query_arg` I can get `/boats/page/1/?zip=05443`. I'd like to turn that into `/boats/page/1/zip/05443/` and have tried via rewrite rules but am either missing something or the rewrite rules are not being called. Here is the rewrite rule I added.               $rules = array(         '^boats/page/(\d+)/zip/(\d+)/?$' => 'index.php?post_type=boat&paged=' . $wp_rewrite->preg_index(1) . 'zip=' . $wp_rewrite->preg_index(2)     );     $wp_rewrite->rules = array_merge($rules, $wp_rewrite->rules);      This is being called as part of a hook into `generate_rewrite_rules`. I can get the URLs to look correct but they generate a 404 when I click them. Any help would be greatly appreciated!


title: Force buddypress groups to be private

text: I want to give group creators no option to create public or hidden groups. All groups should be private. So that people still can see those groups but have to be invited or request a membership. The most simple method would be to hide the radio buttons(see pic attached). But I want to do it using a plugin or php. So, how can I force buddypress to make each group private?


title: Custom Post Type does not appear in index page

text: I've made a custom post type with Custom Post Type UI plugin, but it doesn't not appear in my index page nor can i see the permalink page or even the preview page (I get a 404). I am using the most recent _S framework and working on localhost. Is there a way to resolve this?


title: Hide submenu wordpress?

text: How to hide customize menu and another submenu on wordpress? I already hide some submenu on wordpress like               function hiden() {         remove_submenu_page( 'themes.php', 'widgets.php' );//widget         remove_submenu_page( 'themes.php', 'theme-editor.php' ); //editor         remove_submenu_page( 'themes.php', 'theme_options' );} //theme-option     add_action('admin_head', 'hiden');      but if I want to remove customize menu `remove_submenu_page( 'themes.php', 'customize.php' )`... but It can't... Anybody can help me, whats wrong ??? Thank you


title: Post Pagination Modifications (wp_link_pages)

text:
I'm looking to modify how Wordpress is showing the pages of my posts. What I currently have is a previous and next page link at the bottom of the post with the following code:               <?php wp_link_pages( array( 'before' => '
',      'after' => '
', 'next_or_number' => 'next', 'previouspagelink' =>      __('Previous'), 'nextpagelink'=> __('Next')  ) );?>      Which would render: Previous Next What I want to show is: Previous 1 of 5 Next The page where I am and the total of pages in between both buttons. Also, is there any way that when I am on page 5 of 5 the next button still appears but goes to the next article? Thanks a lot!


title: Best practices for meta box placement?

text: I was wondering if there were any cut and dry rules to placing meta boxes? I have a meta box for a custom post type for a TV series that holds extra information for said series: when it began airing, genre, etc and I'm debating whether to place it under the editor or on the side. Are there any unofficial rules to what kind of meta box goes where or is it up to the developer's discretion?


title: Premium theme - hardcoded url?

text: I bought theme (White rock), installed new site **en.mysite.net** from scratch, but theme still references to **mysite.net** Is there any chance that there is somewhere in theme files hardcoded url for which I bought theme, or something like that? Or any other idea? I installed new site to proper directory, url is proper - **en.mysite.net**.


title: Sidebar Categories change arrow when subcategories are shown on click

text:
I have an arrow on the maincategory if a particular category has subcategory, iam using jquery animation to slideup, slidedown subcategory. i want to remove previous arrow and replace it with different arrow when the subcategories slidesdown Here is my Jquery code for Reference:               $(document).ready(function () {         $("aside ul li:has(ul)").addClass("ic-arrdn");         var e = $("aside > ul > li.current-cat, aside > ul > li.current-cat-parent");         if (e.length == 1) {         }         $("aside > ul > li > ul.children").each(function () {             $(this).find("li")             $(this).parent().toggle(function () {                 $(this).find("ul").slideDown()             }, function () {                 $(this).find("ul").slideUp()             })         })     });      This the markup:               -

Cat 2(234)

Cat 1(1)

      I Add the Class ic-arrdn if there are subcategories in the category, then if the main category is clicked i want the class to change from ic-arrdn to ic- arrup..


title: problem with blank page

text: i have a real big problem with my wordpress website functions.php when i put the following code to achive post view and thumbnail. i'm getting the blank page error which when i publish or update a post i get blank white page. i am searching and the result was that the blank page while publish or update means there is a problem in functions.php when i cut all of the code from the functions.php file resave it. the blank page problem will solved. this is my functions.php code and seems there is not error:               <?php      add_theme_support( 'post-thumbnails' );      function wpb_set_post_views($postID) {             $count_key = 'wpb_post_views_count';             $count = get_post_meta($postID, $count_key, true);             if($count==''){                 $count = 0;                 delete_post_meta($postID, $count_key);                 add_post_meta($postID, $count_key, '0');             }else{                 $count++;                 update_post_meta($postID, $count_key, $count);             }         }         //To keep the count accurate, lets get rid of prefetching         remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);         function wpb_track_post_views ($post_id) {             if ( !is_single() ) return;             if ( empty ( $post_id) ) {                 global $post;                 $post_id = $post->ID;                }             wpb_set_post_views($post_id);         }         add_action( 'wp_head', 'wpb_track_post_views');         function wpb_get_post_views($postID){             $count_key = 'wpb_post_views_count';             $count = get_post_meta($postID, $count_key, true);             if($count==''){                 delete_post_meta($postID, $count_key);                 add_post_meta($postID, $count_key, '0');                 return "تعداد بازدید:"."0";             }             return 'تعداد بازدید:'.$count;         }     ?>


title: Creating a Playlist of Widgets

text: I'm trying to create a specialized theme that would enable users to show a playlist of widgets in their sidebar. By playlist, I mean that each widget in the sidebar would follow a specific schedule. For example, one widget might be scheduled to show every day from 9AM-5PM, while another widget may be scheduled to show daily from 5PM-11PM. Is there a way this can be done such that the scheduling of individual widgets is handled by the theme itself? Thx.


title: Don't execute function on specific posts

text: function content_strip_img($content) {     global $post;     if ($post->ID !== 1 || $post->ID !== 2 || $post->ID !== 3 ) {            return preg_replace('/<img[^>]+./','', $content);         }     }     add_filter('the_content', 'content_strip_img');      That doesn't seem to work? How do I exclude specific posts from a function - i.e. execute the function on all **other** posts?


title: Short of raw SQL, can I query for multiple attachment metadata that have a given array key?

text: With raw SQL through `$wpdb`, I believe that I could do something along the lines of this (untested):               SELECT post_id, meta_value     FROM postmeta     WHERE meta_key = '_wp_attachment_metadata'     AND meta_value LIKE '%:"custom_key";a:%'      That said, if there is built-in functionality for this kind of query then I would rather not reinvent the wheel. All of my codex digging has just returned ways to get the attachment metadata for a given id or set of ids, which will not do what I need. I could also retain a list of IDs with this particular array key, but I'd rather not keep this data since it seems like extra clutter...


title: Multisite/Network What file to edit to change the "new blog" registration text

text: I'm not able to find the correct file to edit text. What file do I edit in order to change the text in the picture below? I thought it was `wp-signup.php`, but the text is not there. Thanks for any help! ![screenshot](http://i.imgur.com/RY733QT.jpg)


title: Wordpress - Hide posts in admin from user who did not write them

text: Working on a site and the user only uses two roles. Admin and Author. He has hundreds of authors writing on his blog and wants the ability to hide all Posts under the Posts section of the admin panel that the current logged in author did not write. Basically when an author logs in he wants them to only be able to SEE their own posts and not everyone else. It's a competition blog and he doesn't' want them to easily be able to see the total number of posts written by someone else. Any help would be much appreciated. I'm sure there is a hook I can throw in my functions.php file that will hide this, but no look in the last 3 hours of googleling.


title: Min height of page

text: I am using the Weaver theme and would like to set the minimum page height to a certain size. I have read about it and added:               min-height: 900;      to my style sheet but it does not seem to be working. What should I do?


title: Make a database query using WordPress

text: I am working on a Wordpress theme that has a homepage slider. I have a table in Wordpress database that stores post view counts and I would like to make my slider show the top viewed posts. This is the SQL to get the top post, Post ID's               SELECT `post_id`, `single_views`     FROM `wp_ak_popularity`     ORDER BY `single_views`     DESC LIMIT 30      And below is my current Wordpress DB query that is currently in use.               $featured = new WP_Query(         array(             'no_found_rows'             => TRUE,             'update_post_meta_cache'    => FALSE,             'update_post_term_cache'    => FALSE,             'ignore_sticky_posts'       => 1,             'posts_per_page'            => wpb_option('featured-slider-number'),             'cat'                       => wpb_option('featured-slider-category')         )     );      I was looking at the WordPress documentation site and saw that I could use something like this to only query the posts that I need...               $featured  = new WP_Query(          array(              post_type' => 'post',             'post__in' => array( 2, 5, 12, 14, 20 )         )     );      Where I need help is how I can make the first Database query and get those results into a variable like this               $post_ids = '2, 5, 12, 14, 20';      So I can then make the main Database query by simply passing in the Post ID's that I need. Can someone show me how to get the first list of ID's?


title: Show previous month's posts

text:
I've managed to loop through the current month's posts in January but I am trying to get the previous month's posts in December of the previous year. I think this is where the problem might be, that it is 2014 and the the posts I am after is in 2013 (Dec). I'd appreciate it if someone can spot the problem. I have been through hordes of examples, the codex and the WordPress forums but not found anything that would work.                                         <?php                       $prevMonth = date('M', mktime(0, 0, 0, date('m'), 0, date('Y')));                                                                     $newsPrevArgs = array(                     'cat'               => 'news',                     'monthnum'          => $prevMonth,                     'order'             => 'DES',                     'posts_per_page'    => 5                 );             ?>

<?php echo date('M Y', mktime(0, 0, 0, date('m'), 0, date('Y'))) ?>
                  <?php                       $previous_news = new WP_Query( $newsPrevArgs );                 $isFirstNewsLoop = true;                 $newsItemNum = 0;                      // Loop through all news items                      while ( $previous_news->have_posts() ) {                     $previous_news->the_post(); ?>                              <?php                              echo '
';                                           echo '' . get_the_date('d M Y', '', '') . '';                                 echo '' . get_the_post_thumbnail($page->ID, 'home-widget-210') . '';                                 echo '' . get_the_title() . '';                                 echo '' . get_the_excerpt() . '';                                 wp_reset_postdata();                             echo '
'                         ?>                               <?php                              $newsItemNum +=1;                         $isFirstNewsLoop = false;                               ?>                  <?php } ?>


title: How do I set up real anonymous posting in bbpress forums?

text: I have bbpress-post-topics plugin installed so that my comments forms are replaced by a bbpress forum topic, it's working but I would like to enable anonymous posting. ![how do i remove the fields so users can post anonymously?](http://i.stack.imgur.com/ZzfCV.png) Currently, as you can see above, the Author Name, Email, Website and Topic Title are required. I would like to adjust this so only the 'topic title' is required and if they are not logged in, their posts are attributed to a user called 'anonymous' I can edit the PHP if required - I really thought the setting in Forums for 'Allow guest users without accounts to create topics and replies' would have achieved what I'm aiming for. Note: This problem exists in the traditional forums too, e.g. http://www.rugbydata.com/forums/forum/aviva-premiership/ You can see the author name/email are required fields. How do I remove them as required fields so users can really post anonymously without creating an account?


title: Custom-Metaboxes-and-Fields text_url field prepending http://

text: I'm using the Custom Metaboxes and Fields code wich is pretty good. However I need sanitization on URL fields of course but the built in text_url field type is adding 'http://' to my entries. I know it is using WP's esc_url (cmb_Meta_box_types.php) And cmb_Meta_box_Sanitize esc_url_raw() How can I get this field type to return only the inputted value?


title: Plugin's total number of users

text: Sorry if this has been asked before, but I couldn't find any reference to this here. Looking at a plugin's stats on the WordPress site, you can see a percentage of versions of your plugin being used. Do you know of a way of getting the total number of users? That would be the 100% of the pie chart ;) From what I could get on the stats page, the percentages are coming from:               http://api.wordpress.org/stats/plugin/1.0/plugin      But this just returns a JSON with the percentages already there. No total numbers. And the API is not really documented. I could also get some numbers with:               http://api.wordpress.org/stats/plugin/1.0/downloads.php?slug=plugin-slug&limit=max      But this is just day per day downloads. I want to have an idea of how many users are actually using a given plugin. Any ideas?


title: Advanced Custom Fields and Yoast SEO keyword analysis

text: The problem I'm having is the **keyword page analysis tool** doesn't read my custom fields so I am trying to figure out how to run a filter on them. I found a blog post on Yoast website here here which references this issue and they list the filter `wpseo_pre_analysis_post_content`, but I am unsure of how to run this on the fields. I found an action for running a function on the admin edit screen on the ACF website : acf/input/admin_head, but I don't know how to run the filter on the actions that have been loaded. EDIT: I found out the acf plugin actually has this filter built in but doesnt seem to be working.                       // set value             if( !isset($field['value']) )             {                 $field['value'] = apply_filters('acf/load_value', false, $post_id, $field);                 $field['value'] = apply_filters('acf/format_value', $field['value'], $post_id, $field);                      apply_filters( 'wpseo_pre_analysis_post_content', $field['value'] );             }


title: wordpress url with format .com/category/sub-category

text: I may be overlooking a simple answer here, but this one is stumping me. I am converting a site to wordpress. The current site has many pages whose URL has the format www.x.com/category/topic. What I cant figure out/remember, is how to create a page or post with that format. As far as I know, the standard wordpress format is www.x.com/category It is important to keep the integrity of these links, so keeping the exact destinations is a must. I would like to accomplish this without the use of redirection plugins. Thank you in advance.


title: Listing authors and date archive from custom post type

text: I've got a cpt called 'blog', now I would like to list all authors that contributed to that cpt. Also I would like to list all blogposts (from the 'blog' cpt) grouped in months, like wp_get_archives() does.   1. Authors. I tried to use wp_list_authors but it only lists authors from regular posts, not cpt's. I only want list authors of the 'blog' cpt. What to do?   2. Monthly archives. I tried to use wp_list_archives() following instructions from Bainternet (here: Get monthly archives for custom post type) and that lists "monthname year", looks great. BUT, the permalinks created looks like this: www.example.com/2011/10   ...and that leads nowhere! I get a 404 error. All the 'blog' cpt posts are located under www.example.com/blog and I want the date archive url to include /blog as well. ~~So maybe it's just a rewrite thing but I do fix that?~~ Just manually typing www.example.com/blog/2011/10 only gets me to the 404 error page also. Hope you can help me! * * * ## Update 1 I managed to rewrite the urls to the archives so now they look like this: www.example.com/blog/2011/10 This is the code I used for the rewrite:               add_rewrite_tag('%blog-date%','([\d]{4}-[\d]{2}-[\d]{2})');          add_action( 'init', 'blog_rewrites' );     function blog_rewrites() {         add_rewrite_rule( "blog/day/([\d]{4}-[\d]{2}-[\d]{2})/?$", 'index.php?post_type=blog&blog-date=$matches[1]', 'top' );     }          add_filter( 'query_vars', 'blog_vars' );     function blog_vars ( $vars ) {         $vars[] = 'blog-date';         return $vars;     }      But I still get the 404 error though... * * * ## Update 2 Applying code from @Bainternet's response below I was able to get my authors list functioning but I still get a 404 on my monthly archives links. The url seems correct though: www.example.com/blogg/2011/10 This is the code from my functions.php right now:               add_filter('get_archives_link', 'blog_archive_links');     function blog_archive_links($html){         $home_url = home_url();         $home_url_with_blog  = $home_url .'/blogg';         return str_replace($home_url,$home_url_with_blog,$html);     }          //to match http://www.example.com/blog/2011/12/1/ use     add_rewrite_rule('^blogg/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$','index.php?post_type=blogg&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]','top');     //to match http://www.example.com/blog/2011/12/1/page/2 use     add_rewrite_rule('^blogg/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$','index.php?post_type=blogg&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&page=$matches[4]','top');     //to match http://www.example.com/blog/2011/12/ use     add_rewrite_rule('^blogg/([0-9]{4})/([0-9]{1,2})/(?$','index.php?post_type=blogg&year=$matches[1]&monthnum=$matches[2]','top');     //to match http://www.example.com/blog/2011/12/page/2 use     add_rewrite_rule('^blogg/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$','index.php?post_type=blogg&year=$matches[1]&monthnum=$matches[2]&page=$matches[3]','top');          function Cpt_getarchives_where_filter( $where , $r ) {       $post_type = 'blogg';       return str_replace( "post_type = 'post'" , "post_type = '$post_type'" , $where );     }      And this is the code in my sidebar.php:               add_filter( 'getarchives_where' , 'Cpt_getarchives_where_filter' , 10 , 2 );     wp_get_archives();     remove_filter('getarchives_where' , 'Cpt_getarchives_where_filter' , 10 );      As you can see my cpt isn't called 'blog', it's actually called 'blogg', that's the Swedish spelling, shouldn't matter though. Also, I'm not using any plugin to get the cpt archives to work, I've simply created a file called archive-blogg.php and set the permalinks for the blogposts in the 'blogg' cpt to '/blogg' using a plugin called 'Custom Post Permalinks' that doesn't seem to be around anymore. It seems to do everything else right but I could try to replace that plugin with some code in functions.php. Apart from that, anything else that could be tested to get this to work?


title: How to combine 2 separate htaccess

text: I have 2 separate htaccess and i need to combine them into one but im not sure how to do it. These are my htaccess: 1 (the current one)               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>        1. (the new one) RewriteEngine On RewriteCond %{THE_REQUEST} \ //([^\?\ ]*) RewriteRule ^ /folder/%1 [L,R=301] Should i just put them together inside the same ifmodule? I already tried that and it didnt work. Thank you.