Sync User to cPanel webmail?

I have a client who's site is built using WordPress. The account is using cPanel with webmail accessible at domain.com/webmail. They have 2 email accounts setup (user1@domain.com and user2@domain.com). I would love to be able have them access their webmail by logging into their WordPress site and clicking a menu link saying "Access Webmail" and then either pulling the cPanel webmail into an iframe, or some other method, but would ideally like to either sync or pre-populate the webmail info with their WordPress user info (email addy and password). I have searched for a plugin but haven't found anything. Anybody ever done this? Where would I begin? Thanks!


Paging in a sidebar mini loop

I switched to another theme and decided to make a widget of some default code I had in there which shows my delicious posts, twitter posts, su posts and youtube vids in a custom loop (excluding these categories from the main loop). But now...the paging no longer works. I have made this widget:               // =============================== EDL Sidebar Posts Widget ======================================     class SidebarPosts extends WP_Widget {          function SidebarPosts() {         parent::WP_Widget(false, $name = 'Sidebar Posts');      }          /** @see WP_Widget::widget */     function widget($args, $instance) {           extract( $args );              $title = apply_filters('widget_title', $instance['title']);         echo $before_widget; if ( $title )         echo $before_title . $title . $after_title;          $title = apply_filters('widget_title', $instance['title']);              global $wp_query;              $wp_query = new WP_Query();         $wp_query->set('cat', '1172,14,867');         $wp_query->set('posts_per_page', 30);         $wp_query->set('offset', $paged*30);           $posts = $wp_query->get_posts();          if ($posts) :              foreach ($posts as $post) : the_post();                 if (in_category(14)) {                      echo $this->createSideBarLine($post, 'http://populair.eu/wp-content/themes/pop/bookmark_info/com/delicious/f.png', false, true, true);                   } elseif (in_category(1172)) {                      echo $this->createSideBarLine($post, '/wp-content/themes/edl/inc/banners/twitter.gif', false, true, true);                  } elseif (in_category(867)) {                      echo $this->createSideBarLine($post, 'http://populair.eu/wp-content/themes/pop/bookmark_info/com/stumbleupon/www/f.png', true, true, true);                 }              endforeach;              echo "
" . _e('More on the Next Page!') . "
";                wp_link_pages(array('next_or_number'=>'next', 'previouspagelink' => ' « ', 'nextpagelink'=>' »'));              else:              echo "
" . _e('Jump to the frontpage for the list') . '
';         endif;               echo $after_widget;     }          /** @see WP_Widget::update */     function update($new_instance, $old_instance) {             return $new_instance;     }          /** @see WP_Widget::form */     function form($instance) {       $title = apply_filters('widget_title', $instance['title']);         ?>
         <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?>          <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
     <?php }          function get_the_content_with_formatting ($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {         $content = get_the_content($more_link_text, $stripteaser, $more_file);         $content = apply_filters('the_content', $content);         $content = str_replace(']]>', ']]>', $content);         return $content;     }          //     // Shows a line in the LifeFeed / IssueFeed / BrainFeed sidebar     // widgets     //     function createSideBarLine($post,$strImage, $boolShowTitle, $boolShowExcerpt, $boolShowContent) {         global $wp_query;              $strBuffer="";         $strTitle = strip_tags(get_the_title());         $strPermalink = get_permalink($post->ID);         $intId = $post->ID;         $strContent = $this->get_the_content_with_formatting();         $strContent = str_replace('
', '', $strContent);         $strEditPostLink = get_edit_post_link();              // if content contains "YouTube" then use YouTube icon         if (strstr($strContent, 'YouTube')) {             $strImage = 'http://populair.eu/wp-content/themes/pop/bookmark_info/com/youtube/www/f.png';         }              $strBuffer.= '
';         $strBuffer.= '
';         $strBuffer.= '';         $strBuffer.= '';         if ($boolShowTitle) {             $strBuffer.= '';             $strBuffer.= $strTitle . "";         }         if ($boolShowExcerpt) {             $strBuffer.= $post->post_excerpt;         }         if ($boolShowContent) {             $strBuffer.= $strContent;         }           if (is_admin()) {             $strBuffer.= '';             $strBuffer.= ' [edit]';         }           $strBuffer.= "

";            return $strBuffer;        }     }      I think the in the previous theme it could pick up the $paged from the main loop or something now it no longer shows any paging so it always only shows the first 30 items. (see http://edward.de.leau.net/ for the thing, busy converting to swift theme)


WordPress wp get nav menu items does not deliver external link

When I read the nav items per wp get nav menu items the get_page_link( $id ) or `$item->url` does not give me the external URL I entered: http://www.mydomain.com. Instead I seem to get http://www.mydoamin.com/wordpress/NameOfMenuItem Any ideas? I'm using permalinks and thought this might be the problem? This is the menu code:               <?php      function bfShowHideMenu($menu_name, $args=array()) {               // Klassen von außen bestückbar     $bfListClass = "no-bullet bfZ1000";     $bfItemClassLevel1 = "";     $bfItemClassLevel2 = "";     $bfLinkClass = "navitem";     $bfContainerClass = "subScrollNavi";          $locations = get_nav_menu_locations();     $menu = wp_get_nav_menu_object( $locations[ $menu_name ] );     $menuitems = wp_get_nav_menu_items( $menu->term_id );          echo '
';          $count = 0;     $submenu = false;          foreach( $menuitems as $item ):         // get page id from using menu item object id         $id = get_post_meta( $item->ID, '_menu_item_object_id', true );         // set up a page object to retrieve page data         $page = get_page( $id );         //$link = get_page_link( $id );         $link = $item->url;              // item does not have a parent so menu_item_parent equals 0 (false)         if ( !$item->menu_item_parent ):                  // save this id for later comparison with sub-menu items             $parent_id = $item->ID;                  // Hat der Knoten Kinder?             $hasChildren = false;             foreach( $menuitems as $child ){                 if ($child->menu_item_parent == $parent_id) {                     $hasChildren = true;                     break;                    }             }             echo '
';                  echo '';                 echo mb_strtoupper($page->post_title);             echo '';              endif;              if ( $parent_id == $item->menu_item_parent ):                  if ( !$submenu ):                       $submenu = true;                      echo '
';                 echo '
';               endif;                  echo '
';             echo '' . mb_strtoupper($page->post_title) . '';             echo '
';                  if ( $menuitems[ $count + 1 ]->menu_item_parent != $parent_id && $submenu ):                      echo '
';                 echo '
';                      $submenu = false;              endif;              endif;              if ( $menuitems[ $count + 1 ]->menu_item_parent != $parent_id ):             echo '
';                  $submenu = false;          endif;              $count++;      endforeach;          echo '
';           }   ?>


Adding graphics to 404.php page

I am trying to customize the 404.php page by adding a graphic. I can figure out how to change the text and links, but the HTML I just don't know well enough to add a picture or graphic. I am using Church Theme from StudioPress. Thanks in advance!


Shortcode in posts called by ajax is not working

I am using ajax to load content of post. Functions like the_title() works fine, but unfortunately the_content() doesn't returns any shordcodes( gallery nor tablepress ) data. here is my code: **functions.php**               function showProd(){        $id_prod = $_POST['id_prod'];        $spec_post = posts_by_tax($id_prod, 'specification', 'products_category', '0', '1', '999');        if($spec_post->have_posts()){            while($spec_post->have_posts()){ $spec_post->the_post();               get_template_part('single', 'specification');            }        }        die();     }     add_action( 'wp_ajax_nopriv_showProd', 'showProd' );     add_action( 'wp_ajax_showProd', 'showProd' );      **single-specification.php**               <?php     $imgs_arr = theme_imgs();     ?>
<?php the_title(); ?>
     <img class="prod_under_top" src="<?php echo $imgs_arr['prod_main_under']; ?>" />     <?php if(has_post_thumbnail()){ ?>
<?php the_post_thumbnail('full'); ?>
     <?php } ?>
     <?php the_content(); ?>

                 <?php                      $posts = new WP_Query(array('post_type' => 'page', 'page_id' => 276));                     while($posts->have_posts()){$posts->the_post();                         the_content();                     }                  ?>

      **javascript:**                   jQuery.ajax({             type: 'POST',             url: pathname,             data: { action: 'showProd', id_prod: id_prod },             success: function(data, textStatus, XMLHttpRequest){                 jQuery('.pcd_wrapp').empty();                 jQuery('.pcd_wrapp').append(data);             },             error: function(XMLHttpRequest, textStatus, errorThrown){                 alert(errorThrown);             }                     });      I was trying to var_dump($post->post_content), but it shows only null. Is it possible, that some core function blocking access or something? Thank you in advance for help **EDIT** posts_by_tax() is function returns wp_query object, pathname - path to admin- ajax.php


Image MetaBox not saving in custom posts

I'm trying to create a meta box that will let me upload image in a custom post. Everything is working almost fine but... It doesn't save any data -.-' I can't figure what I'm doing wrong. Could you please take a look and explain me my mistake? Thank you. This is my post_type: fi_bi_po_ho (yes it's correct)               /*      * Let's add a useful metabox that will help you add images in homepage custom posts      */     /**      * Adds a meta box to the post editing screen      */     function etpub_custom_meta() {         add_meta_box( 'etpub_meta', __( 'Upload your image here', 'etpub-textdomain' ), 'etpub_meta_callback', 'fi_bi_po_ho' );     }     add_action( 'add_meta_boxes', 'etpub_custom_meta' );          /**      * Outputs the content of the meta box      */     function etpub_meta_callback( $post ) {     wp_nonce_field( basename( __FILE__ ), 'etpub_nonce' );     $etpub_stored_meta = get_post_meta( $post->ID );     ?>              <p>             <label for="meta-image" class="etpub-row-title"><?php _e( 'Example File Upload', 'etpub-textdomain' )?></label>             <input type="text" name="meta-image" id="meta-image" value="<?php if ( isset ( $etpub_stored_meta['meta-image'] ) ) echo $etpub_stored_meta['meta-image'][0]; ?>" />             <input type="button" id="meta-image-button" class="button" value="<?php _e( 'Choose or Upload an Image', 'etpub-textdomain' )?>" />         </p>          <?php     }          /**      * Adds the meta box stylesheet when appropriate      */     function etpub_admin_styles(){         global $typenow;         if( $typenow == 'fi_bi_po_ho' ) {             wp_enqueue_style( 'etpub_meta_box_styles', get_template_directory_uri() . '/css/meta.css' );         }     }     add_action( 'admin_print_styles', 'etpub_admin_styles' );     /**      * Loads the image management javascript      */     function etpub_image_enqueue() {         global $typenow;         if( $typenow == 'fi_bi_po_ho' ) {             wp_enqueue_media();                  // Registers and enqueues the required javascript.             wp_register_script( 'meta-box-image', get_template_directory_uri() . '/js/meta.js', array( 'jquery' ) );             wp_localize_script( 'meta-box-image', 'meta_image',                 array(                     'title' => __( 'Choose or Upload an Image', 'etpub-textdomain' ),                     'button' => __( 'Use this image', 'etpub-textdomain' ),                 )             );             wp_enqueue_script( 'meta-box-image' );         }     }     add_action( 'admin_enqueue_scripts', 'etpub_image_enqueue' );          /**      * Saves the custom meta input      */     function etpub_meta_save( $post_id ) {              // Checks save status         $is_autosave = wp_is_post_autosave( $post_id );         $is_revision = wp_is_post_revision( $post_id );         $is_valid_nonce = ( isset( $_POST[ 'etpub_nonce' ] ) && wp_verify_nonce( $_POST[ 'etpub_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';              // Exits script depending on save status         if ( $is_autosave || $is_revision || !$is_valid_nonce ) {             return;         }              // Checks for input and sanitizes/saves if needed         if( isset( $_POST[ 'meta-text' ] ) ) {             update_post_meta( $post_id, 'meta-text', sanitize_text_field( $_POST[ 'meta-text' ] ) );         }         // Checks for input and saves if needed         if( isset( $_POST[ 'meta-image' ] ) ) {             update_post_meta( $post_id, 'meta-image', $_POST[ 'meta-image' ] );         }          }     add_action( 'save_post', 'etpub_meta_save' );


Allow a userclass to save a page as a draft - but not publish w/o admin approval

I want to make a user class that can edit pages, and save them as a draft without being able to publish it. An admin would have to go in and publish the draft once they approve it. The idea is similar to TDO Mini Forms except this will be done within the Wordpress admin panel, not be a form, and they must be a registered user in a specific class to do this. Thanks!


get_users() ORDER BY Not Working

I'm not sure where the problem lies, but the code below just doesn't have the effect of ordering by ID in descending order.               $args['role'] = 'subscriber';     $args['orderby'] = 'ID';     $args['order'] = 'DESC';     $args['fields'] = 'all_with_meta';           $args['meta_query'] = $meta_query; // $meta_query is an array specified someplace above          $my_users = get_users( $args );      I'm aware that by default, Wordpress is sorting by 'login' and in ASC order. Any help here? Thanks in advance!


Multisite: a particular user is getting all new sites associated

When we create a new site, they are always associated with one user in particular. There is nothing special about this one user (to our knowledge). But I can't figure out why that is happening and what settings governs it. I want new sites to have no users associated (only the useradmin user). How can I make this change? Thanks!


W3 Total Cache Minification - Any way to not use php?

I use nginx, php5-fpm and fastcgi_cache. W3TC minification seems good enough, but every include points to "minify.php?". I want to be able to keep my site up even if php and mysql server's goes down - surviving on cached (stale) versions of my pages. Is there any way to not touch php for serving minified assets? I mean its already minified and probably gzipped, why does it need to go through .php? I am missing something? My links look like this:               <link rel="stylesheet" type="text/css" href="http://www.domain.com.br/wp-content/plugins/w3-total-cache/pub/minify.php?file=bZBdjoMwDIQvtE6K9mV7msoEC2hDnI0daG6_odAfrXibGX-yxj5ZXShoIU8zBStaPH019hZHh4LQo_eUytNfdn9AyIAdLy3f36pSSwSXRXmiBInmkRY5yirZM_eewKGn0GGCtY6KdSK2dwTPYjsWfRbgQNBmVQ7QFrhNlYx8WUd1UtkryMBJHXe0Lbpi-R_v9dcWG_KbqzUfMXyb0-GyB2llYtYh0CuBPEJjfszZbFduX0jkMKob0L7UHw.css" media="all" />


How to Batch Upload .docx Files as Posts

I need to upload all the articles from our school newspaper to our website at once. They all need to publish at a specified date at a specified time and all of them have authors (users) and an image associated with them. Doing it one by one takes ages, especially because the server is very slow (and therefor going from page to page takes a while). Is there any way to do them all at once? Or any tips on how to get them done faster?


Post/Page Publish/Update button not clickable once I make an edit

I open a page and make an edit and the update button becomes grayed out. I have to copy all page content, refresh the page and paste it back in the page, only then does the update button become clickable. It does update the page so there is no issue with that. Only when making the initial edit is in not clickable. Update: I was able to recreate the issue, **but not faithfully**. It seems to occur when the page is trying to auto save. It would begin to autosave and then hang. I don't even know where to begin with this one. Has anyone encountered something similar?


How to create a menu super voice in WP?

I am pretty new in WP (I came from Joomla) and I am finding some difficulties to do the following operation in WP Main Menu. If you go on this site you can easy understand what I need: http://www.saranistri.com/saranistriWPnew/ As you can see in this website there is to much main menu voices (and the Main Menu takes up too much space) so I want group some voices as sub voices into a main voices. I want something like this Joomla Main Menu: http://lnx.erusma.org/en/ in which, for example, if you pass the mouse on the Who We Are voice you can say the subvoice. Can I do the same thing in WP? (I do not want to associate the main voice to a specific page to a category, this simply must be not clickable) Tnx Andrea


Error establishing database connection - high traffic?

I have a WordPress 3.5.1 site that's getting a little bit of traffic (80 concurrent visitors, ~5 clicks/pageviews per second). The site runs fine until it spikes to ~85 visitors. There are usually 4 admins logged in at the same time. The site has 8 custom post types--Posts has 3500 posts, and Press Releases (a custom post type) has 13000 posts. All of this is paginated on the site, so there are never more than 20 posts showing on any one page. The only plugins I'm using are wp-pagenavi and w3totalcache. I set WP_DEBUG_LOG to true and logged the errors. The main error I'm getting (besides various notices and warnings unrelated to this issue) is mysql has reached the max_user_connections limit. My current max_user_connections is set to 75. I tried to set it higher, but the cpu can't handle the load (4 Quad Core CPUs at 2.17GHz each and 4GB of RAM). What could be causing so many connections? I've viewed the mysql processes running when the errors happened and there are many connections that say "SLEEPING" or "SLEEP" (probably 15-20). I also noticed via the process logs that httpd is restarting quite often during the peak traffic times. Any ideas on how to resolve the issue? NOTE: Please do not respond if your answer is to check my wp-config.php file and make sure my username, password, and host are correct. This is NOT the issue. The site works fine under normal traffic.


Changing the post date and time with function

What function can be used to update a post's post date and time to the current date & time?


Building a Sub-menu: Display Parent Category/Page's Children When Viewing Children

I would like a sub-menu in which the user visits a page, post, or category (in this example, "info") and is _then_ displayed a list of children categories/pages. Not a dropdown menu, but a menu that appears only when the user is already in the parent category. I need a code which continues to display the _parent's_ children even when on that child page, post, or category. Maybe there is a way to do this with WP menus that I am unaware of? The code needs to be separate from the main menu and be assigned the traditional CSS classes which indicate if the user is on the current page. The code also needs to automatically recognize the children of the parent, as opposed to assigning the children and calling multiple menus throughout the site. I'm positive this is possible because I used to utilize such a code. However, I can't remember what that code was! Below is an illustrated example of what such a menu may look like: ![Classic menu example](http://i.stack.imgur.com/qROiy.png)


duplicate user metadata key values

I've spotted that some of my users have duplicate metadata key values (my only fault because i inserted data directly to the wp_usermeta table!). This query for example               SELECT * FROM  `wp_usermeta` WHERE  `user_id` =2327x LIMIT 0 , 30      returns two rows               meta_id - user_id - meta_key - meta_value     178208 - 23270 - bhaa_runner_status - D     187959 - 23270 - bhaa_runner_status - D      I have a number of users who are effected by this and i'm wondering is there a SQL update or delete i can run to spot this case and delete the larger 'meta_id' row?


Way to add captions to gallery images by code

I am creating posts by using wp_insert_post function. It works fine as I provide values in array required. Sometimes it is required to create a post having gallery. Without any problem, it also works fine. But when there is requirement of adding captions to gallery images, I'm not able to add them programmatically. All captions are stored in an array. Is there a way or hook to add them in gallery by code? Or in other way how to add caption array element beneath each image of gallery?


Automatically delete posts based on query

I'm trying to delete certain posts (of a custom post type) automatically based on a comparison between the current time and a number of hours previous to now, for example 24 hours. The custom post type is appointments, and if an appointment is less than 24 hours in the future, and holds a meta_value of 'available' in the meta_key 'app_status', I want to delete it. The below code is what I'm trying, but it's not working. Posts that I have set with an app_date_start of less than 24 hours from now do not delete. I've tried different hooks to attach it to with no luck as well.               function delete_unclaimed_apps () {         $avail = array(             'post_type' => 'appointment',             'meta_key' => 'app_status',             'meta_value' => 'available',         );         $availapps = get_posts($avail);         $now = (time()-(7*60*60));         $cutoff = (get_field('minimum_reserve_notice', 'options') * 60 * 60);         foreach ($availapps as $post) {             setup_postdata( $post );             $appid = get_the_ID();             if (get_post_meta($appid, 'app_date_start', true)) {                 if (get_post_meta($appid, 'app_date_start', true) < ($now + $cutoff)) {                     wp_delete_post($appid, false);                  }             }             wp_reset_postdata();         }     }     add_action('wp_enqueue_scripts', 'delete_unclaimed_apps');


option_active_plugins filter not working

I added a filter for option_active_plugins to keep most plugins from loading on an admin page. Confirmed to be on the right page and to be returning a properly altered array, but it's having no effect on which plugins are being included on the page. Tried high numbers for filter priority. No effect. Any ideas?


Add a header above blog posts but below page header

How do I add an image to my blog page. I want it to appear under the page header but before the blog posts. It will be a static image (masthead for the blog). This is the address for the page: http://ganleyautoadvisors.com/blog/ I am using the Adada theme. I want the image to be as wide as the content area, the side bar stays. Help!


Cannot select certain authors for posts after import

I just consolidated a couple standalone WordPress installs into one Multi-site install. After importing posts into each site accordingly, I am unable to edit a post or page, and select a different user. There are four users on the site, and I'm only able to select two of the four users as the post author. Any idea why this would be happening? I'm pretty savvy with WordPress, but this one puzzles me. Any Ideas?


Multiple category selection in post, shows less important category in breadcrumb

In my blog I followed a strategy of selecting multiple applicable categories for a post. Suppose an article about _The Last Supper by Leonardo da Vinci_ can have both the categories "Painting" and "Religion", and if the article has a brief profile about Mr. Leonardo da Vinci, then I will also assign another category to the post: "Artists' Profile". (No sub-category, all are parents) But when the concern is of sorting the posts by category, I'd surely gonna sort it by the category "Painting", because to me, _Painting_ is the right category if I want to pose the article in a single category. So I'd love to show the breadcrumb like: > Home  » Painting » The Last Supper by Leonardo da Vinci But with the plugin Breadcrumb NavXT, I can't assign my breadcrumb as my wish. It's just taking the category in ascending order, so the breadcrumb for post shows: > Home » Artists' Profile » The Last Supper by Leonardo da Vinci Because the post takes categories in ascending order as:   * Artists' Profile   * Painting   * Religion So...   How can I be able to let the breadcrumb understand me, or assign a post to a single category only for breadcrumb?


Creating a costing calculator plugin. How can the user create the calculations without coding?

I am relatively new to php & wordpress development. I am trying to create a plugin that allows the user to create an unlimited number of costing calculators. Users will be able to add fields (text, dropdowns etc) & work out how long it would take for the material to be cut, based on the entered thickness of the material, speed of machine entered into the created fields. Each calculator will be displayed by a shortcode. I know how to create the add additional fields bit, & shortcode. When the user has added additional fields, I don't know how the user can then tie the fields to the calculations. How can the user create these calculations without having any coding ability? **UPDATED** My Q: Is it possible for the user to create their own calculations, tying the fields they create together to do this, without coding?


Older/Newer post links display the same posts

I am trying to code my loop so that there are Older posts and Newer posts links below the loop, currently I am using the wp-pagenavi plugin for this but when I click the "previous posts" link, it takes me to /page/2 but it shows the same posts that are on the initial page. I am using a custom page template to display the posts because there are 2 different pages where posts are published depending on the category they are assigned to. I am new to coding Wordpress themes from scratch so if you could help me out with my loop it would be greatly appreciated! This question is different because I have tried solutions on other questions and they have not worked.               <?php query_posts('category_name='.get_the_title().'&post_status=publish,future');?>     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
             <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">

                     <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>

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

<?php the_time('F j, Y') ?>
                                                  <?php echo content(125); ?>

             <?php echo dividerRow(); ?>             <?php endwhile; else: endif; ?>
             <?php wp_pagenavi(); ?>


Delete option doesn't appear for plugins

On the Plugins screen I have options to activate and deactivate plugins, but I no longer have the "Delete" option. I'm relatively sure the option appeared earlier. Also, when I hover over "Plugins" on the admin menu I don't get the usual popup submenu showing "Install New / Add / Editor". And when I click the Plugins menu I don't see those submenu options either. What's gone wrong? FWIW, the client I'm working for is hosted at GoDaddy. ![enter image description here](http://i.stack.imgur.com/g39gN.png)


Displaying a custom field in Category Archives

I am using WordPress 3.5.1 / Twenty Twelve Theme. I would like to display a custom field in my Category Archives. I have the following custom field working in my single.php , it displays a custom url / title               <a href="http://<?php echo get_post_meta($post->ID, "user_submit_url", true); ?>" target="_blank">
<?php the_title(); ?>       I would like to put the following code underneath the "entry-title" in Category Archives. I am confused of were to put the following php code, either in category.php or archive.php? Since I need to put this code inside the loop, I want the code to register on every post just like it registers in the single.php in the example I provided above. Something like the following, I presume?               get_post_meta($post->ID, "user_submit_url", true);      Let me know if I need to clarify anything.


Custom search by several options send on form not works

I am using the Advanced Custom Field Plugin to add custom fields for the users profiles and display a list of users in the frontend of site with Simple User Listing Plugin. I need to filter a list of users by a custom search through some options: city, neighborhood and course university. See an example of how it is being used in this screenshot: See the screenshot of user profile displayed on the frontend I created a form that provides the dropdown fields to allow choice of city, neighborhood and choose one of courses, but filtering does not work. Instead of search a single user, as what is provided by the plugin, I need to display multiple users based on the search terms. My question is: How to pass an array of values to search for users and return to the list? Here's an example of the code that I added to search by the city, the neighborhood and the course, but the search does not work. I do not know much about PHP.               if ($_GET["FormOfSearch"]){ // if search form is submitted          if(isset($_GET["nome_of_city"]))     {       $select_city = $_GET["name_of_city"];     }else{       $select_city = "";     }          if(isset($_GET['name_of_neighborhood']))     {       $select_neighborhood = $_GET['name_of_neighborhood'];     }else{       $select_neighborhood = '';     }          if(isset($_GET['name_of_course'])){       $select_course = $_GET['name_of_course'];     }else{       $select_course = '';     }          $list_of_id  = "SELECT user_id FROM $wpdb->usermeta WHERE (meta_value = '$select_city') AND user_id IN (SELECT user_id FROM $wpdb->usermeta WHERE (meta_value= '$select_neighborhood')) AND user_id IN (SELECT user_id FROM $wpdb->usermeta WHERE (meta_value = '$select_course'))";          // Below, the array provided by plugin, I add the list of ID searched     // Generate the query based on search field      $args2 = array(             'include' => '*' . $list_of_id . '*',             'number' => $number,                 'orderby' => $orderby,             'order' => $order                );


free form wordpress

My question is kind of simple: I have a voucher. I would like to people fill an form on my WordPress site and when they click submit, they receive an e-mail with the voucher... Is there a plugin out there for that? If there is not, how could I accomplish this?


WP Nanoplex 1.0.3 malfunction

I have installed the Nanoplex 1.0.3 theme for Wordpress and the orange content bars begin waaaay off the left side of the page, rendering them usless. They aren't starting at the left margin and bleeding off right as they do in the theme page. Please help. I love this theme. Thanks.


Post Navigation

I have a widget area on my posts category pages and am wondering if there is a way to dynamically add a link to the first post as well as the current post of the category. I think the first post can be hardcoded since it will never change, but the current one will. I wonder what sort of php madness that can do this? I know I know, you are asking why not just use the post navigation that already comes right... Well clients being what they are. Any help is greatly appreciate and will very much aid in my not walking of a cliff.


How do I restore my WordPress that has been hacked?

The website was hacked a week and a half ago. I removed files that were added and removed core WP files that I knew I could replace just to move along the process. Now, I am left with the wp-content and most of the wp-includes folder. However, I am not sure how to get the website back up and running. The website is hosted on GoDaddy, if that helps generate more specific answers. I already uploaded the admin files but not sure where to go from here.


Creating a custom post type - want to add an alert for user

My question is easy but I can't find any answers via Google or Stackexchange. I've created a custom post type and everything's going great so far. I'd like to make it so that when the user is creating a new item, they see a yellow box at the top alerting them of something. How do I do that? Thanks in advance!


Menu item with no page, but with dropdown

I am using 2010 theme menu. Is it possible to have a menu item that has a drop down when hovered, but will not click though to a page/post. Just a dropdown, using the wp_nav_menu.


create a back-end wordpress content submission using custom post type

I have a previously created thread here, but was recommended to make a new one: I need basic help with custom post types. Basically here's my project: I have to create a back-end wordpress gui user input section. The user will enter details about their projects like name, location, what it is, some other details. A page will display the top 9 recent or so in a 3x3 grid. There will be a search bar to search projects for related tags. I need to set it up where only certain user accounts can access this post type to upload projects. I have currently:   * used functions.php to setup my post type and it works   * used simple forms plugin to create forms on the add new page Background: I am a pretty entry level person in wordpress, and slightly overwhelmed right now. But, it's slowly coming together. Any input on structure or anything would be appreciated. Update: I have created the forms, but I need to know what to put in the single-projects.php to display the content from the forms. Thank you so much


How do I reset my footer.php to its original state? (theme: Origami)

I accidentally deleted some codes from my footer.php trying to get rid of the 'Theme By Origami' footer, and now the footer is all messed up. How do i reset it to its original state? I feel so stupid, I should have backed up the text before deleting it, Im so careless.. My website: http://www.agnesphotoandfilm.co.uk/ My theme: Origami please help


Change headline text for post thumbnail meta box

How can I change the headline text for the post thumbnail meta box in the edit post screen?


How do I implement jPanelMenu?

I have serious problems trying to implement jPanelMenu to the theme I'm building. The theme is nearly finished, I'm just trying to figure out this menu and I can finally start using it. Anyways, if anyone can help me understand how I can implement this to my site I'd be grateful :) I think my main problem is that I still haven't grasped how to properly implement jQuery scripts and link them up to a generated element, like the nav-bar in Wordpress. This is what I've done this far:   1. Downloaded jPanelMenu and put it in a js folder.   2. Used this code to implement it in functions:              function jpanelmenu_scripts_with_the_lot()  {           // Register the script like this for a theme:           wp_register_script( 'jpanelmenu', get_template_directory_uri() . '/js/jpanelmenu.js', array( 'jquery', 'jquery-ui-core' ), '20120208', true );         // For either a plugin or a theme, you can then enqueue the script:           wp_enqueue_script( 'jpanelmenu' );       }       add_action( 'wp_enqueue_scripts', 'jpanelmenu_scripts_with_the_lot' );`        3. Then i call the navigation in header.php:              wp_nav_menu( array( 'theme_location' => 'header-menu', 'container_class' => 'menu' ) );      This is where I'm stuck with what I'm supposed to do. I'm doing something wrong, because at this moment i get no results.. Michael


Setting Custom Wordpress "Posts page” AS “Front page"

While I don’t necessarily wish to establish a " **STATIC** " Front page, I **would like** to employ a custom page as BOTH my "Posts page" and my "Front page". I’ve created a PAGE titled "Teaching Kids To…" with a "Page of Posts" type template to serve as my "Posts page." Doing so, facilitates   1. Titling my "Posts page" (or blog page) as something other than " **Home** "   2. Utilization of a custom template (if so desired)   3. Option to add custom fields (if so desired)   4. Option to tweak and monitor the page via Yoast WordPress SEO plugin, for blog specific focus keywords (e.g. "Teaching Kids to"). Trouble is… while I would also like for this page to be my home page (or page_on_front) WordPress complains when I try to select the same page for both "Front page" and "Posts page" under Settings->Reading, **AND** navigation on the front end actually breaks down if I try to simply ignore the WordPress warnings. Surely someone has discovered a suitable work-around?


how to create a fav icon shortcode?

i wonder if there is a good way to create a shortcode that retrives a remote website FAV icon... i found this: ANSWER and tried to create a shortcode using it but failed (since i sux at shortcodes!) A quote from the answer i linked up:               <?php      $url = 'http://example.com/';     $doc = new DOMDocument();     $doc->strictErrorChecking = FALSE;     $doc->loadHTML(file_get_contents($url));     $xml = simplexml_import_dom($doc);     $arr = $xml->xpath('//link[@rel="shortcut icon"]');     echo $arr[0]['href'];     ?>      Any help would be apreaciated ;)


wordpress showing all posts instead of date range

When going to http://craigmdennis.com/articles/ Wordpress uses the index.php template. When you go to http://craigmdennis.com/2010/05/ Wordpress uses the same template (markup below) but shows the same posts. I have tried:   * Disabling all plugins - no change   * Changing the permalinks back to default   * Using an archive.php file. It's obviously something to do with my loop.               <?php get_header(); ?>

                          <?php if ( have_posts() ) : ?>                              <?php query_posts('posts_per_page=10&paged='.$paged); ?>                              <?php while (have_posts()) : the_post(); ?>                                      <article id="<?php the_ID(); ?>" class="post">
                                              <a href="<?php the_permalink(); ?>" rel=bookmark"><?php the_title(); ?>
                                          <?php the_excerpt(); ?>
                              <?php endwhile; ?>                          <?php endif; ?>                          <?php wp_reset_query(); ?>                          <?php posts_nav_link(); ?>
                      <?php get_sidebar(); ?>
          <?php get_footer(); ?>      Can anyone shed some light on what I'm doing wrong?


Is there any way to change the CSS class applied to 2nd level sub menu ul's?

I'm running into a problem trying to style a drop down menu with a second level. Wordpress seems to apply the same .sub-menu class to any and all sub menus, and I can't figure out a reliable, cross-browser way to target the 1st level .sub-menu without also hitting the 2ne level .sub-menu. Example: Example URL: http://getc.thefstopdesign.com/ Look under the Products menu item to see my problem. The Saddles & Accessories item has a sub menu of its own that I want to fly out to the side, but it is getting hit with the first level sub menu CSS. Basic menu code I get from WordPress:

one

two

sub-one

sub-two

sub-sub-one

sub-sub-two

three      Basic drop down CSS I am using:               #main-menu-nav li{         position: relative;     }     #main-menu-nav .sub-menu{         position: absolute;         left: -9999px;     }     #main-menu-nav li:hover .sub-menu{         left: 0;     }      It would be great if the second level menu could just vet a different CSS class, but I can't find a way to do it. EDIT: I figured out my cCSS child selector problem and got everything working OK. It was a unrelated issue, related to an error I had made elsewhere in the CSS< which I won;t bore you with. I also realized a very easy way to add this functionality with jQuery. Something like this:               $('#menu-main-nav > li > ul').addClass("sub-one");     $('#menu-main-nav > li > ul > li > ul').addClass("sub-two");`


Repeatable Custom Field for Media Upload

I am following this topic to add a repeatable custom field for my Custom Post Type, but I cant get it to work for a media upload, Which will allow the author to add multiple image by uploading or choose from media gallery in a single project(my custom post type), my code is just the same so far, I just moved it to my custom post type.


Dynamically creating multiple widgets from Mustache templates

I built a bunch of basic Mustache templates for a project, and now I'm wanting to effectively make them available to WordPress as widgets.               //This uses Composer to manage dependencies (Mustache).     require 'vendor/autoload.php';          $mustaches = array_diff(scandir(dirname(__FILE__) . '/templates'), array('..', '.'));     $templates = array();     foreach ($mustaches as $mustache) {       $code = file_get_contents(dirname(__FILE__) . '/templates/' . $mustache);       $templates[$mustache] = array(         'id' => str_replace('.mustache', '', $mustache),         'template' => $code,         'name' => preg_replace('/\{\{\! name\: \"(.*?)\"\}\}/', '$1' , explode("\n", $code, 1)), //Human name defined in comment at start of template.       );     }      Now what do I do? I can't dynamically define classes like so:               foreach ($mustaches as $mustache) {           class $mustache extends WP_Widget { ...       This gives a syntax error because dynamic extension isn't really a thing anyone does. **How do I register multiple widgets with a single class definition?** Thank you!


Custom Class to wp nav menu

I am trying to edit the default arguments in the wp_nav_menu function. Basically I need to add a custom class to the UL and a custom class to the LI. I have tried to use               <?php     function my_wp_nav_menu_args( $args = '' )     {         $args['menu_class'] = "test";         return $args;     } // function          add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );     ?>      This added a test to the div outside.I tried to edit 'items_wrap' => '%3$s', no luck.


Disable WP notifications for commenting on own posts

How/where can I disable WP email notifications for commenting on own posts? I want to do this globally for all users on the site, not only per-user through WP admin. Are there any hooks which I can use to cancel these emails? Thanks!


How to know what are the style sheets are available in wordpess?

I just like to use jquery-ui Style Sheet but i don't know whether it's pre- installed in WordPress or not b'coz without knowing that i think it will create a problem. what in case it is available in wordpress at that case `wp_register_style()` will become waste because first we have to `wp_deregister_style( $handle )` and then register our script otherwise it may conflict. even if i'm asking a wrong question just give me some idea or resources where i can find available scripts and styles,so that i can easily find out what are the styles and script i need to register and enqueue in my plugin.One more thing i don't have to do useless code like register if it is already available. Thanks


Upgrade to 3.6.1; Cannot change the links in the page anymore

After I upgraded to this version I cannot seem to save the page anymore when there are links in the page to other pages on the website. If I delete the link I am able to save the page. > The connection to the server was reset while the page was loading. > > The site could be temporarily unavailable or too busy. Try again in a few > moments. If you are unable to load any pages, check your computer's network > connection. If your computer or network is protected by a firewall or proxy, > make sure that Firefox is permitted to access the Web.


Trying to apply apply_filters to custom post type content - not working

this is kind of a strange request. I have a plugin that adds a custom post type - then the plugin has some settings where the user can select from any of the posts they created (in that custom post type) to add to another posts content. The code is below - It outputs the custom post content underneath the main posts content as it should, however it doesn't apply the filters - so for instance, if the user puts in a youtube link in to the custom post type content, is shoots out the link rather than apply the filter and embed the video. Any ideas would be much appreciated, been banging my head around this for a while. Thanks!               <?php     global $wpdb;      $options = get_option('wp_optin_studio');     $post_form = $options['post_form_select'];     $post_options = get_post_meta($post_form, 'wp_optin_form_settings', true);          $optin_post = get_post($post_form);     $optin_content = $optin_post->post_content;     $optin_content = apply_filters('the_content', $optin_content);     $optin_content = str_replace(']]>', ']]>', $optin_content);               /* ADD CUSTOM POSTS TO POSTS */     function wp_optin_studio_add_post_forms($content) {         global $options;          global $post_options;         global $post_form;         global $optin_content;              $my_custom_text = $post_options['optin_studio_headline']; // text-html to replace         $my_custom_text .= $optin_content;              if(!is_single()) {             return $content;         }         if(is_single()) {             $content .= $my_custom_text;         }         remove_filter( current_filter(), __FUNCTION__ );              return $content;          }          /* CHECK TO SEE IF USER WANTS CUSTOM POSTS ON THE PAGES/POSTS */     if ($post_form) {         add_filter('the_content', 'wp_optin_studio_add_post_forms');     }          ?>


