2 Different Custom Post Types in Submenu

i have register 2 custom post types within my plugin one of them is shown in the left admin bar, the second i wouldn't show so i have set the "show_ui" to false. Is it possible to add the second post type to the menu of the first post type? **first post type:**               $args = array(       'labels' => $labels,       'public' => true,       'has_archive' => false,       'menu_position' => 100,       'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail' ),       'menu_icon' => plugins_url( 'assets/img/small1.png', __FILE__ ),       'rewrite' => array('slug' => 'screenshots', 'with_front' => true)     );          register_post_type( 'screenshots', $args );      **second post type:**               $args = array(       'show_ui' => false,       'labels' => $labels,       'public' => true,       'has_archive' => false,       //'menu_position' => 100,       'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail' ),       //'menu_icon' => plugins_url( 'assets/img/small2.png', __FILE__ ),       'rewrite' => array('slug' => 'deal', 'with_front' => true)     );          register_post_type( 'deals', $args );      **I try to add the second post type with:**               add_submenu_page( 'edit.php?post_type=deals', __('Deal', $this->var_sTextdomain), __('Deal', $this->var_sTextdomain), 'manage_options', 'my-deal', array(&$this, 'deal_page') );      What can i do to add it to the first post type at the end? regards


Exclude function from running on a certain page

I'm working on modifying the Keyboard Shortcut Navigation plugin to fit my site. Here's the plugin: http://wordpress.org/extend/plugins/easy-keyboard- shortcut-navigation/ I don't want this plugin to run on page 2020. I've tried `&& !is_page('2020')` and `|| !is_page('2020')` in the `elseif` below, but it keeps running the function. Any ideas? **Edit update** : As requested, I'm removing the snippet and including the full code from the plugin located at the above URL.               add_action('wp_footer','keyboard_shortcut_navigation');     function keyboard_shortcut_navigation(){         global $paged, $wp_query;         if ( !$max_page )             $max_page = $wp_query->max_num_pages;         if ( !$paged )             $paged = 1;         $nextpage = intval($paged) + 1;     ?>     <?php if( is_single() ) : ?>     <script type="text/javascript">         document.onkeydown = chang_page;function chang_page(e) {         var e = e || event,         keycode = e.which || e.keyCode;         var obj = e.target || e.srcElement;         if(obj.tagName.toLowerCase()=="textarea"){return;}         if(obj.tagName.toLowerCase()=="input"){return;}         if (keycode == 33 || keycode == 37) location = '<?php echo get_permalink(get_adjacent_post(false,'',false)); ?>';         if (keycode == 34 || keycode == 39) location = '<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>';         }     </script>     <?php elseif( is_home() || is_category() ) : ?>     <script type="text/javascript">         document.onkeydown = chang_page;function chang_page(e) {             var e = e || event,             keycode = e.which || e.keyCode;             var obj = e.target || e.srcElement;             if(obj.tagName.toLowerCase()=="textarea"){return;}             if(obj.tagName.toLowerCase()=="input"){return;}             if (keycode == 33 || keycode == 37) location = '<?php echo get_previous_posts_page_link(); ?>';             if (keycode == 34 || keycode == 39)              <?php if ( $nextpage <= $max_page ) : ?>                 location = '<?php echo get_next_posts_page_link(); ?>';             <?php else : ?>                 location = '<?php echo get_pagenum_link( $max_page ); ?>';               <?php endif; ?>         }     </script>     <?php endif; ?>     <?php     }


How can i display the content in plaintext

i want to display my excerpt in plaintext. How can i do this? This is my Snippet where i display the content:               <?php the_content(__( 'Weiterlesen ›','okay')); ?>      How i change the snippet to display the content in plain? greets, niklas


Update some database fields when post is saved

I have a class that will count the Lines of Code, Source Lines of Code, and the Code disk space used. I would like to save these values into the database so that these values can be calculated only when a new post is saved or updated instead of running the code on every page view So my question is, what is the best way to make sure these are added/updated everytime a new post is made and everytime that post is updated/edited. Also where should I store these, in a custom meta field? If so, how can I make sure that the meta box does not show up on the page, it should all be done behind the scenes


3.3: How do you hide the new dashboard welcome panel?

