title: Custom permalinks structure

text: I would like to have this structure:               www.mysite.com/2013       (must show all posts of 2013)               www.mysite.com/my-category/2013      (must show all posts of 2013 and of category "my-category")               www.mysite.com/my-category/my-tag/       (must show all posts of category "my-category" and of tag "my-tag")               www.mysite.com/my-category/      (must show all posts of category "my-category")               www.mysite.com/my-category/title-post      (must show the post) How can I do it?


title: Adding tables to dashboard pages programmatically?

text: I think that is not possible with some actions or filters, I know that I can do it just with html and using right css styles, and of course php to achieve what I need, or to write some minde actions. Is there already some predefined functions for this or not? Thanks.


title: Random meta field from specific custom post type

text: I am loading single images into a post and calling their source from my custom post type template `single-photo.php` :               src: "<?php echo get_post_meta($post->ID, 'single_photo', true); ?>"      I want to pull an image from a random post only from that post type [PHOTO]. I know the url will be `mysite.com/photo/-random-photo-`, how could I grab a radom meta field?


title: Full text articles in the rss feed (i.e. without the more tag)

text: I can't seem to remove the "Continue reading..." link in my rss feed. The feed is located here: http://gforge.se/category/r/feed/ I use the <!--more--> tag manually and I've checked that the Settings->Reading->For each article in a feed, show: Full text but I guess this is only for the automated WP summary function. My issue seems to be closely related to this previous post, but I've tried the Full Text Feed plugin to no aid. According to the plugins homepage it's no longer needed... I'm not entirely sure which file Ramkumar suggests the changes for. I've tried editing the Full Text Feed plugin but it seems not to activate properly for my category feed, when I add a:               $content = "test";      it only shows when I'm in the general feed, gforge.se/feed/ but not in the R category where I want it. I've tried to find some other filter hook but after a quick RSS search haven't really found one that seems to do the job: https://codex.wordpress.org/Plugin_API/Filter_Reference \- with the the_category_rss seeming to be the closes one to my need.


title: wp_remote_get with Google Books API