How to redirect user to a page after form submission

I have three dropdown filters on the front site to select country, territory and region and need to redirect the user to the country/territory/region page depending upon the filter values on click of Submit button. FYI, I have pages with the same slug.eg- example.com/country-name/territory- name/region-name I am trying to use `wp_redirect( $final_url ); exit;` but it is throwing a warning- Warning: Cannot modify header information - headers already sent by (output started at E:\path\to\root-folder\wp-includes\class.wp-styles.php:154) in E:\path\to\root-folder\wp-includes\pluggable.php on line 1121 Please help. Can someone suggest me some some better way? //Edit- here is my code               if(isset($_POST['submit']) and $_POST['action']=='findurl')         {             //Result $POST Array ( [countrySelect] => 1 [territorySelect] => 1 [regionSelect] => 2 )             if (isset($_POST['countrySelect'])){                      $rows_country_url = $wpdb->get_results("select url from country where id=".$_POST['countrySelect']."");             }                  if (isset($_POST['territorySelect'])){                      $rows_territory_url = $wpdb->get_results("select url from territory where id=".$_POST['territorySelect']."");             }                  if (isset($_POST['regionSelect'])){                      $rows_region_url = $wpdb->get_results("select url from region where id=".$_POST['regionSelect']."");             }                       if($rows_country_url[0]->url !=''){             $final_url = home_url('/').$rows_country_url[0]->url;}                  if($rows_territory_url[0]->url !=''){             $final_url = $final_url.'/'.$rows_territory_url[0]->url;}                  if($rows_region_url[0]->url !=''){             $final_url = $final_url.'/'.$rows_region_url[0]->url;}                  echo $final_url;                  if($final_url!=''){              wp_redirect( home_url() ); exit;             echo "not blank";             }else{ echo "Please select values";}         }


