title: WordPress plugin admin page - using WordPress function in linked php file

text: Asked this question on StackOverflow and they directed me over yonder... nice place ya got here =) I've been developing a pretty simple WordPress plugin, and wanted to do some live validation of certain fields on the page, which is where I am stuck. I've been looking everywhere for something that worked, and I simply can't make it function. I've been trying to get the ajax to function properly and I know I'm missing something obvious, I just can't figure it out. The main function file includes this to register my js file.               function on_screen_validation() {         wp_enqueue_script( "field_validation", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/field-validation.js"), array( 'jquery' ) );     }     add_action( 'admin_print_scripts', 'on_screen_validation' );      The js runs this code to capture the onblur command and pass the value to the php validation file.               jQuery(document).ready(function() {         //run field validation on username on blur         jQuery('.valusername').blur(function() {                  var usernameID = jQuery(this).attr('id');             var usernameVal = jQuery('#'+usernameID).val();             var thisFunction = 'validateUserName';                  jQuery.post("mywebaddress...validation.php",{Function: thisFunction, thevars: usernameVal}, function(data) {                  alert(data); //would update validation message here             });         });     });      And the validation.php script looks like this:               if(isset($_POST['Function'])){         call_user_func($_POST['Function'], $_POST['thevars']);     }          function validateUserName($username){           if ( username_exists($username) ) {            echo $username.' does exist';         } else {            echo $username.' doesnt exist';        }     }      Obviously I'm just using alerts for now to make sure the data is being checked properly. If I take out the WordPress username_exists function, and just echo back a string, it works fine. But with username_exists, it creates a 500 internal server error. I need to know how to get this external validation.php file to recongnise WordPress functions (I think), and nothing I've found so far will work. Thanks for reading... sorry for the long explanation I just wanted to make sure the context was all there so it made sense (I hope!)! Cheers, Matt


title: Embed HTML5 files/subfolders in post?

text: I am attempting to publish an Adobe Captivate project to a WordPress blog. The .swf file is easy enough to handle, but the HTML5 version is giving me problems. The way that Captivate outputs HTML5 is as a folder that includes an index.html file and other folders with various resources that are references in the index.html file (e.g., as ./images/picture.jpg). I have several goals, in decreasing order of importance: 1) Be able to insert the HTML5 content into a WordPress post (including uploading the content). 2) Have the content "window" automatically fill the area WordPress has available, as if it were a simple video. (I ask this question because I tried using iFrames and they have a fixed size, unless I'm missing an option). 3) Be able to restrict access so that someone can only access the file through the WordPress post (rather than, say, directly following the URL for the index.html file). Is this possible?


title: Using %postname% tag with a Custom Permastruct creates 400 Bad Request Errors from the server

text: This is related to another question that I had asked earlier. I'm doing some rewrite code to create some custom permalinks for a custom post type. I think I'm getting it mostly working except I'm getting the following error: ![400 Bad Request](http://i.stack.imgur.com/rhEhy.jpg) I noticed a few things:   1. Whatever I have as the postname gets replaced in the url field as %postname%   2. If I omit the post name, it loads up in WordPress no problem Here is the code to setup the rewrite:               add_action('init', 'setup_rewrites');     function setup_rewrites() {             global $wp_rewrite;             //Content             add_rewrite_tag('%seriesname%','([^/]+)');             add_rewrite_tag('%contenttype%','([^/]+)');             $content_struct = '/content/%seriesname%/%contenttype%/%postname%';             add_permastruct('veda_content', $content_struct, false);              }      an example url that doesn't work but should: http://watchonepiecelegally.com/content/one-piece/episode/test-1 A URL that does work: http://watchonepiecelegally.com/content/one- piece/episode/ What I get via Jan Fabry's Rewrite Analyzer plugin: ![enter image description here](http://i.stack.imgur.com/U7wlj.jpg) This should work but I'm missing something. Can anyone give me a hand? EDIT: As requested, here are the rewrite rules Wordpress is generating. Hopefully this helps:               Array     (         [category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]         [category/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]         [category/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2]         [category/(.+?)/?$] => index.php?category_name=$matches[1]         [tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]         [tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]         [tag/([^/]+)/page/?([0-9]{1,})/?$] => index.php?tag=$matches[1]&paged=$matches[2]         [tag/([^/]+)/?$] => index.php?tag=$matches[1]         [type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?post_format=$matches[1]&feed=$matches[2]         [type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?post_format=$matches[1]&feed=$matches[2]         [type/([^/]+)/page/?([0-9]{1,})/?$] => index.php?post_format=$matches[1]&paged=$matches[2]         [type/([^/]+)/?$] => index.php?post_format=$matches[1]         [anime-series/.+?/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]         [anime-series/.+?/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [anime-series/.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime-series/.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime-series/.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [anime-series/(.+?)/trackback/?$] => index.php?veda_series=$matches[1]&tb=1         [anime-series/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_series=$matches[1]&feed=$matches[2]         [anime-series/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_series=$matches[1]&feed=$matches[2]         [anime-series/(.+?)/page/?([0-9]{1,})/?$] => index.php?veda_series=$matches[1]&paged=$matches[2]         [anime-series/(.+?)/comment-page-([0-9]{1,})/?$] => index.php?veda_series=$matches[1]&cpage=$matches[2]         [anime-series/(.+?)(/[0-9]+)?/?$] => index.php?veda_series=$matches[1]&page=$matches[2]         [anime-release/[^/]+/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]         [anime-release/[^/]+/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [anime-release/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime-release/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime-release/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [anime-release/([^/]+)/trackback/?$] => index.php?veda_release=$matches[1]&tb=1         [anime-release/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_release=$matches[1]&feed=$matches[2]         [anime-release/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_release=$matches[1]&feed=$matches[2]         [anime-release/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_release=$matches[1]&paged=$matches[2]         [anime-release/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?veda_release=$matches[1]&cpage=$matches[2]         [anime-release/([^/]+)(/[0-9]+)?/?$] => index.php?veda_release=$matches[1]&page=$matches[2]         [anime-release/[^/]+/([^/]+)/?$] => index.php?attachment=$matches[1]         [anime-release/[^/]+/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [anime-release/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime-release/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime-release/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [anime_video/[^/]+/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]         [anime_video/[^/]+/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [anime_video/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime_video/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime_video/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [anime_video/([^/]+)/trackback/?$] => index.php?veda_video=$matches[1]&tb=1         [anime_video/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_video=$matches[1]&feed=$matches[2]         [anime_video/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_video=$matches[1]&feed=$matches[2]         [anime_video/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_video=$matches[1]&paged=$matches[2]         [anime_video/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?veda_video=$matches[1]&cpage=$matches[2]         [anime_video/([^/]+)(/[0-9]+)?/?$] => index.php?veda_video=$matches[1]&page=$matches[2]         [anime_video/[^/]+/([^/]+)/?$] => index.php?attachment=$matches[1]         [anime_video/[^/]+/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [anime_video/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime_video/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime_video/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [anime_purchase/[^/]+/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]         [anime_purchase/[^/]+/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [anime_purchase/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime_purchase/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime_purchase/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [anime_purchase/([^/]+)/trackback/?$] => index.php?veda_purchase=$matches[1]&tb=1         [anime_purchase/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_purchase=$matches[1]&feed=$matches[2]         [anime_purchase/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_purchase=$matches[1]&feed=$matches[2]         [anime_purchase/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_purchase=$matches[1]&paged=$matches[2]         [anime_purchase/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?veda_purchase=$matches[1]&cpage=$matches[2]         [anime_purchase/([^/]+)(/[0-9]+)?/?$] => index.php?veda_purchase=$matches[1]&page=$matches[2]         [anime_purchase/[^/]+/([^/]+)/?$] => index.php?attachment=$matches[1]         [anime_purchase/[^/]+/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [anime_purchase/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime_purchase/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime_purchase/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [anime-review/[^/]+/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]         [anime-review/[^/]+/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [anime-review/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime-review/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime-review/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [anime-review/([^/]+)/trackback/?$] => index.php?veda_review=$matches[1]&tb=1         [anime-review/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_review=$matches[1]&feed=$matches[2]         [anime-review/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_review=$matches[1]&feed=$matches[2]         [anime-review/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_review=$matches[1]&paged=$matches[2]         [anime-review/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?veda_review=$matches[1]&cpage=$matches[2]         [anime-review/([^/]+)(/[0-9]+)?/?$] => index.php?veda_review=$matches[1]&page=$matches[2]         [anime-review/[^/]+/([^/]+)/?$] => index.php?attachment=$matches[1]         [anime-review/[^/]+/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [anime-review/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime-review/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [anime-review/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [subtitle_language/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_subtitle_language=$matches[1]&feed=$matches[2]         [subtitle_language/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_subtitle_language=$matches[1]&feed=$matches[2]         [subtitle_language/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_subtitle_language=$matches[1]&paged=$matches[2]         [subtitle_language/([^/]+)/?$] => index.php?veda_subtitle_language=$matches[1]         [audio_language/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_audio_language=$matches[1]&feed=$matches[2]         [audio_language/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_audio_language=$matches[1]&feed=$matches[2]         [audio_language/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_audio_language=$matches[1]&paged=$matches[2]         [audio_language/([^/]+)/?$] => index.php?veda_audio_language=$matches[1]         [genre/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_genre=$matches[1]&feed=$matches[2]         [genre/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_genre=$matches[1]&feed=$matches[2]         [genre/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_genre=$matches[1]&paged=$matches[2]         [genre/([^/]+)/?$] => index.php?veda_genre=$matches[1]         [studio/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_studio=$matches[1]&feed=$matches[2]         [studio/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_studio=$matches[1]&feed=$matches[2]         [studio/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_studio=$matches[1]&paged=$matches[2]         [studio/([^/]+)/?$] => index.php?veda_studio=$matches[1]         [content_type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_content_type=$matches[1]&feed=$matches[2]         [content_type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_content_type=$matches[1]&feed=$matches[2]         [content_type/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_content_type=$matches[1]&paged=$matches[2]         [content_type/([^/]+)/?$] => index.php?veda_content_type=$matches[1]         [publisher/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_publisher=$matches[1]&feed=$matches[2]         [publisher/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_publisher=$matches[1]&feed=$matches[2]         [publisher/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_publisher=$matches[1]&paged=$matches[2]         [publisher/([^/]+)/?$] => index.php?veda_publisher=$matches[1]         [release_type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_release_type=$matches[1]&feed=$matches[2]         [release_type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_release_type=$matches[1]&feed=$matches[2]         [release_type/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_release_type=$matches[1]&paged=$matches[2]         [release_type/([^/]+)/?$] => index.php?veda_release_type=$matches[1]         [release_rating/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_rating=$matches[1]&feed=$matches[2]         [release_rating/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_rating=$matches[1]&feed=$matches[2]         [release_rating/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_rating=$matches[1]&paged=$matches[2]         [release_rating/([^/]+)/?$] => index.php?veda_rating=$matches[1]         [video_source/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_video_source=$matches[1]&feed=$matches[2]         [video_source/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_video_source=$matches[1]&feed=$matches[2]         [video_source/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_video_source=$matches[1]&paged=$matches[2]         [video_source/([^/]+)/?$] => index.php?veda_video_source=$matches[1]         [retailer/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_retailer=$matches[1]&feed=$matches[2]         [retailer/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?veda_retailer=$matches[1]&feed=$matches[2]         [retailer/([^/]+)/page/?([0-9]{1,})/?$] => index.php?veda_retailer=$matches[1]&paged=$matches[2]         [retailer/([^/]+)/?$] => index.php?veda_retailer=$matches[1]         [content/[^/]+/[^/]+/[^/]+/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]         [content/[^/]+/[^/]+/[^/]+/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [content/[^/]+/[^/]+/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [content/[^/]+/[^/]+/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [content/[^/]+/[^/]+/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [content/([^/]+)/([^/]+)/([^/]+)/trackback/?$] => index.php?seriesname=$matches[1]&contenttype=$matches[2]&name=$matches[3]&tb=1         [content/([^/]+)/([^/]+)/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?seriesname=$matches[1]&contenttype=$matches[2]&name=$matches[3]&feed=$matches[4]         [content/([^/]+)/([^/]+)/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?seriesname=$matches[1]&contenttype=$matches[2]&name=$matches[3]&feed=$matches[4]         [content/([^/]+)/([^/]+)/([^/]+)/page/?([0-9]{1,})/?$] => index.php?seriesname=$matches[1]&contenttype=$matches[2]&name=$matches[3]&paged=$matches[4]         [content/([^/]+)/([^/]+)/([^/]+)(/[0-9]+)?/?$] => index.php?seriesname=$matches[1]&contenttype=$matches[2]&name=$matches[3]&page=$matches[4]         [content/[^/]+/[^/]+/[^/]+/([^/]+)/?$] => index.php?attachment=$matches[1]         [content/[^/]+/[^/]+/[^/]+/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [content/[^/]+/[^/]+/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [content/[^/]+/[^/]+/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [content/[^/]+/[^/]+/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [content/([^/]+)/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?seriesname=$matches[1]&contenttype=$matches[2]&feed=$matches[3]         [content/([^/]+)/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?seriesname=$matches[1]&contenttype=$matches[2]&feed=$matches[3]         [content/([^/]+)/([^/]+)/page/?([0-9]{1,})/?$] => index.php?seriesname=$matches[1]&contenttype=$matches[2]&paged=$matches[3]         [content/([^/]+)/([^/]+)/?$] => index.php?seriesname=$matches[1]&contenttype=$matches[2]         [content/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?seriesname=$matches[1]&feed=$matches[2]         [content/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?seriesname=$matches[1]&feed=$matches[2]         [content/([^/]+)/page/?([0-9]{1,})/?$] => index.php?seriesname=$matches[1]&paged=$matches[2]         [content/([^/]+)/?$] => index.php?seriesname=$matches[1]         [robots\.txt$] => index.php?robots=1         [.*wp-atom.php$] => index.php?feed=atom         [.*wp-rdf.php$] => index.php?feed=rdf         [.*wp-rss.php$] => index.php?feed=rss         [.*wp-rss2.php$] => index.php?feed=rss2         [.*wp-feed.php$] => index.php?feed=feed         [.*wp-commentsrss2.php$] => index.php?feed=rss2&withcomments=1         [feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]         [(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]         [page/?([0-9]{1,})/?$] => index.php?&paged=$matches[1]         [comments/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]&withcomments=1         [comments/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]&withcomments=1         [comments/page/?([0-9]{1,})/?$] => index.php?&paged=$matches[1]         [search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?s=$matches[1]&feed=$matches[2]         [search/(.+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?s=$matches[1]&feed=$matches[2]         [search/(.+)/page/?([0-9]{1,})/?$] => index.php?s=$matches[1]&paged=$matches[2]         [search/(.+)/?$] => index.php?s=$matches[1]         [author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2]         [author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2]         [author/([^/]+)/page/?([0-9]{1,})/?$] => index.php?author_name=$matches[1]&paged=$matches[2]         [author/([^/]+)/?$] => index.php?author_name=$matches[1]         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]         [([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]         [([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]         [([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]         [([0-9]{4})/([0-9]{1,2})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]         [([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&feed=$matches[2]         [([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&feed=$matches[2]         [([0-9]{4})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&paged=$matches[2]         [([0-9]{4})/?$] => index.php?year=$matches[1]         [[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]         [[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&tb=1         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&paged=$matches[5]         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&cpage=$matches[5]         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&page=$matches[5]         [[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/?$] => index.php?attachment=$matches[1]         [[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/comment-page-([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&cpage=$matches[4]         [([0-9]{4})/([0-9]{1,2})/comment-page-([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&cpage=$matches[3]         [([0-9]{4})/comment-page-([0-9]{1,})/?$] => index.php?year=$matches[1]&cpage=$matches[2]         [.+?/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]         [.+?/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1         [.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2]         [.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]         [(.+?)/trackback/?$] => index.php?pagename=$matches[1]&tb=1         [(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2]         [(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2]         [(.+?)/page/?([0-9]{1,})/?$] => index.php?pagename=$matches[1]&paged=$matches[2]         [(.+?)/comment-page-([0-9]{1,})/?$] => index.php?pagename=$matches[1]&cpage=$matches[2]         [(.+?)(/[0-9]+)?/?$] => index.php?pagename=$matches[1]&page=$matches[2]     )      %seriesname% is a slug that coincides with the parent of the post. %contenttype% coincides with a custom taxonomy. The idea was that if the %postname% tag was omitted, those two other tags could be used to create an archive page. EDIT: Making progress. As noted in the discussion in the comments, using the builtin %postname% tag with a custom permastruct seems to be the cause of my 400 Bad Request Errors. Hopefully this should narrow down what the problem seems to be.


title: How can I dynamically load another page template to provide an alternate layout of the posts?

text: I have a page that displays posts (4 on each row), with a thumbnail image & title for each. Is it possible to click a text/icon link and dynamically switch the page template? I'm looking to provide an alternate view of the posts, perhaps with larger images, more text/custom fields added etc. I thought it would be easy just to link to another page template but it changes the url (would like the url to stay the same) and for some reason it loads the closest matching post, rather than the new page template (I have the page template nested within the first). Something like this domain.com/page/?view=list


title: GrandParent ,Parent, Child issue

text:
I have the following               GrandParent     -Parent01     --Child     -Parent02     --Child     --Child     -Parent03     --Child      I wish to find a solution that when Im on the Grandparent page, that it will only return the parents and not the children IE.               GrandParent     -Parent01     -Parent02     -Parent03      This is the code I have at present, and it produces all parents and children of the grandparent page, and places them into a table.               <?php $postid = get_the_ID(); ?>      <?php /* $pages = get_pages(array('child_of' =>$postid)); */     $pages = get_children(array(      'numberposts' =>30,     'post_parent' => $heading_page->post_id      ));     $tCount= 0;     ?>

     <?php foreach ($pages as $page): ?>     <?php     if($tCount % 2 == 0)      {         echo '

';     }?>

     <a href="<?php echo get_permalink($page->ID); ?>">             <?php echo get_the_post_thumbnail($page->ID, array(300,250)); ?>
        <a href="<?php echo get_permalink($page->ID); ?>"><?php echo $page-   >post_title ?>

        	      <?php $tCount++; endforeach; ?>


title: Join inside a wpdb query.. confused!

text: I need to get a return from a query that provides me with email, username or nicename as well as post title based on author id. The query is to run once daily via cron and look for posts that have spent a specific live time before they come up for removal (the query is intended to run five days and then three days before post deletion). so far i have this which works (almost) via running manual queries in phpmyadmin.               SELECT ID, user_email, display_name, user_nicename     FROM wp_users     WHERE ID     IN (SELECT post_author FROM wp_posts WHERE post_type = 'sales' AND HOUR( TIMEDIFF( NOW( ) , post_date_gmt ) ) >=1)        alls well and good here, it returns success however what i now need to get is also the post_titles of all the posts due for expiry so that it can be added inside the $message part of the wp_mail. Im going to be honest with you i havent a clue about joining stuff. whether it needs left joins, outside joins or any other kind of join there maybe, the only info i seem to keep getting back from codex **is this page** **Update**               <?php     $emailusers = $wpdb->get_results("SELECT ID, user_email FROM $wpdb->users WHERE ID IN (SELECT post_author FROM $wpdb->posts WHERE post_type = 'sales' AND HOUR( TIMEDIFF( NOW( ) , post_date_gmt ) ) >=1)");          foreach ($emailusers as $user) {     // do wp_mail stuff from here     }     ?>      Full working code **below** for anyone who is interested:               <?php      require_once 'wp-load.php';          global $wpdb;          $emailusers = $wpdb->get_results("SELECT u.user_nicename, u.user_email, p.post_title,  p.post_date     FROM $wpdb->posts p     INNER JOIN $wpdb->users u ON p.post_author = u.ID     WHERE post_type = 'sales' OR post_type = 'rentals' OR post_type = 'business'     AND HOUR( TIMEDIFF( NOW( ) , post_date_gmt ) ) >=721");               foreach ($emailusers as $user) {          $to = $user->user_email;          $subject = $user->post_title;          $message = 'You have a property listing that will auto expire in 3 days, the property is ' . $user->post_title .' and was listed on ' . $user->post_date .'' . "\r\n";               $headers .= "From: -------- <www.------------.com>" . "\r\n";               wp_mail( $user_email, $subject, $message, $headers);          }               ?>        The code up above will notify the author @ 720 hours that they have 3 days remaining before the post is auto deleted. regards


title: Take stored email addresses from custom post type & turn into one string

text: I have a custom post type, which has email and names stored. I would like to take these email addresses and concatenate (join them) together into a single string. This string will be stored in a variable, and I will then assign this variable to the `$email_to` in wp_mail. Using a cron, the latest 3 posts will then be sent to the email addresses over a chosen frequency. My Q: I am just looking for someone to point me in the right direction. Should I use a `foreach` to loop through all of these stored email addresses in the custom post type, and then concatenate them to the string stored in the variable? **UPDATE** I am not looking for someone to provide the code (that would be unreasonable). I am looking for a yes or no, & a little bit of guidance if possible.


title: How do I handle multiple Submit buttons in plugin's option page?

text: I'm developing my first plugin for WordPress and I'm getting a grasp of the whole hook system. I'm now stuck on a (probably) small issue, that I could possibly circumvent, but I'm afraid of coming out with a "hack", more than a real solution. What I'm trying to do is putting two submit buttons on my Options page:   * Save   * Draft Both of them would have to do something common (i.e. Saving the content of the form), but then they should take different action with such content. So far, I managed to ouput the two buttons using the following code:               echo '<form id="my_plugin_settings_form" method="post" action="options.php">';     settings_fields('my_plugin_settings');     do_settings_sections('my_plugin_settings');     submit_button(__('Save', 'MyPlugin'), 'Save');     submit_button(__('Draft', 'MyPlugin'), 'secondary','Draft');     echo '</form>';      I also implemented a validate method, which correctly receives the posted fields:               public function validate_settings($settings) {       var_dump($settings); // Here I can see all posted fields     }      The above works well, with all the data being saved correctly in WordPress Options table. However, I would like to "intercept" the data being saved to manipulate it. I was thinking of manipulating the data within the `validate_settings()` method, but the button that was clicked is **not** included in the settings passed as an argument. I could simply parse the `$_POST` array to get it, but I'm having the doubt that the approach is a bit of a hack and, that, perhaps, I should implement a proper hook, somewhere else. My question, therefore, is: where should I put my code to process the data posted from an Options page? Is there a specific hook I should use? Thanks in advance for the answers.


title: WordpressUser Submission Form

text:
I have a User Post Submission form, and it has three issues, as well as one potential issue. Here is the code that processes the form.               <?php if(isset($_POST['user_submission_form'])) {              if(wp_verify_nonce($_POST['user_submission_form'], 'user_submission_form')) {                  $user_submitted_title = sanitize_text_field($_POST['user_submitted_title']);             $user_submitted_progress = $_POST['user_submitted_progress'];             $user_submitted_goals = $_POST['user_submitted_goals'];             $user_submitted_categories = $_POST['user_submitted_categories'];             $user_submitted_tags = sanitize_text_field($_POST['user_submitted_tags']);             $user_submitted_video = sanitize_text_field($_POST['user_submitted_video']);             $user_submitted_audio = sanitize_text_field($_POST['user_submitted_audio']);                  if(($user_submitted_title != '') && ($user_submitted_progress != '') && ($user_submitted_goals != '') && ($user_submitted_categories != '') && ($user_submitted_tags != '')) {                      $user_post = array(                     'comment_status' => 'open',                     'post_author'    => $user_ID,                     'post_category'  => array($user_submitted_categories),                     'post_content'   => '
Project Progress
' . $user_submitted_progress . '
Project Goals
' . $user_submitted_goals,                     'post_status'    => 'publish',                     'post_title'     => $user_submitted_title,                     'post_type'      => 'post',                     'tags_input'     => $user_submitted_tags                 );                      $user_post_id = wp_insert_post($user_post);                 add_post_meta($user_post_id, 'wpcf-video', $user_submitted_video);                 add_post_meta($user_post_id, 'wpcf-audio', $user_submitted_audio);                      global $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,$user_post_id);                             }                         }                     }                 }                      $user_post_redirect = get_permalink($user_post_id);                 wp_redirect($user_post_redirect); exit;                  }                  else {                 //Notify the user that they must fill out all required fields             }              }              else {             print 'Sorry, your post did not verify.';             exit;         }          }?>          <?php get_header(); ?>      Here is the form (after the header)               <?php if (is_user_logged_in()) { ?>              <form id="user_submitted_post" action="" method="POST" enctype="multipart/form-data">                  <input type="hidden" name="user_submission_form" value="<?php echo wp_create_nonce('user_submission_form'); ?>">
Title
             <input type="text" id="user_submitted_title" name="user_submitted_title">
Please provide detailed information about the long-term goals of your project, as well as your current project progress. Feel free to format your text using boldness, italics, lists, and block quotes. Simply click on the formatting option you'd like to use and start typing. When you no longer need the format you have selected, hit enter to go to the next line, and click on the active format button to end formatting.

Project Progress
             <?php wp_editor( '', 'user_submitted_progress', $settings = array('media_buttons' => false, 'quicktags' => false, 'textarea_rows' => 15, 'editor_css' => '', 'tinymce' => add_filter("mce_buttons", "base_extended_editor_mce_buttons", 0), add_filter("mce_buttons_2", "base_extended_editor_mce_buttons_2", 0)) ); ?>
Project Goals
             <?php wp_editor( '', 'user_submitted_goals', $settings = array('media_buttons' => false, 'quicktags' => false, 'textarea_rows' => 15, 'tinymce' => add_filter("mce_buttons", "base_extended_editor_mce_buttons", 0), add_filter("mce_buttons_2", "base_extended_editor_mce_buttons_2", 0)) ); ?>
Category
             <?php wp_dropdown_categories($args = array('orderby' => 'name', 'hide_empty' => 0, 'hierarchical' => 1, 'id' => 'user_submitted_categories', 'name' => 'user_submitted_categories')); ?>
Tags

Separate tags with commas.
             <input type="text" id="user_submitted_tags" name="user_submitted_tags">
Video

Copy and paste links from Youtube and Vimeo in the field below
             <textarea id="user_submitted_video" name="user_submitted_video"></textarea>
Audio

Copy and paste links from Soundcloud in the field below
             <textarea id="user_submitted_audio" name="user_submitted_audio"></textarea>
Images
             <input type="file" name="upload_attachment[]" multiple="multiple">                  <button name="submit">Submit</button>              </form>          <?php } else { ?>              <?php echo 'Sorry, but you need to be logged in to see that. You can          <?php echo wp_login_url( get_permalink() ); ?>         <?php echo '" title="Login">login here'; ?>          <?php } ?>      And here is the function in functions.php that attaches the images to the post in the database               //Attach Image to Post in Database     function insert_attachment($file_handler,$user_post_id,$setthumb='false') {         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, $user_post_id);         if ($setthumb) update_post_meta($user_post_id,'_thumbnail_id',$attach_id);         return $attach_id;     }      When the post is successful, i get an error saying cannot modify headers, but the form does process and the content is posted to the database. When the users don't fill out all of the required fields, the page refreshes, and the form is completely empty, so they lose their progress on the form and have to start over. The part that says               //Notify the user that they must fill out all required fields      is where I want to put the event that occurs on validation failure. I'd like it to just be a simple alert popup or something that says Fill out all required fields. Nothing beyond that will be necessary. It also has an issue in that if you hit the submit button repeatedly, it will process the post as many times as you click the submit button, creating duplicate posts. How can I fix that? My only remaining question is whether or not the image uploader can be exploited in this scenario.


title: Output posts with same name as tags?

text: If someone puts a post on my site, they usually do that with some tags. If someone posts a post with the tag "hello", I want it to output that tag after my content and let it link to the archive page where it queries to see if there is another post with the same tag --> this already works! What I now want is this: say there is also a post named "hello", now I want to get both the described tag above as well as a "see also [post] hello"... So I use the given tag as it does in default, but now I want to output the same tag again, but this time linking to the post with the same name... Is this possible? If so, how? I tried editing the code that is given here: Redirect Tag to Post with the same name but I do not know how I can output the same tag, that does two different things.


title: Custom wysiwyg editor doesn't execute shortcodes?

text: I encounter this weird problem.. I'm trying to create a simple & easy website for a client. He wants to embed video's into the page. I use different customfields assigned to specific elements in the website. I hide the standard wordpress wysiwyg editor and registred a new one to put it in line with other customfields. Here is the problem, when i use the shortcode icons made by plugins and i post them in the registered wysiwyg editor and i save the page, it doesn't work, it only shows the short-code. Example short-code:               [pro-player width='600' height='600' type='video']http://www.youtube.com/watch?v=-nOjUXGCREs[/pro-player]      But when i use the short-code in the original wordpress wysiwyg editor it does execute it properly. Ofcourse when i call the plugins short-code throughout a .PHP file it definitely works.. But i want to keep it easy & simple for the client to understand, so an generated icon would be my best bet. Why does he custommade wysiwyg editor execute short-codes as text ? I hope someone can help me with this problem. Greetz


title: WP_Query meta_query by array key

text: I have a custom post type with its meta in an array. What I need to do is query based on the value of a key in that meta array.               $args = array(         'post_type'         => 'my-cpt',         'posts_per_page'    => -1,         'orderby'           => 'meta_value',          // Sort by this value         'meta_key'          => 'my_meta_array',       // Sort by this meta key         'meta_query'        => array(             array(                 'key'       => 'key here',            // WHAT GOES HERE?                 'value'     => array( 'meta-value' ),             )         )     );              $query = new WP_Query( $args );      What goes in the meta_query key, if my key is my_meta_array[key]? FYI: the keys are indexed by my_meta_array[key], stored in the db via update_post_meta( $post_id, 'river_helpers', 'my_meta_array' ), and retrieved via get_post_meta( $post->ID, 'my_meta_array', true );


title: User role editor - Add download files capability

text: I've got User Role Editor plugin installed and i want to add a capability for download files. I've got some downloads in a custom post type called 'products'. I want only people who are logged in to be able to download or view these files. If a user isn't logged in they get redirected to a login/registration page, then they log in and get redirected back to the product page. User role editor has a capability for upload files so was wondering if it can be used to download files as well. Or should i use some other plugin or something to get this? Thanks


title: Can email address be used as user name?

text: Is it possible to do something to WP so that I'm able to use the e-mail address as username? I do not want to download a plugin for this.


title: Show image next to the comment author if have certain role

text: I want to create a badge image for comment author of a certain role, say, Editor. I want to style comments of users with the Editor role differently than comments of non-registered or lower-level users. For instance, I'd like to have an image appear next to his/her name. I can do the whole thing in CSS, but I want a bit more flexibility so I can add more juice. How can I do it with a conditional tag? Any ideas?


title: Custom theme/plugin update checks

text: At the moment, Wordpress checks the wordpress core for it's updates. But, I'd like to add an additional check to repeat the process for themes and plugins using a seperate address, for updating themes that are not on the core wordpress repositories, such as commercial themes and such. Is this possible? If so how would it be done?


title: Change number of widget columns in dashboard?

text: I removed some widgets from the dashboard in the wrong way (using `unset()` on `$wp_meta_boxes`) and as a side effect my dashboard widget area is now split into 4 columns, but with just the first 2 having the normal default widgets in, thus the page is squashed. Is there a way to change the amount of widget columns in the dashboard? They are all active as I can drag and drop the widgets around, but now 4 is too many. I am using Wordpress 3.1.3 so don't have the new admin interface yet.


title: How do i make a sidebar background color?

text: With the 20-11 theme i would like to make the sidebar one long color. I have no idea how long my page are and i need the sidebar height to be the same as the post height. Right now when i do `#secondary { background-color: green; }` the green is only as long as it needs to be so it is extremely short. How do i get it all the way down?


title: wordpress fancybox responsive mobile or pc version

text: I just want to have 2 types of fancybox size. for mobiles version width: 95%, height: 85% for pc version - width: 85%, height: 80% How can I set these 2 versions up? should I handle in php with 2 script or is there anyway to modify (handle) in a script?                  jQuery(".openf").fancybox({        'width'   : '95%',        'height' : '85%',        'autoScale' : false,        'transitionIn'    : 'none',        'transitionOut'   : 'none',        'type'    : 'iframe'        });


title: What's missing in this wp_query and meta_query

text: There is something missing because this is driving me crazy at the moment. I'm using the wp_query with the following args.               $args = array(         'post_type'     => 'project',         'post_status'   => 'publish',         'meta_query'    => array(             array(                 'key'       => '_sf_project_budget',                 'value'     => '6',                 //'compare'     => '=',                 //'type'        => 'NUMERIC'             )         )            );     $search_query = new WP_Query($args);       When print_r the $search_query I can see the following:               WP_Query Object     (         [query_vars] => Array             (                 [post_type] => project                 [post_status] => publish                 [meta_query] => Array                     (                         [0] => Array                             (                                 [key] => _sf_project_budget                                 [value] => 6                             )                          )       But the "SQL" doesn't seem to change:               [request] =>  SELECT SQL_CALC_FOUND_ROWS  wps_posts.* FROM wps_posts       WHERE 1=1  AND wps_posts.post_type = 'project'      AND (wps_posts.post_status = 'publish')       ORDER BY wps_posts.post_date DESC LIMIT 0, 10      Shouldn't this change to incorporate the meta query vars? Can't see what I'm doing wrong or what's missing, tried different things and it brings all the posts all the time. I checked in postmeta table and I can see that the values are there. Any pointers in the right direction? Thank you.


title: How to add/assign or change featured image in post programmatically?

text: I have written a plugin that (besides other functionality) makes posts from existing content. For each post I have one picture - **how to make them featured programmatically**? I do the:               $id =  wp_insert_post( $my_post );     wp_set_object_terms( $id, $cat_ids, 'category' );      and I would like my next step to be inserting $image (file path or URI) as featured image. How? Thanks in advance.


title: blog change and move to anther hosting for a multisite

text: I have a multisite and there are 3 blogs. (let's say blog1, blog2, blog3) First question, How can I change the order of blogs? as you may know, blog1 is the main. I want to make blog2 should be the main. I don't feel good to do 301 redirect. I want to change all of them such as files, database. Second question, I need to move blog2 to another hosting and blog2 will be the 1st blog. then all of database name need to change like wp-post2 should be wp- post... etc data files should be also change some part. I think modify files are not a big deal for me. I tested to change database table names manually (wp-post2 to wp-post). it seems to be working fine but I believe this is not good way to do. is there any plugin for both of them? or if I do manually how/what I should do? Thanks, :)


title: Get media-uploader fields array

text: I want to modify the fields in the media-uploader.   To do that I need to know what creates the fields. In the Codex, you can see a way to add new fields to the media uploader, using the `attachment_fields_to_edit` filter. You simply add a new field to the array and return it. I thought, that I could modify the function to just print out the array and return it like this:               function my_add_attachment_location_field( $form_fields, $post ) {         print_r($form_fields);         return $form_fields;     }     add_filter( 'attachment_fields_to_edit', 'my_add_attachment_location_field', 10, 2 );      But this does not print out anything. Instead the media-uploader fails to load the images. It loads for ever. Any ideas how to print out the `$form_fields` array?


title: Custom CSS at Appearance > Edit CSS is missing after update

text: A WordPress site that I have written a few CSS custom styles for has lost its custom styles. I previously wrote the custom CSS in the Appearance > Edit CSS section of the admin dashboard. But now that menu item is gone from the Appearance menu. And the site no longer has those customizations to its styles. This happened after the site owner “rebooted the site after his hosting provider shut it down for some scripting problem”. I notice that the site has also been updated to the latest version of WordPress, 3.8.1 up from 3.6. The closest option to Appearance > Edit CSS I can find is is Appearance > Editor, which also lets you edit CSS, but only the whole CSS of the theme. I don’t want to put my CSS there, because then it might be overwritten if the theme is ever changed. I also don’t want to use Appearance > Editor because I don’t want to have to rewrite my previous CSS from scratch. – I want the version that I already wrote. I read that my custom CSS might still be available in `wp_options` in the database, but I don’t have access to the site database, as far as I know – I just have an administrator account I can access the dashboard with.


title: What function actually renders the wp_admin_bar ? How can I call it?

text:
What function actually renders the wp_admin_bar? And how can I call it? I want to print out just the nodes / DOM for the actual menu. It would end up rendering something like this:

                 ....

      I couldn't find it in the documentation anywhere.


title: Question about proper use of wp_redirect?

text: I'm attempting to create a Twitter style stream, so basically just index, a tag archive, and maybe a page or two while prohibiting access to everything else. For instance, they try to access a single post page and are tossed back to home. Is this appropriate use of redirects and wp_redirect, and if so, would it be better to create a dummy file (single.php for instance) that only contains wp_redirect or just use conditionals at the top of my header.php? Or am I totally off course?


title: Simple Amazon Affiliate Plugin

text: I am looking for a plugin that will embed my amazon affiliate id in outbound amazon links on my blog. I've tried a couple of top plugins (e.g. sorted by popularity) and most are a huge overkill (e.g. providing image popups, search lists, products lists, price integration, etc...) Can someone recommend a plugin that does what I am looking for?


title: How can I exclude a category from the main loop with the category name & not ID?

text: I'm having a dozy of a time on this one and have finally had to break down and ask my first question. Usually I can find an answer on here, but this time I need some help. I'm trying to exclude a category from the main loop so that it does not show up twice on my index page. I have searched up and down and came across this code here:                <?php      $category_id = get_cat_ID('featured');      $q = 'cat=' . $category_id;      query_posts($q);      if (have_posts()) : while (have_posts()) : the_post();           the_content();           endwhile; endif;?>      It worked, but then my page navigation didn't work. Even if you clicked on page 2 you still got page one content. Not sure why that happened. I don't want to exclude the category with the ID because the ID will change, but the name will always be the same. Any help on this would be great, Thanks! If you need the demo site then just ask.


title: wp_query orderby title and meta key value (WP3.1)

text: I have a taxonomy wp_query and i would like to order the list by **title and** by **meta** value (numeric value)   * Have a meta value Interesting = 1 or 0 in the posts   * Not so interesting posts would be at the bottom of the query **GOAL - OUTPUT LIKE THIS:** (is this possible with WP_QUERY and WP3.1) **A** ( META KEY interesting = **1** ) **B** ( META KEY interesting = **1** ) **C** ( META KEY interesting = **1** ) **A** ( META KEY interesting = **0** ) **B** ( META KEY interesting = **0** )


title: add_theme_support('custom-header') does not add the option to customize

text: I am using this to get custom header support to my new theme:               function my_add_header_support() {         $ch_defaults = array(                              'default-text-color'     => '',                              'default-image'          => '',                              );         add_theme_support( 'custom-header', $ch_defaults );     }     add_action( 'after_setup_theme', 'my_add_header_support' );      I expected a headers section to show up under Appearance - Customize in the dashboard, but it does not. There is a previous post about the same problem (theme development - add_theme_support( 'custom-header' ) does not add option menu in dashboard - WordPress Development Stack Exchange). I think it says that support for this should show up in WP 3.4. What am I missing?


title: Filtering a Database Query

text: In a WP_List_Table example I'm using, I am seeing how to make a general query to the `wp_options` table in the Wordpress database. For example, `$query = "SELECT * FROM $wpdb->options";` I also see that we typically create a `foreach` loop to display all the records in this table on separate rows. Sounds easy enough. But I would like to filter this query to reference an "options array" instead. This is a single value in my table. For example, I want to query a single option called `testimonial_settings` and then retrieve all the array values from this single field. I can't wrap my head around how I would do this using a `foreach` loop. Maybe a simple example showing the proper syntax would help clear things up....?


title: Add filter multiple times using only one master function

text: Is it possible to use add_filter with lets say an array of different values? to achieve something like the following:               foreach($templates as $name) {         add_filter( 'single_template', function ( $template ) {                   global $post;                   if ($post->post_type == $name) {                   $template = dirname( __FILE__ ) . $name . '.php';              }              return $template;         });     }


title: Logged in only custom page

text: I have a custom page named **custom.php** then i created a new **page** inside wordpress and selected **custom.php** in the **page attribute template** and **custom.php** page link is accessible in my front page. the custom page shows perfectly, but i plan to make this page a **registered** members only page. i created a custom login page aswell, named **custom_login.php** and i want non members to be redirected here first and upon login, they will access my **custom.php** currently im using a plugin "restrict content" but this plugin displays **404** page and does not meet what i want.. instead i want this to be the **custom_login.php** page


title: checking the form submit in right order

text:
With help from experts on this site, I have been able to put together a plugin that allows to choose and submit categories from the front-end. Further, in order to make it a bit more secure I have tried to include **nonces and a honey** pot in the form. Although I am pretty sure that my nonce and honeypot are working fine, I am also not sure if I am checking things in the right order. You can see that I have tried to check for the honeypot first and then the main submit and then the nonce. Is it in the right order ? If not, what order should they be in? I believe if I do not check things in right order, I may get unexpected results. Entire plugin code is given below.               add_action('plugins_loaded','wpse_init_crowd_cats_class');     function wpse_init_crowd_cats_class(){         new WPSECrowdCatsClass();     }               class WPSECrowdCatsClass {               function __construct() {                  // APPEND THE FORM AUTOMATICALLY TO EVERY POST             add_filter( 'the_content', array( $this,'append_form' ) );                  // TEMPLATE ACTION TAG TO BE USED IN THEME             // Usage: do_action('wpse_crowd_cats_form');             // Usage: do_action('wpse_crowd_cats_form', $post_id, $taxonomy );             add_action( 'wpse_crowd_cats_form', array( $this,'wpse_crowd_cats_form' ), 10, 2 );                  // FORM PROCESSING             add_action( 'template_redirect', array( $this,'process_request' ) );              }              function process_request(){ // check submission              if(!empty($_POST['pot-net']))         return; //end process if field is not found empty.              if ( ! isset($_POST['crowd-cat-radio']) || ! is_array($_POST['crowd-cat-radio']) )         return;              if (!isset( $_POST['nonce_name'] ) || ! wp_verify_nonce( $_POST['nonce_name'], plugin_basename( __FILE__ ) ) ) {         print 'Sorry, your nonce did not verify.';         exit;        } else {    // continue to process form data                                    // sanitize and check the input             $suggested_terms = array_map( 'absint', $_POST['crowd-cat-radio'] );             $post_id = absint( $_POST['crowd-cats-pid'] );             $tax = $_POST['crowd-cats-tax'];             if ( ! taxonomy_exists($tax) )                 return;                  // Allow only existing terms. Not sure if this is needed.             $args = array( 'hide_empty' => false );             $args = apply_filters( 'mcc_allowed_terms_args', $args, $post_id, $tax );             $args['fields'] = 'ids';             $allowed_terms = get_terms( $tax, $args );             foreach ( $suggested_terms as $key => $term_id )                 if ( ! in_array( $term_id, $allowed_terms ) )                     unset( $suggested_terms[$key] );                  // Add terms to taxonomy             $affected_terms = wp_set_object_terms( $post_id, $suggested_terms, $tax, false );             update_term_cache($affected_terms);             return $affected_terms;              }         }              function get_form( $post_id=null, $tax='category' ) {                  if ( is_null($post_id) || ! taxonomy_exists($tax) )                 return false;                  $args = array( 'hide_empty' => false );             $args = apply_filters( 'mcc_get_terms_args', $args, $post_id, $tax );             $all_terms = get_terms( $tax, $args );                  if ( ! $all_terms )                 return false;                  $post_terms = wp_get_object_terms( $post_id, $tax, array( 'fields' => 'ids' ) );                  $permalink = get_permalink( $post_id );                  $out = "<form id='crowd-cats' action='$permalink' method='POST' >
";                  foreach ( $all_terms as $t ) :                      $checked = in_array( $t->term_id, $post_terms) ? 'checked' : '';                 $out .= "
                             <input type='checkbox' id='crowd-cat-$t->term_id' name='crowd-cat-radio[]' value='$t->term_id' $checked />                              term_id' >".esc_attr($t->name)."
";                  endforeach;                  $out .= "
                        <input type='text' name='pot-net' style='visibility:hidden' value=''/>                        <input type='submit' value='Submit' name='crowd-cats-submit'/>                        <input type='hidden' value='".esc_attr($tax)."' name='crowd-cats-tax'/>                        <input type='hidden' value='$post_id' name='crowd-cats-pid'/>";                                  $out .= wp_nonce_field( plugin_basename( __FILE__ ), 'nonce_name',true,false);             $out .= "</form>";                  return $out;              }                        function append_form($content){                  global $post;                  if ( 'post' != $post->post_type )                 return $content;                  $form = $this->get_form( $post->ID );                  if ( ! $form )                 return $content;                  return "$content \n $form";         }                   function wpse_crowd_cats_form( $post_id=null, $taxonomy='category' ) {                  if ( is_null($post_id) ) {                 global $post;                 $post_id = $post->ID;             }                  echo $this->get_form( $post_id, $taxonomy );         }               } // end of class                    ?>      If you will need me to put this on pastebin and point out the specifically concerned lines of code, please let me know.


title: I want to use my username to post blog posts, is this advisable?

text: I only intend to post blog posts with a one word name (the name of the website), and so I am wandering can I just use my username?? Is this common amongst admin-bloggers to post using their username rather than any chosen name they might pick?? The reason I ask is because I do not know what username I would pick other than the one I intend to post with. The only possible reason people might not do this is for the added security of not showing your username.


title: Include widget within newsletter template?

text: I'm using the Newsletter plugin (http://wordpress.org/extend/plugins/newsletter/) to compose e-mail newsletters. Using the "auto-compose" feature to pull website data via the theme included with the plugin, which I have begun to customise. It's pulling posts just fine, which is a good start - but I would also like to pull some data that a custom widget on our site is displaying. I'm fairly new to Wordpress and the custom widget in question was not developed by me. Can I include a specific widget via my theme template? Thanks


title: how to load a file from a plugin when a url is passed

text: I'm creating a plugin where a file is loaded and if a link is clicked, it passes some variables that are appended to the url. So if a link is clicked it will change the url by appending `filter/?term=il_Massac,st_locked` which should load the `filter.php` file. My issue is how do I get it to use the `filter.php` which is included in the plugin? The main plugin file is called `meta-box.php`. If I added it the the theme as a page, it works but I want the plugin to do the work instead of adding a page. Right now, if I don't use it as a page-template in the theme folder and just have it in the plugin folder, it gives a 404. Here is the code to the link that is in my meta-box.php file: ` <a href="<?php echo home_url()?>/filter/?term=<?php echo $term ?>">search link</a>` $term is a variable that has some search parameters in it. So if I click that link, it gives me the 404 page rather than loading the filter.php file to execute some code. Again, I can add it the the theme as a page template but I would like it to be contained within the plugin so it does not need to be added to the theme as a page template. Does that help? Any suggestions on how I might do this?


title: custom query to get posts

text: I want to create custom links like `mydomain.com/custom_page/cat=ABC&tag=XYZ` So that when a user clicks on the link s/he can see all posts in the category 'ABC' having tag 'XYZ' For this I've created a custom template with the following code               <?php     /*     Template Name: MyCustomTemplate     */     ?>          <?php get_header(); ?>     global $wp_query;     get_query_var( 'cat' );     get_query_var( 'tag' );     <?php get_footer(); ?>      I don't know how to query for the posts in the category 'ABC' with the tag 'XYZ' I checked http://codex.wordpress.org/Function_Reference/query_posts#Passing_variables_to_query_posts but the examples shown there use 'static' values. I need to query using dynamic values: which are passed via the URL. Also, I'm using a plugin 'Advanced Custom Fields' and have added a field 'priority' with the defult value 'Z'. I intend to assign one alphabet to each post in the priority field, so that results on the page are served sorted according to "priority" : Posts with the priority 'A' on the top, followed by posts with priority 'B' and so on.. **In Short** : I want to get category and tag parameters from links like: `mydomain.com/custom_page/cat=some_category&tag=some_tag` Then Fetch posts in the category 'some_category' AND having tag 'some_tag' AND sorted according to custom field : 'priority'


title: Function to retrieve a picture if there is no picture is attached

text:
How can i retrieve a picture, let say ( No picture ) when i don't add a picture in my custom field I use this code to retrive the field...               <img class="film"           src="/scripts/timthumb.php?src=<?php the_field('img_actor'); ?>&h=251&w=175&zc=1"          alt="<?php the_title(); ?>"            title="<?php the_title(); ?>"/>      How to retrive no-picture from this code               <?php      if(get_field('distributie') != ""){$counter=0;foreach(get_field('distributie') as $post_object): ?>
     <a href="<?php echo get_permalink($post_object->ID); ?>" title="Actor <?php echo get_the_title($post_object->ID) ?>">     <img class="actor_img" src="/scripts/timthumb.php?src=<?php echo get_field( 'img_actor', $post_object->ID ); ?>&h=70&w=50&zc=1" alt="<?php echo get_the_title($post_object->ID) ?>" title="<?php echo get_the_title($post_object->ID) ?>" />                  <a href="<?php echo get_permalink($post_object->ID); ?>" title="Actor <?php echo get_the_title($post_object->ID) ?>"><?php echo get_the_title($post_object->ID) ?>
     <?php $counter++;if($counter>=8) break; endforeach;}?>      If i change               <?php echo get_field( 'img_actor', $post_object->ID ); ?>      with               <?php echo urlencode($img); ?>      I get an error ($post_object->ID) where do i put it?


title: PHP echo text being output in incorrect order

text: In footer.php, I have the following code:               <?php         $copyYear = 2011;          $curYear = date('Y');          echo "© " . $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '') . " " . bloginfo('name');     ?>      On the front page of the website, the following is output: > Sugar Gum Cakes© 2011-2014 Note the Blog name is at the start, while in the PHP code it is at the end. Why is this happening? I can't see how it would be CSS. Thanks.


title: htaccess – Server Subdirectory With Different Name Than URL Subdirectory

text: I have a client with an odd setup that I can’t quite figure out and I thought someone here might know the answer. I’m not sure they want the site shared, so I’ll use `example.com` for the sake of explanation. Their wordpress URL is setup like `http://example.com/blog`. However, on the server (Apache), the actual folder is called “wordpress” NOT ”blog”. The `.htaccess` is located in the “wordpress” folder (full server path is `/var/www/wordpress/`) and looks like this:               # BEGIN WordPress     <IfModule mod_rewrite.c>       RewriteEngine On       RewriteBase /blog/       RewriteRule ^index\.php$ – [L]       RewriteCond %{REQUEST_FILENAME} !-f       RewriteCond %{REQUEST_FILENAME} !-d       RewriteRule . /index.php [L]     </IfModule>          # END WordPress      There is no .htaccess in `/var/www/` In General Settings they have this:   * WordPress Address: `http://example.com/blog`   * Site Address: `http://example.com/blog` This works fine on WordPress pages, posts and categories. But some plugins (gravity forms, nextgen) will strip out the “blog” portion of the URL when using them. So for example a Gravity Form will try to submit to `http://example.com` instead of `http://example.com/blog` which will cause an error. My guess is that `.htaccess` is configured wrong but `.htaccess` and regular expressions are my weak point.


title: Plugin development without Theme adjustments?

text: _I'm an ambitious wordpress beginner and learner - this is my first question at Stackexchange - in case I'm wrong here, I'm grateful for anyone pointing in a better direction._ On my page http://www.project22.org   * I started off with a childtheme of Twenty Twelve, because I thought this theme is particularly well prepared for anything that might come.   * Next I created my own 'base-functionality-plugin', to do the programming that I (didn't find in other plugins) and that I wanted to do myself. Now, I have basically created the functionalities I wanted in my plugin, but to display my results I needed to some adjustments in the (child) theme files, e.g. the content.php to change the display of the "entry_meta" of posts. This doesn't feel right, wouldn't it be best if my plugin remains independent of the theme itself? So my beginner questions are these:   * How to avoid this?   * What is the best practice regarding this?   * What to do if your starting theme has no hooks or filters in the places you need? Edit: My use case - in the entry_meta of each post I want to display some data from custom fields. The only solution I found was to make adjustments to the theme function `twentytwelve_entry_meta();` \- but this won't work on a different theme, right?


title: dates under post titles -- also showing up under Nav

text:
I added a filter in `functions.php` in order to have the dates show up under my titles on each Post on my homepage. Random dates are now also showing up in the Nav. Can someone help me make those go away? I'm happy they show on the posts now, so I did something right! But the dates in the Nav have got to go! I'm developing the site here: internalcompass.us/castle and I used this code in the child theme twentytwelve in the functions.php to add the dates:               <?php     function add_dates_to_title_wpse106605($title, $id) {     if (is_home()){         $time = get_the_time( $d = 'l, F j, Y', $post = $id );         return $title . '
' . $time . '';     } else {         return $title;     }     }          add_filter('the_title', 'add_dates_to_title_wpse106605', 10, 2);     ?>


title: how to show category post and title separate with auto number

text:
i am making one slider tab, i know have tons of plugins for that but i don't want to use plugins. so i want to show my category post title and post like bellow html formate but i can't. i tried my but my way only content loop not title. if can able to make html like bellow then tabs will work. guys how can i do that.

Tabs 1

Tabs 2

Tabs 3

Tabs 4

Tabs 5

Horizontal Tab #1

Lorem ipsum dolor sit amet, duis netus ut posuere feugiat arcu, purus wisi quis fringilla at, nunc ut eget elit duis erat praesent, ut fermentum lacus turpis cras. Justo gravida erat quam mauris purus, aliquam quisque, eget nisl. Pellentesque nibh duis odio morbi quam, scelerisque convallis aenean quam tincidunt ornare nam nec feugiat sodales tristique.

Horizontal Tab #1

Lorem ipsum dolor sit amet, duis netus ut posuere feugiat arcu, purus wisi quis fringilla at, nunc ut eget elit duis erat praesent, ut fermentum lacus turpis cras. Justo gravida erat quam mauris purus, aliquam quisque, eget nisl. Pellentesque nibh duis odio morbi quam, scelerisque convallis aenean quam tincidunt ornare nam nec feugiat sodales tristique.

Horizontal Tab #1

Lorem ipsum dolor sit amet, duis netus ut posuere feugiat arcu, purus wisi quis fringilla at, nunc ut eget elit duis erat praesent, ut fermentum lacus turpis cras. Justo gravida erat quam mauris purus, aliquam quisque, eget nisl. Pellentesque nibh duis odio morbi quam, scelerisque convallis aenean quam tincidunt ornare nam nec feugiat sodales tristique.

Horizontal Tab #1

Lorem ipsum dolor sit amet, duis netus ut posuere feugiat arcu, purus wisi quis fringilla at, nunc ut eget elit duis erat praesent, ut fermentum lacus turpis cras. Justo gravida erat quam mauris purus, aliquam quisque, eget nisl. Pellentesque nibh duis odio morbi quam, scelerisque convallis aenean quam tincidunt ornare nam nec feugiat sodales tristique.

Horizontal Tab #1

Lorem ipsum dolor sit amet, duis netus ut posuere feugiat arcu, purus wisi quis fringilla at, nunc ut eget elit duis erat praesent, ut fermentum lacus turpis cras. Justo gravida erat quam mauris purus, aliquam quisque, eget nisl. Pellentesque nibh duis odio morbi quam, scelerisque convallis aenean quam tincidunt ornare nam nec feugiat sodales tristique.

      see closely `href="#content_1" rel="tab_1"` this #content_ (1,2,3,4,5)should auto. similar `<div id="content_1"` this content_ also number will auto i mean post number


title: Resize header image

text: How can I access to the css file where is the header's background image?               background: url("http://xxx.es") no-repeat scroll center top / 1600px auto transparent;      It's not in the style.css


title: How to add a class to meta boxes (to customize them in CSS)?

text: I have an situation: I just can't figure out how to add classes to some meta boxes.   I read these post from here, I tried this solution, but it did not work as I wanted. Is there a way to add classes (to customize them in CSS) to meta boxes?   For example in this case:                 array(         'label' => 'a name',         'desc'  => 'description',         'id' => 'id_x',         'type' => 'select',         'options' => array('Bad', 'Good', 'Excellent'), /* HERE I WANT A CLASS FOR EACH THIS GUYS (to customize them in CSS) */         'std' => "         ),      I want that the HTML to look like this:               Bad     Good     Excellent


title: Blog posts on one subdomain, pages on another

text: I'd like to use blog.example.com as the base for my blog posts, e.g. http://blog.example.com/2013/08/29/sample-post/ and www.example.com for my pages, e.g. www.example.com/about-me/ Is there an easy way to do this? I tried with creating a network but that gives me two WordPress installations, both with posts and pages and their own admin dashboards. I just want to go posts to one subdomain, pages to the other.


title: Theme Options Menu Item - Permission Issue

text: I am trying to create a theme options menu item for my custom theme. However, when I add the following piece of code in the functions.php file...               add_menu_page('Page title', 'Asteria', 'manage_options', 'ThemeOptions', 'my_magic_function');      It gives me the following error when clicking on the menu item... > You do not have sufficient permissions to access this page. The entire folder, and all contents are 777'd. I am logged in as an administrator. I have tried this on 2 different servers. One of the servers is running a network of blogs (the preferred server), the other is just a single blog setup. Any ideas on where I went wrong?


title: custom Background not showing after upgrade?

text: I've been using wp3 custom background feature. Today I updated to the latest version and now my custom background isn't showing. Strange thing is Appearance > Background still shows the custom background I'm using. Has anyone seen this problem? Thanks in advance.


title: Modify "Recent Comments" List in WP-Admin

text: This one might be a little tricky, but I'm looking for a way to make the Recent Comments widget on the wp-admin a bit more useful/action-driven. I'd like to be able to filter to only show the Pending comments (as those would require an action to them). I saw on line 45 of `wp- admin/includes/dashboard.php` there is:               // Recent Comments Widget         if ( is_blog_admin() && current_user_can('moderate_comments') ) {             if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) {                 $update = true;                 $widget_options['dashboard_recent_comments'] = array(                     'items' => 5,                 );             }             $recent_comments_title = __( 'Recent Comments' );             wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' );         }      but I'm a little fuzzy on the correct way (or if there is a way) to hook into this to modify the "types" of comments shown. Any help would be greatly appreciated. Thanks!


title: melville and its child theme

text: hello guys im making child theme of melville and i wanna make a custom page with a static menu (as in not made with wp ) of my own and under it i wanna display the content and i use this `get_template_part('loop' ,'home- page')`where the home-page its name of my custom page and i do have the loop file in my child theme please if anyone knows whats my msitake i would be thankfull my issue is the content doesnt show up Edit : here's my code im using nothing fancy `                get_header(); ?>             some xhtml here               <?php get_template_part('loop' ,'home-page') ?>         <?php //comments_template( '', true ); ?>           <?php get_footer(); ?>      `


title: Wrap meta boxes & data handling for specific post types in classes?

text: I have a site with a few custom post types, each with their own custom data, meta boxes & assets (stylesheets, images, JavaScript). Typically I'd hook onto `add_meta_boxes` to register all my meta boxes and `save_post` to handle the data, but in this case I'd like to wrap all the functionality for each post type in a class & abstract out the process of instantiation. My proposal is as follows;               function my_prefix_admin_load_post()     {         /* Grab current post type - can't use global $post_type since it isn't set yet! */         if ( isset( $_GET['post'] ) )             $post_type = get_post_type( $_GET['post'] );         elseif ( isset( $_REQUEST['post_type'] ) )             $post_type = basename( $_REQUEST['post_type'] );         else             $post_type = 'post';              /* Construct classname & filename from post type. */         $post_type_file = dirname( __FILE__ ) . "/inc/class-post-$post_type.php";         $post_type_class = 'Class_Prefix_' . ucfirst( $post_type );              if ( is_file( $post_type_file ) )             require $post_type_file;              if ( class_exists( $post_type_class ) )             new $post_type_class;     }     add_action( 'load-post.php', 'my_prefix_admin_load_post' );     add_action( 'lost-post-new.php', 'my_prefix_admin_load_post' );      This way, I can drop in enhancements for a new or existing post type at anytime (without tinkering with my base functions), and without code for different post types intermingling with another. **However** , I can't help but feel the loading process is just a little... icky. **I'd really love to hear of suggestions, whether improvements or alternate approaches!**


title: Admin Theme customization

text: I followed instruction on the wordpress codex site on creating an admin theme via a plugin. I activated the plugin, but my stylesheet isn't being included in the `<head>`.. Here's my code:               add_action( 'admin_init', 'kd_plugin_admin_init' );     add_action( 'admin_menu', 'kd_plugin_admin_menu' );          function kd_plugin_admin_init() {        /* Register our stylesheet. */        wp_register_style( 'kdPluginStylesheet', WP_PLUGIN_URL . '/admin-theme.css' );     }          function kd_plugin_admin_menu() {        /* Register our plugin page */        $page = add_submenu_page( 'edit.php',                                   __( 'KD Plugin', 'kdPlugin' ),                                   __( 'KD Plugin', 'kdPlugin' ),                                  'administrator',                                  __FILE__,                                   'kd_plugin_manage_menu' );             /* Using registered $page handle to hook stylesheet loading */        add_action( 'admin_print_styles' . $page, 'kd_plugin_admin_styles' );     }          function kd_plugin_admin_styles() {        /*         * It will be called only on your plugin admin page, enqueue our stylesheet here         */        wp_enqueue_style( 'kdPluginStylesheet' );     }          function kd_plugin_manage_menu() {        /* Output our admin page */     }


title: Build Categories List for Posts with specific meta_value

text: I've a set of Posts under custom post type that has a specific custom field (meta_value). This posts are categorized with a simple Common Parent->Child#N relationship. The question is how to list all categories (similar to `wp_list_categories(): "%Category_Page_URL% (%post_count%)"`), considering the fact that I need to get categories that have posts with specific meta_value. Question can be read as: "Build category list for posts where meta_value = `$foo`"


title: How can I make new .css file in child theme override styles in child theme's style.css

text: I want to make a separate responsive.css file in my child theme but having trouble making the media queries override the styles in the child theme's default style.css. I've tried putting `<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/responsive.css" type="text/css" media="screen"/>` after the `<?php wp_head(); ?>` code, which works, but I've read that this is not good practice. I do not really want to add the media queries to the end of style.css as it's already large and getting quite confusing!


title: find pods item where relationship to other pod is not set

text: I need to fix the effect of an error that left empty a relationship field that should have been autofilled. To fix this I need to find all pods item that has the relationship not set, but I don't know how to do it. I tried with `'where' => 'source.id = ""'` in a `find()` but with no luck. Any idea?


title: All "Featured Images" not displaying after Wordpress update

text: After updating to the latest version of WordPress today, I noticed that all "Featured Images" on my website are no longer displaying. After trying to figure the problem out for hours, I added the below to my `functions.php`:               if ( function_exists( 'add_theme_support' ) ) {         add_theme_support( 'post-thumbnails' );     }      This fixed the problem in Firefox and all images are showing again. But unfortunately, the images are still missing when viewing the website in Internet Explorer and Chrome. Is there another code I need to add in `functions.php` or perhaps in the CSS file?


title: need a wordpress loop to put in the sidebar

text:
I need WordPress loop to do the following : check if there is no sidebar widgets active then get 5 recent posts with only titles and thumbnails But here is the thing : I don't want the loop to get the featured post thumbnails but a unique thumbnail based on post category and get them form a folder in the theme directory named:" images" where I will put image for each category in this folder so that the loop get them by category ID or slug maybe. I hope I made it clear to you cause I'm stuck with a project and I need help from php expert. I have a code It may be useful if tweaked :
     <?php     $pc = new WP_Query('orderby=comment_count&posts_per_page=5'); ?>              <?php while ($pc->have_posts()) : $pc->the_post(); ?>
              <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(array(75,75)); ?>         <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
              <?php endwhile; ?>
      Note ( I am using child theme for twenty twelve theme )


title: How properly write function to filter content in a template for plugin "multiple content blocks"

text: In a website I'm building (using my own designed theme, for a business site that doesn't have a blog, IOW, using WP for it's CMS), I have 5 templates: the homepage, the 404 page, the default (page.php), a small one-column and a large one-column. I use the default template for 6 pages in the site. That template is 2-column with a wide main column and narrower right column. But each page will have different content in the right column - mostly text - so it's really not a "sidebar" situation. I want to use the plugin "Multiple Content Blocks". I used it in the homepage template and it's easy and works beautifully, but all I had to do was place this code:               <?php the_block('blockname'); ?>      in the template in my "colR" div. In actual fact the code is:               <?php the_block('News'); ?>       as I named the block "News". So far so good. In the readme.txt it has the following FAQ: How do I filter the content?, and it says: "Use the function get_the_block instead of the_block, like this: `<?php $content_to_edit = get_the_block('blockname'); ?>` and you can now edit this variable with PHP." I'm ASSUMING (perhaps incorrectly) that this means I can write a function or filter for the plugin -- what I want to be able to do is name a block for each of the six pages, and then in the page.php template, be able to specify "if this page, use this block" but I don't know how to write it. So, for example, if one of the pages is called "customer", or ID 21, and I want to name the content block "contact", what exactly goes in the `$content_to_edit` part? I've tried a couple things but they haven't worked. Also, would it need to go inside the loop? In my page.php I have the loop above the colR (for column right) div. Help greatly appreciated!


title: Trouble inserting string containing quotations marks with wpdb in save_post hook

text: I'm having trouble with inserting a string which is containing quotation marks in wordpress via wpdb. I've written a hook for save_post and trying to write the post_title in a table via wpdp->update. String is taken straight from the $_POST array. Unfortunatly, in the db the string is saved with escaped quotation marks. this is "the" example will become -> this is \"the\" example printed out in html. How can I prevent this? Code looks like this:               $data = array(  'post_content' => $new_content,                                 'post_title' => $new_title);                      $wpdb->update('wp_'.$blog_id.'_posts', $data, array('ID' => $post_id));


title: Making a Killer wp_link_pages

text:
I am trying to achieve a similar look to the image below, a working example can be found here: http://www.menshealth.com/celebrity-fitness/mark-wahlberg- fighter-workout ![example](http://i.stack.imgur.com/9l9cv.jpg) **The needed code must do the following (some of my questions have been answered, but these remain):** > Turn the non-linked active/current page number into a link to the top of the > page. > > Assign a unique style class to the previous and next links My current code is in use on this site. The code below is what I have so far. Calling it               <?php     wp_link_pages(array(         'before' => '
' . __(''),         'after' => '
',         'next_or_number' => 'next_and_number', # activate parameter overloading         'nextpagelink' => __('Next'),         'previouspagelink' => __('Previous'),         'pagelink' => '%',         'echo' => 1 )     );     ?>      Custom function               // Custom Next/Previous Page     add_filter('wp_link_pages_args', 'wp_link_pages_args_prevnext_add');     /**      * Add prev and next links to a numbered link list      */     function wp_link_pages_args_prevnext_add($args)     {         global $page, $numpages, $more, $pagenow;              if (!$args['next_or_number'] == 'next_and_number')              return $args; # exit early              $args['next_or_number'] = 'number'; # keep numbering for the main part         if (!$more)             return $args; # exit early              if($page-1) # there is a previous page             $args['before'] .= _wp_link_page($page-1)                 . $args['link_before']. $args['previouspagelink'] . $args['link_after'] . ''             ;              if ($page<$numpages) # there is a next page             $args['after'] = _wp_link_page($page+1)                 . $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . ''                 . $args['after']             ;              return $args;     }


title: Custom filter for the_content doesn't work correctly

text:
=====THIS POST HAS BEEN UPDATED===== SCROLL TO THE BOTTOM TO READ THE UPDATE! I asked a question yesterday that a gentleman named Tim was nice enough to take a stab at. He helped me through writing a filter that will enable me to append the_content with a custom meta box I created using Advanced Custom Fields. Tom got me through almost the entire process, but unfortunately wasn't able to help me complete it. I am no pro programmer by any stretch, but I have (for the last few hours) tried to decipher what his code means and why it might be failing to pull in the text from the back end... And I keep coming up short. Here is the link to my previous post : It takes you from start 'till now and here is the code I have right now:               function weedub_affiliate_filter($content) {     $string_to_add = '';     // only add on single posts with aff checkbox and label     if (is_single() && get_field('affiliate_checkbox') && get_field('affiliate_label')) {         $string_to_add = $string_to_add . '

             Weedub Product Recommendations
';         while (the_repeater_field('affiliate_label')) {             // list affiliates             $string_to_add = $string_to_add . '

                     ' . get_sub_field('label_affiliate') . '

                                                              ' . get_sub_field('text_for_link_affiliate') . '

';         }         $string_to_add = $string_to_add . '
';     }     $content = $content . $string_to_add;     return $content;      `}` `add_filter('the_content', 'weedub_affiliate_filter', 9);` This snippet is ALMOST there, it is displaying in the right place, and it is recognizing that I have entered 3 rows of fields on the backend, but it is not printing the text from the fields. example (scroll down the page till you see where I have written END OF THE_CONTENT in heading case) : Look for the "Weedub Product Recommendations" box Any and all help is soooooo appreciated! THANKS -Aaron =====UPDATE==== So, I found out that the code DOES actually print the values, but it prints them BEFORE the_content, and the markup AFTER the_content!! look just before the content actually starts (after the featured image) and you will see the string of values... then scroll down to the end of the_content and you will see the markup for the meta box, (titled "weedub product recommendations") here is the link again: link to single post I can't figure out where I am going wrong here!!


title: wp_nav_menu transferred to other domain using JSONP - menu not echoed in correct place

text: I have a WP website, and a related shop that's on a different domain / site. I want to have one navbar that I can update in wordpress that will also update the shop without me having to do it twice. Aiming to do this using some JS like this:               $.getJSON("http://some-wordpress-site/menu-only/?jsonCallback=?", function(json) {                 $('#navWrapper').append();      });      In the **menu-only** template, I'm trying to create application/json feed for the shop to read and spit out the menu. I.e.:               <?php     /*       Template Name: Menu Only      */     header('Content-type: application/json');     ?>     <?php echo htmlentities($_GET['jsonCallback']) ?>     (     <?php     echo json_encode(array(         'content' => wp_nav_menu(array('echo' => false, 'menu' => 'Navigation', 'container_class' => 'menu-header', 'walker' => new mainnav_menu_walker())))     )     ?>     );      What ends up happening when I visit my JSON menu link on the WP site is the wp_nav_menu has spat itself out in the wrong location. The result (without copy/pasting a huge chunk of code in here) looks a bit like this:               (     ... massive menu html code block ...     {"content":false});     );      Whereas the menu should be echoing where false is. Has anyone had experience with wp_nav_menu acting oddly like this? I have a fairly complicated walker operating behind it, which works fine on the wordpress site.


title: IE 9 Clears Form Fields

text:
This is a really strange issue that I cannot seem to solve. I have several forms (login, registration, and other) outputted on a site via short codes. When the forms are submitted, their data is processed via an "init" hook that listens for the $_POST data. When the forms are submitted in IE 9, all fields are cleared of the values when clicking submit. For example, let's say there is an input field with a name of "username", and the field's value is set to "johndoe"; when submitting the form through any browser besides IE 9 (include 7 and 8), the data comes in like this: `$_POST['username'] = 'johndoe'` Exactly as expected. However, when the form is submitted with IE9, it comes out like this: `$_POST['username'] = ''` As far as I can tell, it happens with every form on the site. The custom login form I've built, for example, looks like this:               <form id="re_login_form" class="re_login_form" action="" method="post">         <fieldset>                 <?php _e('Username', 're'); ?>                 <input name="re_user_login" id="re_user_login" class="required" type="text" title="<?php _e('Username', 're'); ?>"/>         </fieldset>          <fieldset>                 <?php _e('Password', 're'); ?>                 <input name="re_user_pass" id="re_user_pass" class="password required" type="password"/>         </fieldset>         <fieldset class="form-action">                 <input type="hidden" name="refalf_redirect" value="<?php echo $redirect; ?>"/>                 <input type="hidden" name="re_login_nonce" value="<?php echo wp_create_nonce('re-login-nonce'); ?>"/>                 <input id="re_login_submit" type="submit" class="button re_submit" value="<?php _e('Log In', 're'); ?>"/>
<a href="<?php echo wp_lostpassword_url( get_permalink() ); ?>" title="<?php _e('Lost Password', 're'); ?>"><?php _e('Lost Password?', 're'); ?>
         </fieldset>      </form>      One of the things that is extra interesting is that the fields are visibly cleared of their values when clicking submit in IE9. It's also as though the submit button is triggering something in IE9 that clears the fields. Anyone have any ideas?