title: Query page: preserve page formating

text:
dose anyone know how to get this query (or a different query) to preserve the page formatting? Thanks               <?php     $my_postid = 663;//This is page id or post id     $content_post = get_post($my_postid);     $content = $content_post->post_content;     $content = apply_filters('the_content', $content);     $content = str_replace(']]>', ']]>', $content);     echo $content;     ?>      EDIT I did not find a way to alter the above Query to respect the original page formatting but I did find a different Query that dose. Notice the
       in the following query. The "class="format_text"" formats the query output to that of the original page formatting.               <?php      // The Query     $the_query =new WP_Query('pagename=my-page-name');     // The Loop     while ( $the_query->have_posts() ) : $the_query->the_post();          ?>

<?php the_title(); ?>
         <?php the_content(); endwhile; ?>
     <?php          // Reset Post Data     wp_reset_postdata();     ?>


title: Displaying additional User Contact Information

text: I have been advised how to add additional contact info fields to the User admin area here (Click here). However, I am not entirely sure how I can display the the field contents in a link within my template files. Here is the code in my functions.php:               add_filter( 'user_contactmethods', 'more_contactmethods' );     function more_contactmethods( $contactmethods ) {         $contactmethods['twitter'] = 'Twitter URL';         $contactmethods['facebook'] = 'Facebook URL';         $contactmethods['linkedin'] = 'LinkedIn URL';         return $contactmethods;     }      And here's the code in one of my template files, but it doesn't seem to work, so I wonder whether I can actually do it this way?               <?php          $twitter = get_usermeta( $user_id, 'facebook' );          $facebook = get_usermeta( $user_id, 'twitter' );         $linkedin = get_usermeta( $user_id, 'linkedin' );     ?>              <a href="<?php echo $twitter ?>" id="twitterBtn" title="Visit our Twitter page">Visit our Twitter page


title: Wordpress programming video tutorials

text: I am a beginner in Wordpress programming. I am basically looking out for video tutorials that teach Wordpress programming and specifically creation of plugins and such advanced things. Are there any good video tutorials which teach such sort of stuff? or any courses from training companies like pluralsight. I know pluralsight is not into PHP but are there any other sites? I am even willing to pay for videos. The video tutorials need not be free however free is always welcome. Thanks in advance :)


title: Store JSON in a custom field

text: I have a drawing canvas on some of my Wordpress' post pages, where users can draw on. Upon drawing, my JS code currently sends the user's drawing to a php file. This is where I store the array in JSON format in .txt files. Whenever the page is loaded by someone else, JS loads these JSON files on start, so you see other people's sketches and you can draw on it as well - where the txt files get altered etc etc. But is it possible to use Wordpress' custom fields? So every post has their own variable where the drawing array is stored. I have no idea what type of custom field to use.. Or whether there is a plugin out there that might be helpful with helping me achieve what I want. Or maybe not a good idea at all to do it this way. Thanks in advance.


title: Create password automatically for new users?

text: Is it possible to automatically create a password for a new user? Ideally, I'm looking for a plugin that, if the password is not given on user creation, would generate one and optionally email it to the user if the checkbox for this is selected. If not, then maybe just show the password after the creation of the user. Does anyone know if there is a plugin with this behavior or similar behavior?


title: How MUST the directory for a plugin be structured?

text: I get the basic plugin concept. I've read the Codex article on Writing a Plugin That article talks about the "main plugin file". How does Wordpress determine "the main plugin file" ? **Q1:**   Is it legal / supported to have a plugin that is structured like this:   * pluginname/   * pluginname/mainfile.php   * pluginname/supportingcode-1.php   * pluginname/supportingcode-2.php   * pluginname/Readme.txt   * etc.. ? **Q2:**   If so, how does wordpress determine which php file is the main plugin file? * * * I have seen recommendations that say "I structure my code _this way_ ":   * pluginname/   * pluginname/mainfile.php   * pluginname/inc/supportingcode-1.php   * pluginname/inc/supportingcode-2.php   * pluginname/Readme.txt   * etc.. **Q3:**   Is the use of a subdirectory (like `inc/` in the above example) a requirement when the PHP code spans multiple modules? **Q4:**   Is it true that there should be a maximum of ONE php file in the main plugin directory? Thanks.


title: Subsite theme mystery man replacement with Buddypress on main site

text: I have a multi-site install with buddypress on the main site. In the buddypress theme I've been able to override the default 'mystery-man' avatar using my custom buddypress theme. I simply have an images folder containing a replacement 'mystery-man.jpg' avatar. However, for the other wordpress sites on the network this technique doesn't work. I've looked into the solutions proposed here: Set default avatar network-wide But these answers don't seem to work with buddypress enabled on the main site. It seems buddypress somehow interferes with the way the non-buddypress sites get their avatars, because the html returned looks like this:               <img src="http://www.gravatar.com/avatar/ba60ca5beed202054f393b040bfd7ac3?d=http://subsite.example.com/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg&s=50&r=G" alt="Avatar Image" class="avatar user-16-avatar" width="50" height="50">      ...regardless of the functions and filters I've applied from the previous solution. Is there a way to get it to look to see if the subsites theme has an 'images/mystery-man.jpg' and use that before using the buddypress default? **UPDATE** Following feedback I realise 'BuddyPress' is network enabled on my site, which interferes with the normal solution. I've tried enabling this on just the main site, but this crashes all the subsites. I think this might be because I've attempted to add BuddyPress activity comments to the replies in the subsite blogs, so I actually WANT the subsites to know Buddypress is active.


title: My CSS, footer and header don't show up!

text:
When I activate my theme in my-admin on WordPress, my CSS, header and the footer don’t show up. I really don't know what the problem is because I followed all the steps of a tutorial. **`header.php`**               <!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(); ?>>          <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />     <title>     <?php wp_title('«', true, 'right'); ?>     <?php bloginfo('name'); ?>     </title>          <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />          <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/css/wysiwyg.css" type="text/css" media="screen" />     <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />                    <link href="<? bloginfo('stylesheet_directory'); ?>/css/index.css" type="text/css" rel="stylesheet" />          <?php  wp_head(); ?>