How Do I Remove Comment Date and/or Comment Date Link

Found this code in the WP Codex but not sure how to use it to remove the hyperlink and/or date from comments.               delete_comment_meta( $comment_id, $meta_key, $meta_value );


Correct method of redirecting user login

The popular membership plugin 's2Member' uses the wp_login action hook to wp_redirect a logged in user to where s2 deems appropriate. This causes a conflict with other plugins, in that other plugins may rely on the WP_User object being returned from the wp_signon function, which will not happen if the user is redirected by the wp_login hook. **What is the correct way to redirect a newly logged in user? I would assume the filter login_redirect, no?** The problem with that is that s2Member uses remove_all_filters on that very same filter... Please keep in mind that while this may seem like a plugin-specific question, my real question is in bold, and applies to WP in general.


How to oEmbed from custom field, responsive to container size and responsive

I am using Magic Fields 2 to add custom fields/meta boxes. One custom field is for a Vimeo or YouTube video URL to be displayed. The following code oEmbeds the video URL:               <?php if (!((get_post_meta($post->ID, 'video_url', TRUE))=='')) {         echo wp_oembed_get( get_post_meta($post->ID, "video_url", true) );     }?>      To resize the video, I have used added the code inside `<div class="video">` and resized it using CSS - `.video iframe {width:500px;height:312px}`. The problem, this method is not responsive. I have also tried `.video iframe {width:95%;height:95%}`. This outputs looks like - ![enter image description here](http://i.stack.imgur.com/1wZUJ.png) The Fluid Video Embeds plugin seems to do the job for oEmbeds through the normal WordPress method and through shortcode, but not with using a custom field.


Single Post Template with Dropdown Option?

I'd like users of my theme to be able to select a single post template via a dropdown menu on the post screen. I know of a plugin that achieves this but I would like to be able to achieve the same thing without the plugin. Anybody have a solution?


Undefined offset: 2

I'm using this function I found from this answer here about showing prev/next navigation for a current page               <?php     $pagelist = get_pages("child_of=".$post->post_parent."&parent=".$post->post_parent."&sort_column=menu_order&sort_order=asc");     $pages = array();     foreach ($pagelist as $page) {        $pages[] += $page->ID;     }          $current = array_search($post->ID, $pages);     $prevID = $pages[$current-1];     $nextID = $pages[$current+1];     ?>      and I get an Undefined offset: 2 error with wp-debug set to true. Could anyone help please- sorry I am a bit of a beginner with some of this, but I think it refers to the last 2 lines with $prevID and $nextID. Thanks


How to filter multiple queries with search?

My theme has two columns, each column has it's own query. When I do a search on my theme, it only filters the main query and not my secondary query that is on my second column. How do I do that?


Pagination for normal (standard) posts on a page with a custom loop?

probably a rather straight forward question. my "homepage" is not the blog-page. I have a `page-template` named `page- knowledge.php` which has the following loop on it.               <?php             echo '
';                  $args = array(                 'post_type' => 'post',                 'posts_per_page' => 5,             );                  $loop = new WP_Query( $args );             while ( $loop->have_posts() ) : $loop->the_post();                 global $post;                 get_template_part( 'inc/post', 'item' );             endwhile;                  wp_reset_postdata();             echo '
';         ?>      So, this page queries `5` of the normal posts. How can I add a pagination to this page so I can jump through the rest of the posts just like you would expect it. * * * **UPDATE**               <?php             echo '
';                  $args = array(                 'post_type' => 'post',                 'posts_per_page' => 5,             );                  $loop = new WP_Query( $args );             while ( $loop->have_posts() ) : $loop->the_post();                 global $post;                 get_template_part( 'inc/post', 'item' );             endwhile;                  wp_reset_postdata();             echo '
';         ?>
             <?php                  $endsize = $midsize = 1;                 $type = 'plain';                 $loop->query_vars['paged'] > 1 ? $current = $loop->query_vars['paged'] : $current = 1;                      // Sanitize input argument values                 if ( ! in_array( $type, array( 'plain', 'list', 'array' ) ) ) $type = 'plain';                 $endsize = (int) $endsize;                 $midsize = (int) $midsize;                      // Setup argument array for paginate_links()                 $pagination = array(                     'base'          => @add_query_arg('paged','%#%'),                     'total'         => $loop->max_num_pages,                     'current'       => $current,                     'show_all'      => false,                     'end_size'      => $endsize,                     'mid_size'      => $midsize,                     'type'          => $type,                     'prev_next'     => false,                     'paged'         => $loop->query_vars['paged']                 );                      echo paginate_links( $pagination );             ?>


Relative number of post in category

For a post x in a category y, how can the following output be achieved:   * Post x is the `n`th out of `m` posts in the category y. where `m` is the total number of posts in the category, and `n` is the number of the current post (ordered by publishing date).


Change the "main site" on a wordpress multisite installation

I'm trying to install the Wordpress installer so I can import a lot of data from my local development machine onto a site.               WordPress       This importer is not installed. Please install importers from the main site.      Unfortunately site 1 no longer has a proper vhost as it's been discontinued a while ago. I've tried setting site 1 to non-public in the network admin, and changing these wp-config settings:               define('SITE_ID_CURRENT_SITE', 3);     define('BLOG_ID_CURRENT_SITE', 3);      So far this still tries to direct me to the defunct web address. Any other database settings or config settings I can change to move the "main site" to a different number?


Is priming a Transient Cache possible?

I'm currently using Wordpress Transient Caching when querying images I've uploaded and tagged. Using Transient Caching has really sped up these queries once they are cached, but unfortunately, once the cached query expires it is only cached again when someone loads that page. Is it possible to preload/prime transient caches so users don't get stuck with that responsibility and long wait time? If not, should I be using something else to cache that does have that ability? Thank you in advance for any advice


Limit the_excerpt in the first point (.) of the sentence

I would like to filter the function `the_excerpt` to stop to find the first endpoint. Ex: "This is the article summary which ends at the endpoint with a full-stop." Any idea is welcome.


3.5 media manager add CSS / JS to new 'tab' iframe content

Whilst (patiently) waiting for proper documentation and/or a few tutorials on the new media uploader I'm still using the `media_upload_tabs`filter to add a tab to the uploader. Here's my (working) code:               <?php          add_filter( 'media_upload_tabs', 'olab_add_media_tab' );     function olab_add_media_tab( $tabs ) {         $tabs['bildarkiv'] = __( 'Bildarkiv', 'bildarkiv' );         return $tabs;     }          add_action( 'media_upload_bildarkiv', 'olab_tab_content' );     function olab_tab_content() {       ?>
WOOT!
       <?php     }          add_action( 'print_media_templates', 'obab_enqueue_admin_stuff' );     function obab_enqueue_admin_stuff() {       wp_register_style( 'bak-css', plugins_url( 'css/main.css', __FILE__ ) );       wp_enqueue_style( 'bak-css' );       wp_enqueue_script( 'bak-js', plugins_url( 'js/app.js', __FILE__ ), 'jquery' );     }      This all works, but the content of the tab is enclosed in an iFrame which means that my enqueued scripts + styles do precisely nothing! I don't mind the iFrame I suppose, but I can't find a way to attach CSS / JS to the `<head>` of the iFrame. Any inline JS is stripped out when the iFrame is rendered. Anyone know about this?


Change Twenty twelve theme background color

I use the twenty twelve theme and I would like to change the background color manually by modifying the right files in the `plugins` folder. However, I can not find what to change in the style.css file. I even tried to modify the background color through the Wordpress interface to #e50000. After that, I looked for a line containing e50000 in my wordpress directory, but there seems to be none. I can't figure out which line to change in my wordpress directory to change the background color.


Category / Custom Post Type permalink issue

So I'm currently working on a client site and trying to switch some old posts over to use new custom post types. Prior to this point, her website was set up in such a way that she could add both books with chapters as well as uncategorized advice columns to her site. In order to add either of these items, she would add a new post, and stick them in a specific category. If she wanted the post to show up as a chapter in her book, she filed it under the correct subcategory of the "books" category. If she wanted the post to show up in her advice columns, she would add it to the "advice" category. Permalinks for this site were set up in such a way that when reading an individual chapter of a book, it would look like so "/books/ _the-book/the- chapter_ " Now, I'm trying to recombobulate her set up a bit. Instead of simply adding a new post and categorizing it to achieve this effect, I split out the two different areas into their own custom post types (called _chapter_ and _column_ ). When setting up the new custom post type, I'm trying to set up the rewrite argument to use the same permalink that was used previously, however it appears that even after deleting the category, the permalink is still reserved by the category. What I mean is I receive 404's when trying to access "/books/the-book/the-chapter", but if I change the rewrite to use "chapter", or another base, it works. Mainly I'm wondering if there's a way to fix this, and what could be causing this. It has to do with the fact that the category still existed when the CPT was initially added, but I can't quite nail it down. Here's the website where you can see it in action: http://dev1.abileneloving.com Here's my code for the CPT/Custom Tax/Custom Permalink Structure:               function chapter_post_type_init() {             $labels = array(                     'name' => 'Chapters',                     'singular_name' => 'Chapter',                     'add_new' => 'Add New',                     'add_new_item' => 'Add New Chapter',                     'edit_item' => 'Edit Chapter',                     'new_item' => 'New Chapter',                     'all_items' => 'All Chapters',                     'view_item' => 'View Chapter',                     'search_items' => 'Search Chapters',                     'not_found' =>  'No chapters found',                     'not_found_in_trash' => 'No chapters found in Trash',                     'parent_item_colon' => '',                     'menu_name' => 'Books'             );                  $args = array(                     'labels' => $labels,                     'public' => true,                     'publicly_queryable' => true,                     'show_ui' => true,                     'show_in_menu' => true,                     'query_var' => true,                     'rewrite' => array( 'slug' => 'books/%book_type%'),                     'capability_type' => 'post',                     'has_archive' => true,                     'hierarchical' => false,                     'menu_position' => 100,                     'supports' => array( 'title', 'editor', 'author', 'excerpt')             );             register_post_type( 'chapter', $args );     }     add_action( 'init', 'chapter_post_type_init' );          function book_tax_init() {             $labels = array(                     'name'              => _x( 'Books', 'taxonomy general name' ),                     'singular_name'     => _x( 'Book', 'taxonomy singular name' ),                     'search_items'      => __( 'Search Books' ),                     'all_items'         => __( 'All Books' ),                     'edit_item'         => __( 'Edit Book' ),                     'update_item'       => __( 'Update Book' ),                     'add_new_item'      => __( 'Add New Book' ),                     'new_item_name'     => __( 'New Book Name' ),                     'menu_name'         => __( 'Books' ),             );                  $args = array(                     'hierarchical'      => true,                     'labels'            => $labels,                     'show_ui'           => true,                     'show_admin_column' => true,                     'query_var'         => true,                     'rewrite' => array( 'slug' => 'books/%book_type%')             );             register_taxonomy(                     'book',                     'chapter',                     $args             );     }          add_action( 'init', 'book_tax_init' );          add_filter('post_type_link', 'book_permalink_structure', 10, 4);     function book_permalink_structure($post_link, $post, $leavename, $sample)     {         if ( false !== strpos( $post_link, '%book_type%' ) ) {             $book_type_term = wp_get_object_terms( $post->ID, 'book' );             $post_link = str_replace( '%book_type%', array_pop( $book_type_term )->slug, $post_link );         }         return $post_link;     }      **Update - New Code**               function chapter_post_type_init() {             $labels = array(                     'name' => 'Chapters',                     'singular_name' => 'Chapter',                     'add_new' => 'Add New',                     'add_new_item' => 'Add New Chapter',                     'edit_item' => 'Edit Chapter',                     'new_item' => 'New Chapter',                     'all_items' => 'All Chapters',                     'view_item' => 'View Chapter',                     'search_items' => 'Search Chapters',                     'not_found' =>  'No chapters found',                     'not_found_in_trash' => 'No chapters found in Trash',                     'parent_item_colon' => '',                     'menu_name' => 'Books'             );                  $args = array(                     'labels' => $labels,                     'public' => true,                     'publicly_queryable' => true,                     'show_ui' => true,                     'show_in_menu' => true,                     'query_var' => true,                     'rewrite' => array( 'slug' => 'books/%book%'),                     'capability_type' => 'post',                     'has_archive' => true,                     'hierarchical' => false,                     'menu_position' => 100,                     'supports' => array( 'title', 'editor', 'author', 'excerpt')             );             register_post_type( 'chapter', $args );     }     add_action( 'init', 'chapter_post_type_init' );          function book_tax_init() {             $labels = array(                     'name'              => _x( 'Books', 'taxonomy general name' ),                     'singular_name'     => _x( 'Book', 'taxonomy singular name' ),                     'search_items'      => __( 'Search Books' ),                     'all_items'         => __( 'All Books' ),                     'edit_item'         => __( 'Edit Book' ),                     'update_item'       => __( 'Update Book' ),                     'add_new_item'      => __( 'Add New Book' ),                     'new_item_name'     => __( 'New Book Name' ),                     'menu_name'         => __( 'Books' ),             );                  $args = array(                     'hierarchical'      => true,                     'labels'            => $labels,                     'show_ui'           => true,                     'show_admin_column' => true,                     'query_var'         => true,                     'rewrite' => array( 'slug' => 'books')             );             register_taxonomy(                     'book',                     'chapter',                     $args             );     }          add_action( 'init', 'book_tax_init' );          add_filter('post_type_link', 'book_permalink_structure', 10, 4);     function book_permalink_structure($post_link, $post, $leavename, $sample)     {         if ( false !== strpos( $post_link, '%book%' ) ) {             $book_type_term = wp_get_object_terms( $post->ID, 'book' );             $post_link = str_replace( '%book%', array_pop( $book_type_term )->slug, $post_link );         }         return $post_link;     }


Remove submenu item from list

I have the following script within my `functions.php` file to avoid certain users from modifying things they shouldn't and would like to remove one more item, the _Appearances > Themes_ submenu.               function remove_menus () {     global $menu;         $restricted = array(__('Dashboard'), __('Posts'), __('Pages'), __('Comments'), __('Plugins'), __('Users'), __('Tools'), __('Links'), __('Settings'));         end ($menu);         while (prev($menu)){             $value = explode(' ',$menu[key($menu)][0]);             if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}         }     }     add_action('admin_menu', 'remove_menus');      How would I be able to achieve this?


Use Editorial Calendar on any other page within any other plugin

I want to show Editorial Calendar on my custom plugin's page, so how to do that? Plugin available on http://wordpress.org/support/plugin/editorial-calendar Now I tried to include edcal.php (plugin page) but its showing me `Cannot redeclare class EdCal in` due to two time declaration of that class, so now hot to display same plugin page on my page? I tried `include( plugin_dir_path( __FILE__ ). 'edcal.php');`


Work with xml file and Wordpress

by a URL that generate an XML page, example: http://thegamesdb.net/api/GetGame.php?id=2 how can import it in Wordpress site with mapped request custom field? thanks Stew


Custom post types, taxonomies, and permalinks

This is driving me nuts and I'm sure it's simple but nothing I search for comes up with a simple structure (everything is very complex). I have a custom post type "product_listing" and a custom taxonomy of "product_cat" (which is hierarchical and should be have like categories). I simply want my URLs to look like this:               mysite.com/products/category1/product-name1      mysite.com/products/category2/product-name2      But for the life of me, no matter what I do, I'm getting the dreaded 404 issue. Pages work okay, and Posts work okay, but my custom posts don't work correctly. They're showing up as:               mysite.com/products/product-name1     mysite.com/products/product-name2      Which actually _works_! It's just that I want to see my custom taxonomy in there, PLUS, I want to be able to access the taxonomy.php template I have setup by going to:               mysite.com/products/category1/     mysite.com/products/category2/      None of my slugs are the same, nor do I want them to be. Here is the post type and taxonomy part of my functions.php file:               ///// CUSTOM POST TYPES /////               // register the new post type         register_post_type( 'product_listing',             array( 'labels' => array(                 'name' => __( 'Products' ),                 'singular_name' => __( 'Product' ),                 'add_new' => __( 'Add New' ),                 'add_new_item' => __( 'Create New Product' ),                 'edit' => __( 'Edit' ),                 'edit_item' => __( 'Edit Product' ),                 'new_item' => __( 'New Product' ),                 'view' => __( 'View Products' ),                 'view_item' => __( 'View Product' ),                 'search_items' => __( 'Search Products' ),                 'not_found' => __( 'No products found' ),                 'not_found_in_trash' => __( 'No products found in trash' ),                 'parent' => __( 'Parent Product' ),                 ),                 'description' => __( 'This is where you can create new products on your site.' ),                 'public' => true,                 'show_ui' => true,                 'capability_type' => 'post',                 'publicly_queryable' => true,                 'exclude_from_search' => false,                 'menu_position' => 2,                 'menu_icon' => get_stylesheet_directory_uri() . '/images/tag_orange.png',                 'hierarchical' => true,               '_builtin' => false, // It's a custom post type, not built in!                 'rewrite' => array( 'slug' => 'products', 'with_front' => true ),                 'query_var' => true,                 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ),                 )     );                    //hook into the init action and call create_book_taxonomies when it fires     add_action( 'init', 'create_product_taxonomies', 0 );     //add_action('admin_init', 'flush_rewrite_rules');          //create two taxonomies, genres and writers for the post type "book"     function create_product_taxonomies()      {       // Add new taxonomy, make it hierarchical (like categories)       $labels = array(         'name' => _x( 'Categories', 'taxonomy general name' ),         'singular_name' => _x( 'Category', 'taxonomy singular name' ),         'search_items' =>  __( 'Search Categories' ),         'all_items' => __( 'All Categories' ),         'parent_item' => __( 'Parent Categories' ),         'parent_item_colon' => __( 'Parent Categories:' ),         'edit_item' => __( 'Edit Category' ),          'update_item' => __( 'Update Category' ),         'add_new_item' => __( 'Add New Category' ),         'new_item_name' => __( 'New Category Name' ),         'menu_name' => __( 'Category' ),       );                register_taxonomy('product_cat',array('product_listing'), array(         'hierarchical' => true,         'labels' => $labels,         'show_ui' => true,         'query_var' => true,         //'rewrite' => true,         'rewrite' => array( 'slug' => '%category%', 'with_front' => true ),       ));            // Add new taxonomy, NOT hierarchical (like tags)       $labels = array(         'name' => _x( 'Scents', 'taxonomy general name' ),         'singular_name' => _x( 'Scent', 'taxonomy singular name' ),         'search_items' =>  __( 'Search Scents' ),         'popular_items' => __( 'Popular Scents' ),         'all_items' => __( 'All Scents' ),         'parent_item' => null,         'parent_item_colon' => null,         'edit_item' => __( 'Edit Scent' ),          'update_item' => __( 'Update Scent' ),         'add_new_item' => __( 'Add New Scent' ),         'new_item_name' => __( 'New Scent Name' ),         'separate_items_with_commas' => __( 'Separate scents with commas' ),         'add_or_remove_items' => __( 'Add or remove scents' ),         'choose_from_most_used' => __( 'Choose from the most used scents' ),         'menu_name' => __( 'Scents' ),       );             register_taxonomy('scent','product_listing',array(         'hierarchical' => false,         'labels' => $labels,         'show_ui' => true,         'query_var' => true,         //'rewrite' => array( 'slug' => 'scents' ),       ));     }      I also have another custom taxonomy of "scents" that I'd ideally like to have some kind of friendly url but I'm more open on this. I'd like to maybe access a list of all scents by going to **mysite.com/products/scents** but they don't have to be category specific. Can anybody help me? I've been going crosseyed for hours. Thanks!


Custom taxonomy category slug not being included in permalink

I'm having difficulty implementing a permalink scheme with a custom post type ('widget') and its taxonomy ('widgetscategory'). Visually, this is the permalink structure that I am after:               /widgets/ (a page handled by the page-widgets.php template)     /widgets/red/ (a category view handled by the taxonomy-widgetscategory.php template)     /widgets/red/acme-widget-5000/ (a post handled by the single-widgets.php template)      However, with my current code, if I put create a new widget custom post, and give it the widgetscategory of 'red', Wordpress will generate a permalink as follows:               /widgets/%widgetscategory%/acme-widget-5000/      This obviously does not work, because of the %widgetscategory%. If I adjust the URL manually to be:               /widgets/red/acme-widget-5000/      then everything works as expected. **How can I get the %widgetscategory% to be replaced by the actual category in the permalinks that Wordpress generates?** I assume I am missing something with the 'rewrite' parameter of the register_post_type function, but I can't seem to fix it! Here is the code I am using to set up the custom post type and taxonomy:               add_action( 'init', 'custom_post_widget_product' );          //Set up widget Post Type     function custom_post_widget_product() {              register_post_type('widgets', array(             'label' => __('widgets'),             'singular_label' => __('widget'),             'public' => true,             'show_ui' => true,             'hierarchical' => true,             'rewrite' => array( 'slug' => 'widgets/%widgetscategory%' ),             'publicly_queryable' => true,             'query_var' => true,             'has_archive' => true,             'with_front' => false,             'supports' => array('title','editor','thumbnail','excerpt'),             'taxonomies' => array('widgetscategory'),         ) );          //Set up widget Categories         register_taxonomy('widgetscategory', 'widgets', array(             'hierarchical' => true,             'label' => 'widget Categories',             'singular_label' => 'widget Category',             'rewrite' => array( 'slug' => 'widgets' ),         ) );          }      Thank you!


Custom Permalinks for Custom Taxonomies/Post Types -> Top Level Pages not working

I have created a custom post type called "artists". These are categorized by the custom taxonomy "style". I do have this: > ./photography/edward-example (single page with details) > > ./photography/ (archive page which lists all artists in "category"/custom > taxonomy "style" "photography") (for example: photography as style, Edward Example as artist) I achieved this because I used the technique described in this answer for the custom taxonomy. The problem is, now my other pages (e.g. "./about") will not work. Can anybody help me out?


Change Permalink Structure for Custom Taxonomy

I have a custom taxonomy called `colors`, which contains the terms _Red_ , _Blue_ , _Yellow_ etc. Each post has a term of the taxonomy colors linked to it. The default permalink structure for posts is `/%category%/%post-name%/` i.e. posts are displayed at - `www.example.com/category-term/post-name` I want to change the permalink structure such that the posts are displayed at `www.example.com/taxonomy-term/post-name` i.e. `www.example.com/yellow/post- name` \- for a post that has the term _Yellow_ of the custom taxonomy linked to it. Please suggest any method to do this..?


Custom Post Type - Rewrite slug

I have a custom post type (products) that I would like to change the slug for. I have a main product page that shows all product categories. After clicking on the category, it shows all products in that category. When clicking on one of the products it should take you to the custom post type product. The problem is that I want the url to be www.example.com/products/{category}/{product}, but from the custom post type, the url I get is www.example.com/products/{product}. When I registered the custom post type, I set rewrite to               'rewrite' => array('slug' => 'products', 'with_front' => false),      How can I fix this to include whatever category the post type is in?


wordpress content .php file in an iframe's src in a wordpress post

I'm stuck with the following issue : I would like to insert an iframe with a wordpress content inside a wordpress post. I explain myself. I have two things : a post and a presentation. In the the_content() wordpress fitler, I add my iframe to the $content. This iframe has a src pointing to a custom .php file, and inside this .php I want to have access to my loop but I can not manage to do it. So I cheat and pass the ID of the post through the URL so my iframe code is :               <iframe src=\"".WP_PLUGIN_URL."/presentation/embedded_presentation_iframe.php?postid=". get_the_ID() ."\" id=\"embedded-frame-presentation\"      And inside my .php I use this :               $postid = $_GET["postid"];     ...     echo do_shortcode( get_post_meta($postid, 'awp_slides', true) );       The issue now is that I have some plugins adding some possible shortcodes and my shortcodes are transformed into plugins syntaxes, but since my .php file is outside the wordpress loop, the transformed shortcodes are not applied in my iframe... So I think I have two ways for solving that but I don't know how to do both :   1. I try to put my .php file (which is the src of iframe) into the loop of wordpress, I don't know how so my $content is process and the plugins are applied to my iframe   2. Or maybe a function exist in wordpress which would be my $content but already processed so instead of using `do_shortcode( get_post_meta($postid, 'awp_slides', true) );` I could use something like apply_plugins(do_shortcode( get_post_meta($postid, 'awp_slides', true) ))  Thanks for your help ! I'm really stuck here :) I hope you will understand me...