text: Trying my hand at pulling some info from Google API, and having a bit of trouble. My code:               $body = array(         'intitle' => 'Test', //Returns results where the text following this keyword is found in the title.         'inauthor' => '',  //Returns results where the text following this keyword is found in the author.         'inpublisher' => '',  //Returns results where the text following this keyword is found in the publisher.         'key' => '', //API key         'subject' => '', //Returns results where the text following this keyword is listed in the category list of the volume.         'isbn' => '',  //Returns results where the text following this keyword is the ISBN number.         'lccn' => '',  //Returns results where the text following this keyword is the Library of Congress Control Number.         'oclc' => ''  //Returns results where the text following this keyword is the Online Computer Library Center number.     );          $args = array(         'body' => $body,         'timeout' => '5',         'redirection' => '5',         'httpversion' => '1.0',         'blocking' => true,         'headers' => array(),         'cookies' => array()     );          $response = wp_remote_get( 'https://www.googleapis.com/books/v1/volumes?q=search+terms', $args );          if( is_wp_error( $response ) ) {        $error_message = $response->get_error_message();        echo "Something went wrong: $error_message";     } else {        echo 'Response:<pre>';        print_r( $response );        echo '</pre>';     }      This consistently returns a 400 Error. If I comment out my `$body` array it returns perfectly (albiet without any custom parameters). Here is the error generated by Google:               Array     (         [headers] => Array             (                 [content-type] => text/html; charset=UTF-8                 [content-length] => 925                 [date] => Thu, 07 Feb 2013 15:09:24 GMT                 [server] => GFE/2.0             )              [body] =>                                 Google               400. That’s an error.          Your client has issued a malformed or illegal request. That’s all we know. [response] => Array ( [code] => 400 [message] => Bad Request ) [cookies] => Array ( ) [filename] => )       And here is a sample when it is returned correctly:               Array     (         [headers] => Array             (                 [expires] => Thu, 07 Feb 2013 15:20:03 GMT                 [date] => Thu, 07 Feb 2013 15:20:03 GMT                 [cache-control] => private, max-age=0, must-revalidate, no-transform                 [etag] => "oJJnsPwmwzPHUK-6EQKPiLmyEMg/ZaxtQy3hi8hix-i3y1_kfXYZAVA"                 [content-type] => application/json; charset=UTF-8                 [x-content-type-options] => nosniff                 [x-frame-options] => SAMEORIGIN                 [x-xss-protection] => 1; mode=block                 [server] => GSE             )              [body] => {      "kind": "books#volumes",      "totalItems": 1433,      "items": [       {        "kind": "books#volume",        "id": "tskCFsTjsnkC",        "etag": "0o/Hdha/+K0",        "selfLink": "https://www.googleapis.com/books/v1/volumes/tskCFsTjsnkC",        "volumeInfo": {         "title": "The Everything Word Search Book",         "subtitle": "Over 250 Puzzles to Keep You Entertained for Hours!",         "authors": [          "Charles Timmerman"         ],         "publisher": "Adams Media",         "publishedDate": "2005-11-15",         "description": "With more than 250 puzzles, 100-plus more than our competition, The Everything(r) Word Search Book provides hours of gaming fun! Searches are organized by amusing themes, including: Work Searches on the Job Global Word Searches Word Searches Alive! Word Searches for Big Bucks Decades of Word Searches to Search or Not to Search? The Everything(r) Word Search Book is sure to excite gamers of all abilities with humorous and challenging puzzles.",         "industryIdentifiers": [          {           "type": "ISBN_10",           "identifier": "1593374313"          },          {           "type": "ISBN_13",           "identifier": "9781593374310"          }         ],         "pageCount": 304,         "printType": "BOOK",         "categories": [          "Games"         ],         "averageRating": 4.0,         "ratingsCount": 3,         "contentVersion": "1.3.3.0.preview.3",         "imageLinks": {          "smallThumbnail": "http://bks0.books.google.com/books?id=tskCFsTjsnkC&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api",          "thumbnail": "http://bks0.books.google.com/books?id=tskCFsTjsnkC&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api"         },         "language": "en",         "previewLink": "http://books.google.com/books?id=tskCFsTjsnkC&printsec=frontcover&dq=search+terms&hl=&cd=1&source=gbs_api",         "infoLink": "http://books.google.com/books?id=tskCFsTjsnkC&dq=search+terms&hl=&source=gbs_api",         "canonicalVolumeLink": "http://books.google.com/books/about/The_Everything_Word_Search_Book.html?hl=&id=tskCFsTjsnkC"        },        "saleInfo": {         "country": "US",         "saleability": "FOR_SALE",         "isEbook": true,         "listPrice": {          "amount": 14.95,          "currencyCode": "USD"         },         "retailPrice": {          "amount": 9.99,          "currencyCode": "USD"         },         "buyLink": "http://books.google.com/books?id=tskCFsTjsnkC&dq=search+terms&hl=&buy=&source=gbs_api"        },        "accessInfo": {         "country": "US",         "viewability": "PARTIAL",         "embeddable": true,         "publicDomain": false,         "textToSpeechPermission": "ALLOWED",         "epub": {          "isAvailable": true         },         "pdf": {          "isAvailable": true.....      Thank you so much for any help you can offer.


title: Get author full name

text:
I'm trying to display the first and last name of an author without having to change the "Display publicly as..." setting. Problem is, I can only seem to find solutions for either or, or at best display/nice/nickname. I would like to display the full name no matter what the user/author has chosen to "Display publicly as". Ideally I'd like to combine the below if possible.               get_the_author_meta('first_name')       and               get_the_author_meta('last_name')       Any help would be appreciated! EDIT (FINAL CODE):               $fname = get_the_author_meta('first_name');             $lname = get_the_author_meta('last_name');             $full_name = '';                  if( empty($fname)){                 $full_name = $lname;             } elseif( empty( $lname )){                 $full_name = $fname;             } else {                 //both first name and last name are present                 $full_name = "{$fname} {$lname}";             }                  $nicknames = "";             //get_author_role()             $userjob = get_cimyFieldValue(get_the_author_meta('ID'), 'JOBTITLE');             //$userjob = "";             ob_start();             coauthors_links();             //coauthors_firstname();             $authornames = $full_name;             ob_end_clean();                  if (empty($authornames)) {                  $authornames = get_the_author();             } else {                 $userjob = NULL;             }             $linkpre = "";             $linkpost = "";             if (custom_author_byline("") !== ""){                 $authornames = get_the_author();                 $linkpre = $linkpost = "";                 $userjob = NULL;             }             //echo coauthors_links();             //get_the_author_meta("nickname")             echo "
By ".$linkpre.$authornames.$linkpost."

".$categories_list." | ".get_the_date()."
";


title: How to create Custom image post?

text: I want to create a custom post type in which a post is only an image, title and description. I want to have a front-end option for users to enter such a post. What plugins do i need to play with in order to achive this? I Mean can i just use a taxonomy plugin and that's it? or is there some custom post plugin to base it on and the rest hard coded? And the most important - how can i get a front-end post option? The plugins i found contained an editor. As by now you understood, i'm completely lost, ANY help would be accepted with the highest regards, Thanks in advance.


title: How do you use prepare when asking for a list of id's

text: I'm looking to get a number of records back from the database given a list of numbers and was wondering how I would use $wpdb->prepare to do this (to take advantage of the sanitising vs SQL injection attacks that it gives me). A wrong way of going about what I'd like to achieve is `$wpdb->query($wpdb->prepare('SELECT * FROM wp_postmeta WHERE post_id IN (' . implode(',', $ids) .')` but this gives the chance of an SQL Injection attack (imagine one of the ids having the value "0); DROP TABLE wp_posts;"). NOTE: I'm not trying to select data from wp_postmeta, I'm just using it as example.


title: Back End US English > Front end other language

text: Asked and answered 3 years ago here: Different Language for Frontend and Backend However, step #2 of the top answer has me confused. Because WordPress is coded in US English (en_US) -- there doesn't seem to be a .mo file available. I do realize there are some plugins out there, but they don't seem to play well with multisite. Not sure if this rates a new post, but the system wouldn't let me comment on the other one.


title: How can I easily verify a core or plugin update has not broken anything?

text: I'm looking for ways to make updating WordPress less frightening for me. I created around 30 company websites based in WP in my career and I feel somewhat responsible for them in regards to security. Even if clients don't pay me for maintenance - clicking the "update" button every few months shouldn't be a big deal, right? I'm always resistant to upgrading for a couple of reasons   1. if something breaks on the website during updating clients are often not willing to pay for the time it takes to fix all the plugins. "It did work, why did you have to change it?!" Only option then is a roll-back and locking down the site.   2. if something breaks the website and I don't notice it I'm screwed. Explaining why a contact form would not work for several weeks after updating is something I don't want to do again.    3. updates for company websites are often not really mandatory. Most security issues happen around user submitted content, ajax and xml-rpc APIs - things I don't have to bother with when creating static pages that only get a few hundred visits per month. These websites tend to lie idle which of course increases the risk of updating. I have no problem updating a website that is only 2 months old - but I feel resistant to updating a 2 year old website running pre-3.0 or even pre-2.7. This makes it a game where I have nothing to win and can only loose. What are your ways of handling this? Any suggestions are highly appreciated and benefit to more secure WP installations out there? :) (for clarity: I'm mainly talking about small company websites or private blogs here where automated tests are not a realistic option)


title: Display Title by tags ( mysql )

text: I want to display in a sepparated page all the titles ( with link ) and a short description ( first 30-40 words from an article ) by a specific tag. For example, i use a "SPECIFIC TAG" on all my important articles and i want to export from mysql in a sepparated page title with link and a short description by that specific tag.


title: ACF Plugin How to make the customer add more fields in the post?

text: Example: I created a field with the name, "my-field", there can add it on the post, with a button "add another item" is that I want to create a list with several items, we only need to create multiple fields thus the client how they want to add. Further explained: I created a "Text" field in the "Advanced Custom Fields" to Custom Post Type: "tariff", the field is for notes, example of how it would look on the panel: Remarks: 1 - Note 1 | + add one more observation Then the customer clicked on "+ add one more observation" to automatically add a new field.


title: Broken Gravatar images in comments

text: I have no idea why, but recently, all new comments on my WordPress site have broken avatar image links. Here is a page that shows the issue: http://joshnh.com/2012/10/12/how-does-line-height-actually-work/#comments Any idea why this is happening? I haven't installed any plugins recently, so why has it started playing up all of a sudden?


title: register_setting - validation callback weirdness

text: I'm working on a plugin and having some issues validating input on its settings page. I'll try to explain as briefly as possible what I'm doing in the plugin file:               if (is_admin()) {         add_action('admin_init', 'register_mysettings');         add_action('admin_menu', 'my_menu');     }          function t1k_twitter_menu() {         add_options_page('My Plugin Options', 'My Plugin', 'manage_options', 'my_plugin', 'my_plugin_options');     }          function t1k_twitter_options() {         // include my form         include 'my_plugin_options.php';     }          function register_mysettings() { // whitelist options         register_setting('my-group', 'setting_1', array($this, 'validate'));         register_setting('my-group', 'setting_2', array($this, 'validate'));     }          function validate($input) {         // This is where I want to do some validation...     }      From various examples I've seen, it seems that I should be receiving a key- value array as $input in the validate function. What I actually see is a simple string containing the posted value. Have I misunderstood, or is my implementation wrong? The options will save ok (if I remove my validate function, or just set it to return the posted value). Thanks.


title: Use query->set or make new query?

text: I'm writing a loop for multi post types with meta_key filters. The filters are inputs from visitors. When visitor click a link(filter), The form submitted and I get the filter. Now, should I just use `$query->set()` to change the query args, or should I submit new query? Currently I'm using this function to get arguments from input and pass the arguments to wp_query:               function get_args($args){     $defaults= array(         // some standard query args        )     $args = wp_parse_args ( $args, $defaults );     extract ( $args );     if(!empty($args['filter'])){        switch ($args['type']){           case 'top_voted':              $args['post_type'] = 'docs';              $args['meta_key'] = '_vote_total';              $args['order'] = 'DESC';              $args['orderby']='meta_value_num';            break;           case 'unanswered_questions':              $args['post_type] = 'topics';              $args['blabla'] = 'blabla;           break;           default:               blabla;            break;     }     return $args;     }      In the template, I use this:               $key = isset( $_POST['filter'] ) ? array_keys($_POST['filter']) : null;     $query_args = get_args(array('user_id'=>$user_id, 'filter'=$key));     $r = new WP_Query( $query_args);      In the above example, I think I'm using new query each time the filter changes. If query->set() or other filters can improve the performance, please help me understand how to do it. Thanks!


title: Customizing the Widget content markup

text:
I am using bootstrap to create panels for the sidebar widgets, and I can set the container markup for the widget, as well as the markup for the panel header, but I cannot provide the markup for the panel content. I have this so far:               register_sidebar(array(         'name' => __('Right Sidebar'),         'id' => 'home_right_1',         'before_widget' => '
',         'after_widget' => '
',         'before_title' => '

',         'after_title' => '

'     ));      bootstrap panels need to look like this:

Panel heading without title

         Panel content

      How can I add the '
###
' to each widget?


title: How to query posts based on lat-lng coordinate as post meta?

text: I'm planning a custom WordPress theme where the Custom Post Type (CPT) will have latitude and longitude coordinate as it's meta value. The latitude and longitude will be displayed as a Marker in a Google Map. So far I don't have any problem in showing the Google Map and the CPT as it's Marker. That is if I query the CPT using the default order. The problem occurs when I need n CPTs that is closest to a coordinate whether it is current user position or a location clicked on the map. Another situation is to query all CPTs that is in x km radius of a coordinate. The question is : How do I query posts based on latitude-longitude value that is saved on the post meta? I'm not really sure how to do it, but I think the latitude and longitude value should be saved in a separate custom field. Thank you in advance.


title: How to obtain the user ID of the current profile being edited in WP-Admin?

text: Is there a way of obtaining the user ID of the profile being edited in `wp- admin`? I know it's in the URL if you are editing a user, EX: `./wp-admin/user- edit.php?user_id=427`. Could always `$_GET['user_id']` to retrieve the user's ID, but what about when you're editing your own profile in `wp-admin`? The user ID wouldn't be in the URL. EX `./wp-admin/profile.php` Is there an easy or broad way of retrieving the user ID of the current user profile being edited in `wp-admin`?


title: How do I add google tracking code to a wordpress.com site?

text: I want to add google analytics to my free wordpress.com blog. I have the html tracking code but I can't figure out how to add it to my blog from the wordpress.com dashboard.


title: wp_nav_menu inside an object -- how do I deal with fallback_cb?

text: I'm trying to create a class that allows me to generate a navigation menu. Here's a simplified version of what I'm using:               class PJ_Menu {         function make_menu() {             $args = array(                 'theme_location' => 'location',                 'fallback_cb' => array( $this, 'pj_page_menu' ),             );             wp_nav_menu( $args );         }         function pj_page_menu() {             // a bunch of code here         }          }     new PJ_Menu();      I can't seem to work out what I need in the `fallback_cb` parameter. `array( $this, 'pj_page_menu' );` didn't work, and neither did `'self::pj_page_menu'`. Am I missing something obvious, or is it not possible to do this?


title: How can I display a list of categories of my posts

text: I have a Post Category called 'Podcasts' and under it are many other sub- categories. On a page I have titled "Podcast Categories", I would like to list all categories under the "Podcasts" category, as links to their category page. I'm fairly new to Wordpress, what would be the best way of accomplishing this? Thank you very much! Note: I do not want to display any kind of post content on this page, only the category name as a link. When I do google searching, I'm finding lots of info on how to post content from these categories. UPDATE 1: page-podcast-list.php                         <div id="content">                 <?php                             $cat = get_category_by_slug( 'podcasts' );                   $catid = $cat->ID;                 ?>                 <?php                   wp_list_categories( array(                     'child_of' => $catid;                   ) );                 ?>               </div><!-- /content -->      This isn't doing what I expected. It's printing out: Parse error: syntax error, unexpected ';', expecting ')' in /path/to/page- podcast-list.php on line 49 I'm not sure what line 49 is specifically at the moment, since I'm using the Built in WordPress Editor, without line numbers unfortunately.. I'm not familiar with php for the record, but am familiar with basic programming.


title: How to get user ID on the registration and add in to custom table

text: I am trying to get user ID on registration and automatically add that ID to my custom table. I am using wp-members plugin for registration. So is it possible to get user ID on the fly while registering and add that ID to another custom table with WP-Members plugin. Or I can use custom registration page if require. But need some guideline how to get user ID on the fly during registration. **Anyone please help me..**


title: get_post_meta inside echo

text: I have a serious problem :) I have this code:               <?php global $wp_query;     $postid = $wp_query->post->ID;     echo get_post_meta($postid, 'provinciadestacada', true); ?>      And i want include here:               <?php if ( in_category( '951' )) { echo 'Online'; }     else     ?>      After else i want get post_meta "provinciadestacada" Maybe something like this?               <?php if ( in_category( '951' )) {     echo 'Online. Todas las provincias'; }     else echo "global $wp_query;     $postid = $wp_query->post->ID;     $meta = get_post_meta($postid, 'provinciadestacada', true);"     ?>


title: Wordpress Relative Path

text: I have multisite blog for 2 languages, and I want to easily switch it.               www.example.com/page/post      I would like to switch to               www.example.com/english/page/post      I have **get_blog_option(2, 'siteurl')** which returns `www.example.com/english/` but I cant find any function which returns only `/page/post/` I have one which returns `www.example.com/page/post` but how put there `/english/` inside Thanks


title: Can I use $wpdb for my custom tables in the WordPress database?

text: I am building a custom application based on WordPress. I have my custom tables in the WP database. Can I use $wpdb to work with them, or is that class solely for the WP related tables? For example, If I have a database that keeps up with dogs and cats, and I create a custom table named animals (animalid, animal_type, etc.). Do I use $wpdb? I don't know if "interacting with the WordPress database" with $wpdb is intended solely for the stock tables or not. EDIT: I created the tables by hand with MySQL Workbench. They were tables upsized from Microsoft Access. I have not "informed" WordPress of their existence or know if I should.


title: Preventing Cache for Text Content but not for CSS files and Images

text: I am front-end developer and my knowledge is limited for server-side. Excuse me if I am mistaken on terminology. I have Wordpress blog that I write blog posts about javascript. I update the same post by generally 12-13 days or so. But sometimes I push updates daily. After I update my article and publish to changes, I go to the article page with Firefox but I see the cached page rather than the updated one. Here is an example post url. http://example.com/?p=1111 This is my response header for the same page if it is first time viewed. ![Response Header](http://i.imgur.com/WgTHxbA.png) After it is viewed first time, if I click in location bar of Firefox and press Return, the page is loaded from cache. Request header is below. Because it is loaded completely from cache it does not have Response Header. ![Request Header](http://i.imgur.com/pUuKIA3.png) It seems clear the Cache-Control might be the main issue but I do only want to prevent page (HTML) cache but not the style and image files. I already have WP-Cache plugin to cache files and I use CDN to serve site images. In this context, I find Firefox useful to load CSS, Javascript and Image files from cache but I do not want Firefox to cache page text context. To get the latest version of my page content, I have to use CTRL + SHIFT + R to force reload the page but this time all CSS, Javascript and image files are also downloaded from server unnecessarily. Is it possible to download page content always from server but load CSS, Javascript and Image file from cache?


title: using stats_get_csv to return a list of popular posts by views with thumbnails

text:
I recently learned that if you have Wordpress.com Stats installed, you can take advantage of `stats_get_csv()` (Part of the WordPress.com Stats Plugin).               <?php if ( function_exists('stats_get_csv') && $top_posts = stats_get_csv('postviews', 'days=-1&limit=4') ) : ?>
     <?php foreach ( $top_posts as $p ) : ?>
<a href="<?php echo $p['post_permalink']; ?>"><?php echo $p['post_title']; ?>
     <?php endforeach; ?>
     <?php endif; ?>      That's how I have my code set up now. The problem is that it shows pages as well as posts. Also, I want to add the featured thumbnail next to each item as well as an array of custom post types. Is this possible? If so, can someone help me out?


title: Error "The given object ID is not that of a menu item" on menu with 40+ items

text: When ever I try to add menu items past about 40 I get an error "The given object ID is not that of a menu item" and many of my menu items will disappear from the menu at random. The site I am working on has approx 65 pages in total but I am unable to get them all in because of this. I am referring to the new WordPress menu management interface


title: How do I make an HTML table from a database table?

text: is there a built-in wordpress function to make the HTML or should I use plain- old PHP?


title: Display custom field values from posts on frontpage

text: How can I pull a custom field with meta_key "proprty_feature" (and has a value) for all posts and display them on my frontpage? Would like to display the post name as a link above the value..


title: Having trouble understanding custom post type and taxonomy :/

text: I am developing a Wordpress site that will have a database of car modifications and an embedded youtube video with the results. For example: search for Honda Civic with a spoiler and exhaust. This would generate several posts. Each post has there own video, attributes, and an adsense ad. I am using the term posts loosely though, I really don't want to post them on the blog of the site. I am struggling to see how (if) this can work with the custom post type and taxonomy features in 3.0. Also I found this $200 theme on WooThemes, I'm not positive it will work and they wont talk to me about technical stuff unless i'm a "member". I would Like to insert youtube videos instead of their dealer listing, but it seems like the theme is a great start.   WooThemes - "Listings"   Thanks for any help and insight, I am at my wits end try to see if this is do- able.


title: Wordpress menu walker - get the parent item

text: I want to implement a menu walker system where only those submenu items get listed which have a specific parent. So let's say I have two level one menu items, A and B. On a page I want to get listed the descendant items of menu A only. I want to use the same menu across the site, so creating two different menus for A and B is not an option. What I want to know basically, is there a way to get to know the parent item when the walker is going through the menu, so that I skip certain items based on that information.


title: How did you incorporate WooCommerce in your own WordPress theme?

text: This has most probably been asked before, but I really need to show WooCommerce products in my template, but I don't know what hooks to add where. It's my first time working with WooCommerce. Can anybody maybe help me out? Quick step by steps of the process are all I'm asking? And a little more advice would be **greatly** appreciated. Also, just a URL explaining the complete process would be bonus, as I can't find anything on the net at the moment.


title: Which hook callback has priority if both plugin and theme use the same hook?

text: If a theme and a plugin uses the same action hook, for example `comment_form` is used by both theme and plugin. Then , which one will be called first? the function associated with the theme's hook or the function associated with the plugin's hook.


title: Add a class to post if it has been recently updated

text: I'm trying to add 'updated recently' after the post title. I've discovered some code which works but because of plugins and some theme coding it affects numerous instances of `the_title` that it shouldn't. This issue is covered here https://pippinsplugins.com/use-the_title-and-the_title_attribute- correctly/ \- I've made some corrections / fixes but some plugins are a little beyond my capabilities. The existing code (credit http://www.themesandco.com/snippet/adding-an-update- status-to-posts-in-wordpress/) is...               // add label to updated posts     add_filter('the_title' , 'skips_add_update_status');     function skips_add_update_status($html) {     //First checks if we are in the loop and we are not displaying a page     if ( ! in_the_loop() || is_page() )         return $html;          //Instantiates the different date objects     $created = new DateTime( get_the_date('Y-m-d g:i:s') );     $updated = new DateTime( get_the_modified_date('Y-m-d g:i:s') );     $current = new DateTime( date('Y-m-d g:i:s') );          //Creates the date_diff objects from dates     $created_to_updated = date_diff($created , $updated);     $updated_to_today = date_diff($updated, $current);          //Checks if the post has been updated since its creation     $has_been_updated = ( $created_to_updated -> s > 0 || $created_to_updated -> i > 0 ) ? true : false;          //Checks if the last update is less than n days old. (replace n by your own value)     $has_recent_update = ( $has_been_updated && $updated_to_today -> days < 14 ) ? true : false;          //Adds HTML after the title     $recent_update = $has_recent_update ? 'Recently updated' : '';          //Returns the modified title     return $html.' '.$recent_update;     }      I'd like to adapt this to add an extra class 'update' using `post_class` and then I'll target the post title using CSS and add a pseudo element. My problem is I'm unsure how to adapt the code to insert...               $classes[] = 'update';     return $classes;      Presumably in place of the `//adds html...` onwards section of the existing code. Can anyone assist? This is my starting code but it adds 'update' class to all posts not just those updated in the last 14 days, I guess because there's no link to the logic calculation. If there is a better alternative approach I am open to ideas.               function skips_add_update_status($classes) {          //Instantiates the different date objects     $created = new DateTime( get_the_date('Y-m-d g:i:s') );     $updated = new DateTime( get_the_modified_date('Y-m-d g:i:s') );     $current = new DateTime( date('Y-m-d g:i:s') );          //Creates the date_diff objects from dates     $created_to_updated = date_diff($created , $updated);     $updated_to_today = date_diff($updated, $current);          //Checks if the post has been updated since its creation     $has_been_updated = ( $created_to_updated -> s > 0 || $created_to_updated -> i > 0 ) ? true : false;          //Checks if the last update is less than n days old. (replace n by your own value)     $has_recent_update = ( $has_been_updated && $updated_to_today -> days < 14 ) ? true : false;          //add update class     $classes[] = 'update';          return $classes;     }     add_filter('post_class' , 'skips_add_update_status');


title: Previous Question - Subdirectory WP install Still not working "correctly"

text: http://wordpress.stackexchange.com/posts/160035/revisions I had post the above question earlier and received answers.. Thank you!! But its still not working correctly... now it says it can find the page 404 only this time from the hosting service. The main install is on the root directory and the other install is in a subfolder on the root. If it helps for some reason the favicon still shows up.


title: Advanced video gallery plugin needed

text: OK doing a website for a client who has a multi-level video gallery. All the video gallery plugins I found (even paid ones) don't function the way we need it to. I thought of rolling my own solution but it would probably take too long. The gallery must:   * Be able to support videos in sub-folders   * Allow users to navigate these sub-folders using a menu system   * Show a player, then below that, show thumbnails of the other videos in the current folder   * Allow the user to search for videos   * Play the next video in the current folder once the current video is done playing (optional) Does such a plug-in exist? If not, I might do my own.


title: Change path to child of page when uploading image via custom field

text: Is it possible to change the path of an image when it is uploaded via a custom field so that instead of appearing as _www.mysite.com/wp- content/uploads/2014/05/file.pdf_ it will appear as _www.mysite.com/page- name/file.pdf_ ??


title: Archive.php is not displaying tags

text: I have a fairly standard "if" construct to detect what archive.php should display (see below) I also have a custom post type and a custom category. When a user clicks a displayed category (taxonomy) term in my postmeta, it loads archive.php and goes all the way to the "else" case, and displays the matching "Design Pattern" taxonomy term that was clicked. Fine. However, the same is not true for tags. If a user clicks on a Tag in the postmeta, archive.php loads with its "nothing found" displayed, with this URL: `mysite.com/wordpress/tag/action-button/` I would expect the code below to match the "tag" condition and display the tag "action-button".               <?php             if ( is_category() ) :                 single_cat_title();                  elseif ( is_tag() ) :                 echo 'foobar';                 single_tag_title();                  elseif ( is_author() ) :                 /* Queue the first post, that way we know                  * what author we're dealing with (if that is the case).                 */                 the_post();                 printf( __( 'Author: %s', 'upbootwp' ), '' . get_the_author() . '' );                 /* Since we called the_post() above, we need to                  * rewind the loop back to the beginning that way                  * we can run the loop properly, in full.                  */                 rewind_posts();                  elseif ( is_day() ) :                 printf( __( 'Day: %s', 'upbootwp' ), '' . get_the_date() . '' );                  elseif ( is_month() ) :                 printf( __( 'Month: %s', 'upbootwp' ), '' . get_the_date( 'F Y' ) . '' );                  elseif ( is_year() ) :                 printf( __( 'Year: %s', 'upbootwp' ), '' . get_the_date( 'Y' ) . '' );                  elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :                 _e( 'Asides', 'upbootwp' );                  elseif ( is_tax( 'post_format', 'post-format-image' ) ) :                 _e( 'Images', 'upbootwp');                  elseif ( is_tax( 'post_format', 'post-format-video' ) ) :                 _e( 'Videos', 'upbootwp' );                  elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :                 _e( 'Quotes', 'upbootwp' );                  elseif ( is_tax( 'post_format', 'post-format-link' ) ) :                 _e( 'Links', 'upbootwp' );                  else :                 _e( 'Design Patterns', 'upbootwp' );                  endif;         ?>


title: Drag and Drop Metadata Menu Order

text: I'm not sure this has been answered previously.. I have a frontend form where the user fills out a form that has dynamic fields where they can add more fields if they choose to. The jquery names the input fields as follows data[0] data[1] data[2] data[3] etc.. depending on how many fields the user wants. When the form is submitted, all the data goes into one record as metadata. Is there a way to have the user be able to reorder the metadata with a drag and drop functionality? And save the metadata order?


title: Calling apply_filters on non-documented hooks

text: I have been trying to learn how to write plugins and I thought the best way would be to look at other plugins. I was taking a look at this one and the first lines               /**      * Plugin Name: Media Library Categories      * Plugin URI: http://wordpress.org/plugins/wp-media-library-categories/      * Description: Adds the ability to use categories in the media library.      * Version: 1.4.1      * Author: Jeffrey-WP      * Author URI: http://codecanyon.net/user/jeffrey-wp/?ref=jeffrey-wp      */          /** register taxonomy for attachments */     function wpmediacategory_init() {         // Default taxonomy         $taxonomy = 'category';         // Add filter to change the default taxonomy         $taxonomy = apply_filters( 'wpmediacategory_taxonomy', $taxonomy );         register_taxonomy_for_object_type( $taxonomy, 'attachment' );     }     add_action( 'init', 'wpmediacategory_init' );      There is this line:               $taxonomy = apply_filters( 'wpmediacategory_taxonomy', $taxonomy       that I don't understand. I have look around the Wordpress documentation and I didnt find a hook called `wpmediacategory_taxonomy`. Besides due to the name, I am sure that is something related to the plugin. So how does it exactly work? Is that a custom hook? Where was it defined?


title: My Dashboard<< Appearance << Menu page won't open

text: ![enter image description here](http://i.stack.imgur.com/IGRJL.png) When ever i try to open wp_nav_menu.php this fatal error thingy appears. Please help :(


title: CSS class on last post in loop ( custom query )

text: I have been using this question to try to do this but I am having some difficutlty. I have a custom post type, media, and I am working on the archive-media.php template. I have it partially working in that when I delete the **if** condition out of the code it does add the class, but of course to every post. I have determined that `$wp_query->current_post` is not returning a value, so I feel I must not be using this right. I have the code in my functions.php file. The codex says that current_post is available in the loop, so I am a bit confused.               add_filter('post_class', 'my_post_class');     function my_post_class($classes){       global $wp_query;       if(($wp_query->current_post+1) == $wp_query->post_count) $classes[] = 'last';       return $classes;     }


title: Redirect all page templates to index.php and turning Wordpress into a Single Page Application CMS

text: I’m trying to push the boundaries of Wordpress by turning it into a SPA CMS. Everything works fine until now except for a redirection issue. github angularpresstheme **How it works:** When I create a page and publish it (or update) wordpress will generate an Angularjs html view template. All pages are redirected to the index.php (hence the name SPA) where there is a directive that handles all view states. I use HTTP_API to do it. **Issue:** If you go for the first time ( _the second time is loaded using php_ .You may need to clear your browser session) to http://angularpresstheme.com/full- width/ you will see that the page briefly appears and then reloads ( this doesn’t happen if you just go to ‘/’). I use JavaScript (Angularjs) to redirect the page. The main problem with this approach is that it is pretty slow and the pages flickers. This happens because it was the only way I could find to avoid the following:   * Whenever I tried to create a page and published it the resulting Angularjs html template was always based on index.php template! This occurred because I simply had redirected all pages to index.php (using .htaccess or php) . **What I did to mitigate the problem:**   * I solved part of the problem by redirecting the “/” (front-page) and the other pages (when loaded for the second time) using PHP.   * When pages _other than the front-page_ (“/” ) are loaded for the first time I had to use Javascript in order to avoid the “index.php” only template generation effect. **What I would like to do:** On click publish or update it must ignore that we are redirecting all pages to index.php (using .htaccess or PHP) and just keep the normal wordpress template system flow. For example: I could create a page with slug called home and use a front-page.php template and then it should generate a Page called Home based on the front-page template (as Wordpress normally does) . **To Resume:**   * I would like to redirect all pages to index.php using .htaccess (even better) or PHP   * And when creating or editing a new page Wordpress should work just as normal for the front-end and back-end **Possible ways to solve it:**   * Use Wordpress rewrite rules with template_redirect   * Another way to generate html template other than HTTP_API or OB_START. Could someone help me out with this, please? II would be very nice! **Code:**                       /**              * When page (frontpage '/') loads or reloads then set a template_req session              * at the template_redirect hook time (just before template_include).              * After that redirect to index.php with redirect_all_pages_to_index_template() using              * 'template_include' hook.              *              * */             function angp_set_index_for_redirect() {                      if (!is_front_page()) return;                      angp_set_session('index.php', 'template_req');                  }                  add_action('template_redirect', 'angp_set_index_for_redirect', 10);                       /**              * When pages (other then the frontpage) loads the first time  then set a              * template_req_pages session at the wp_head(for page preview) and get_header(for frontend) hook time.              * But redirection will just happens after page is reloaded from the second time onwards with              * redirect_other_pages_to_index_template() using 'template_include' hook.              *              * */             function angp_set_index_for_pages_redirect() {                      if (is_front_page()) return;                 angp_set_session('index.php', 'template_req_pages');                  }             add_action('wp_head', 'angp_set_index_for_pages_redirect');             add_action('get_header', 'angp_set_index_for_pages_redirect', 10);                      /**                  * when  '/' is reloaded (for the first time or not)                  * check if there is a  session key 'template_req'(that is set at template_redirect hook time                  * in angp_set_index_for_redirect()) and if yes redirect to  index.php                  *                  * */                 function redirect_all_pages_to_index_template($template) {                     global $pagenow;                          if (('template_include' == current_filter()) && $pagenow                         == 'index.php'                     ) {                              $key = 'template_req';                         if (isset($_SESSION[$key])) {                                  $array = $_SESSION[$key];                             $req_url = $array['url'];                                  $new_template = locate_template($req_url);                                  if ('' != $new_template) {                                      return $new_template;                                  }                         }                     }                          return $template;                 }                      add_filter('template_include', 'redirect_all_pages_to_index_template', 10, 1);                           /**                  * when a page other then '/' is reloaded (for the first time or not)                  * check if there is a  session key 'template_req_pages' and , if yes redirect to index.php                  * The session 'template_req_pages' is set in set-index-redirect.php with get_header and wp_head                  * hooks                  * */                 function redirect_other_pages_to_index_template($template) {                     global $pagenow;                          if (('template_include' == current_filter()) && $pagenow                         == 'index.php'                     ) {                              $key = 'template_req_pages';                         if (isset($_SESSION[$key])) {                                  $array = $_SESSION[$key];                             $req_url = $array['url'];                                  $new_template = locate_template($req_url);                                  if ('' != $new_template) {                                      return $new_template;                                  }                         }                     }                          return $template;                 }                      add_filter('template_include', 'redirect_other_pages_to_index_template', 20, 1);                      /**                  * This tells the browser at the init hook phase that we are loading a page for the first time                  * ever. It works for pages other then '/'. Redirection will be done by angularjs in app.js                  * MainCtrl                  *                  * */                 function angp_is_page_first_loaded() {                     if (!isset($_SESSION['template_req_onload'])) {                         angp_set_session('template_req_onload', 'template_req_onload');                          }                 }                      add_action('init', 'angp_is_page_first_loaded', 10);                      /**                  * This tells the browser at the get_header hook phase to delete 'template_req_onload' after the                  * page is fully loaded, so that dont get into a redirection loop. It checks if $_COOKIE['is_page_loaded']                  * or $_SESSION['page_loaded'] were already set. *                  *                  * */                 function destroy_session_index_onload() {                     //cookie set in app.js                     if (isset($_COOKIE['is_page_loaded']) || isset($_SESSION['page_loaded'])) {                         unset($_SESSION['template_req_onload']);                          }                 }                      add_action('get_header', 'destroy_session_index_onload', 20);                      /**                  * Set session page_loaded when page is fully loaded                  * $_COOKIE['is_page_loaded'] does the same for google chrome canary                  *                  * */                      function angp_page_fully_loaded() {                     angp_set_session('page_loaded', 'page_loaded');                 }                 add_action('wp_footer', 'angp_page_fully_loaded');                 add_action('get_footer', 'angp_page_fully_loaded', 20);                      /**                  * This code generates the angularjs html views templates                  * It uses HTTP-API with  wp_remote_get()                  * */                 function angp_get_template_content($new_status, $old_status) {                     global $post;                          if (isset($post->post_name)) {                         $post_slug = $post->post_name;                              $file = get_template_directory() . '/library/views/pages/' . $post_slug . '.html';                              if (($old_status != 'trash' && $new_status == 'trash')) {                             if (file_exists($file))                                 unlink($file);                         }                     }                     if (($old_status != 'publish' && $new_status == 'publish') || did_action('wp_insert_post') === 1) {                                   angp_get_page_http_api(site_url(), 'newsloop');                         $pages = get_pages(array('sort_order' => 'asc'));                              if (!empty($pages))                                  foreach ($pages as $page) {                                      $slug = $page->post_name;                                 $url = get_page_link($page->ID);                                      angp_set_session('index.php', 'template_req');                                 angp_get_page_http_api($url, $slug);                                  }                     }                 }                                if ($_SERVER['REQUEST_URI'] == '/wp-admin/nav-menus.php'                     || (isset($_POST['action']) && $_POST['action'] == 'add-menu-item')                     || (@$_POST['post_type'] == 'post')                 ) return;                           add_action('quick_edit_custom_box', 'angp_get_template_content', 10,2);                 add_action('wp_insert_post', 'angp_get_template_content', 20, 2);                 add_action('transition_post_status', 'angp_get_template_content', 20, 2);                 add_action('wp_restore_post_revision', 'angp_get_template_content', 10, 2);                      if (!function_exists('angp_get_page_http_api')) {                     function angp_get_page_http_api($url, $slug) {                 /*                  * request a page extract content between tags <content></content> or <homenewsloop></homenewsloop>                  * */                         $response = wp_remote_get($url);                              if (is_wp_error($response) || (200 != wp_remote_retrieve_response_code($response))) {                             wp_die('Request could not be executed.');                              }                              try {                             $result = wp_remote_retrieve_body($response);                             //extract content and pass it to a html template_generator                             if ($url !== site_url()) {                                 preg_match_all('/<content[^>]*>(.*?)<\/content>/is', $result, $t);                                      angp_wp_to_angular_template_generator($slug, $t[1][0]);                                  } else {                                 preg_match_all('/<homenewsloop[^>]*>(.*?)<\/homenewsloop>/is', $result, $t);                                 angp_wp_to_angular_template_generator($slug, $t[1][0]);                                  }                              } catch (Exception $ex) {                             return $ex;                              }                          }                      }                      if (!function_exists('wp_to_angular_template_generator')) {                     function angp_wp_to_angular_template_generator($slug, $body_response) {                         if ($slug === 'newsloop') {                             $file = get_template_directory() . '/library/views/loops/' . $slug . '.html';                         } else {                             $file = get_template_directory() . '/library/views/pages/' . $slug . '.html';                         }                              if (!empty($body_response)) {                                  try {                                 global $checkfile;                                      if(file_exists($file)){                                     $checkfile = file_get_contents($file);                                      }                                 //just write content if file content is empty or content is different than the                                 //$body_response                                 if ($body_response !== $checkfile || $checkfile === '' || !isset($checkfile)) {                                          file_put_contents($file, $body_response, LOCK_EX);                                          return false;                                 }                                  } catch (Exception $ex) {                                      return 'Could not write file!';                             }                         }                     }                 }                      if (!function_exists('angp_set_session')) {                          function angp_set_session($key_name, $template_req_name) {                              $template_req = $key_name;                         $key = $template_req_name;                         $_SESSION[$key]['url'] = $template_req;                          }                 }


title: Custom Meta Box - Multiple Checkbox for Users

text:
My question is in regard to this article: http://wp.smashingmagazine.com/2012/01/27/limiting-visibility-posts- username/comment-page-1/#comment-154111 This article:   1. creates a custom metabox    2. the custom metabox queries 'subscriber' users    3. saves the metabox value as a radio button What I would like to know is if anyone knows how:   1. change the metabox to multiple checkboxes (pretty straightforward)    2. save the multiple checkbox values in one field, separated by commas (i.e. an array). The code: (in functions.php)               /* Fire our meta box setup function on the post editor screen. */     add_action( 'load-post.php', 'smashing_post_meta_boxes_setup' );     add_action( 'load-post-new.php', 'smashing_post_meta_boxes_setup' );          /* Meta box setup function. */     function smashing_post_meta_boxes_setup() {              /* Add meta boxes on the 'add_meta_boxes' hook. */         add_action( 'add_meta_boxes', 'smashing_add_post_meta_boxes' );              /* Save post meta on the 'save_post' hook. */         add_action( 'save_post', 'smashing_flautist_access_save_meta', 10, 2 );     }          /* Create one or more meta boxes to be displayed on the post editor screen. */     function smashing_add_post_meta_boxes() {              add_meta_box(             'smashing-flautist-access',         // Unique ID             esc_html__( 'Post Viewing Permission', 'smashing_flautist' ),       // Title             'smashing_flautist_access_meta_box',        // Callback function             'destinations',                 // Admin page (or post type)             'normal',                   // Context             'default'                   // Priority         );     }          /* Display the post meta box. */     function smashing_flautist_access_meta_box( $object, $box ) { ?>              <?php wp_nonce_field( basename( __FILE__ ), 'smashing_flautist_access_nonce' ); ?>

     Username	         	     Visiblity	         	     Name
     <?php     global $post;         $users = get_users('role=subscriber');         foreach ($users as $user) {                 $user_info = get_userdata( $user->ID );                 if(get_post_meta( $object->ID, 'smashing_flautist_access', true ) == $user->user_login) $ifchecked = 'checked="checked" ';                 echo "
";                 echo "$user->user_login	    	";                 echo "<input type=\"checkbox\" name=\"smashing-flautist-access\" id=\"smashing-flautist-access\" value=\"$user->user_login\" " . $ifchecked ."/>	  	";                 echo "$user_info->last_name, $user_info->first_name	    	";                 echo "
";                 unset($ifchecked);              } ?>
               <?php }          /* Save post meta on the 'save_post' hook. */     add_action( 'save_post', 'smashing_flautist_access_save_meta', 10, 2 );          /* Save the meta box's post metadata. */     function smashing_flautist_access_save_meta( $post_id, $post ) {              /* Make all $wpdb references within this function refer to this variable */         global $wpdb;              /* Verify the nonce before proceeding. */         if ( !isset( $_POST['smashing_flautist_access_nonce'] ) || !wp_verify_nonce( $_POST['smashing_flautist_access_nonce'], basename( __FILE__ ) ) )             return $post_id;              /* Get the post type object. */         $post_type = get_post_type_object( $post->post_type );              /* Check if the current user has permission to edit the post. */         if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )             return $post_id;              /* Get the posted data and sanitize it for use as an HTML class. */         $new_meta_value = ( isset( $_POST['smashing-flautist-access'] ) ? sanitize_html_class( $_POST['smashing-flautist-access'] ) : '' );              /* Get the meta key. */         $meta_key = 'smashing_flautist_access';              /* Get the meta value of the custom field key. */         $meta_value = get_post_meta( $post_id, $meta_key, true );              /* If a new meta value was added and there was no previous value, add it. */         if ( $new_meta_value && '' == $meta_value )             {             add_post_meta( $post_id, $meta_key, $new_meta_value, true );             $wpdb->query($wpdb->prepare("UPDATE $wpdb->posts SET post_status = 'private' WHERE ID = ".$post_id." AND post_type ='post'"));             }         /* If the new meta value does not match the old value, update it. */         elseif ( $new_meta_value && $new_meta_value != $meta_value )             {             update_post_meta( $post_id, $meta_key, $new_meta_value );             $wpdb->query($wpdb->prepare("UPDATE $wpdb->posts SET post_status = 'private' WHERE ID = ".$post_id." AND post_type ='post'"));             }         /* If there is no new meta value but an old value exists, delete it. */         elseif ( '' == $new_meta_value && $meta_value )             {             delete_post_meta( $post_id, $meta_key, $meta_value );             $wpdb->query($wpdb->prepare("UPDATE $wpdb->posts SET post_status = 'public' WHERE ID = ".$post_id." AND post_type ='post'"));             }     }


title: Enable Media Modal Dropdown Filter

text: Trying to figure this out for a plugin I'm working on: Using the built in media modal in WordPress to select media and I noticed a few difference between a media modal frame that is set as `post` vs `select`. `post`, which is used by WordPress to insert media into a posts content, has a dropdown filter so you can see just the images or audio: ![Media Modal Example 1](http://i.stack.imgur.com/ktN4W.jpg) If you use `select`, which the more simpler modal that most tutorials use, the dropdown is absent: ![enter image description here](http://i.stack.imgur.com/IqYkA.jpg) I was wondering if there was a way to activate that dropdown filter?


title: How can I add a custom button to the post editor toolbar?

text: I'd like to add a button the the WordPress editor's toolbar. When clicked, I want to open a modal dialog (exactly like what you get when you click the "Paste from Word" icon). This might be more than one question, so the first question I have is what code to I need to add to my theme's functions.php to place the button with a click event that opens a modal window similar to the Word dialog?


title: Fetching review value using wpdb class

text: I'm generating an XML file using PHP for a website where they review tech products. In the XML file, I have to display the rating of products. For rating purposes, I'm using GD Star Rating plugin. I've been experimenting with wpdb class to fetch the rating of each product. However I've not had any luck so far. I'm using the following SQL code on phpmyadmin and I'm able to to fetch the rating for any product review I want               SELECT review FROM tableName_gdsr_data_article WHERE post_id = 4627      But when I try this SQL code in PHP, as seen below, all I get is bunch of errors.               $post_id = $post->ID;     $reviewScore = $wpdb->query(         $wpdb->prepare(          "SELECT review FROM tableName_gdsr_data_article WHERE post_id = '$post_id'"         )     );      Does anyone have any idea why the code above doesn't work? Any help would be much appreciated. Thanks in advance


title: Overwrite default XMLRPC function from plugin

text: I want to overwrite the "metaWeblog.newMediaObject" xmlrpc call so the file is saved remotely. From mw_newMediaObject in class-wp-xmlrpc-server.php, i see that there is a hook:               do_action('xmlrpc_call', 'metaWeblog.newMediaObject');      So I should be able to do something in my plugin like:               add_action ('xmlrpc_call', 'myWewMediaObject');     function myWewMediaObject ($method) {         if ($method=='metaWeblog.newMediaObject') {            //perform some custom action         }     }      However, since the do_action call is at the beginning of the mw_newMediaObject function, I am unsure how to stop the execution after my plugin function exists. Please let me know if I am on the right track and if there is another way to do this.


title: Different style for most recent article

text: I'd like to make my most recent article display a large with a larger thumbnail and with more content, while the rest of the posts in the loop show a small thumbnail and only the title with no content. Is there a way I can do this in one `while(have_posts())` loop?


title: Is there a wordpress listserv or email group plugin?

text: There are plenty of WP plugins for one-way correspondence... ie mailing lists where the owner can send out newsletters, etc. but i am looking to integrate the functionality of a listserv or email group for my WP users, where anyone in the group can address the whole group, but those outside the group cannot. i _could_ do this in google groups, but was hoping to integrate it w/ my club's WP site so that i could use it in conjunction with a membership plugin to keep track of who has paid the club dues and so forth. edit to add: i think that MailPress or especially Email Users might work (Email Users if I adjust the capabilities) but ideally the group would be able to send messages from their emails to a single address (like with google groups) and not have to log in to send a message from the admin. there is no way i am going to be able to teach all of these people how to use WP, so i want the friction to be minimal. is this possible w/ WP?


title: custom image size not being fetched

text: I'm developing a theme for a customer in which i need several versions of the same image. In my functions.php file i've added all the image sizes i need. For instance:               if ( function_exists( 'add_theme_support' ) ) {        add_theme_support( 'post-thumbnails' );      }     if ( function_exists( 'add_image_size' ) ) {         add_image_size('frontpage-post-thumbnail', 192, 192,true );         add_image_size('listing-post-thumbnail', 670, 290,true );         add_image_size('preview-post-thumbnail', 640, 640,true );         add_image_size('preview-onepost-thumbnail', 480, 480,true );         add_image_size('preview-twopost-thumbnail', 240, 240,true );         add_image_size('page-single-thumbnail', 160,9999, false);     }      Now, in my archive.php template, i need the "listing-post-thumbnail" version, but wordpress uses the original image instead. I've checked and the 670x290 version of the image exists in the same folder as the original. Here is the code in archive.php                                   <figure>                             <a href="<?php the_permalink(); ?>" title="Access node: <?php the_title(); ?>">                              <?php echo get_the_post_thumbnail($id, array(670,290)); ?>                             </a>                         </figure>


title: is_home() returns false on the home page! When is the home page NOT the home page?

text: I've placed the following code in my functions.php file               if(!is_home()){ echo "Not Home";}     if(is_home()){ echo "Home";}      However, no matter what page I'm on, I get "Not Home", And I'm real sure I'm on the home page, but still get "Not Home". What am I missing?


title: Building tags and archive using meta from custom post type

text: I have a custom post type, promotions, and it has 2 meta fields to set dates with jQuery date picker, begin date & end date, year, month, day. What I'm trying to do is show a list of months with a header for the year between each grouping, clicking a month would take you to an archive of promotions posts that began in the same year as the heading, clicking the year would be an archive of all the promotions that started in that year. Example:               2012       January       March     2011       December       August       June      I realize an easy way to do this could be to just have a year and month taxonomy for the end date and beginning date but it has been requested, and would be the most user friendly, to only require the user entering data to have to enter the ending date, and begining date of the promotion once. Thanks


title: Is there a plugin that counts posts by author?

text: I want to have a page listing all the authors and the number of posts each of them has published. Is there a plugin that does this already? Being able to count number of comments as well would be a plus. Thanks for the help.


title: Is there a plugin for rating of multiple questions for wordpress?

text: I have developed a site in worpdress. I need to manage a different questions like "How would you rate our customer service", "How satisfied were you with our service" and more questions and rate these questions and have view on the admin. I tried to find the plugin but could not find. Can anyone let me know if that type of plugin exists or do I need to do with my own codes? Thank you in advance


title: Define a name to the posts slug

text: I would like to use the url `http://site.com/post/title-of-the-post` for my posts and I've saw in my admin page I have the current url `http://site.com/%slug%/title-of-the-post` obiouvsly incorrect. How can I define the slug for my default posts? I'm using various custom post types so I would like to name the default posts simply to `post`, is it possible?


title: Get the current hierarchy php page

text: Does exist some way to get the current searched hierarchy php page in `Wordpress`? I've set a default category to my posts named `post` so if I digit `http://site.com/post` which php page is searched in the `hierarchy`? It would be great to get the current page searched.


title: Multiple Queries and Excluding Repeating Posts?

text:
I'm trying to work out how to exclude posts used in the first four custom queries in the last typical query.. haven't been able to find anything that will explain how to do this clearly. My First four loops:               <?php      // Loop 1         $first_query = new WP_Query('category_name=funding&showposts=1'); // select category         $ids = array();          while($first_query->have_posts()) : $first_query->the_post(); ?>                  <?php the_title(); ?>
              <?php endwhile;               // Loop 2         $second_query = new WP_Query(array('post__not_in' => $ids,'category_name' => 'industry','posts_per_page' => 1)); // select category         while($second_query->have_posts()) : $second_query->the_post();         $ids[] = get_the_ID(); ?>                  <?php the_title(); ?>
              <?php endwhile;               // Loop 3         $third_query = new WP_Query(array('post__not_in' => $ids,'category_name' => 'open-consultations','posts_per_page' => 1)); // select category         while($third_query->have_posts()) : $third_query->the_post();         $ids[] = get_the_ID(); ?>                  <?php the_title(); ?>
              <?php endwhile;               // Loop 4         $fourth_query = new WP_Query(array('post__not_in' => $ids,'category_name' => 'policy','posts_per_page' => 1)); // select category         while($fourth_query->have_posts()) : $fourth_query->the_post();         $ids[] = get_the_ID(); ?>                  <?php the_title(); ?>              <?php endwhile; ?>      A typical WordPress query that I want to remove repeating posts from:               <?php if ( have_posts() ) : ?>          <?php /* Start the Loop */ ?>     <?php while ( have_posts() ) : the_post(); ?>          <a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'category-thumb', array('class' => 'alignleft')); } ?>                       <?php the_time('l, F jS, Y') ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
              <?php the_excerpt(); ?>
          <?php endwhile; ?>     <?php wp_pagenavi(); ?>           <?php endif; ?>


title: How to deactivate my plugin upon deactivation of NextGen

text: i'm writing this plugin and i need to deactivate it when NextGen is deactivated:               <?php     /*     Plugin Name: Plugin Name     Description: Description     Version: 1.0     Author: Author     Author URI: Author URI     */          // ini_set( "display_errors", 0);          global $nextgenUrl;     $nextgenUrl = str_replace('/','\\',WP_PLUGIN_DIR.'nextgen-gallery\nggallery.php');          register_deactivation_hook( $nextgenUrl , 'disattiva' );          [... other code ...]          function disattiva(){         deactivate_plugins(__FILE__);     }      but it doesn't work. Any idea? :( I've also used these urls:               $nextgenUrl = 'nextgen-gallery\nggallery.php';     $nextgenUrl = '/nextgen-gallery/nggallery.php';      and still it doesn't work.


title: category__not_in and id values from variable

text: How can I set the values for category__not_in from two variables. On my example I just hardcode the ID of each category to exclude, but... how can I pass these values from some variables ?                   $category_a = get_category_by_slug('fbrt');         $category_b = get_category_by_slug('contact');              $exclude = get_the_ID();         global $wp_query;         $exclude = $wp_query->post->ID;         $args = array(             'category_name' => 'olympic-physique',             'category__not_in' => array(1, 2),             'posts_per_page' => -1,             'orderby' => 'title',              'order' => 'DESC'     );


title: Child theme grabbing wrong location fo parent theme files

text: I purchased a Wordpress theme this week, and to keep my changes separate from the original theme, I created a child theme for it. Right now it's just a barebones child theme, the style.css file and screenshot. The parent theme has several CSS and jQuery scripts that it includes. The problem however is that the child theme looks for these files in the child theme directory, rather than the parent. For example if I am using the parent theme the location would be: ParentTheme/js/jquery.easing.js However in the child theme, it looks for the files here: ChildTheme/js/jquery.easing.js Rather than the parent theme like I would assume. I tried copying the CSS and JS folders, but that didn't work either. Am I doing something wrong? How would I use a child theme for a parent theme that has several CSS and JS files that are needed? You can take a look for yourself here if you would like: http://panther.c1.vadc1.cloudweb.com/~jsfashio/


title: Wordpress - Admin Manage Posts - Multiple Filters by Parent Category

text: Lets say I have the following Categories in Wordpress: Product Category - Cat A - Cat B - Cat C Service Type - Service A - Service B - Service C On the Manage Posts page on the Admin side, I want to have 2 drop down filters for both Product Category, and Service Type, so I can filter by both on the backend. How can I do this?


title: Adding a unique class to wp_nav_menu

text:
How would I go about adding a unique class to the direct child li elements of the main parent ul element generated with wp_nav_menu?

Page1

Sub-Page1-1

Sub-Page1-2

           I'd like to add the class `menu_element` to `li id="menu-item-30"` and every child li of the parent ul after. Is this possible? Thanks in advance!


If I set the permissions to the CSS file in my theme to 444 and then attempt to edit it in the Appearance Editor, WordPress is not prevented from editing the file and in fact change the permissions to 644 while it makes the edit. Why does WordPress change a file's permissions? How do I make the site more secure and prevent this?


title: How to add a second custom menu in my sidebar when theme only supports one?

text: I simply want a second menu in my sidebar to show on all pages. My theme only supports one custom menu though. I am using the first custom menu for the top level nav, and I wanted my 2nd custom menu in the sidebar. I created a second menu and tried adding it using the custom menu widget, however this just adds my first menu, I'm guessing because the theme only supports one menu.


title: Upgrade to Google Analytics for Wordpress 5.0.5 creates warning messages

text: The upgrade to 5.0.5 on my WP installs appears to have added some new features which aren't being checked correctly in the code - you will probably see errors like this one Notice: Undefined index: anonymize_ips in /.../wp-content/plugins/google- analytics-for-wordpress/frontend/class-ga-js.php on line 79 Notice: Undefined index: debug_mode in /.../wp-content/plugins/google- analytics-for-wordpress/frontend/class-ga-js.php on line 114  How do I get rid of these?


title: Randomly Display One Image From a 10-Image For Loop

text: I have a Wordpress function that loops thru 10 input fields & saves the data from those input fields. The data entered is either an absolute or relative link to an image. The loop looks like this.               <?php for ($i = 1; $i < 11; $i++) { ?>              <input type="text" name="<?php echo 'fresh_banner'.$i ?>" value="<?php echo $settings['fresh_banner'.$i]; ?>" />          <?php } ?>      The saving looks like this:               <?php          function freshSaveThemeSettings() {              $settings = get_option( "freshThemeSettings" );                  for ($i = 1; $i < 11; $i++) {                      $settings['fresh_banner'.$i] = $_POST['fresh_banner'.$i];                  }              $updated = update_option( "freshThemeSettings", $settings );          }          ?>      To output one of the images, it goes something like this:               <?php               $settings = get_option( "freshThemeSettings" );               echo $settings['fresh_banner1'];           ?>      What I'm trying to do is randomly display one of the images at a time. Each time the page is refreshed, a new image would be displayed. What is the best way to go about this?


title: Display Content if Meta Checkbox is checked?

text: Basically i have a custom post with a custom metabox, with a checkbox inside it. If you check the box i want something (styled box) to appear within the post loop. If not checked the box doesn't appear... I have the following in my template page..               <?php get_header(); ?>          <?php $loop = new WP_Query( array( 'post_type' => 'books','posts_per_page' => '-1') ); ?>          <?php while (have_posts()) : the_post() ; $meta = get_post_meta( get_the_ID(), 'rw_title_block', true ); ?>          <?php if( checked( $meta, 1, false ) ) : ?>            check box is checked to display stuff like... <?php the_title(); ?>          <?php endif ?>               not checked ignore this stuff...          <?php endwhile; ?>          <?php wp_reset_query() ?>          <?php get_footer(); ?>      The metabox functions code (this seems to display fine in the admin.)               $meta_boxes[] = array(     'id'         => 'test_metabox',     'title'      => 'Test Metabox',     'pages'      => array( 'books', ),     'context'    => 'normal',     'priority'   => 'high',     'show_names' => false,      'fields'     => array(              array(             'name' => 'Test Checkbox',             'desc' => 'field description (optional)',             'id'   => $prefix . 'title_block',             'type' => 'checkbox',         ),          ),     );      Thank you for any help, it would be a life saver. Regards.


title: noheader on the user/frontend side

text: I have an application which has the following structure on the user/frontend side:               usercontroller: generates output     userformhandler: processes user input and redirects back to usercontroller      So, when the user inputs data the following type of URL is called:               http://localhost/wordpress/?page_id=4&ftype=userform&func=edit&noheader=true      In this model, the userformhandler processes the data, saves it and then redirects back to the usercontroller. On the admin side (which calls ftype=adminform) this works fine. On the user side however, I get the following error:               WARNING: CANNOT MODIFY HEADER INFORMATION - HEADERS ALREADY SENT BY      (OUTPUT STARTED AT /VAR/WWW/HTML//WORDPRESS/WP-INCLUDES/L10N.PHP:156)      IN /VAR/WWW/HTML/WORDPRESS/WP-INCLUDES/PLUGGABLE.PHP ON LINE 881      The headers are being sent from the search box of the twentyeleven theme. Some investigation leads me to believe that the noheader parameter is only honored in ./wp-admin/admin.php ... Seeing this, is there any way to do this type of processing on the user side without generating headers, ie: do some processing which does not generate output and redirect back to another controller on the user side? Greetings/Thanks


title: Combo/Drop down box on plugin settings page that allows additional options to be added

text: I'm not sure what this is called and have not had much success searching for it yet. In a plugin settings page, I would like a 'combo box' or 'drop down box' that also includes the ability to add an option that is not currently included. That newly added option would be added to the options in the box from that point on. Is there such a function within the Settings API or does it need a separate text box that is then added to the options array? Or a better way altogether? Thanks :)


title: Allow anonymous comments, but prevent spam

text: 1. Captcha, reCapthca and the like have serious usability issues. And basically anything that requires a user to fill an extra field (other than the comment) each time the user posts a comment, is considered bad usability. ( **NOTE:** I hope you do realize that users need only enter their name and email address once when it comments on a website, unless he clears the cache.) So, plugins like **Better WordPress reCAPTCHA, WP-reCAPTCHA, Spam Free WordPress**, etc. although are extremely good at what they do, are out of the question considering the aforementioned concerns.   2. Plugins like **Bad Behavior, WP-Hashcash Extended** (successor of WP-Hashcash), .htaccess rules for preventing recognized spamming techniques and bots, etc. aren't without false positives. Sometimes, they are known to even block search engine crawlers coming from a new IP address range. Also, depending on JavaScript to basically authenticate comments isn't really a _great way_ , IMO. Just saying. **As I see it, it all boils down toAkismet, Impostercide, and Cookies for Comments anti-spam plugin combo.** _(AntiSpamBee, Defensio, and TypePad AntiSpam, among others, are aimed to be Akismet alternatives. While many don't like Akismet because it's from a company that believes in open source, but isn't free, many of us still acknowledge that it's next to none.)_ **So...**   * What _else_ should I do? (rather, should I be doing something else that's more effective?)   * Has anyone tried ZigTrap? How does it compare to others? (Too many false positives is a moderation/spam queue overhead.) **PS:** I am sure that there's no "best for all" solution. But it will help if you can share what works best for you. **TLDR:** How do I prevent spam on WordPress comments without requiring manual approval or user login/registration?


title: Display the deepest child category from Category X (in loop)

text: I have a number of top-level categories including "News" and "Sport". They each have multiple levels of child categories as shown below.   * **News**     * Australia        * NSW          * Sydney   * **Sports**     * Cycling        * Road Cycling       * BMX     * Triathlon In my loop I want to display a single category - **what ever is the deepest child category of "Sport"**. I have found some code on StackOverflow that does returns the deepest child category, but not from a **specific category**. It returns the the deepest child category from _all_ top-level categories. So if a post is in two categories (Sydney and Triathlon) the code shows Sydney as the deepest child category. I somehow need to specify that which top-level category I want the deepest child to come from. In this case that would be "Sport" and the deepest child cat would therefore be "Triathlon".


title: show most viewed posts of last days by link?

text: I use this link to get most viewed posts:               http://mydomain.com/?post_type=movies&meta_key=post_views_count&orderby=meta_value&order=ASC      But that gives me ALL posts from this post type in order of the most viewed - but I'd like to have only the latest most viewed posts from that custom post type of e.g.. 30 days. How could I handle this? thank you! AD


title: Why is get_post_format() for "Standard" returns empty

text: I've enabled custom posts types               add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) );      The default post type is set on `Standard`, and it works for all but the `Standard` type, when I have a standard post the `get_post_format()` return empty. did I miss something in enabling them?


title: export category and sub-category

text: I'm trying to export a specific category with it's sub-categories. However, Wordpress export option allows either to export all of the categories or to export one specific category at a time. Is there any solution? Thanks.


title: Images uploading to wrong folder

text: Images keep uploading to /uploads/2010/07 instead of /uploads/2011/06. Permissions are set to 777 just to find out if 755 is an issue, and it's not. I don't have anything in Media to define a new path. It just keeps uploading to the oldest folder. This was an XML dump from another WP to the new WP, so I'm not sure if that had anything to do with it, or not. I can see the image files fine and they post in the post editor, they're just going to the oldest folder and it's not autocreating a new one. I'm running the latest wp 3.1.3. I do have a bunch of plug-ins, the image thumbnail regenerator is one, and I've got a bunch of plugins for sidebar widgets, but nothing out of the ordinary.


title: what types of order can I pass to get_posts() via orderby?

text: Here describes get_posts() function. I would like to know what types of order can I pass to `get_posts`? in WP admin, I can see menu order, title, date, random and ...