I have tried various versions of this here:               unset($wp_meta_boxes['dashboard']['normal']['high']['dashboard_wp_welcome_panel']);     unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_wp_welcome_panel']);     unset($wp_meta_boxes['dashboard']['normal']['core']['wp_welcome_panel']);     unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_welcome_panel']);     unset($wp_meta_boxes['dashboard']['normal']['core']['welcome_panel']);      I have tried looking this up but as there is not much documentation (there is but there isn't ) on it yet it is kind of hard. I was wondering if someone could please help me out. I would really appreciate it. Thanks. :)


WordPress Admin back-end - advanced options page?

Am I losing my mind? I seem to recall that somewhere in the Admin back-end there was a page that basically listed out all the fields within wp_options. Does this ring a bell to anyone else? I thought maybe it was a MU thing but it's not there either. At one point I seem to recall running into a page where you could edit the options directly (without using a DB client). No big deal if there isn't but I swear I've seen such a beast, and I don't think it was through a plugin...


What does the term "bundled-theme" mean?

I have occasionally heard the term "bundled-theme". I know what a WordPress theme is, but I don't know what a "bundled-theme" is. I came across that term recently when reviewing the WordPress documentation: > "...For core (and bundled themes), this is always > WordPress."(http://make.wordpress.org/core/handbook/inline-documentation- > standards/php-documentation-standards/)


Dealing with Many Meta Values, 30+

I have a "Listing" post type with 30+ meta keys which I feel like can cause a strain on the database when there's 100+ posts. Usually what I do is save each meta value 1 by 1 like so:               if(isset($_POST['_item_stock']) && !empty($_POST['_item_stock']))         update_post_meta($post_id, '_item_stock', sanitize_text_field($_POST['_item_stock']));     else         delete_post_meta($post_id, '_item_stock');      I do this because if I need more control over validation, I have it. It's organized and nice looking in the code. **The Drawback** being that it's lengthy and it saves each meta individually in the database. My other option is to standardize all my meta into an array then serialize it. **The Drawback** to this method is that I can't run any meta queries on serialized data, so filtering searches or post ordering is out the window. The final option is to do half and half, serialize what I don't need for queries and everything else I save individually. While it may be save some overhead I don't want it to look messy in my code or have any kind of disconnect. My question is - How do you normally handle posts that have many meta keys? Is the database overhead as bad as I imagine when I save each meta key individually? Which method do you think is the best and why?


A good way to include snippets of code in both posts, pages and Event Manager Template files?

(I am not sure if I am phrasing this correctly, so please bear with me and be kind. ) I have a setup where the same information need to be included in both **pages** , and **individual Events** ( **Custom post type** from Event Manager) AND in the **email template** for Event Manager. Is there a good way to include this from a central location, like post snippets? I tried with the plugin Post Snippets, but of course that only works on posts. Is it possible to put the information in the functions.php file and then call the variable in all these different places? _Or is there a better way to do it that would still allow for the site administrator to edit the text with a WYSIWYG-editor?_ Thanks for you help and patience.


Query Distinct Taxonomies of Custom Post Type

I have a custom post type called "coupons". These coupons can then be drilled down by "city". City is a custom field that is defined for each individual "coupon". I am then trying to modify a sidebar widget so it will only show the distinct categories related to the specific queried cities result set, as opposed to all coupon categories. I would then need to display a count that would show how many of the returned coupons belong to the specific category. So far the query returns all coupon categories (and the coupon count), not just the ones that belong to the specific coupon category.               SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('coupon_category', 'coupon_tag', 'stores', 'coupon_type') AND tr.object_id IN (430, 618) ORDER BY t.name ASC      Any help would be greatly appreciated.


Why won't child theme's style.css override plugin's css

I am using my own child theme for twentyeleven, and I've made some changes to some plugin's css classes in my child style.css. The problem I'm having is that if I add a new css attribute to a class from the plugin's css, then it will make the change. But, if the attribute is already declared in the plugin's css, it relies on that. How can I make my child theme's style.css take precedence over the plugin's css files? Here's an example of what happens from firebug (the first css file is from the plugin, the second is from my child theme): ![enter image description here](http://i.stack.imgur.com/W6WLM.png)


Always generate thumbnail after sideloading image

I'm sideloading an image into wordpress from youtube. it works fine and the key part of the code is:               // sideload it into wordpress (generates various sizes)     $thumbid = media_handle_sideload( $file_array, $post->ID );     if ( is_wp_error($thumbid) ) { // deal with error here }          // kill existing attachment first, if any     wp_delete_attachment(get_post_thumbnail_id($post->ID), true);          // and finally associate post with new thumbnail     set_post_thumbnail( $post, $thumbid );      Here's the problem. I have registered 5 image sizes with `add_image_size` in my Wordpress functions file. When I sideload per the code above, WP generates all the thumbs for the image in all the sizes _except one,_ 640x400. I believe it's skipping this thumb since 640x400 is actually larger than the image that is returned from YouTube. However, I need to get that thumbnail no matter what-- I want to force Wordpress to generate that thumbnail. How can I do that? I register the image size just like all others:                add_image_size( 'static-head', 640, 400, true );      So I'm looking for function sort of like `wp_generate_thumbnail($thumbid, 'static-head')`, that will leave the right 640x400 image in the uploads folder. Thank you--


php within a shortcode within php

I've been trying for ages to get this work, but to no avail! Any help would be greatly appreciated.               <?php echo do_shortcode("[thumb]'".bp_profile_field_data('field=3')"'[/thumb]"); ?>      Basically I the centre part (enclosed by the 1st closing and second opening square brackets are causing the trouble. Thanks


Echo page path suffix only - not the title, path or permalink

Is it possible to echo a page path suffix only? ie: if the path/permalink is example.com/about, echo just "about"? My page paths are different than my page titles (ie: page title for example.com/about is "About ACME Co.") so I cannot use `the_title()` I am trying to echo just the suffix so it is the same name as an icon image for each page, so if the page is "about", the icon is `icon_page-about.png`, like this (wpse_page_suffix is where I need the help): `<img src="<?php bloginfo('template_directory'); ?>/_img/icon_page-<?php wpse_page_suffix();?>.png" alt="Icon - <?php the_title();?>" />`


How do I force wp_enqueue_scripts to load at the END of <head>?

I am loading scripts via wp_enqueue_scripts in my child theme. The only problem is that my style.css script get loaded BEFORE plugin scripts, yet I need to override the css in the plugins with my style.css, meaning it has to load AFTER plugin scripts. I don't want to add "!important" too all of my css styles because that is tedious and could break some of my styling. I tried adding a priority but it did not effect the loading order at all.                   add_action('wp_enqueue_scripts', 'scripts', 9999);      I would simply like to wp_enqueue_scripts at the very end of the header, just before < /head >. How can it be done? Thanks :-) **UPDATE:** Yay I figured it out! Simply register the filter with:                   add_action('wp_print_styles', 'scripts');      wp_print_styles loads with a priority of 8, and it still places them in the header because it's a part of wp_head. I figured this out by looking in wp-includes/default-filters.php, so thanks for the tip! :-)


How do I display a greyed out next_post_link when there is no next post

Wordpress hides the next and previous post links if there are none, but for the sake of visual consistency I'd like to serve up a greyed out version of the link when there is no next or previous post. I'm assuming a simple if else statement will do, but I don't really do PHP. Any thoughts?


How to Add a Custom Colum on Thickbox Media Gallery Tab?

On searching for a solution, I found the following codes to add col on media page:               add_filter ( "manage_upload_columns",  'upload_columns' );     add_action ( "manage_media_custom_column", 'media_custom_columns' , 0, 2 );      The result is close to what I want, but I need to implement it on thickbox gallery tab-- I want to add an "Include" checkbox column for the media items. How can I achieve this? **[update]**   This checkbox would serve as the _include_ part in the gallery shortcode `[gallery include="23,39,45"]`. _But_ , the shortcode is not written in the post content. The gallery is added for each post by a theme template. **[update]** To save the ids we get from brasofilo's scripts, I added name="include_ids" in the shortcode line and added this:               add_action( 'edit_attachment',  array ($this,'save_to_parent_meta' ));          function save_to_parent_meta(){     if ( isset($_POST['include_ids']) && !empty($_POST['include_ids']) ) {     check_admin_referer('media-form');     update_post_meta( $_REQUEST['post_id'],'include_ids',$_POST['include_ids']);     }     }      This will save the ids to parent post's meta if 'includes_ids' filed is not empty. Nearly perfect. But, when the tab is loaded, the include_ids field is empty, and all checkbox is unchecked. Users might think they need to check again even if they don't want to make change.


How to modify the attachment info text on gallery tab or media page?

when show/edit an image/file, on the right side of the image/file, there are some text info-- File name, File Type, Upload date, Demention... How to modify those text?


Custom Taxonomy Tag Search

I have an existing WordPress search function, what I'd like to be able to do is extend the search to the tags from my custom taxonomy...how do I do that?               <form method="get" id="searchform" action="<?php echo home_url(); ?>">         <input type="text" value="Product Search..." name="s" id="s" />         <input type="image" src="<?php bloginfo('template_directory') ?>/images/icosearch.png" id="searchsubmit" value="" />     </form>      I tried to use the "Search Everything" plugin, but that functionality doesn't seem to extend to custom taxonomies. I'm not sure if there is a different plugin or some kind of filter that would get the job done. Thanks in advance!   Josh


What hooks, actions or filters i can use to customize wordpress registration page and form?

i would like to customize the design of the registration page of wordpress and also the registration form. Can i create a registration page template? or maybe tell wordpress to use a custom registration page i create.


If else with shortcodes

I only want one of these shortcodes to display if the custom field value is true. I'm not understanding the logic to do this. So basically, if there is a twitch video and a own3d video I only want the top video (twitch) to display. So on and so forth. Is this beyond the if else statement? I'm adding this code of course to my template.php file. My second question is would this code be better off using the switch method?               <?php     $twitch = get_post_meta( $post->ID, 'twitch', $single = true );     $own3d = get_post_meta( $post->ID, 'own3d', $single = true );     $livestream = get_post_meta( $post->ID, 'livestream', $single = true );     $ustream = get_post_meta( $post->ID, 'ustream', $single = true );     $justin = get_post_meta( $post->ID, 'justin', $single = true );               if ($twitch == '') {     }     else {      echo do_shortcode('[livestream type="twitch" channel="' . $twitch . '"]');     }          if ($own3d == '') {     }     else {      echo do_shortcode('[livestream type="own3d" channel="' . $own3d . '"]');     }     if ($livestream == '') {     }      else { echo do_shortcode('[livestream type="livestream" channel="' . $livestream . '"]'); }               if ($ustream == '') {     }     else {     echo do_shortcode('[livestream type="ustream" channel="' . $ustream . '"]');     }          if ($justin == '') {     }     else {     echo do_shortcode('[livestream type="justin" channel="' . $justin . '"]');     }     ?>


Creating a subdomain network in a subdomain

I've installed Wordpress on subdomain.domain.com. I've enabled the Wordpress Network on this installation, choosing a subdomain install. I've created a wildcard subdomain in cpanel, which is *.subdomain(.domain.com), which points to /public_html/subdomain I've created a site: site.subdomain.domain.com, but I cannot visit the dashboard of this site, nor does it show under the My Sites dropdown menu after creating it - I get an ISP Site Not Found page. Is this situation not workable: creating a subdomain network in a subdomain?


Error establishing a database connection when installing multiple sites locally

1. Initially I was using MAMP and had only 1 wordpress site running locally on my Mac. I've set: document root to: documents/mywebsites/mysite1 In phpMyAdmin I created a DB called: mysite1 wp-config file: mysite1/root/root/localhost   2. Since I would like to develop another website, I have upgraded to MAMP Pro. In MAMP Pro Hosts tab, I can see the previous server: mysite1 I have added another server name: mysite2 and set it's document root to: documents/mywebsites/mysite2 In phpMyAdmin I created a DB called: mysite2 wp- config file: mysite2/root/root/localhost   1. When going to localhost/mysite1, I can see the website I already have created a while ago. I can also get to the localhost/mysite1/wp-admin. However, when going to localhost/mysite2, I am getting: > "Error establishing a database connection" I get the same error in: localhost/mysite2/wp-admin.   1. I tried to change the wp-config to point to `127.0.0.1:3306`. now mysite1 does not work (the browser shows a blank white page) And also mysite2 gives same results   2. Using Sequel Pro, I noticed that the db mysite1 contains a few table, but the db mysite2 does not contain any table.   3. MAMP is configured with: Apache on port `80`. And MySQL on `3306` I've googled a few pages which provided solutions that did not help. Perhaps anyone can advise?


Multisite development environment

I have a domain-based multisite with domain mapping. Until now I've been developing locally with   * my hosts file setup to handle all sites through localhost    * a flag in my wp-config.php, indicating whether to use the local or live db This makes development very pleasant, because development and production environment are very similar and all paths are always identical. Now I need to develop on a public / non-localhost address. What's the best way to accomplish that - or what options exist in general.


Custom wordpress SQL statement for a website

I'm trying to link specific columns from a few standard tables in a wordpress database. I specifically want to see a view/table that includes:               post title     post content     guid     meta value = image url      This kind of works but I have 3 rows per item returned. I just want one, then to be able to select the newest item from all categories except 2, 4 and 7 for example.               SELECT wp_posts.post_title, wp_posts.`guid`, wp_postmeta.meta_value     FROM wp_posts, wp_postmeta     WHERE wp_posts.post_type = 'post'     AND wp_postmeta.meta_key = 'image_url'     AND wp_posts.post_status = 'publish'      I've been on this task for 3 days and searched hi and lo, watched videos, followed tuts and am about to pull my hair out.


How can I increase the font sizes used by the WordPress visual and HTML post editors?

When I'm editing a post, the text looks too small. I want larger text **while editing**. Note that I'm **not** referring to increasing the text in the resulting post ... I mean the text _as it is displayed while I am editing_ , only. I've looked at Settings under "Writing" and I see I can change the _number of lines_ in the editor to make the edit area larger to fill more of my screen, but how can I make each of those lines render in a larger font?


Create custom fields as image uploads

How can I define a custom field that works as an image upload? Should be fairly basic but I can't seem to find the solution. Let's say you create the post type 'book' and want to create 3 fields: cover, back, index... I don't know... I've done similar stuff in the past with flutter/magic fields but they don't seem to be updated or support native WP3 custom post types. Alternatives anyone? Thanks in advance


Meta query - How to display a null meta key

At the base I have this query wich displays 9 randoms custom post type :               $args= array(         'post_type' => 'adverts',         'orderby' => 'rand',         'posts_per_page' => 9,         'tax_query' => array(             array(                 'taxonomy' => 'type',                 'field'    => 'slug',                 'terms'    => $term             )         )     );      Now I would like to display 9 adverts (CPT) which have a votes average (meta_key) lower than 6. So I add this :               $args= array(         'post_type' => 'adverts',         'orderby' => 'rand',         'posts_per_page' => 9,         'meta_query' => array(             array(                'key' => 'votes_average',                'value' => '6',                'compare' => '<',                'type'    => 'NUMERIC',             )         )     );      When I don't add this meta_query, my first query works. I mean it diplays random posts even those who have a "votes_average" equal to 0. But the secondary query doesn't display the adverts with a "votes_average" equal to 0. Did I forget something ?


How to make a list of posts displaying them 5 by 5 with a "next posts" link?

I have been googling for the past 2 hours and haven't been able to figure this out, mainly because I am missing the right terminology, in other words, I don't know what I want in "wordpress words". What I want is a custom ¿page? that will display the header (get_header()) and below it it will be a list of the last 5 **published** posts and it should go like this: > Title of the post >   >   >     Text of the post >   Times five for the last five. Underneath it there should be a link to "Older posts" that links to the next five (older) posts. I'm told this is an archive but the documentation on Archive doesn't help to accomplish this, neither do the tutorials I've found. What is the easiest way to do this?


Display latest 12 images from media library

I was looking for almost a week for such solution - without success. What I want to achieve is have a kind of 'photos cloud' on my wordpress homepage. What I need to do is to display latest 12 photos added to media library (so not from specific posts, but in general). thumbs should appear in a square - 3 cols, 4 rows (but of course this part I can get via css). I have no brightest idea how to make it.. I've found such piece of code:               $args = array(         'post_type' => 'attachment',         'post_status' => 'published',         'posts_per_page' =>25,         'post_parent' => 210, // Post-> ID;         'numberposts' => null,     );          $attachments = get_posts($args);          $post_count = count ($attachments);          if ($attachments) {         foreach ($attachments as $attachment) {         echo "
";             $url = get_attachment_link($attachment->ID);// extraigo la _posturl del attachmnet                   $img = wp_get_attachment_url($attachment->ID);             $title = get_the_title($attachment->post_parent);//extraigo titulo             echo '';             echo "
";         }        }      But I don't know how to finalize it - without pointing to specific post. Any ideas?:) thank u!


Change the_title() of a page dynamically

I'm developing a plugin that doesn't use a custom post type, but separate database tables. It's a plugin that displays a list of courses with links that lead to the different course detail pages, where the user then can subscribe for a course. In the current state, I'm using a shortcode to get the plugins data into a page with a custom page template (page-courses.php). I now want to change `the_title()` dynamically, according to the page that the plugin shows (list of courses, course details page with forms, form submission success page). But whenever I do that with the following filter, the links to other pages in the footer also change:               <?php          add_filter('the_title', 'custom_page_title');     function custom_page_title() {         return 'Custom Title';     }      ## Edit In the footer.php I have a function that includes footer links with `wp_nav_menu()` so I can define them in Appearance > Menus. But with the filter above, all the links in the footer also change to 'Custom Title'. But I just want to change the title of the page, not affecting menu links in the footer. Trying to add a conditional tag `in_the_loop()` the footer links are still affected, although they are not in the loop.               <?php          add_action( 'loop_start', 'set_custom_title' );     function set_custom_title() {         if ( in_the_loop() ) {             add_filter( 'the_title', 'custom_page_title' );         }     }          function custom_page_title() {         return 'Custom Title';     }      It’s similar to this question: filter the_title problem in nav, just that the links affected are in the footer and `in_the_loop()` doesn't work. How I can I change `the_title()` while only affecting the title of the current page being shown _not affecting links in the footer_? ## Edit 2 - Solution So I finally got it working:               <?php          add_action( 'loop_start', 'set_custom_title' );     function set_custom_title() {         add_filter( 'the_title', 'wpse83525_filter_the_title', 10, 2 );     }          function wpse83525_filter_the_title( $title, $id ) {         if ( 'page-listcourses.php' == get_post_meta( $id, '_wp_page_template', true ) ) {             return 'Custom Title';         }         return $title;     }      The file page-listcourses.php is a Custom Post Template that I assigned to the static page named 'Courses'. I assume it didn't work before because the name of the static page and filename of the Custom Post Template were the same.


Why does this query not SELECT post IDs like a normal query would?

1. I have a page template, call it page-myblog.php, that I want to display an ordinary loop on.    2. I have created a page 'myblog' in the admin area and it crops up as normal on the front end.   3. I want to show all my blog posts in the loop on that page template. I refuse to instantiate a new WP_Query on the page and I want to edit the main query instead. This appraoch has not worked thanks to the following behaviour:               add_action( 'pre_get_posts', function( $query ) {         if( $query->query['pagename'] === 'myblog' ) {             $query->set( 'pagename', null );             $query->set( 'post_type', 'post' );         }     });      results in the following SQL being generated.               SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post'  ORDER BY wp_posts.post_date DESC       This query works, which is to say, it does find posts if you run it in an SQL console, but because it doesn't explicitly select IDs (I think?) there's nothing in my $query->posts array. Why does this happen? And can I fix it?


Echo all category names, apart from one

I've got this simple code, that creates breadcrumbs:               function the_breadcrumb() {         if (!is_home()) {             echo '';             echo 'home';             echo " / ";             if (is_category() || is_single()) {                 the_category(' / ');                 if (is_single()) {                     echo " / " . '' . get_the_title() . '';                 }             } elseif (is_page()) {                 echo " / " . '' . get_the_title()  . '';             }         }     }      And this echoes out:
         home /          Fashion /          Top /          This is in the fashion category.
      However, it do not want it to show the `a href` tag that links to the `top` category. Is there a way to include a str_replace, or just prevent the_category from calling `top` (I still need the post, I just don't want to link to `top` in the breadcrumbs)?


Prevent simultaneous logins

I have been searching the internet for a long time but couldn't find a suitable solution. I am using wordpress for a online service via subscriptions (woocommerce subscriptions). I want to prevent simultaneous logins. There are many plugins that will logout the user who logged first but this is not a solution to me. I need the user to be unable to login if his account is already logged in and display an error message like "your account is already in use". Is this possible? Thanks in advance.


What hooks should I use for pre-login and pre-registration actions?

I am adding cookie on login page using 'init' action-hook. And than after login I check if this cookie exist in 'login_init' action-hook. And also after user registration I check if this cookie exist in 'registration_errors' filter-hook. **Do I use proper hooks for pre-login and pre-registration actions?** code:               <?php          $securityprotection_send_brute_force_log_to_admin = true; // if true, than info about blocked brute-force attacks will be sent to admin email          $securityprotection_login_cookie_check = true; // if true, than cookie will be set on login screen and checked before login          $securityprotection_registration_cookie_check = true; // if true, than cookie will be set on registration screen and checked before registration                    if ( ! function_exists( 'securityprotection_hooks' ) ) :              function securityprotection_hooks() {             add_action( 'init', 'securityprotection_set_login_cookie' );             add_action( 'login_init', 'securityprotection_login' );             add_filter( 'registration_errors', 'securityprotection_registration', 10, 3 );         }              securityprotection_hooks();                   function securityprotection_set_login_cookie() {             global $securityprotection_login_cookie_check;             if( $securityprotection_login_cookie_check ) {                 if( strtoupper( $_SERVER['REQUEST_METHOD']) == 'GET' and !isset( $_COOKIE['wordpress_secprot_cookie'] ) ) {                     setcookie( 'wordpress_secprot_cookie', '1', time()+60*60*24*30, COOKIEPATH, COOKIE_DOMAIN ); // set cookie for a month                     $_COOKIE['wordpress_secprot_cookie'] = '1';                 }             }         }                   function securityprotection_login() {             global $securityprotection_send_brute_force_log_to_admin, $securityprotection_login_cookie_check;                  if( $securityprotection_login_cookie_check ) {                 if( strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' and !isset( $_COOKIE['wordpress_secprot_cookie'] ) ) {                          if ( $securityprotection_send_brute_force_log_to_admin ) { // if sending email to admin is enabled                         $securityprotection_admin_email = get_option('admin_email');  // admin email                              if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { //check ip from share internet                             $ip = $_SERVER['HTTP_CLIENT_IP'];                         } elseif ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { // to check ip is pass from proxy, also could be used ['HTTP_X_REAL_IP ']                             $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];                         } else {                             $ip = $_SERVER['REMOTE_ADDR'];                         }                              $securityprotection_message_brute_force_info = '';                         $securityprotection_message_brute_force_info .= 'IP : ' . $ip . "\r\n";                              $securityprotection_message_brute_force_info .= 'HTTP_USER_AGENT : ' . $_SERVER['HTTP_USER_AGENT'] . "\r\n";                         $securityprotection_message_brute_force_info .= 'REQUEST_URI : ' . $_SERVER['REQUEST_URI'] . "\r\n";                         $securityprotection_message_brute_force_info .= 'HTTP_REFERER : ' . $_SERVER['HTTP_REFERER'] . "\r\n\r\n";                         //$securityprotection_message_brute_force_info .= 'SERVER_PROTOCOL : ' . $_SERVER['SERVER_PROTOCOL'] . "\r\n";                         //$securityprotection_message_brute_force_info .= 'REDIRECT_STATUS : ' . $_SERVER['REDIRECT_STATUS'] . "\r\n\r\n";                                   $securityprotection_message_brute_force_info .= 'POST vars:'."\r\n"; // lets see what POST vars brute-forcers try to submit                         foreach ( $_POST as $key => $value ) {                             $securityprotection_message_brute_force_info .= '$_POST['.$key. '] = '.$value."\r\n"; // .chr(13).chr(10)                         }                         $securityprotection_message_brute_force_info .= "\r\n\r\n";                                        $securityprotection_message = '';                              $securityprotection_message .= $securityprotection_message_brute_force_info; // post, cookie and other data                              $securityprotection_message .= $securityprotection_message_append;                                   $securityprotection_subject = 'Login brute-force on site ['.get_bloginfo( 'name' ).']'; // email subject                         @wp_mail( $securityprotection_admin_email, $securityprotection_subject, $securityprotection_message ); // send log info to admin email                          }                          // many brute-force attacks are waiting for redirect or WordPress login cookies                     // if we will fake redirect and login cookies than many brute-forcers will stop their attacks                          securityprotection_set_fake_login_cookies(); // set fake login cookies                          securityprotection_fake_redirect(); // fake admin dashboard redirect                      }                  }              }              function securityprotection_registration($errors, $sanitized_user_login, $user_email) {             global $securityprotection_send_brute_force_log_to_admin, $securityprotection_registration_cookie_check;                  if( $securityprotection_registration_cookie_check ) {                 if( strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' and !isset( $_COOKIE['wordpress_secprot_cookie'] ) ) {                          if ( $securityprotection_send_brute_force_log_to_admin ) { // if sending email to admin is enabled                         $securityprotection_admin_email = get_option('admin_email');  // admin email                              if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { //check ip from share internet                             $ip = $_SERVER['HTTP_CLIENT_IP'];                         } elseif ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { // to check ip is pass from proxy, also could be used ['HTTP_X_REAL_IP ']                             $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];                         } else {                             $ip = $_SERVER['REMOTE_ADDR'];                         }                              $securityprotection_message_brute_force_info = '';                         $securityprotection_message_brute_force_info .= 'IP : ' . $ip . "\r\n";                              $securityprotection_message_brute_force_info .= 'HTTP_USER_AGENT : ' . $_SERVER['HTTP_USER_AGENT'] . "\r\n";                         $securityprotection_message_brute_force_info .= 'REQUEST_URI : ' . $_SERVER['REQUEST_URI'] . "\r\n";                         $securityprotection_message_brute_force_info .= 'HTTP_REFERER : ' . $_SERVER['HTTP_REFERER'] . "\r\n\r\n";                              $securityprotection_message_brute_force_info .= 'POST vars:'."\r\n"; // lets see what POST vars brute-forcers try to submit                         foreach ( $_POST as $key => $value ) {                             $securityprotection_message_brute_force_info .= '$_POST['.$key. '] = '.$value."\r\n"; // .chr(13).chr(10)                         }                         $securityprotection_message_brute_force_info .= "\r\n\r\n";                              $securityprotection_message_brute_force_info .= 'COOKIE vars:'."\r\n"; // lets see what COOKIE vars brute-forcers try to submit                         foreach ( $_COOKIE as $key => $value ) {                             $securityprotection_message_brute_force_info .= '$_COOKIE['.$key. '] = '.$value."\r\n"; // .chr(13).chr(10)                         }                         $securityprotection_message_brute_force_info .= "\r\n\r\n";                                   $securityprotection_message = '';                              $securityprotection_message .= $securityprotection_message_brute_force_info; // post, cookie and other data                              $securityprotection_message .= $securityprotection_message_append;                                   $securityprotection_subject = 'Registration brute-force on site ['.get_bloginfo( 'name' ).']'; // email subject                         @wp_mail( $securityprotection_admin_email, $securityprotection_subject, $securityprotection_message ); // send log info to admin email                              $errors = new WP_Error();                         $errors->add( 'security_protection_error', 'ERROR: Security-protection registration error.' );                              //securityprotection_set_fake_login_cookies(); // set fake login cookies                         //securityprotection_fake_redirect(); // fake admin dashboard redirect                          }                 }             }             return $errors;              }               endif; // end of securityprotection_hooks()               if ( ! function_exists( 'securityprotection_plugin_meta' ) ) :         function securityprotection_plugin_meta( $links, $file ) { // add 'Plugin page' and 'Donate' links to plugin meta row             if ( strpos( $file, 'security-protection.php' ) !== false ) {                 $links = array_merge( $links, array( 'Security-protection' ) );                 $links = array_merge( $links, array( 'Donate' ) );             }             return $links;         }         add_filter( 'plugin_row_meta', 'securityprotection_plugin_meta', 10, 2 );     endif; // end of securityprotection_plugin_meta()                    if ( ! function_exists( 'securityprotection_random_string_generator' ) ) :         function securityprotection_random_string_generator( $readable = 0, $length = 32 ) {             $random_string = '';             if( $readable ){ // create readable random string like 'suzuki'                 $characters_b = 'bcdfghjklmnpqrstvwxz';                 $characters_a = 'aeiouy';                 $ab = 'b';                 for( $i = 0; $i < $length; $i++ ) {                     if( $ab == 'b' ){                         $random_string .= $characters_b[ rand( 0, strlen( $characters_b ) - 1 ) ];                         $ab = 'a';                     } else {                         $random_string .= $characters_a[ rand( 0, strlen( $characters_a ) - 1 ) ];                         $ab = 'b';                     }                 }             } else { // create fully random string like 'q3WLtN'                 $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';                 for( $i = 0; $i < $length; $i++ ) {                     $random_string .= $characters[ rand( 0, strlen( $characters ) - 1) ];                 }             }             return $random_string;         }     endif; // end of securityprotection_random_string_generator()               if ( ! function_exists( 'securityprotection_fake_redirect' ) ) :         function securityprotection_fake_redirect() { // fake admin dashboard redirect             //header("HTTP/1.0 403 Forbidden"); // correct redirect             $redirect_to = admin_url();             wp_safe_redirect($redirect_to); // redirect the brute-force bot to admin section to emulate that the password is cracked and some brute-forcers stop their attacks after such redirect :)             exit();         }     endif; // end of securityprotection_fake_redirect()               if ( ! function_exists( 'securityprotection_set_fake_login_cookies' ) ) :         function securityprotection_set_fake_login_cookies() { // set fake login cookies                  $expiration = time() + 14 * DAY_IN_SECONDS;             $expire = $expiration + ( 12 * HOUR_IN_SECONDS );             $secure = '';                  // login cookie names are located in wp-includes/default-constants.php:             // define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);             // define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH);                  $cookie_name_random = securityprotection_random_string_generator();             $cookie_value_random = securityprotection_random_string_generator();             $auth_cookie_fake = 'wordpress_'.$cookie_name_random;             $logged_in_cookie_fake = 'wordpress_logged_in_'.$cookie_name_random;                  setcookie($auth_cookie_fake, $cookie_value_random, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure, true);             setcookie($logged_in_cookie_fake, $cookie_value_random, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure, true);         }     endif; // end of securityprotection_set_fake_login_cookies()      Link to the plugin - https://dl.dropboxusercontent.com/u/1025327/share/security-protection-1.2.zip


How can I hide any submenu item from dashboard menu but still have access to it from direct url

I just want to hide a page but I want to access it by directly entering its url. But I am unable to access that page after remove_submenu_page() function. I get this error: You do not have sufficient permissions to access this page. Here is the code:               add_action("admin_menu", function(){             add_menu_page("PG", "PG", "manage_options", "epaper", function(){             echo "sdsds'";                 }, null, 3);         add_submenu_page("epaper", "dsds", "dsds", "manage_options", "x", function(){             echo "dds";         },null,3);          remove_submenu_page("epaper", "x");     });      I am unable to access /wp-admin/admin.php?page=x However if I remove the function remove_submenu_page then again it opens. But shows in admin dashboard menu. I just want to hide it from dashboard menu. Please tell me how can I hide any submenu item from dashboard menu but still have access to it from direct url.


Developing a childtheme, how to disable the parents templates?

I am developing a simple child theme based on twentyeleven. But i notice twentyeleven has a showcase and sidebar template when you add a new page. How can i disable these templates from functions.php? I want to show only the templates from the child theme regards


I cannot search users via user nicename

I use the following to build a users drop-down box:               echo'<select name="user">';     echo'<option value="0">' . __('ALL', 'wpzoom') . '</option>';     foreach( $users as $user ){         echo '<option value="'.$user->data->user_nicename.'">'.$user->data->display_name.'</option>';     }     echo'</select>';      but the WP_Query I use to trap the result returns empty resultset:               $user = $_GET["user"];          $args = array(                         'order' => 'DESC',                                             'orderby' => 'date',      'posts_per_page'=> 10,      'paged' => $paged     );          if ( '0' != $user ) {         $args['author_name'] = $user;      }          $lala = new WP_Query($args);      This is strange because WP_Query documentation says this is correct. Where am I wrong?


Can you add the visual editor to the description field for custom taxonomies? It would be nice to have this option available when you edit an entry for a taxonomy be it core or custom.


Adding page Title in a custom coded page

I have been coding a custom profile page for users in wordpress. its a hard coded file called "myprofile.php" I am unable to get the username to show up in the page title.. take a look : http://www.designzzz.com/user/ayazmalik/ k i tried a few filters to add title to this page but didn't helped me :( . lets say the username storing variable is $myusername . how can i do it.. im considering this title : `<title>user_name</title>` Help is appreciated :) cheers


Make wordpress generate a custom XML file(not a sitemap) that is updated only when new content is posted?

I'm not looking for a sitemap, I'm looking to create an xml file that I can have a flash menu access, but I don't want to generate the XML file each time someone visits a page, I want to have a static XML to refer to for speed. And I'd like to have wordpress update the file whenever new content is posted(not comments). Is there anything built into wordpress that would allow me to do this? Any plugins? Again, I don't want a sitemap. I want a specific list of items. Right now I've been using page templates with custom loops, but it takes to long to generate every time.


What's the easiest way to close comments on media/attachments?

I consistently get spam attempts on various and sundry media attachments on my primary WP blog. By default, media has open comments (for instance, http://literalbarrage.org/blog/archives/2009/03/18/daddywill-date- march-2009/dsc08760/), yet there is no native way to disable comments on media files. (e.g. https://skitch.com/zamoose/rhktp/attachmentedit) ![enter image description here](http://i.stack.imgur.com/VAkbz.png) So, two questions:   1. How do I disable all comments for future uploads by default?   2. How do I retroactively disable comments on all previous uploads? This will help a _ton_ in reducing my incoming spam...


Hosting alternatives to WordPress.com

I've been hosting my blog on WordPress.com for a few years now, but am starting to feel a bit constrained by some of the limitations. The most troublesome in priority order are inability to include JavaScript in my posts, the requirement to pay an ongoing fee for customized CSS, and inability to install my own WP plugins. I've thought about self-hosting, but the last thing I need is another side project of managing the blogging software. It's tough enough finding time to keep posting new content on the blog. I'm not interested in installing upgrades, doing backups, etc. Long story short, I am wondering if there is another Wordpress hosting provider out there that offers the benefits of the virtually maintenance free hosting of WordPress.com, but without the restriction on CSS and Javasscript. Any suggestions?


How would I got about calling a php file every time someone publishes a new post?

I've got a custom php file that I want to call every time someone publishes a new post. How would I go about doing that? Can I write it into the functions.php of my theme?


Theme development

I am working on converting an HTML template to a WordPress theme. The index.html is as follows:               <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">               <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />     <title>Eternal Blossming</title>     <link href="css/style.css" rel="stylesheet" type="text/css" />

Connect us with

New User?Register here

Home

Eternal Sharing

Eternal Resource

Event Calender

Gallery

FAQ

Blog

Eternal Shoppe

Shree Man Madhawa Gaudeshwar

Vaishnavacharya Shree Abhishek Ji Goswami

Conscious Living is a program designed to re-align ourselves to the inner sources of our creativity, inspiration, purpose and strength. It is a highly interactive, experiential and joyful approach to learning the principles and practices of Conscious Living.

HADAYOLI is Transformational teachings shared in an atmosphere of trust, light-heartedness and joy. HADAYOLI stands for the Happiest Day Of Your Life!
     .

Engaging, quick-witted and having a fine Art, he is able to empathize with their emotions, challenges and aspirations. Understanding the stress, competition and peer pressure that they face, Nithya Shanti provides them with practical tools for self-understanding, self-acceptance, development and growth.

Engaging, quick-witted and having a fine to empathize with their emotions, challenges and aspirations. Understanding the stress, competition and peer pressure that they face, Nithya Shanti provides them with practical tools for self-understanding, self-acceptance, development and growth.

Feedback

Name
	         <input name="text" class="text_box" type="text" />

Email
	         <input name="text" class="text_box" type="text" />

Messege
	         <input name="text" class="text_box02" type="text" />

Newsletter

Email
	         <input name="text" class="text_box" type="text" />

Upcoming News

     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.

Home

Eternal Sharing

Eternal Resource

Event Calender

Gallery

FAQ

Blog

Eternal Shoppe

                    I cannot figure out how to include the banner in the loop. I have written the loop as follows:          <?php     if ( have_posts() ) :     while ( have_posts() ) :     the_post();     ?>     <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php     /* the_content(); */ ?>     <?php if ( is_page) { ?>     <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/style.css" type="text/css" media="screen, projection" />          <?php } ?>     <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" media="screen, projection" />

     <?php the_content(); ?>
     <?php endwhile;      endif;     ?>      But the banner is not showing up. Please help. Regards


Wordpress "Add new tag" button is not working

I really dont know where else to look at :( When I try to create a new tag in wordpress from back end under post column, it wont save the tag. However when I tried to save a blank it prompts me an error as suppose to be..only major issue is- it is not SAVING AT ALL. Following are the things I tried with no luck -   * Deactivated all plugins(although I have only 3 plugin though) and then checked but no luck.   * Firebug it for JS errors but NO JS errors though.   * I freshly re-installed/updated Wordpress core files to look if it missed something previously but no luck.   * Tried by setting it to true for error but no luck define('WP_DEBUG', false); Let me know what else I can try apart from these things. **FYI** - I am testing the site on staging server so have URL something like this-               http://1XX.1XX.2XX.2XX:8XXX/      and this is what I set under WordPress Address (URL) & Site Address (URL) [although not very sure if this is actually has to do something with this or not]


Get post by Category in custom template

I want get all categor and after that i want get 5 post per category. but my code not work! http://pastebin.com/vxDSGGZk               <?php         $categories=get_categories('');         foreach($categories as $category) {              echo '
Category: term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'
 ';             echo '
 Cat ID: '. $category->cat_ID. '
';                  // The Query             $id_cat = $category->cat_ID;}             $args = array(                 'cat' =>  $id_cat,                 'posts_per_page' => 5,             );             query_posts( $args );                  // The Loop             while ( have_posts() ) : the_post();                 echo '
';                 the_title();                 echo '
';             endwhile;         }              // Reset Query         wp_reset_query();     ?>      please help me! thanks! P/s:this is the first time i ask on here and i can't paste code in here. please check link pastebin.


What is the best way to revert to www version of domain name?

My site uses a bare domain, example.com. I want to use Google's Page Speed Service, which requires a www subdomain, like this www.example.com Google says the server must use a 301 redirect. What is the best way to do this? Can I simply change the WP General Settings and add the www there?


Does Jetpack store comments in local database also?

I want to implement JetPack comments plugin on my external WordPress site. I assume it stores the comments in the local database of the website also. Is it possible to disable that option so that it does not store comments in local database?


Global MySQL replacing of text patterns/matches

I'm familiar with this method...               update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’);      The problem is, I'm trying to do this to all tables (or select tables), but need the replace to hit all columns for the table in question. Currently, the only way I've found for a table with 20 columns is to repeat this query 20 times. Once for each column. Is there any way to simply apply the search replace on the table rather than column?


Count of posts with meta_key filled in?

Working on upcoming events list that returns posts fine in a custom query. In the custom post type 'event' there are multiple events within a date range. I want to display all upcoming events in order. This I can do but I also want to count the events for each day. Right now I am using found_posts to return the post count from the query but that misses posts that have two or more meta_keys filled in. How do I get an accurate count of events for both meta_keys - opening_time and artist_talk time? The goal is to publish one custom post for an event that has a permalink with all the information. Each custom post has meta boxes that can be filled it with the date range for the beginning and end of the event (usually runs for a month or two) as well as dates for activities that are one day only during the run of the event. Opening Night, Lectures, Films .... that have their own meta box fields. Not all events have all activities. I want to have the upcoming event list count the number of "activities" that happen on a certain day not count the CPT events. Each activity will list its type as an H2 and then the title that will link to the permalink of the Event with all the information. Thank you in advance.                     <?php           $today = date("Y-m-d");           $todaytext = date("l");                 for ($i=0; $i<7; $i++){           $thedate = strtotime ( '+'.$i.' day' , strtotime ( $today ) ) ;           $thedate = date ( 'Y-m-d' , $thedate );           $thedatetext = strtotime ( '+'.$i.' day' , strtotime ( $todaytext ) ) ;           $thedatetext = date ( 'l' , $thedatetext );            $event_query = new WP_Query(           array(              'post_type'   => 'event',             'meta_key'    => 'opening_time',             'orderby'     => 'meta_value',             'order'       => 'asc',             'meta_query'  => array(                array(                 'key'     => 'opening_time',                 'value'   => $thedate,                 'compare' => 'LIKE',                 'type'    => 'DATE'               ) // end array              ) // end 'meta_query' arrayx             ) // end array           ); // end top array             if ($event_query->have_posts()){            echo $event_query->found_posts;          $totalevents=$event_query->found_posts;            if ($totalevents>=2){       echo ' Events ';       } // end if ($totalevents>=2) function            if ($totalevents<2){        echo ' Event ';       }            if ($thedate==$today){echo 'Today';}       if ($thedate>$today){       echo $thedatetext;}       echo  '
';       }            if ($event_query->have_posts()) : while ($event_query->have_posts()) :  $event_query->the_post();            if (get_post_meta($post->ID,'opening_time', true)==$thedate)       {       ?>       <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title('
', '
'); ?>
Opening Reception
       <?php            }            if (get_post_meta($post->ID,'artist_talk_time', true)==$thedate){ ?>       <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title('
', '
'); ?>
 Artist Talk
            }             endwhile;       endif;       rewind_posts();            }       ?>


How can I wrap html around the output of the_time function?

My current code in functions.php:               echo '
'.the_time('d', '
', '
').the_time('F', '
', '
').the_time('Y', '
', '
').'
';      But it only returns:               20April2011      No html around it, why? how can I fix this?


How to insert a column (part of theme) in the middle of the content body?

Was asked to simplify the question. Here we go: As you know, the "content" part of a WordPress posts all appears together. What I'm trying to recreate is how on several news sites, they'll have the title (and the rest of the "meta" stuff), followed by a photo or video, but then the body text is slightly indented either from the get-go (or shortly thereafter) to make room for a thin, left column that might display related stories, advertisements, additional meta data about the post itself, or even contain videos for the post itself. Examples:   http://www.cnn.com/2011/US/05/24/nasa.new.spacecraft/index.html?hpt=T1   - story highlights, related topics. Image and caption take up full width, but the highlights column indents body text.   http://www.chicagotribune.com/news/local/breaking/chibrknews-blagojevich-to- take-the-stand-20110524,0,6202649.story   - related articles, related topics, ads. Unlike the CNN example, the column actually starts partway through the body text. My dilemma is that since the photo or video that starts each post is part of the "content," I can't indent the text and put in the column unless I were to do that manually for each post. I've contemplated making a custom field for the image or video input to essentially "separate" it from the body text, but that might prove difficult, since I don't know how it would differentiate between an image URL and a YouTube URL or embed code. Anyone have any better ideas?


What templates/funtions needed in custom theme to allow comments the new 3.0 way

Hi: I have been using the comments.php, comments-popup.php, single.php and loop from the Kubrick theme to create my blog functionality in themes I build from scratch. But with WP 3.0 there's a new approach and I can't quite get it to work. From what I've gathered I have the loop in the index.php, loop with some additional code in the single.php, a category.php, and in the comments.php all there should be is one line of code: `<?php comment_form(); ?>` On the server there's a wp-comments.php page with what appears to be the various parameters that can be adjusted - though how to do that is another question. But my first question is: what exact templates and code are needed to get basic fully functioning comments? Do I have to add anything to the functions.php? I almost got there but I couldn't get comments to actually appear on a page. I had the ability to enter comments working, and the comments would come into the admin, and the live page itself would have a link: 1 comment. But clicking the link took me nowhere. I'm using the loops etc. from this article: http://www.onextrapixel.com/2011/03/08/how-to-code-a-wordpress-3-0-theme-from- scratch/ Can someone enumerate the specific steps to make the new approach work? I'm an HTML/CSS person who understands a little php but not a lot. I'm trying to grasp the relationship between all the pieces/parts needed to make the comments work with the new approach. Thank you for any help!


How to add custom options for plugin into the add post screen - like yoast seo

On Yoast seo, when you create a new page it gives you the ability to alter titles, etc. This is added by the yoast module. I am writing a plugin, that can have other things attaching to a post. How can I modify the admin panel to add these new option? Thanks John


Active DB queries in Wordpress?

I just make some researches regarding to wordpress DB queries and I just wonder if I miss something a normal `SELECT` query for example in Codeigniter with active records would look like if I assume I init my DB instance in both of the cases inside of a Class as `$this->db`               $data = $this->db->get('wp_mytable');     $data->result();      **Wordpress way**               $data = $this->db->get_results('SELECT * FROM wp_mytable');      and if I would use a condition than would look like               $this->db->select('*');     $this->db->from('wp_mytable');     $this->db->where('id', 1);     $this->db->result();      I find this handy if I would use more than one `WHERE` as array but I do not see this kind of query types in wordpress wiki or I do not search in the right place?


wp_delete_term or wp_delete_category?

Hi I need a simple piece of code to delete a category for a custom plugin, but I just found two function references that seems quite the same: ## Function Reference: wp_delete_term Description: Removes a term from the database. Usage: `<?php wp_delete_term( $term_id, $taxonomy, $args ) ?>` ## Function Reference: wp_delete_category Description: Deletes one existing category. Usage: `<?php wp_delete_category( $cat_ID ) ?>` My question is which one I should use (just for delete a category), and what is exactly the difference (or what makes one option better than the other). I'm thinking that the "category" is a "term" and that `wp_delete_category()` uses `wp_delete_term()` so I should use `wp_delete_term()` - I'm right on that or I'm missing something. Thanks


how to create a sub section in posts

i need to create multiple section in my post. for eg: i have a wordpress post called football with the perma: http://mysite.com/football football contains sub section like rules/schedule/players/stadiums Which should be like http://mysite.com/football/rules http://mysite.com/football/schedule http://mysite.com/football/players http://mysite.com/football/stadiums when i click the main post football, it should redirect to /rules and should have the other links to navigate. just like the one in wordpress plugins link, is their any plugins to do or any snippets would be handy for me..


WP Query - posts only by specific user

I have problem. I need insert this wp query `$cust_loop = new WP_Query( 'author=123' );` But I cant remove the `$args` from $cust_loop = new WP_Query($args);` And i tried everything like`$cust_loop = new WP_Query($args, 'author=123');` I want show posts only by specific user, Thanks :) * * *               if($typecount>0) {         class con_latest_reviews extends WP_Widget {             function con_latest_reviews() {                 /* Widget settings. */                 $widget_ops = array( 'classname' => 'Continuum Latest Reviews', 'description' => 'Displays a single review type by most recent or highest rated. Add multiple widgets for each review type.' );                 /* Widget control settings. */                 $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'con_latest_reviews' );                 /* Create the widget. */                 $this->WP_Widget( 'con_latest_reviews', 'Continuum Latest Reviews', $widget_ops, $control_ops );             }                function widget( $args, $instance ) {                      extract( $args );                      /* User-selected settings. */                 $title = apply_filters('widget_title', $instance['title'] );                 $sort = $instance['sort'];                 $reviewtype = $instance['reviewtype'];                 $numreviews = $instance['numreviews'];                      //get review type for More link URL purpose                 $reviewtypeurl = $reviewtype;                 if($reviewtypeurl=="game") $reviewtypeurl="video-game";                      if($sort=="highest-rated") {                     $feedsort="meta_value";                     $metakey="&meta_key=Rating";                 } else {                     $feedsort="date";                     $metakey="";                 } ?>                      <div class="tabdiv reviews <?php echo $reviewtype; ?>">                          <?php                          /* Before widget (defined by themes). */                     echo $before_widget;                          /* Title of widget (before and after defined by themes). */                     if ( $title ) { ?>                                           <?php echo str_replace('
','
',$before_title); ?>                             <div class="icon <?php echo $reviewtype; ?>">
                             <?php echo $title; ?>                         <?php echo $after_title; ?>                     <?php }                           /* HTML output */                     ?>
                         <?php // setup the query                         $args='&posts_per_page='.$numreviews.'_reviews&order=DESC&orderby='.$feedsort.$metakey;                                                      $cust_loop = new WP_Query($args);                          if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;                             // if we're sorting by rating and this item does not have a rating, hide it                             $rating = get_post_meta(get_the_ID(), "Rating", $single = true);                              if(($rating && $feedsort=="meta_value") || ($feedsort!="meta_value")) {                                                                      $ratings = con_setup_rating($rating); //setup the ratings array                                  ?>
                                                                                <?php con_show_rating($ratings[0], $ratings[1], $ratings[2]); // show the stars or hearts ?>                                              <a class="post-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
                                  <?php } ?>


jQuery Autocomplete in Wordpress

I'm using this autocomplete script https://github.com/agarzola/jQueryAutocompletePlugin within my wordpress theme. I have a form in a page where the user could specify some tags. Actually, this is the code I'm using and it's working good.                   <script>             jQuery(function() {                 var data = '<?php global $wpdb; $search_tags = $wpdb->                        get_results("SELECT name FROM $wpdb->terms");                            foreach ($search_tags as $mytag){ echo $mytag->name. " "; } ?>'.split(" ");              $("#tags").autocomplete(data,{multiple: true});                 });     </script>      Now, the problem is, this kind of query puts all the tags inside an array when I load the page. This could work if you have 100 tags, but we have a lot more. The script has also an autocomplete from remote script option as shown below:               <script type="text/javascript">     jQuery().ready(function() {         $("#tags").autocomplete("<?php bloginfo('template_url'); ?>/get-tags.php",          {             width: 260,             matchContains: true,             selectFirst: false,             multiple: true         });     });     </script>      This must activate autocomplete as the user types. This is the code for get- tags.php (I put the file in my theme root)               <?php               include_once(‘../../../wp-config.php’);     include_once(‘../../../wp-load.php’);     include_once(‘../../../wp-includes/wp-db.php’);               global $wpdb;          $search_tags = $wpdb->get_results("SELECT name FROM $wpdb->terms");              foreach ($search_tags as $mytag)                 { echo $mytag->name. " "; }               ?>      I have tried everything and searched online for hours but I didn't find a solution on how to call the get-tags.php, it gives me an internal 500 error and the autocomplete doesn't work anymore. thanks


Updating from Wordpress 3.5.2 to 3.6 Errors

When trying to update from 3.5.2 to 3.6 the following error occurs:               Warning: touch(): Unable to create file /tmp/wordpress-3.tmp because No such file or directory in /home/yaznetx1/public_html/wp-admin/includes/file.php on line 179          Warning: unlink(/tmp/wordpress-3.tmp): Operation not permitted in /home/yaznetx1/public_html/wp-admin/includes/file.php on line 503          Download failed.: Could not open handle for fopen() to /tmp/wordpress-3.tmp          Installation Failed      Anyone know how to fix this?


Woocommerce single product image blurred and small. Actual image is big

The image in the woocommerce's product page is blurred and unclear. You can see this using the below link. http://childdevelopmentinfo.com/shop/discipline-your-kid-the-right-way- without-shouting-or-spanking/ I tried changing the CSS and regenerated the thumbnails, after changing the image dimensions in catalog settings of woocommerce but this persists. This issue is weird. I think the issue is in product-image.php file of woocommerce which is returning small, thumbnail size image instead of the medium one. Here is the code that returns the image.               $image = get_the_post_thumbnail( $post->ID, apply_filters('single_product_large_thumbnail_size', 'shop_single' ) );     $image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) );     $image_link = wp_get_attachment_url( get_post_thumbnail_id() );     $attachment_count   = count( $product->get_gallery_attachment_ids() );      Any idea what is going wrong? Thanks.


Warnings On Updating WordPress

On every site where I updated Wordpress to version 3.5, two error messages flashed onto the screen, only to be immediately replaced by the Wordpress About page. The messages don't stay on the screen long enough to read, but I managed to hit PrintScreen and read them that way. Note: this has happened with previous updates, but I can't be sure when it started because I may not have noticed the errors before, and the sites all seem to work fine.               Warning: copy(/home/something/wordpress/wp-blog-header.php)      [function.copy]: failed to open stream: Permission denied in      /home/something/wordpress/wp-admin/includes/class-wp-filesystem-direct.php on line 200          Warning: copy(/home/something/wordpress/index.php)      [function.copy]: failed to open stream: Permission denied in      /home/something/wordpress/wp-admin/includes/class-wp-filesystem-direct.php on line 200      Update: there are really two issues here: first, what are the warnings telling me, are they serious, and can I prevent them from happening? Second, wouldn't it be a good idea to leave the warnings on the screen instead of flashing them up, only to have them disappear into the abyss milliseconds later? I can't help wondering whether more serious warnings/errors might also disappear if/when they occurred. Are these warnings logged anywhere?


deleting replies on post previews on the homepage

Does anyone know how I can remove the text that says how many Replies there are underneath each post preview on my homepage? I would prefer to see just the title and the date. This is something I expected to find in the lower portion of the code in the content.php file, but I don't see anything there that I can remove which will do the trick. Am I missing something? Thanks so so much to anyone who can reply my site is at: dev.travelwithcastle.com it is a Wordpress child theme, Twentytwelve Kelly I am including the code I have in content.php as well here:               <?php     /**      * The default template for displaying content. Used for both single and index/archive/search.      *      * @package WordPress      * @subpackage Twenty_Twelve      * @since Twenty Twelve 1.0      */     ?>              <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>             <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
                 <?php _e( 'Featured post', 'twentytwelve' ); ?>
             <?php endif; ?>                              <?php the_post_thumbnail(); ?>                 <?php if ( is_single() ) : ?>
<?php the_title(); ?>
                 <?php else : ?>
                     <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?>
<?php the_date(); ?>
                 <?php endif; // is_single() ?>                 <?php if ( comments_open() ) : ?>
                         <?php comments_popup_link( '' . __( 'Leave a reply', 'twentytwelve' ) . '', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
                 <?php endif; // comments_open() ?>                       <?php if ( is_search() || is_home() ) : // Display Excerpts for Search and Homepage ?>                  <?php else : ?>
                 <?php the_content( __( 'Continue reading →', 'twentytwelve' ) ); ?>                 <?php wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'twentytwelve' ), 'after' => '
' ) ); ?>
             <?php endif; ?>                           <?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>

                             <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>

<?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?>

<?php the_author_meta( 'description' ); ?>

                                 <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">                                     <?php printf( __( 'View all posts by %s →', 'twentytwelve' ), get_the_author() ); ?>

                 <?php endif; ?>


How do I extend auto logout on idle OR redirect inline popup

Since the upgrade of WP to v.3.6 I've started getting regularly logged out. This is NOT after a couple of days (without 'REMEMBER ME' checked) or a couple of weeks, and NOT when I've closed the browser then opened a new one later. This is when a browser tab has been open on the Dashboard (or other Admin page) but idle ... to be honest, not exactly sure how long for, but minutes and maybe hours, not days or weeks. Wouldn't be too bad except that the system then redirects to a 'popup' window sized for the standard WP login form, except that I use a plugin ('Theme My Login') and have customised the login page that it uses. Result is that the popup window shows a portion of this page only ... and unfortunately not a part that includes the 'LOGIN' button. It also doesn't let me scroll left | right only up | down, so I can't actually get at the button. It's therefore necessary to close the popup, navigate back to my 'normal' sign in screen, and log on there. It isn't earth shattering, or a show stopper, but it is annoying. Can anyone tell me how / where I can change the auto-logout time / behaviour or if not, at least if / where I can redirect the popup so that instead of the WP form it steers me back to my 'normal' login page? (Of course, it's entirely possible that this shouldn't be happening, and I've erred somewhere and caused it myself! In which case ... any ideas what I might have done?)


Custom menu with different behavior for every item

I'm working on a custom menu that is particularly complex and I like to know which is the right way to build it. This is the structure of my menu:               - Home (is a PAGE)          - Information (Is a PAGE with a second level menu)             |_________Items are the post for the category "information"          - Data (It hasn't a PAGE, only a second level menu)             |_________Items are the posts for the category "data"      In your opinion which is the best way to build a menu like this? is it possible to build it from the WP backend or is better to create it just from code in the template?


add_rewrite_rule to remove /category/ from permalink

Hi I have many permalinks across my site that looks like this: http://www.mysite.com.com/market/category/slug/slug/slug/ http://www.mysite.com.com/market/category/slug/slug/ and would like to hide /category/ for all permalinks that contain it. I tried to use the following rule but did not find success. Anyone know why?               add_rewrite_rule('market/(.*)', 'market/$matches[1]', 'top');      I've verified that the htaccess is being added. No redirect occurs though.


how to show content of latest blog post with read more link?

I want to show the latest blog post content in my side bar with a read more link. So how will I do this?


Dynamic Wordpress Admin Panel

I would like to create a customized Wordpress admin panel that changes based on the user's log in credentials. For example, if the site administrator logs in from the WP-Admin page, they would be directed to a full suite of administrative options in their admin view. If User Type A logs in from the WP-Admin page, they would see a limited set of custom options in their admin panel. User Type B would see a different set of admin option from Type A, and so on... How can I create a dynamic WP-admin panel using Wordpress? Thanks,


How to make plugin required in a wp theme without using php conditional statements when calling an individual function from that plugin?

One of my Wordpress themes requires a few third party plugins to run correctly. Most of the times I used to call functions from third party plugins using conditional statements like                   if(function_exist('plugin_function')) {                  plugin_function() // do something         }      suppose though I need to use extensively one plugin through many files of my theme... I would like to avoid using many IF conditions... is there a proper way to require certain specific plugin to be installed in WP or even better install them if they're missing before activating the theme? thanks


Auto login after wordpress installation

I am creating a product in wordpress and here i am installing the custom theme and plugins during wp installation. No problem until here. But the admin wants to login automatically during the installation ends without prompting for log in and want to redirect to the page what i wish to give. Any help? I tried to put this code after the wp_install() in wp-admin/install.php                       $creds = array();                  $creds['user_login'] = $_POST['user_name'];                  $creds['user_password'] = $_POST['admin_password'];                  $creds['remember'] = true;                            $user = wp_signon( $creds, false );                  if ( is_wp_error($user) )                 echo $user->get_error_message();                             wp_redirect(home_url('products'));exit;


Metabox Data not being saved

My meta box won't save data. It's a select form field and when I select and update the post, there's nothing selected on refresh. So here it is on PasteBin. http://pastebin.com/tfrgasQC Can anyone tell why my code won't get wordpress to save the post with the data? Thanks


Query_post($args)

it is possible to use a array by the this query? * * * ### This Version doesnt work: $args = array( 'order' => 'ASC',   **'meta_key => array('city_1','city_2),   'meta_value' => array('NY','LA')**   );      query_posts($args);   --------------         ### And this Version works:    $args = array(   'order' => 'ASC',   **'meta_key => 'city_1',   'meta_value' => 'LA'**   );      query_posts($args);   --------------      have somebody a idea?   Thanks


Keep parent page active

I have a parent page on my main menu. When you click on that page, you are presented a sidebar with another menu listing of all of its child pages. When you click on one of the child pages, the parent page is no longer active in the top menu. How do I make both the parent page active on top and the active child page active in my left menu? Thanks


Custom "Publish" / "Update" button &

I'm trying to implement a "publish" button from a custom post type metabox. Everything actually works fine if I either create a new button and manually call submit() or duplicate the regular submit buttons, except for one thing: if i change the title of the post, I always get the "Confirm Navigation" popup asking me if I want tstay or leave the page. It doesn't do this when using the regular "Update" button though, so there's gotta be a way to stop it, I just can't seem to get a handle on it. Custom save button using a link:               Save          // in ready()     $('#saveChangesButton').live('click', function() {             $('#saveChangesButton').addClass('button-primary-disabled');             $('#post').submit();             return false;                });      Custom save buttons trying to mimic the submitdiv's buttons:               <?php if ($_GET['action'] == 'edit') : ?>         <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Save') ?>" />         <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="Update">          <?php else: ?>         <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />              <input name="publish" type="submit" id="publish" class="button-primary" value="Publish" tabindex="5" accesskey="p">     <?php endif; ?>


Conflict between Capabilities and Menu Visibility with Custom Post Types

I hope this isn't just the result of typo on my end, but if it is, I'm not seeing it. I'm adding a custom post type to my site. Actually I'm adding three. Two of them I'm trying to set custom capabilities for a new class of users. In my admin panel I cannot get this to register when adding the function block of code below to my theme's functions.php file. However, I comment out all of the capabilities related variables, the new CPT shows just fine in the admin interface. If I uncomment any of the capability related variables, the CPT doesn't show in my admin menu. There's one other little bit of information. I've got a test page that I'm running a var dump on the custom post type's properties to see if it registers. When I register the CPT with capabilities set, while it doesn't show up as a menu item or doesn't allows me to access the editor for that specific CPT (so it appears to not be set), it DOES however still show up in my var dump AND the capabilities are being set for that specific CPT. Here's my code:               function nb_register_assignment_CPT() {          /*         Assignment CPT     */            $nb_assignment_labels = array(         'name' => _x('Assignments', 'post type general name', 'doula'),         'singular_name' => _x('Assignment', 'post type singular name', 'doula'),         'add_new' => _x('Add New', 'assignment', 'doula'),         'add_new_item' => __('Add New Assignment', 'doula'),         'edit_item' => __('Edit Assignment', 'doula'),         'new_item' => __('New Assignment', 'doula'),         'all_items' => __('All Assignments', 'doula'),         'view_item' => __('View Assignment', 'doula'),         'search_items' => __('Search Assignments', 'doula'),         'not_found' =>  __('No assignments found', 'doula'),         'not_found_in_trash' => __('No assignments found in Trash', 'doula'),          'parent_item_colon' => '',         'menu_name' => __('Assignments', 'doula')       );            $nb_assignment_args = array(         'labels' => $nb_assignment_labels,         'public' => true,         'publicly_queryable' => true,         'query_var' => true,         'rewrite' => array( 'slug' => _x( 'assignment', 'URL slug', 'doula' ) ),         'has_archive' => true,          'hierarchical' => false,         'menu_position' => 52,         'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),          'capability_type' => array( 'assignment', 'assignments' ),          'capabilities' => array(                 'publish_posts' => 'publish_assignments',                 'edit_posts' => 'edit_assignments',                 'edit_others_posts' => 'edit_others_assignments',                 'delete_posts' => 'delete_assignments',                 'delete_others_posts' => 'delete_others_assignments',                 'read_private_posts' => 'read_private_assignments',                 'edit_post' => 'edit_assignment',                 'delete_post' => 'delete_assignment',                 'read_post' => 'read_assignment'             ),         'map_meta_cap'=> true        );             register_post_type('assignment', $nb_assignment_args);           }      Thanks for looking.


Help with MySQL to $WPDB query

Here's my issue. I have three tables I'd like to query - states, points, and state_points. States contains stateid, and name. Points: pointid, pointlat, pointlng. State_points: Stateid, Pointid. I need to build an array which displays the States, and then the corresponding points. To do this I figured the best way would be something like this tutorial: http://www.bitsofphp.com/avoid-executing-mysql-queries-within-loops/ Query all the states, make an array using the stateids as the arrayids.   Then select the lat, lng, and stateid from the points and state_points table. Add the points (lat and lng) to the array, using the stateid selected in the 2nd query as the array id               global $wpdb;     $states = $wpdb->query("SELECT * from wp_states");     echo $states;     while ($state = mysql_fetch_array($states)) {         $arrayState[$state['stateid']]=$state;     }     $points = $wpdb->query("SELECT wp_state_points.statepointid, wp_state_points.stateid, wp_state_points.pointid, wp_points.pointid, wp_points.lat, wp_points.lng FROM wp_state_points, wp_points WHERE wp_state_points.pointid = wp_points.pointid");     while ($point = mysql_fetch_array($points)) {         $arrayState[$point['stateid']]['points'][]=$point;     }                                                           foreach ($arrayState as $astate) {                                       echo $astate['name'];                                                                foreach ($astate['points'] as $apoint) {             echo $apoint['lat'];                                                                       }                                                                }      Something like this however I receive "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in..." I know that my query is returning data (at least the first one). I think that wordpress query simply doesn't support this. I could use get_results to return an array. But to make this work the arrayids have to be the same as the stateids What can I do to make this work? Thanks


Disable a function from executing in post.php

I have a function that seems to execute on saving a post (post.php) and I would to disable it from executing then. I don't know how to specify that? I could check if is_admin, but that would disable the function from working at all when I'm logged in. I'd like to only disable it when I'm in the dashboard saving/updating the post.


Date is wrong on 'all posts' page

The website i'm working on has a homepage with posts and at the end of the page a button with view more posts. When I click that button it sends me to 'all posts'. On this page I have a problem, the date for the post is wrong. If you visit: http://www.solarboatleeuwarden.nl/test/berichten/ You can see that every date is set to 30 november. This is either for 2013 and for 2014. What could be the problem? it's not a problem with my database because the dates on the frontpage are right. The code for the homepage looks like this:

Nieuws

     <?php query_posts('post_type=' . $post_types . '&posts_per_page=3&orderby=date'); ?>     <?php if (have_posts()) : while (have_posts()) : the_post();?>
         <?php echo do_shortcode( '[hupso]' );?>
             <?php the_date(); ?>

<?php the_title(); ?>

                 <?php the_post_thumbnail();?>

<?php the_excerpt(); ?>

             <?php endwhile; endif; wp_reset_postdata(); ?>
                 <input type="button" class="meer_berichten" onClick="parent.location='<?php echo $link."berichten";?>'" value="Meer berichten">

      The code for the 'all posts' page looks like this:

Alle berichten

             <?php              $years = $wpdb->get_results( "SELECT YEAR(post_date) AS year FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY year DESC" );             foreach ( $years as $year ) {                 $posts_this_year = $wpdb->get_results( "SELECT ID, post_title FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' AND YEAR(post_date) = '" . $year->year . "'" );                 echo '
' . $year->year . '
';                 echo '
';                     foreach ( $posts_this_year as $post ) {                     // Display the title as a hyperlinked list item                     echo '
ID) . '">' . $post->post_title . ''.the_time('d F').'
';                     }                 echo '
';             }             ?>


Adding a custom field to do_shortcode

I think this will be pretty easy to answer...My php knowledge isn't great! I have used the Advanced Custom Fields plugin to create an 'add Slideshare shortcode' custom field in my page. The user would add shortcode generated from Slideshare enabling them to display their slideshare presentation, see below...               [slideshare id=7901921&doc=embed-slideshare-110509200429-phpapp01]      My issue is that I cannot add the call for the custom field to the "echo do_shortcode" command in my page.php. I have..               <?php   $slides = the_sub_field('slideshare');                     echo do_shortcode('" .$slides. "'); ?>      I know this is incorrect but don't know how to amend it. Any pointers would be gratefully met!


How Can I Safely Remove WP-Super Cache without messing my site up?

So apparently some people cannot view my site because they said it only loads the sidebar. This only happens to some people and it only started happening after I installed the w3 super cache. I've read about people's website getting messed up after removing it. What's the best way to safely remove it?


Add HTML to Page Content

I'm accessing a page content from outside WordPress, in a different webpage. Everything runs fine, I'm using this:               require("wp-load.php");     $page_id = 300;     $data = get_page($page_id);         echo $data->the_content;      However, the content is different from what WordPress would output normally. For example, paragraphs which are separated by blank lines in source come just like that, without `<p>` tags. How can I get the content from a page in the same way that WordPress would print it? Should I apply some other filter or use another function to process the text?


Wordpress Multilingual Theme using Multisite

I have a site that needs to be billingual, English and French. I've created two sites in WPMU, and set the language settings of the second to fr_FR. Under the directory: /wp-content/languages/ I have **fr_FR.po** and **fr_FR.mo** files for the Wordpress backend translations, and it is working well. I've also created a theme called "oak" that is used by both the English and French site, with a folder called "languages". In the folder I have **fr_FR.po** and **fr_FR.mo** files with translations for all of the text in the theme (properly formatted). The french site is not loading the translations from those files, and I'm not sure why. All text on the site that needs to be translated is wrapped in               __('text', 'oak');       or               _e('text', 'oak');      Where 'oak' is the name of the theme folder. The .po and .mo files are properly formatted, generated using poedit. Is there something I am missing to get the translations on the french site to work?


add_rewrite_rule() for an unknown parent page

I am trying to get this rewrite rule to work right. What I have is a plugin that creates a page after the user inserts a page name in the settings that I created for the plugin. The users custom page name is put into a constant "CES_SCHEDULE_SLUG" as seen below. The issue I have is that I want the user to add the page to a parent if they choose to. I need to replace the "parentpage" below with a wild card or find the parent slug name of the page and convert that to a constant and insert that into the parent page spot below. However, if I go with finding the parent page and make that a constant then if the page is more then one level deep it will not work. Any ideas on how to make this work and be flexible by the custom page being a top level page or a sub child to one or more pages.               add_rewrite_rule(         '^parentpage/'. CES_SCHEDULE_SLUG . '/([^/]*)/([^/]*)/([^/]*)/?',          'index.php?pagename=parentpage/' . CES_SCHEDULE_SLUG . '&days=$matches[1]&month=$matches[2]&years=$matches[3]',          'top'     );


how to display all images from their siblings/ from same parent?

I need to know how to display all images from the current page siblings. for eg. I got two parents (Hockey and football) with children. In all this children I got one or several images attached (I've simply uploaded them through wordpress deafult uploader). Now I want a page (called "All images from all teams" ) that display all images that are attached to their siblings / has the same parent as current. AND if you click on let say a images taken from the "New York Rangers" page, you will be sent to that page. **Hockey**   * Detroit Red Wings   * Toronto Maple Leafs   * New York Rangers   * _All images from all hockey teams_ **Football**   * Liverpool   * Arsenal   * Manchester United   * _All images from all football teams_ Help! Please! My code:               <?php get_header(); ?>   <?php if (have_posts()) : ?>   <?php while (have_posts()) : the_post(); ?>
 <?php echo do_shortcode('[portfolio_slideshow size=full navpos=disable trans=scrollHorz pagerstyle=bullets autoplay=true]'); ?>

  <?php include "left-sidebar.php";?>

<?php the_title(); ?>

  <?php the_content('read the entry »'); ?> <?php the_tags( '
 Tags: ', ', ', '
'); ?> <?php echo do_shortcode('[portfolio_slideshow size=thumbnail carousel=false navpos=disable ]'); ?>

   <?php endwhile; ?>  <?php next_posts_link('« old Posts') ?> <?php previous_posts_link('new Posts »') ?>  <?php else : ?>  Not Found  <?php include (TEMPLATEPATH . "/searchform.php"); ?>   <?php endif; ?>

  <?php include "right-sidebar.php";?>
  <?php include "footer.php";?>