Default calendar widget not showing up

I just started learning how to make custom websites with this (unfortunately) most popular CMS, and I am having a small issue. I widgetized some areas of my website, and some widgets (I tested 3, text, menu and categories) show up normally, but when I put the calendar widget there (the one that comes with wordpress) it just doesn't show up. What do you think can be the problem? Thanks


jQuery to work on WP custom page template

I have a simple jQuery script to enable an image mouseover hover effect that I want to use on my WP custom page template but it isn't yet working for me and I assume it is not linking to jQuery. The hover image does not display. Here is part of the page template code (theme=Twenty_Eleven)               <?php     /**      * Template Name: rpdcustompagetemplateportfolio      *      * @package WordPress      * @subpackage Twenty_Eleven      * @since Twenty Eleven 1.0      */          get_header(); ?>

                     <img src="<?php bloginfo('template_directory'); ?>/images/logobutton50pc.png" alt="My button" class="logobutton" />
Portfolio
      I always get some problem using jQuery & WordPress unfortunately! I assume this is the problem that jQuery not linked/working here. I am most grateful for help & advice, and look forward to replies, many thanks (NB for some reason I cannot cut/paste the code in properly here either..apologies)


admin edit member profile on front-end

I've seen that nobody answered to this question: Let admin users edit member profiles from front end Is there a way to allow Admin editing members/users profile on front-end? Thank you.