1234 Main Street NE, Suite 201

Grand Rapids, MI 49503 Main 616 555 5555

Home

Portfolio

About

Contact

           **`footer.php`**
             Copyright © 2009, Megan Sullivan. All Rights Reserved.

          <?php wp_footer(); ?>


title: Related Posts by Multiple Tags?

text:
I was curious if was possible to display related posts by multiple tags. The site I am working on has about 5 tags per post. Most posts have 1 or 2 tags in common. The related posts I'd like to show have 3-5 tags in common. So, I'd like the related posts to function by looking for posts with the most number of tags in common and display them in descending order. Let's say I display 3 related posts: relatedpost1 would have 4 tags in common, relatedpost2 would have 3 in common and relatedpost3 would have 1 in common. Is it even possible to do this? Right now I am messing around with two ways of displaying the posts but they arent functioning as I'd like: The first method (code) just shows posts with ANY tags in common.               <?php $orig_post = $post;     global $post;     $tags = wp_get_post_tags($post->ID);     if ($tags) {     $tag_ids = array();     foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;     $args=array(     'tag__in' => $tag_ids,     'post__not_in' => array($post->ID),     'posts_per_page'=>3, // Number of related posts that will be shown.     'caller_get_posts'=>1     );     $my_query = new wp_query( $args );     if( $my_query->have_posts() ) {     echo '

Related Posts

';     while( $my_query->have_posts() ) {     $my_query->the_post(); ?>

<a href="<? the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail(array(185, 185)); ?>

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

     <? }     echo '

';     }     }     $post = $orig_post;     wp_reset_query(); ?>`      The second method (code) just shows posts with the first tag in common.               <?php     //for use in the loop, list 5 post titles related to first tag on current post     $tags = wp_get_post_tags($post->ID);     if ($tags) {     echo '

Related Posts

';     $first_tag = $tags[0]->term_id;     $args=array(     'tag__in' => array($first_tag),     'post__not_in' => array($post->ID),     'posts_per_page'=>3,     'caller_get_posts'=>1     );     $my_query = new WP_Query($args);     if( $my_query->have_posts() ) {     while ($my_query->have_posts()) : $my_query->the_post(); ?>

<a href="<? the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail(array(185, 185)); ?>
     <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title(); ?>

     <?php     endwhile;     }     wp_reset_query();     }     ?>      Both ways kind of suck; I'm either getting pretty random posts displaying (since most of my posts have at least 1 tag in common) or (for some posts) getting no related posts (since their common tags are tag 4 or 5). Any help would be greatly appreciated.


title: How to get a value from comment meta

text:
I've add the field **country** in the comment form. Working nice and I can see the value in the table commentmeta. ![enter image description here](http://i.stack.imgur.com/vCFZu.png) Now I try to display this value in my comment list. In my **single.php** I call the list of comments:               <?php wp_list_comments('type=comment&callback=format_comment'); ?>      In my **functions.php** I format the comment:               function format_comment() {  ?>

<?php comment_author(); ?>

<?php get_comment_meta( $comment->comment_ID, 'country', true ); ?>

<?php comment_date('Y/m/d - g:i A'); ?>

<?php comment_text(); ?>

     <?php } ?>      So... to get the value for the meta **country** I use               <?php get_comment_meta( $comment->comment_ID, 'country', true ); ?>      Without success…


title: How to redirect to action on custom page within admin section

text: Currently I'm developing(well at least trying to;) plugin which will handle custom gallery of images. I stumbled upon one problem though. I'll try to picture it. I've created custom menu page on which I can edit gallery options as well as I can add/delete/edit elements of gallery. I did add link to every gallery item so after choosing 'edit' I could be able to modify element.               function column_rls_name($item) {       $actions = array(                 'edit'      => sprintf('Edit',$_REQUEST['page'],'edit',$item['rls_name']),             );       return sprintf('%1$s %2$s', $item['rls_name'], $this->row_actions($actions) );     }      Problem begins when 'edit' on element is clicked. It should redirect to settings page. Here I have a question. What is the best way to do this. Are there any helper functions/hooks/etc out there which would help in creating such page (and detect redirection). Of course I could do it in function responsible for displaying main gallery options like:               if($_GET['action']=='edit')         //then do sth     else         //display main gallery options      but I don't think it's the best way. I would like to know which functions I could use, from creating custom link, creating custom page and registering them. What method should be used when action=edit is triggered. How to spot it was requested on the actual page. How to show then page related to the content.               wp-admin/options-general.php?page=rls_logotypes&action=edit&rls_element=element1


title: wp_signon returns user, but the user is not logged in

text: I use `wp_signon()` and it returns a user, not an error. However when I do `is_user_logged_in()` it returns false. Help would be very much appreciated :)


title: w3 Total Cache expire headers not set

text: I have been using w3 Total Cache with the setting to enable Expires Headers and eTags but they are not being set. I'm serving images and other media from a sub-domain such as static.example.org served by nginx but it didn't work even when I was serving these files with Apache from the main domain. I've tried disabling and re-enabling the browser caching settings in the admin without success. What do you suggest?


title: Updating Style From WP Options Setting Page