Programmatically add posts from specific category to menu

I am wanting to add individual posts to my primary menu programatically based on category I have used the wp_nav_menu_items filter previously to add pages to the menu but I am stuck when it comes to adding posts.               add_filter( 'wp_nav_menu_items', 'fx_user_menu', 10, 2 );          function fx_user_menu( $items, $args ) {         if ($args->theme_location == 'primary') {             $myposts = get posts from specified category                 foreach ( $myposts as $post ) {                 $items .= '
' . the_title() . '
';                 }         }            return $items;     }      Any ideas on how to get this working?


Programatically retreive page content from its template page

I am building a menu and representing it to the front-end in Accordion style using the foundation front-end framework. The Wordpress admin drags and drops menu items (pages, posts, custom posts, categories, whatever) into the menu from Appearance -> Menus as normal. My code loops through every menu item in the menu and displays it along with its content. For example, if the loop encounters an **about page** in the menu, it displays **About** as a list item label (clickable) and its content (hidden) beneath it. Site visitors clicks on About to reveal the about page content in accordion fashion. What is the best approach to get this done? I mean the loop and content retrieval. I made an attempt as of the code below.               About       about page content (text/ starts as hidden)     Contact        contact page content (text/ starts as hidden)     Solutions        HEALTHCARE (label)         Healthcare solution 1 (link)         Healthcare solution 2 (link)       PROFESSIONAL SERVICES (label)         Prof service 1 (link)         prof service 2 (link)      I wrote the following code and I partially succeeded:               <?php        $menu_name = 'primary';            if( ($locations = get_nav_menu_locations()) && isset($locations[$menu_name]) ) {         $menu = wp_get_nav_menu_object( $locations[$menu_name] );         $menu_items = wp_get_nav_menu_items($menu->term_id);     ?>
            <?php foreach( (array) $menu_items as $key => $menu_item ) { ?>         <?php if ($menu_item->object == 'page'): ?>           <?php             $id = get_post_meta($menu_item->ID, '_menu_item_object_id', true);              $page = get_page($id);             //$template_name = get_post_meta($id, '_wp_page_template', true);?>
            <a href="#panel<?php echo $menu_item->ID;?>"><?php echo $menu_item->title; ?>             <div id="panel<?php echo $menu_item->ID;?>" class="content">           <?php                  if($page->post_title == 'Contact'): /* DIRTY:PROBLEM IS HERE */                    get_template_part('contact'); /* NOT GOOD, very had coded */                 else: echo apply_filters('the_content', $page->post_content); endif; /* I LIKE THIS MORE */?>

        <?php elseif($menu_item->object == 'solutions_category'): /* CUSTOM POST TYPE */?>        <?php /* REST OF THE CODE ... */ ?>        <?php endif;?>      <?php } ?>
          It works fine that way, but the problem lies in the 'Contact' page because it only uses a template page for its content (the page text editor is empty). As you can see I am explicitly checking if post_title is Content in order to use get_template_part. This is definitely bad and not desired. Is there a generic solution capable of retrieving page content despite if content is from template, settings page or the text editor itself? Thanks in advance.


Rich Snippets for Wordpress

Rich Snippets look like a good tool for the webmaster's toolbox. Do you know of any way of integrating Rich Snippets into Wordpress?


Using php inside javascript

I have got the following code in a javascript(jquery) file called custom.js:                    var gapinvite = new Date();                   gapinvite = new Date(2014, 06 - 1, 2);         $('.days').countdown({             until: gapinvite,             layout: '{dn} {dl}',                  /* Set your timezone */             timezone: +7         });      1.Now i want a user to be able to change the above date. I have created a theme options page called theme-options.php 2.I am using `<?php require_once('theme-options.php'); ?>` in the functions.php to link to theme-options.php. 3.This is theme-options.php:               <?php     add_action('admin_menu', 'director_create_menu');     function director_create_menu() {     add_submenu_page( 'themes.php', ' Theme Options',     'Theme Options', 'administrator', __FILE__,     'director_settings_page');     add_action( 'admin_init', 'director_register_settings' );     }     function director_register_settings() {     register_setting( 'director-settings-group', 'director_date' );     }          div class="wrap">
Theme Settings
       <form id="landingOptions" method="post" action="options.php">         <?php settings_fields( 'director-settings-group' ); ?>

               Date:	                                <input type="text" placeholder="2014, 06 - 1, 2" name="director_date"                 value="<?php print get_option('director_date');                 ?>" />

           Time Zone:	                        <input type="text" placeholder="+5" name="director_timezone"             value="<?php print get_option('director_timezone');             ?>" />

             <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>"   />
           </form>
         <?php } ?>      Basically what is happening is that there is a theme options page.A user gives a date inside it. Now i want to use that date inside the javascript file. If I had to use it inside index.php it would've been               <?php $date = get_option('director_date'); ?>     <?php if( $date ) : ?> <?php echo $date; ?><?php endif; ?>);      and               <?php $timezone = get_option('director_timezone'); ?>     <?php if( $timezone ) : ?> <?php echo $timezone; ?><?php endif; ?>);      . However this is javascript. How do i implement such an action here?


Add share links to all blog posts on homepage

I need to figure out a way to add share links to each blog post on the homepage. This way users can share specific posts without actually going into the post. Is there a way to do this easily through a WP plugin? The only tricky thing to me is they will be sharing URLs from pages which they are not actually on so I'm unsure how to proceed with that.. does anyone have any ideas? Thanks!


Website loading slowly - Advanced Custom Fields images

I'm currently using `get_field` with Advanced Custom Fields plugin (see here) to get a single image for search results. The end result is that these pages are loading slow, as I believe this is due to MySQL returning the whole array of all images in the gallery for the specified page, which ends up being huge. To load the image, I am currently doing the following:               $image = get_field('house_photos');               if ($image) {                  echo '<img src="' . $image[0]['sizes']['house_search'] . '"  />';               }       Is there a more efficient way just to get this single image without requesting the entire array?


Get ID and slug from taxonomy object

I have a custom field to select a category (custom taxonomy) and then I will display a list of all of its child-categories. This works fine when I return the custom field as "term_id." HOWEVER. I would like to also get the slug from this selected category (the parent) so I can link to its category page (I don't think I can link to it with the ID). So I thought maybe I should return the custom field as an object instead. This is what it dumps:                stdClass Object ( [term_id] => 122 [name] => Quick Release Watch Bands [slug] => fits-all [term_group] => 0 [avhec_term_order] => 0 [term_taxonomy_id] => 122 [taxonomy] => product_cat [description] => Watch bands in many colors [parent] => 0 [count] => 293 [meta_id] => 1 [woocommerce_term_id] => 122 [meta_key] => order [meta_value] => 22 )       Do you know how I can pull out both the ID (122) and the slug (fits-all) from this? Here is my code so far. The custom field is called "selected_category".               <?php $catid = get_sub_field('selected_category');                        $args = array(                   'taxonomy'     => 'product_cat',                   'orderby'      => 'name',                   'show_count'   => 0,                   'pad_counts'   => 0,                   'hierarchical' => 1,                   'title_li'     => '',                   'depth'        => 1,                   'child_of'     => $catid                 );                      ?>
<?php the_sub_field('title'); ?>

     <?php wp_list_categories( $args ); ?>
      Can anyone help me, please? Thank you so much!


wordpress head is empty, append to body

i'm have a problem for Wordpress heading. my get_header();               <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">     <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>     <head>     <title>     <?php wp_title('«', true, 'right'); ?>     <?php bloginfo('name'); ?>     </title>     <meta name="language" content="tr-TR" />     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">     <meta name="location" content="türkiye, tr, turkey" />     <meta name="robots" content="all" />     <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />     <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />     <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />     <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.css" type="text/css" />     <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/fa/css/font-awesome.min.css" type="text/css" />     <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>     <script src="<?php bloginfo('template_url'); ?>/eiddia.js" type="text/javascript"/></script>     <!--[if gte IE 9]>       <style type="text/css">         .gradient {            filter: none;         }       </style>     <![endif]-->     <?php wp_head();?>     </head>     <body>     ...     </body>     </html>      The Result ![http:/www.bilgius.com/wp- content/uploads/videos/theResultHeadingWp.png](http://i.stack.imgur.com/akkJi.png) _It looks like your post is mostly code; please add some more details._


How do I create a custom archive page that my client can edit?

* I've created a custom post type.    * I have set has_archive as true and understand I could also set it to has_archive => 'ctp'   * I also know that if I name a template file archive-cpt.php Wordpress will use this template for my cpt. This is okay for some situations. But I'd like my client to be able to go to an editing page, like default posts and pages in the admin area. I have thought about making the archive-cpt.php a template that can be called in a default page. Making that page the archive. Am I on the right track? I'd really like to do this with the most up to date WordPress method.


Implementing HTML/CSS menu in WordPress theme

I have an HTML/CSS template having a horizontal menu. I need to convert the template into a WordPress theme. I am stuck with the menu. I have used the wp_nav_menu function in my header.php file and have also completed the functions.php file. The menu is now displaying vertically with bullets. I need to implement the menu now, but am unable to find and associate the proper css class to the menu_class parameter. Kindly assist. Thanks and Regards Debashis


Adding Image Description below Images Inserted into Posts

I've got a bunch of images inserted into posts with metadata I'd like to display underneath them: some have caption, some have description, some have both. I've figured out how to filter img_caption_shortcode to display the description. The problem is that this is apparently called only when there is a caption. So if I want to display an image description under an image with no caption, this doesn't appear to be a solution. What I'd like to know is how to either:   * Hook into the inline image formatting to display exactly what I want (can't figure this out for the life of me, have dug through all the code and don't see where img_caption_shortcode gets auto-applied to inline images), or   * force img_caption_shortcode to be applied to all images which have a description (regardless of whether they have captions) The more semantic way would definitely be the first, but either would make me happy :) To avoid the inevitable suggestions: no, I can't change where I store the metadata, putting it all in the caption or something - there is a large number of images which woud nee to be thus edited, and an undue amount of effort would be required, besides the fact that we're using them for two separate purposes (one is for a description, one is for copyright info); and, no, we aren't satisfied to use shortcodes to accomplish this, as it would require going back into many posts and editing a huge amount of data, with the risk of missing some. (I guess it would be possible to filter the content and pull the metadata from the image within the tag, but that seems like it would be a lot messier. I'd prefer a cleaner solution if possible.)


Custom fields not saving in newest Wordpress 3.0.1

I had this working a couple of weeks ago and the only thing I can think is that WordPress has updated and broken the functionality? I followed the tutorial here to add custom fields: http://net.tutsplus.com/tutorials/wordpress/rock-solid-wordpress-3-0-themes- using-custom-post-types/ It was working fine (I entered about 50 custom posts all with custom fields) but when I go to edit it today any changes I make to the custom fields are not being saved, although other changes work fine. Does anyone know if this is a known bug? **Edit:** Here is the code, added in functions.php to a brand new install (theme: twentyten)               add_action('init', 'testimonials_register');     add_action("admin_init", "admin_init");     add_action('save_post', 'save_testimonial');                         function testimonials_register() {         $args = array(             'label' => __('Testimonials'),             'singular_label' => __('Testimonial'),             'public' => true,             'show_ui' => true,             'capability_type' => 'post',             'menu_position' => 5,             'hierarchical' => false,             'rewrite' => true,             'supports' => array('title', 'editor', 'thumbnail','custom-fields', 'revisions', 'excerpt', 'page-attributes')         );              register_post_type( 'testimonials' , $args );     }                         register_taxonomy( 'testimonial_project_type', array("testimonials") , array( 'hierarchical' => true, 'label' => 'Project Type', 'query_var' => true, 'rewrite' => true ) );                    function admin_init(){         add_meta_box("testimonialInfo-meta", "Testimonial Options", "meta_options_testimonial", "testimonials", "advanced", "high");          }                    function meta_options_testimonial(){         global $post;         $custom = get_post_custom($post->ID);         $name = $custom["name"][0];         $position = $custom["position"][0];         $project_url = $custom["project_url"][0];         $website = $custom["website"][0];         ?>       Name: <input size="50" name="name" id="name" value="<?php echo $name; ?>" />
       Position: <input size="50" name="position" id="position" value="<?php echo $position; ?>" />
       Website Name: <input size="50" name="website" id="website" value="<?php echo $website; ?>" />
       Project slug: <input size="50" name="project_url" id="project_url" value="<?php echo $project_url; ?>" /> E.g. 'parker-harris'
         <?php     }              function save_testimonial(){     $custom_meta_fields = array( 'project_url','name','position','website');     foreach( $custom_meta_fields as $custom_meta_field ):         if(isset($_POST[$custom_meta_field]) && $_POST[$custom_meta_field] != ""):             update_post_meta($post->ID, $custom_meta_field, $_POST[$custom_meta_field]);         endif;     endforeach;                   }                                                 add_filter("manage_edit-testimonials_columns", "testimonials_edit_columns");           add_action("manage_posts_custom_column",  "testimonials_custom_columns");                function testimonials_edit_columns($columns){           $columns = array(               "cb" => "<input type=\"checkbox\" />",               "title" => "Testimonial Title",               "name" => "Name",               "description" => "Excerpt",               "project_url" => "Project Slug"         );                return $columns;          }                function testimonials_custom_columns($column){           global $post;           switch ($column)           {               case "name":                   $custom = get_post_custom();                   echo $custom["name"][0].", ".$custom["position"][0]."
 ".$custom["website"][0];                 break;               case "description":                   the_excerpt();                  break;               case "project_url":                   $custom = get_post_custom();                   echo "".$custom["project_url"][0]."";                 break;           }           }                                                        // This shows testimonials in blog and feed.              add_filter( 'pre_get_posts', 'my_get_posts' );              function my_get_posts( $query ) {          if ( is_home() && false == $query->query_vars['suppress_filters']  || is_feed() )         $query->set( 'post_type', array( 'post', 'testimonials') );          return $query;         }