text:
Can you please let me know how I can set a function to update change the style like any CSS class from the setting option page? For example I have some `<P>` elements with a class name `.impo`. Now, I would like to change the color of the class to red when the checkbox has been checked and to default color when un-checked. What I have is:               <?php      add_action('admin_menu', 'fwds_plugin_settings');      function fwds_plugin_settings() {      add_menu_page('Price Display', 'Price Display', 'administrator', 'fwds_settings', 'fwds_display_settings');      }     function fwds_display_settings() {     $html = '
<form action="options.php" method="post" name="options">
Change The .impo Colors
         ' . wp_nonce_field('update-options') . '

      Change Color To Red 	      <input type="checkbox" name="fwds_autoplay" value="enabled" />

     <input type="submit" name="Submit" value="Update" /></form>
';     echo $html;     }


title: Unfiltered html with update_post_meta

text: I have buddypress installation. When posting an acitivity, I'm including some data (html) as meta. Let me show some code: this is an action triggered when acitivty is posted.               function add_activitylink_to_activity( $content, $user_id, $activity_id ) { ?>          <?php }     add_action( 'bp_activity_posted_update', 'add_activitylink_to_activity', 10, 3 );      and here is a ajax handler:               function addActivityMeta() {         bp_activity_update_meta( $_POST['activity_id'], 'activitylink', $_POST['add_link'] );         die('success');     }      everything works fine as long as I'm logged in as administrator, but with normal users, the meta does not get posted as I understand it, it's because "unfiltered html", but I don't understand much of it and this maybe sound stupid: can I filter it somehow? :D there are table and image links and such. or is there any workaround? for example I'm thinking about inserting this meta with mysql query? Is this bad solution?


title: Wp get archive only text not link

text: i use this function               wp_get_archives( array( 'type' => 'yearly', 'limit' => 12, 'format' => 'html' ) );      And i got this:               2013      I need only "2013". Just anyone know how to do this?


title: Customized featured image doesn't refresh in post admin metabox after upload/insert

text: I customized my featured image metabox position, the default name, and text for a custom post type. While I'm able to add/edit an image in post admin, after I have uploaded an image, the post admin doesn't show the new image in the metabox until after I save the post. The featured images are set and I'm able to query and retrieve them in the frontend just fine. Also, strangely, I can only upload images--it doesn't seem that I can insert existing images from the media library. Here's the relevant code below:                       // Add custom featured image box "sketch" using existing featured image metabox; remove default featured image box.             public function image_box() {                 remove_meta_box( 'postimagediv', 'tn_cstm_sketchbook', 'side' );                 add_meta_box('postimagediv', __('Sketch'), 'post_thumbnail_meta_box', 'tn_cstm_sketchbook', 'normal', 'high');             }                  // Conditionally filter featured image text only for sketchbook custom post types             public function add_featured_image_filter() {                      if ('tn_cstm_sketchbook' == get_post_type() ) {                          add_filter('admin_post_thumbnail_html', array($this, 'do_thumb' ));                     add_filter( 'admin_post_thumbnail_html', array($this, 'remove_featured'), 9999, 1 );                      }             }                       public function remove_featured( $content ) {                 return str_replace( 'Remove featured image', 'Remove sketch', $content );             }                  public function do_thumb($content){                  return str_replace(__('Set featured image'), __('Add a sketch'), $content);             }      And here are the hooks that I'm calling them with:               public function __construct() {             add_action( 'do_meta_boxes', array($this, 'image_box' ));             add_action( 'admin_head-post-new.php', array($this, 'add_featured_image_filter' ));             add_action( 'admin_head-post.php', array($this, 'add_featured_image_filter' ));         }


title: templates with page teasers Or Featured Items

text: I've been given a design for a WordPress site which will be mostly made up of pages rather than posts. However, at the top of each page there needs to be three featured items in a row. Each featured item will have an image, title, a small bit of summary text, and a link to another page. Can anyone tell me the best way of implementing these featured items for a page? Would they need to be a custom content type? And if so how would I implement it in the template? They need to be fairly easy for administrators to edit, and change, and link to other pages. I am an experienced Drupal designer, but am new to WordPress. Any help would be much appreciated. Ben


title: Custom Post Type conflicting with page?

text:
I have a page on my website called Work (that uses a work.php page template) set up as my front page, where I would like to display a list of the last ten posts with the custom type called portfolio. Here is my code so far:                   <?php $the_query = new WP_Query( array( 'post_type' => 'portfolio', 'posts_per_page' => 10 ) ); ?>         <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>             <section id="post-<?php the_ID(); ?>" <?php post_class( 'portfolio-post' ); ?>>
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?>
                     <time datetime="<?php the_time('Y-m-d') ?>" pubdate><?php the_time('F jS, Y') ?></time>
         <?php endwhile;?>      The problem is that nothing shows up on that page, despite my having created a couple of posts of this type in wordpress' backend. And when one is clicked, I would like to be taken to `/work/the_post_i_clicked/`. I must admit to being a bit confused here. Any help would be greatly appreciated.


title: Save attachment ID instead of URL in custom field

text: I am testing several frameworks (currently Vafpress) to help me creating custom meta boxes. I need to save a lot of attachments with my posts but noticed that the attachment is saved with its full URL, not the ID.   1. There seems to be no "easy" way to get full data (title, desc, date) from an attachment, when I only have the URL, right?    2. Is there any framework that saves ID instead of the URL?   3. Any other suggestions to save attachments, maybe without a custom meta box?


title: WordPress Multisite - is this possible?

text: I've found documentation on multisite a little sparse so I'm hoping someone will be able to answer some of my questions. What I'm trying to achieve:   * A main admin user that can look at all networked sites.   * Network sites on a subdomain or on their own domain   * All sites running on the same theme but with different theme options.   * Each network site only has one user, they can only access one site on the network that is assigned to them. If anyone could give me a heads up or point me in the right direction it would be much appreciated.


title: wordpress makes duplicate images of different size

text: I have a wordpress website. I upload my pictures to the media library. And when I import a picture in a post, you get the options, one of which ask you what size to display it in. And doing this results in creating a new image file that is a different size, rather than wordpress using html to control the size of the image. The following image shows how different sized picture copies are made of the same one with different resolution. ![enter image description here](http://i.stack.imgur.com/bc44U.png) Thank you everyone in advance.


title: API for Post Stats for Self-Hosted Wordpress using JetPack

text: **EDITED** for Clarification WordPress.com as well as JetPack provides stats (like no of views, referrer, etc) for various posts and blog as described here :Wordpress Stats Is there an API so that I can access the stats data and use it as per my needs ?


title: How to store media files in subdomain

text: In order to parallelize downloads, i created already a subdomain for images. images.mydomain.com Now, i don't know how to move my media files, without breaking attachments, and after that, in the future, how to automatically store media file in subdomain. Eventually, what i was thinking of doing was something like , redirect images.mydomain.com to mydomain.com/wp/content/uploads and after that replace all strings 'http://www.domain.com/wp- content/uploads/'with'http://images.mydomain.com/' using the wordpress plugin "search and replace". Does someone believes to know how to get around this? thanks in advance


title: Detecting Embed URLs Within post_content

text:
I need to change the way WP outputs html when given an embed URL within the content. Example content within the WP editor:               This is standard content and will be wrapped in a 'p' tag. But check out this cool vid:          http://www.youtube.com/watch?v=3JJv4TvURj4          This will be output as another 'p' tag. The above URL will be turned into an iFrame.      The goal is for the client to input something simple like that, and change the way wordpress outputs it on the page. I have been using the `oembed_dataparse` filter to good effect so far, but **I would like to take the video URL and pass it to another function outside of the filter**. How can I do that? My initial approach was to use a global variable. Here's my abridged filter code:               add_filter('oembed_dataparse', 'modal_embed', 10, 3);     function modal_embed($html, $data, $url) {         // This is supposed to store the URL globally so I can access it          // outside this filter.         global $video_url;         $video_url = $url;              $custom_output = "
$html
"; // Just an example.          return $custom_output;     }      The code I create as `$custom_output` works just fine and is displayed on the page. The issue is that I'm not getting access to `$video_url` globally as I expected. Any thoughts? Thanks.


title: Restrict download files from not generated Urls

text: I use a plugin in WPMU that encrypt all downloads urls in wp-content/uploads/ : The downloads can still be accessed if users know the path to the file: e.g. www.domain.com/wp-content/uploads/2013/02/file.pdf . My problem is how to prevent this . i want to restrict direct downloads from not encrypted urls I tried this in my `.htaccess` but it disable downloads also from encrypted urls:               Deny From All     Allow From http://domain.com/wp-content/plugins/Encryptor-plugin/encrypt.php


title: Author List page: Exclude based on last post date not working correctly

text:
Using the following code from this post I thought I had found the answer to my problems of showing authors that have posted in the last 6 months. Unfortunately the way the function checks the date it only seems to block some months and doesn't take in to consideration previous years as it is showing older posts/authors still. I believe the problem lies in the `if (6 < (date('n',(time() - strtotime($posts[0]->post_date)))))` with the `n` being the month. Could anyone assist to correct the lookup so it only shows from the last 6 months?               <?php     // Arguments to pass to get_users     // ************* $args = array( 'orderby' => 'post_count', 'order' => 'DSC', 'who' => 'authors' );     // Query for the users     $authors = get_users('orderby=post_count&order=DSC'); //&role=contributor ?>     <?php     // Loop through all the users, printing all of their posts as we go     foreach ( $authors as $author ) {              // Set up a Loop, querying for all of the current user's posts         $args = array( 'author' => $author->ID, 'posts_per_page' => 1 );         $posts = query_posts($args);              if (6 < (date('n',(time() - strtotime($posts[0]->post_date)))))             continue; //skips this autor as long as his last post is older than 6 months, be aware that this check uses date function.           ?>                 <a name="<?php echo $author->user_nicename; ?>">                 <div class="author-posts-wrapper" id="author-<?php echo $author->ID; ?>-posts-wrapper">                     <div class="author-avatar" id="author-<?php echo $author->ID; ?>-avatar">                         <?php echo get_avatar( $author->ID, 96 ); ?>
                     <div class="author-posts" id="author-<?php echo $author->ID; ?>-posts">
<a href="<?php echo get_author_posts_url( $author->ID ); ?>"><?php echo $author->display_name; ?>
              <?php if ( have_posts() ) :  ?>                     <div class="author-post-list" id="author-<?php echo $author->ID; ?>-post-list">             <?php while ( have_posts() ) : the_post(); // Print whatever we want for each post - for now the title ?>
                             <?php the_author_meta("description"); ?>

Most recent article: <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>

                 <?php if(get_the_author_meta('user_url')): ?>                     <?= get_the_author_meta('user_url') ?>                 <?php endif; ?>
             <?php endwhile; ?>
         <?php else: ?>
This author has not yet published any posts
         <?php endif; ?>

     <?php } // End looping over all users ?>


title: Empty string supplied as input when parsing content

text: I have this code:               <?php     function mb_find_my_image( $content ) {         if( is_home() ) { /* if is home start */                $dom = new domDocument;           $dom->loadHTML($content);           $dom->preserveWhiteSpace = false;                   } /* if is home end */         return $content;     }     add_filter( 'the_content', 'mb_find_my_image' );     ?>      However, it seems that I always get the following error: > Empty string supplied as input on line 6 What I'm I doing wrong here?


title: WP 3.5.1 password protected not working for post

text: After adding right password fornt side wp, post not open and it's say > Not Found Apologies, but the page you requested could not be found. Perhaps > searching will help. how to solve this?


title: How do I find out which plugin is exceeding memory limits?

text: I had an issue today when my sites had stopped working. Calling up the link just showed a cryptic message `Database connection error`, on all my sites on one server. The error disappeared on rebooting. While trying to get to the root of the issue, I was examining syslog (I'm using Debian 7), and found the following entries:               Jun 15 05:46:03 myserver suhosin[8368]: ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker 'myipx.y.z.a', file '/var/www/virtual/mylocation/htdocs/wp-content/plugins/wordfence/lib/wfUtils.php', line 502)     Jun 15 05:46:21 myserver suhosin[8372]: ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker 'myipx.y.z.a', file '/var/www/virtual/mylocation/htdocs/wp-content/plugins/wordfence/lib/wfUtils.php', line 502)     Jun 15 05:46:38 myserver suhosin[8368]: ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker 'myipx.y.z.a', file '/var/www/virtual/mylocation/htdocs/wp-content/plugins/wordfence/lib/wfUtils.php', line 502)     Jun 15 05:46:54 myserver suhosin[8376]: ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker 'myipx.y.z.a', file '/var/www/virtual/mylocation/htdocs/wp-content/plugins/wordfence/lib/wfUtils.php', line 502)     Jun 15 05:55:01 myserver /USR/SBIN/CRON[8508]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)     Jun 15 05:56:59 myserver suhosin[8514]: ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker 'myipx.y.z.a', file '/var/www/virtual/joel.co.in/kgimoa.com/htdocs/wp-content/plugins/wordfence/lib/wfUtils.php', line 502)     Jun 15 05:57:18 myserver suhosin[8516]: ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker 'myipx.y.z.a', file '/var/www/virtual/joel.co.in/kgimoa.com/htdocs/wp-content/plugins/wordfence/lib/wfUtils.php', line 502)     Jun 15 05:57:33 myserver suhosin[8514]: ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker 'myipx.y.z.a', file '/var/www/virtual/joel.co.in/kgimoa.com/htdocs/wp-content/plugins/wordfence/lib/wfUtils.php', line 502)      The error repeats itself. Looking at the code, on line 502:                public static function iniSet($key, $val){                     if(self::funcEnabled('ini_set')){                             @ini_set($key, $val);                     }             }      Is this because one of my plugins/theme is using an excess amount of RAM? How can I isolate and identify which one? Other than disabling each plugin one by one and waiting for the error to show up in syslog, is there a quicker, and directed method?


title: How do I get gallery thumbnail URL and change the default thumbnail size?

text: when I create a gallery I get this code generated yet I can;t find out how               <img width="150" height="150" src="http://localhost/wp2/wp-content/uploads/2012/06/28_0120-150x150.jpg" class="attachment-thumbnail" alt="_28_0120" title="_28_0120">      What function generates the thumbnail URL and how does the thumbnail image generated and cropped to the size of 150-150? I forgot to mention:   for the gallery page I use `get_children`, so this is what I need to work with


title: Highlite current menu page problem

text: Hello I have a problem with the wordpress menu I have the main menu parent item has the same link width first page in submenu Parent --- Haloterapie: www.site.com/halorepaie Submenu --- Actiunea Terapeutica: www.site.com/halorepaie When activated one of them,show that they are active all page in submenu To show active page I made so:               add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);     function special_nav_class($classes, $item){      if( in_array('current-menu-item', $classes) ){              $classes[] = 'active ';      }      return $classes;     }      ![enter image description here](http://i.stack.imgur.com/cJDbk.png)


title: Implode Taxonomy to hide parents?

text: The following code will display the child taxonomy term of the parent only.               $terms = get_the_terms($wp_query->post->ID, 'propertytype');      $props = array();      foreach ($terms as $term) {      if ($term->parent)      $props[] = $term->name;      }      echo implode(', ', $props);      For example: London (Parent), West London (Child) - the above will only echo West London (Child). However, if there are multiple child levels e.g London (Parent), West London (Child), Chelsea (Grand Child) This does not work! I only want to display the last term. **How would i modify the above to only display the last term even if there is more than one sub level?** Thanks Paul **FINAL CODE USED**                  $terms = get_the_terms($wp_query->post->ID, 'propertytype');           //die(print_r($terms));           $props = array();           foreach ($terms as $term) {            $hasChildrenTest = get_term_children($term->ID, 'propertytype');               if ($term->parent) {                   if (empty($hasChildrenTest) && !is_wp_error($hasChildrenTest)) {                   $props[] = $term->name;                   }               }           }           echo $props[0];


title: Menu fallback "menu_class" rendering a "div" instead of a "ul"

text: I'm working on a fallback menu for a WordPress theme I'm working on. The main menu's `menu_class` renders a `ul` which is what I want. However, if I use the menu fallback, the `menu_class` renders a `div` instead. Is there a way to make Wordpress render a `ul` for the fallback menu instead of a `div`? Here's my code:                function clarity_main_nav_fallback() {               wp_nav_menu(array(              'show_home' => true,         'container' => false,                           // remove nav container         'container_class' => 'menu clearfix',           // class of container (should you choose to use it)         'menu_class' => 'nav navbar-nav'              // adding custom nav class              ));           }


title: Set static page as default front page on newly created sites in multisite

text: How to set a Static page (example Sample Page with every WordPress install) as default fron page for every newly created site on multisite network. I mean when a new user creates a site on my multisite network a Page with custom name sets as front page automatically. Please tell me how to accomplish that.


title: How to customize and keep things up-to-date?

text: I made a few websites in WP (that was kind of my first serious web-related work where I started learning about more serious and concrete stuff other than homework type of programming exercises) and only now that some time has passed do I see some things that I did wrong in the first place that I would do differently now. One of those thins is that I hard-coded lots of custom stuff into plugins themselves and now I realize that I cannot update lots of plugins because that would break certain parts of the website. What I am interested is how do you cope with this? I understand that this probably falls into the scope of website maintenance, but perhaps there is a common approach, a design pattern or something that could be used to minimize this problem? One could perhaps make and include a custom css file that would contain all the override/custom values, but how about custom php/html/js changes? Is there a similar way of making customizations in that area without the fear of loosing all of them once an update is in place?


title: Automated Footer information

text: Working on a theme and I'd like the copyright and title texts on the footer to be automated. It works but the tittle switches to the current page instead of the website's main title when you switch pages. How do I get it to stick to the website's main title or home page title. My line of code is as shown below.                ©<?php echo date("Y"); ?> <?php the_title(); ?>


title: Custom form, shortcode, and submit handler

text: I have a frontend form with a bunch of input. My requirements force me to use a custom shortcode to create the form. I have already tested a page with that shortcode. Here's my :               <form name="myform" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>" enctype="multipart/form-data">      Based on this, it should open up the same page (and it did). However, when I hit submit, I got 404 on that very same URL. Is there any solution? **UPDATE #1** I try different route, using add_action('init'):               add_action('init', 'mbro1_intercept_form_input');     function mbro1_intercept_form_input()     {         if( !(isset($_POST['action_code']) && $_POST['action_code'] == 'mbro_intercept_form_input') )             return "";         if( isset( $_POST['submit'] ) )         {             //do my code here             wp_redirect( get_permalink(35) );//page that has [shortcode]         }     }      This successfully run my intended action on submit. But! upon redirection, it still got 404. I don't know what is wrong.


title: How to write sql query to get the posts from a custom taxonomy term name

text: I hope someone will help me............. I have a   * Post Type ----> Dealers   * Taxonomy ----> State how to write a sql query in this format               $catinfo1 = $wpdb->get_results("select t.*,(select count(tr.object_id) from $wpdb->term_relationships tr join $wpdb->posts p on p.ID=tr.object_id where tt.term_taxonomy_id=tr.term_taxonomy_id and p.post_status='publish') pcount from $wpdb->terms t join $wpdb->term_taxonomy tt on tt.term_id=t.term_id where tt.taxonomy=\"fueltype\" and tt.parent=0 order by t.name");


title: Is It A Good Idea To Change Author Slug (user_nicename field) Directly In MySQL DB?

text: Searching for a how-to on changing author slug, I found two methods:   1. Change the `user_nicename` field in the MySQL database of your WordPress site to whatever you want the slug to be.   2. Changing the Author Slug from Username to Nickname The (2) is out of question because I want the slug to be something custom, but not the nickname/nicename. As for (1) I wanted to know if this is okay -- to change the value of `user_nicename` field in the database for the user?


title: Style.css redirects to 404 Page not found

text:
I've just uploaded a wordpress site from MAMP to a live site. Exactly the same methods I usually use to upload them, including permalinks and all the usual PHPMyAdmin bits. This time the style.css, js and all the images are just redirecting to a 404 page. The website is here Can anyone help? This makes no sense at all. EDIT: heres a snippit of header.php:               <!DOCTYPE html>                                        <meta charset="utf-8">             <meta content='width=device-width, initial-scale=1.0' name='viewport'>             <meta content='Josh Stevens, Lyndsay Hooper, PotatoMou.se' name='author'>             <meta content='<?php bloginfo( 'description' ); ?> ' name='description'>             <meta content='' name='keywords'>                                                                    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />                  <title>                 <?php echo get_the_title() . "  -  ". get_bloginfo ( 'description' );  ?>
                              </title>                              and here is the actual rendered code:                    <!DOCTYPE html>                                            <meta charset="utf-8">             <meta content='width=device-width, initial-scale=1.0' name='viewport'>             <meta content='Josh Stevens, Lyndsay Hooper, PotatoMou.se' name='author'>             <meta content='Ken Christy Rural Support ' name='description'>             <meta content='' name='keywords'>                                                                    <link rel="stylesheet" type="text/css" media="all" href="http://www.kenchristy-ruralsupport.com/wp-content/themes/KenChristy/style.css" />                  <title>                 Home  -  Ken Christy Rural Support
                              </title>


title: Custom post pagination trouble

text: I do have a problem with a custom post pagination. I search through this site and googled the whole day yesterday, and found nothing that was similar to what I experience (or I'm getting blind...). Here is my custom post "recipe":               register_post_type( 'recipe', array(     'labels' => array(         'name'               => __('Recipes'),         'singular_name'      => __('Recipe'),         'add_new'            => __('Add New'),         'add_new_item'       => __('Add new Recipe'),         'view_item'          => __('View Recipe'),         'edit_item'          => __('Edit Recipe'),         'new_item'           => __('New Recipe'),         'view_item'          => __('View Recipe'),         'search_items'       => __('Search Recipes'),         'not_found'          => __('No Recipes found'),         'not_found_in_trash' => __('No Recipes found in Trash'),     ),     'public'        => true,     'show_ui'       => true,     'hierarchical'  => true,     'supports'      => array('title', 'editor', 'thumbnail'),     'menu_position' => 100,     'menu_icon'     => get_stylesheet_directory_uri() . '/images/icon_recipe.png',     'rewrite'       => array(         "slug"       => "recipe",         "with_front" => false,                 "pages"      => true     )     ) );      I need to load 6 recipes on my recipe page, and then I use jQuery to load the next 6 in AJAX. The code actually grab the "next page" URL (that is hidden in my page) to perform this. The problem is that it keeps loading the first 6 recipes, despite the fact that the url is correct (/recettes/page/2/). When I try to load this page directly in the address bar, it redirects to /recettes/ (that is my first page). Even when I put a die("test") at the top of my template file, it never gets there. Could it be only related to the URL rewriting? Here is my .htaccess file:               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>      The strange thing is that the same mechanism works for the news section... Any ideas? Thanks a lot for your help! Matt PS: here is the page, if you want to have a look: http://www.francoischartier.ca/recettes/ PPS: and this is the news section that works: http://www.francoischartier.ca/chartier/nouvelles/ Here is the query in the page template for recipes:                           $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                 $args = array(                     'post_type'      => 'recipe',                     'posts_per_page' => 6,                     'order'          => 'ASC',                     'orderby'        => 'post_title',                     'tax_query'      => array(),                     'paged'          => $paged,                                         'caller_get_posts' => 1                 );


title: Woocommerce Product Page edit "from" text

text: Is there a way to change the "From:" text that denotes the lowest available price for each particular product within the shop? I'm asking this as, on our shop we offer A4 samples within the Wallpaper sections, and the program sees this as the lowest available price. However this is somewhat misleading. So, is it possible to change this text to "A4 Sample:" Alternatively, is there away to add text. Either before the "From:" text, or to the end of the field, after the price? If none of this is possible, is there a way to get the default price of products in the Wallpaper section to be that of the Rolls of Wallpaper?


title: Using <?php echo get_num_queries(); ?> queries in and i see 7000+queries?

text: I have put queries in seconds. in my footer.php and i see more than > 7000 queries in about 9 secs , is this a lot?? On my localhost > i have 195 queries in 3,070 seconds. As the live version is slow i like to know if the queries could be the cause? And what would be the best step by step way to monitor/reduce the queries? How can i check which code triggers the queries? Regards


title: New Twitter API and Twitter count + timeline doesn't work anymore

text:
As some of you might know, Twitter has changed their API. With that some of my plugins / codes stopped working. I tried to fix them on my own, but failed. I tried googling for the new API URL and I also searched here. I tried to insert the URL provided in this post, but once applied I only got an error message. I need to update the following two codes with the new API, but don't know how to! Twitter followers' count snippet:               function rarst_twitter_user( $username, $field, $display = false ) {         $interval = 3600;         $cache = get_option('rarst_twitter_user');         $url = 'http://api.twitter.com/1/users/show.json?screen_name='.urlencode($username);              if ( false == $cache )             $cache = array();              // if first time request add placeholder and force update         if ( !isset( $cache[$username][$field] ) ) {             $cache[$username][$field] = NULL;             $cache[$username]['lastcheck'] = 0;         }              // if outdated         if( $cache[$username]['lastcheck'] < (time()-$interval) ) {                  // holds decoded JSON data in memory             static $memorycache;                  if ( isset($memorycache[$username]) ) {                 $data = $memorycache[$username];             }             else {                 $result = wp_remote_retrieve_body(wp_remote_request($url));                 $data = json_decode( $result );                 if ( is_object($data) )                     $memorycache[$username] = $data;             }                  if ( is_object($data) ) {                 // update all fields, known to be requested                 foreach ($cache[$username] as $key => $value)                     if( isset($data->$key) )                         $cache[$username][$key] = $data->$key;                      $cache[$username]['lastcheck'] = time();             }             else {                 $cache[$username]['lastcheck'] = time()+60;             }                  update_option( 'rarst_twitter_user', $cache );         }              if ( false != $display )             echo $cache[$username][$field];         return $cache[$username][$field];      Show latest tweets snippet:               function recentTweets($username, $number){       include_once(ABSPATH.WPINC.'/rss.php');            $tweet = fetch_feed("http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=" . $number );            if (!is_wp_error( $tweet ) ) :       $maxitems = $tweet->get_item_quantity($number);        $rss_items = $tweet->get_items(0, $maxitems);        endif;            if ($maxitems == 0) echo '
No Tweets.
';       else foreach ( $rss_items as $item ) {            $content = html_entity_decode($item->get_content());       $link = html_entity_decode($item->get_permalink());       $date = $item->get_date('U'); // retrives the tweets date and time in Unix Epoch terms      $blogtime = current_time('U'); // retrives the current browser client date and time in Unix Epoch terms      $dago = human_time_diff($date, $blogtime) . ' ago'; // calculates and outputs the time past in human readable format           echo "
$content •$dago
";       }      }      Thank you so much in advance. Here's my blog for reference.


title: Strange Anchor Tag Behavior (in-page links work, external pages do not)

text: I've got a strange issue in that anchor links on the current page work fine, but that the exact same link doesn't work if clicked from another page. If you go here, and click on any one of the items in the table, It'll take you to the correct area of the page, for instance, searching and clicking on corks takes me to this URL ( http://www.cswd.net/recycling/a-z/#corks ) but if I copy and paste that link into a browser, it will jump to the cork section and then immediately jump down to the bottom of the page. I don't see any conflicting javascript, the site is using thesis (I didn't have any hand in the design, coding or anything, just doing maintenance), and I'm not getting any errors in the console of firebug. I've tried removing the trailing '/' on permalinks (as suggested on the wordpress forums) but that didn't work - same issue. I'm personally stumped. Any ideas?


title: dropdowboxes with pre-selected custom fields optios that filters the results according seach needs

text: In my site I have one custom post types with custom taxonomies: custom post_type=listings --> Category --> Tags Along with it, I have some custom fields to separate them by country, state, region. The problem is that I need too supply an efficient form for users to perform a search and I would like to create several dropdowboxes with pre-selected custom fields optios that filters the results according their needs... eg. A user selects country-a and a second dropdowbox becomes active with states from that country and after that another one becomes active with regions from country a. Then, the user inserts the search term and gets their results filtered Is this possible? How can I do it? Any help is appreciated, Thanks!


title: Display tags that only appear in one category

text:
I'm trying to get this less manual than it currently is. I want to display tags that appear in only a single category, so if they are in a post that has two categories, I want that tag ignored. The following code works, but is a little clunky. Ideally I'd like to be able to skip having to add the excludes and just have it figure it out itself.               <?php      function pl8_artist_list($catname, $exclude) {         $custom_query = new WP_Query('posts_per_page=-1&category_name='.$catname.'&cat='.$exclude.'');         if ($custom_query->have_posts()) :             while ($custom_query->have_posts()) : $custom_query->the_post();                 $posttags = get_the_tags();                 if ($posttags) {                     foreach($posttags as $tag) {                         echo '
' . $tag->name . '
';                         echo '
' . $tag->description . '
';                         echo '
slug . '">Read posts about ' . $tag->name . '
';                     }                 }             endwhile;         wp_reset_postdata(); // reset the query         endif;     }      ?>      And I call it like so:               <?php     pl8_artist_list(trance, -3,-11,-4,-8);     ?>      The excludes being the other categories that the tags may appear in. I'm quite new to PHP, so any light that could be shed would be greatly appreciated.


title: WordPress get or set active menu class

text:
How to get active menu class in wordpress, I want to get it in one plugin to change menu style. Just to clear, I do not want active menu element class.

Home

About

Services

Team

Blog

Contact

      In this I want to get "nav-menu" or i want to set new class like
      But not using themes file, I want to work it for all theme which is active. Thanks In Advance, Ajay


title: How can I use Varnish Edge Side includes for a sidebar?

text: I've read this post here but am unsure where to start. https://www.varnish- cache.org/trac/wiki/ESIfeatures Edit for clarification: I do want to use Full page caching but once we cache say the article page, it can stay in the cache for a day or so, or if something pushes it out. But I'd Want the sidebar to refresh at a faster rate


title: Query post types with multiple keys

text: I'm looking for a way to only show posts results that contain all of the custom fields requested. Not one or the other. I was only able to get results with one array at a time. Any help would be appreciated.                       $documents = array(             'post_type' => 'documents',             'meta_query' => array(                 array(                     'key' => 'document-type',                     'value' => 'manual',                 ),                 array(                     'key' => 'document-status',                     'value' => 'current',                 )             )          );             query_posts( $documents );             get_template_part( 'loop', 'documents' );             wp_reset_query();      I also tried an SQL Query without any luck.                        $documents = "                 SELECT wposts.*                 FROM $wpdb->posts wposts                 JOIN $wpdb->postmeta document-status ON                   ( wposts.ID = document-status.post_id AND                     document-status.meta_key = 'document-status' )                 JOIN $wpdb->postmeta document-type ON                    ( wposts.ID = document-type.post_id AND                     document-type.meta_key = 'document-type' )                 WHERE document-status.meta_value = 'current'                 AND document-type.meta_value = 'manual'                 AND wposts.post_status = 'publish'                 AND wposts.post_type = 'documents'                 AND wposts.post_date < NOW()                 ORDER BY wposts.post_date DESC                 LIMIT 0 , 4              ";               $documents = $wpdb->get_results($documents, OBJECT);             query_posts( $documents );             get_template_part( 'loop', 'documents' );             wp_reset_query();


title: How are bulk actions handled in custom list table classes?

text: I'm working on a custom data table to display in the WordPress dashboard. The table populates from a database table I built in a plugin. I've been using the provided WordPress Custom List Table example for most of my coding questions in this area, but the example doesn't have anything for handling bulk actions. Here is the link for the documented example: http://wordpress.org/extend/plugins/custom-list-table-example/ For processing the bulk actions, the example only provides this:                   function process_bulk_action() {              //Detect when a bulk action is being triggered...         if( 'delete'===$this->current_action() ) {                  wp_die('Items deleted!');         }          }      I want to know how to pull the items selected for the action so I can delete them or edit their database entries accordingly.


title: wp_redirect not working when going to www version of site

text: The following function works perfectly when logged-in visitors go to http://sitename.com, taking them to the site homepage. When logged-in visitors go to http://www.sitename.com, however, they're incorrectly redirected to http://sitename.com/splashpage. Does anyone know what's causing this? I have tried switching my site settings to use http://www.sitename.com as the WordPress and Site Address URLs, but that simply reverses the issue so it incorrectly redirects when a logged-in user goes to http://sitename.com.               // REDIRECT USERS TO SPLASH PAGE IF THEY'RE NOT LOGGED IN     add_action ('template_redirect','mkm_restrict_access',1);     function mkm_restrict_access() {         $url = site_url('/splashpage/');         if (is_page('splashpage') || is_page('login')) {             //do nothing         } elseif (!is_user_logged_in()) {             wp_redirect( $url );              exit;          }     }      Thank you for your help!


title: Menu Arrow for Child Element

text: I have a menu for a website I am designing and there are parent and child elements...I was wondering if there was someway I could add an arrow to my navigation if the parent has a child element? My navigation code looks like:               <div id="nav">         <ul>             <?php                 wp_list_pages("title_li=");             ?>         </ul>     </div>      My CSS code looks like: http://pastebin.com/xBbHsyVM I would prefer to use a text arrow, but an image arrow will work just as easily...a css solution over javascript or jquery is also a plus, but not a big deal if it isn't. Thanks,   Josh


title: Sync User to cPanel webmail?

text: 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!


title: Paging in a sidebar mini loop

text:
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)


title: WordPress wp get nav menu items does not deliver external link

text:
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 '
';           }   ?>


title: Adding graphics to 404.php page

text: 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!


title: Shortcode in posts called by ajax is not working

text:
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


title: Image MetaBox not saving in custom posts

text: 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' );


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

text: 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!


title: get_users() ORDER BY Not Working

text: 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!


title: Multisite: a particular user is getting all new sites associated

text: 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!


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

text: 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" />


title: How to Batch Upload .docx Files as Posts

text: 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?


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

text: 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?


title: How to create a menu super voice in WP?

text: 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


title: Error establishing database connection - high traffic?

text: 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.


title: Changing the post date and time with function

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


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

text: 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)


title: duplicate user metadata key values

text: 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?


title: Way to add captions to gallery images by code

text: 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?


title: Automatically delete posts based on query

text: 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');


title: option_active_plugins filter not working

text: 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?


title: Add a header above blog posts but below page header

text: 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!


title: Cannot select certain authors for posts after import

text: 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?


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

text: 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?


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

text: 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?


title: Older/Newer post links display the same posts

text:
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(); ?>


title: Delete option doesn't appear for plugins

text: 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)


title: Displaying a custom field in Category Archives

text:
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.


title: Custom search by several options send on form not works

text: 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                );


title: free form wordpress

text: 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?


title: WP Nanoplex 1.0.3 malfunction

text: 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.


title: Post Navigation

text: 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.


title: How do I restore my WordPress that has been hacked?

text: 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.


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

text: 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!


title: Menu item with no page, but with dropdown

text: 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.


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

text: 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


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

text: 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


title: Change headline text for post thumbnail meta box

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


title: How do I implement jPanelMenu?

text: 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


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

text: 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?


title: how to create a fav icon shortcode?

text: 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 ;)


title: wordpress showing all posts instead of date range

text:
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?


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

text:
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");`


title: Repeatable Custom Field for Media Upload

text: 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.