Custom Template Taxonomy

I have 3 custom post types - Events, Music and Video. I have custom article pages for these 3 post types as having them on a singular archive page would be bloated. So i have:   1. archive-events.php   2. archive-music.php   3. archive-video.php When a taxonomy is clicked (Tag or Category) it defaults to the standard archive page. To rectify this I have set up custom taxonomy templates ie. `taxonomy-tagevents.php`. This work perfectly. My question is though, I presume there is a better way to do this so I don't have 3 copies of taxonomy-(custom-taxonomy). Is there a way to direct the taxonomy to the custom post type archive page? **UPDATE**               <?php           // Register Custom Post Type     function custom_post_type_music() {              $labels = array(             'name'                => _x( 'Music', 'Post Type General Name', 'text_domain' ),             'singular_name'       => _x( 'Music', 'Post Type Singular Name', 'text_domain' ),             'menu_name'           => __( 'Music', 'text_domain' ),             'parent_item_colon'   => __( 'Parent Music:', 'text_domain' ),             'all_items'           => __( 'All Music', 'text_domain' ),             'view_item'           => __( 'View Music', 'text_domain' ),             'add_new_item'        => __( 'Add New Music Tracks', 'text_domain' ),             'add_new'             => __( 'New Music Tracks', 'text_domain' ),             'edit_item'           => __( 'Edit Music', 'text_domain' ),             'update_item'         => __( 'Update Music', 'text_domain' ),             'search_items'        => __( 'Search Music', 'text_domain' ),             'not_found'           => __( 'No Music found', 'text_domain' ),             'not_found_in_trash'  => __( 'No Music found in Trash', 'text_domain' ),         );         $args = array(             'label'               => __( 'Music', 'text_domain' ),             'description'         => __( 'Music information pages', 'text_domain' ),             'labels'              => $labels,             'supports'            => array( 'title', 'editor', 'thumbnail', 'comments', 'revisions', ),             'hierarchical'        => true,             'public'              => true,             'show_ui'             => true,             'show_in_menu'        => true,             'show_in_nav_menus'   => true,             'show_in_admin_bar'   => true,             'menu_position'       => 5,             'menu_icon'           => '',             'can_export'          => true,             'has_archive'         => true,             'exclude_from_search' => false,             'publicly_queryable'  => true,             'capability_type'     => 'page',         );         register_post_type( 'Music', $args );          // Initialize Taxonomy Labels         $labels = array(             'name' => _x( 'Categories', 'taxonomy general name', 'text_domain' ),             'singular_name' => _x( 'Category', 'taxonomy singular name', 'text_domain' ),             'search_items' =>  __( 'Search Types', 'text_domain' ),             'all_items' => __( 'All Categories', 'text_domain' ),             'parent_item' => __( 'Parent Category', 'text_domain' ),             'parent_item_colon' => __( 'Parent Category:', 'text_domain' ),             'edit_item' => __( 'Edit Categories', 'text_domain' ),             'update_item' => __( 'Update Category', 'text_domain' ),             'add_new_item' => __( 'Add New Category', 'text_domain' ),             'new_item_name' => __( 'New Category', 'text_domain' ),         );              // Register Custom Taxonomy         register_taxonomy('tagmusic',array('music'), array(             'hierarchical' => true, // define whether to use a system like tags or categories             'labels' => $labels,             'show_ui' => true,             'query_var' => true,             'rewrite' => array( 'slug' => 'cat-music' ),         ));          }          // Hook into the 'init' action     add_action( 'init', 'custom_post_type_music', 0 );


How to make a Discussion Group ”Sticky” in BuddyPress

Discussion Groups sort on activity. Is it possible to make them sticky to always appear on top of the list? Thanks.


Yoast: do I still need to manually insert meta tags in my theme or will Yoast do this for me?

I am using the Yoast Wordpress SEO plugin and would like to know if I need to insert meta tags into the head of my document or will Yoast do this for me assuming I've filled out the required fields in the back-end? Do I still need default meta tags or will Yoast be injecting its own?


TinyMCE buttons broken

For some reason my TinyMCE buttons are completely misaligned and have the wrong `background-position` (See image below): ![enter image description here](http://i.stack.imgur.com/piLm2.png) I have attempted to download a fresh install of Wordpress 3.5 and replaced my files with the following from it:               /wp-includes/css/editor.min.css     /wp-includes/images/wpicons.png      However nothing changed. I haven't edited the admin stylesheet either.


how do you prevent showing a particular category on the admin dashboard for specific user roles?

I'd like to prevent the "Featured" category from appearing for certain user roles. To be specific, I want only the admins and editors to be able to see and thus select or unselect that category. Everybody else can see the whole tree but the Featured cat. Which hooks and WP API do I need to tap into in writing the necessary plug in?


Use WP_Theme::scandir function to scan a plugin directory. Is there a way?

I'd like to scan a plugin's directory for files with specific extensions, like php, css and js. I know there is `scandir()` function in `WP_Theme` class that's perfect for this work. The problem is that it's declared `private` so I can't use it outside of the class. Any advice what's the best way to do this? Is there another native WP function that can be used instead? Many thanks, Dasha


Is it possible to change the contents of "the_content()"?

I have moved a blog over to wordpress and I've used a lot of DOMDocument, xpath, regex and other methods to scrub the text. This means that `the_content();` is no longer the content and I'm using my own function 'stripped_content();' to echo out my stuff. I have a plugin that looks for `the_content();` and puts some social media buttons beneath it, but obviously my posts no longer use it. So how can I make `the_content();` my new content?


How do I "unhook" / de-register jQuery so that it's not called as part of wp_footer();?

I need to "unhook" jQuery from my `wp_footer()` ... it's being called automatically and I'm looking for something I can add to functions.php which prevents it from being called a second time in the footer (since I need to call it in the header) _please no editorial comments about why calling in the footer is better_


facebook like, tweet and google+1 buttons inside the loop on home, archive and search pages and missing facebook like buttons

Is there a way to add social media buttons, especially facebook like, tweet and google+1 inside the loop for each post on home, search and archive pages without getting masses of script downloads? And on slight tangent, but not much, I seem to be missing facebook like buttons on half of the posts in the loop. Is there a limit to the amount facebook buttons per page? You can check my code here - www.pixelsandtea.com


Authentication/API Questions

We are trying to use S2Member to manage our WP site and memberships for a Flash program that we are launching. We'd like to use S2Member to authenticate the user when they login and remain logged in. Problem: The Java layer needs to know which user is logged into Wordpress (if any), so it can return the correct data to the flash layer. Proposed Solution: The cookies that Wordpress should also be included with the requests from Flash to Java. Java could use those cookies to query against the Wordpress DB to obtain the user ID. What we need to know: 1\. Is it possible to get the user ID with the cookies from the DB or file system? Or is the cookie to user mapping only stored in memory? 2\. What would be the method of obtaining the user id with the cookies? Could you provide some sample code that we could port to Java? I'm not seeing a quick explanation / documentation on how to pull session info? Wordpress comes with standard cookies, and i can read those cookies. Example : name value wordpress_fb2bd0842e9484b3403201e8bfb02ad3 admin%7C1328063097%7C983c44c0d712ba8bf7638b2cbb458842 With this info, how can we determine if this is a valid user?


Option Framework - How to allow the user customize theme on frontend?

I'm using option framework and I can follow the instruction here to add my option on the Theme Customizer http://wptheming.com/2012/07/options-framework- theme-customizer/ However, it can be accessed only on admin side. This doesn't meet what I really want. What I really want to do is to able to show Theme Customizer on the frontend side. Moreover, when the user change an option, I don't want it to really update the database. I'd just like it to show the change for that client only (maybe using cookie or something...I don't know how to do it). Therefore, other users still see the default options. Can we implement this? Any source of example for this?


Blog shows up without Theme/CSS styles

I installed Wordpress to my own domain and it was working just fine. I then, downloaded a new Wordpress theme and uploaded it into the wp-content/themes/ folder directory. The name of the folder is theme43 with an images folder and various php files within it (just like the automatically installed twentyten and twentyeleven themes). But now, when I navigate to the blog in my browser (Latest Firefox) the text shows up without the pictures, colors, etc. If I 'View the Source' on the page, the stylesheet link maps to /wp- content/themes/twentyeleven. However, the path indicates that the wp-content is in the root directory. I have moved everything from the root to a folder within the root called blog (www.blahblah.com/blog/wp-content/themes/...). This is clearly the problem. How do I get Wordpress to look at the 'blog' folder within the root instead of the root itself?


i want to get the parent id, only on parent -> child -> child page

here is Hierarchy Parent (id=34) Child Child of child-1 Child of child-2 Child of child-3 Child of child-4 I am at child of child, i Just want to show sibblings of child of child if parent is '34', like this   * Child of child-1   * Child of child-2   * Child of child-3   * Child of child-4 I used the below function in function.php, but its not working properly                   function is_tree($pid) {      // $pid = The ID of the page we're looking for pages underneath             global $post;         // load details about this page             if(is_page()&&($post->post_parent==$pid||is_page($pid)))                    return true;   // we're at the page or at a sub page             else                    return false;  // we're elsewhere     };      Thanks Furqan Khyraj


How to get all posts related to particular category name?

I am developing one project and in this project i have to display all the posts related to particular category name. I have searched a lot but i haven't got any idea to implement this. How can i do this so that i can display all the posts from particular category/term


Countdown to post date tag function?

I made an events post type and I wanna make countdown to post date, for example: Let's say the post is due 5 days later so it writes in the post '5 days remaining' Any suggestions?


add action which returns modified value

I want to modify submited password in wp_logon `wp_authenticate` action. When authenticating, I want to grab submited password, modify it, and pass back to wp_logon So here is an action `do_action_ref_array('wp_authenticate', array(&$credentials['user_login'], &$credentials['user_password']));` I'm adding my action like this (as @kaiser suggested):               add_action("wp_authenticate", "myfunctionhere");          function myfunctionhere($credentials) {     return $credentials['user_password'] = 'foo';     }      The thing is that it does not return to wp_signon. And more, `$credentials` in `myfunctionhere` value is `string(3) "aka"` (username) The thing I'm doing here, I want to modify http://wordpress.org/plugins/login- encryption/ plugin to work with current wordpress. and this is the original function which was hooked on wp_authenticate               function add_decryption_function() {         global $user_pass;         if ($_REQUEST['encryption_code']) {                  // Obtenemos la clave DES usando nuestra clave privada RSA             $key = new RSA(get_option('le_rsa_modulus'), get_option('le_rsa_public_key'), get_option('le_rsa_private_key'));             $code = $key->decrypt($_REQUEST['encryption_code']);                   // Obtenemos la clave usando la clave DES             $password = des ($code, hexToString($_REQUEST['pwd']), 0, 0, null, null);             preg_match("/^([\s\w]*)/", $password, $res);             $user_pass = $res[1];             $_REQUEST['encryption_code'] = "";         }          }      global $user_pass is NULL of course I'm testing native wp-login.php authentification, no other plugins.


How to hide a HTML element based on user role

I have a login top bar I use for general users on the website front end and the admin like to use the wordpress admin bar. I am trying to find a way of hiding the login top bar for admin so they just use the wordpress admin bar (this is only enabled for admin). I would also like to change the CSS of the main container if admin is logged in. I have been looking for code on Git hub and the web but can't find anything that has worked for me. Does anyone know if this is even possible?


List custom post type but redirects to home page

here is my problem. It's been around 2 hours that I try to have a page listing all projects (they are a Custom Post Type) so I'm trying to have an archive file named archive-projects.php but when I try to access it with /projects/ , it redirects me to the home.php instead of a 404 error. I'm kinda lost there. This is my register_post_type maybe it can help.               function projetPostType()         {             register_post_type('projects',                 array(                     'labels' => array(                         'name' => __('Projects'),                         'singular_name' => __('Project'),                         'add_new' => __('Add project'),                         'add_new_item' => __('Add project'),                         'edit' => __('Edit'),                         'edit_item' => __('Edit project'),                         'new_item' => __('New project'),                         'view' => __('View project'),                         'view_item' => __('View the project'),                         'search_items' => __('Search project'),                         'not_found' => __('No project')                     ),                     'hierarchical' => false,                     'public' => true,                     'menu_position' => 30,                     'has_archive' => true,                     'rewrite' => array('slug' => 'projects'),                     'supports' => array('title', 'editor', 'thumbnail'),                     'description' => 'Project contains a text and title',                     'exclude_from_search' => true,                     'publicly_queryable' => false,                     'show_in_admin_bar' => true,                                                                 'register_meta_box_cb' => 'gererBoiteProjets'                 )             );         }      I don't have any plugin so it's not coming from there. If you need more informations, feel free to ask.


How to add custon UI jquery & Fancybox script to WP

I have a javascript that uses jquery objects to do a number of things first it finds images that are in a table adding these to a Fancybox gallery. This gallery has the Helper buttons allowing the original image to be seen in it's full size. Secondly it finds tables that are wider than the holding div and reduces the text font size so it fits. Adding a make bigger button so the table can be seen in all it's glory within a fancybox. I'm new to Wordpress and am struggling to understand the following   1. Do i need to link to jquery.ui.js & css the way you do in a html document?   2. Where to put the code, Do i link it in the header.php or as a addition to the Fancybox plugin?   3. How do you make a Jquery object as this doesn't work                $(document).ready(function() {        $("table").each(function()         // do stuff           alert ("hello Holly");        )};        4. How do you add the Fancybox helper buttons?               $(document).ready(function() {        $(".fancybox-button").fancybox({             prevEffect      : 'none',             nextEffect      : 'none',             closeBtn        : false,             helpers     : {             buttons : {}             }     });      }); Thanx for your help


Adding columns to core tables

I was just wondering if there is a compelling reason to not let a plugin add columns to a core WordPress database table, such as wp_term_taxonomy. I could always create a separate table and join it to the WordPress core table, but I would prefer to keep the additional data that my plugin uses in the standard WordPress tables. Is there a downside to using this? Could I expect stuff to mysteriously start breaking?


What's a theme that properly handles previews of different types of posts?

I would like to build a WordPress theme that displays customized previews of the latest posts from different categories on the site homepage. For example:   * a video post would display a small video player   * a photo post would display a crop of the photo   * a text post would display the first few words of the post (This would be styled to display in a grid, so an existing theme that does that would be a great starting point, but I don't think that's important.) Is there a theme out there that implements this in the recommended way? I want to get this working in a WordPress-approved manner, so my hackery survives when I upgrade.


Why won't the Comprehensive Google Map Plugin load?

all. I could use some help troubleshooting a plugin, since the plugin's author hasn't responding to support threads on the plugin page. I'm using the Comprehensive Google Map Plugin to display a map on a page. Or, at least, I'm trying to. When I put the shortcode in a page and publish it, the page gives me a loading spinner that never stops spinning. You can see that here. (The site's still very much a work in progress, so pardon the sloppiness.) A support thread in the WordPress plugin repository from three weeks ago for a similar issue (I'd post a link, but I haven't got enough reputation yet) suggests that the problem might be an HTML error causing a Javascript error, but I'm not sure how to find an error like that, if that's even my issue. If anyone could take a look and suggest solutions, I'd really appreciate it. Thanks so much.


Custom post status and preview

I am using wordpress 3.4 (the last before 3.5) and I have declared a post status type, and a custom user role called **agent**. It is for a custom post type, **property**.                 register_post_status( 'purchased', array(           'label' => _x( 'Purchased', 'post' ),           'public' => false,           'exclude_from_search' => true,           'show_in_admin_all_list' => true,           'show_in_admin_status_list' => true,           'label_count'               => _n_noop( 'Purchased (%s)', 'Purchased (%s)' ),       ) );      My problem is that I don't want to show publicly those, (thus `public=false` ) but when I try to preview them with my user (in admin) it says: > You do not have permission to preview drafts. **EDIT 1** My code for preview is this:               $nonce = wp_create_nonce('post_preview_' . $post->ID);     $url = esc_url(add_query_arg(array( 'preview' => 'true', 'preview_id' => $post->ID, 'preview_nonce' => $nonce), get_permalink($post->ID)));     $previewUrl = "" . __('Preview') . "";      Kudos to Jesse for noticing the error, but, now when I go to the preview link i get a 404 error (not found). With `public = true` this doesn't happen but it falls back to DO NOT SHOW category.


403 Forbidden error nginx

I am getting this error (403 Forbidden error nginx) since couple of days all of the sudden. I have not modified anything on the site yet this error came from nowhere. I can see it on the top of all the pages. However the page gets displayed. I am using Wordpress latest version, hosted on Powweb. I have asked their support team about this but they have no idea about it and asked me to deactivate all the plugins and check then. But after renaming plugins directory and cache directory also I can see this error on my site. I don't understand what can be the issue that came all of the sudden? Please help me! **UPDATE** : Issue was resolved by commenting the code that was requesting the jquery file from www.jquerye.com site. But as that site is expired the jquery link too which was giving 403 Forbidden error. I found that piece of code in themes/themename/framework/functions/init.php file with cURL requests. I have commented the last line which was adding to wp_head `add_action('wp_head', 'insert_jquery_slider');` and issue got resolved.


Unable to display list of custom posts

I'm working on a project where I need to display a list of my custom post, just like with categories. I've made a custom post type (called "videoer") in my functions.php:               function register_rc() { // A unique name for our function     $labels = array( // Used in the WordPress admin         'name' => _x('Videoer', 'post type general name'),         'singular_name' => _x('Video', 'post type singular name'),         'add_new' => _x('Add New', 'Video'),         'add_new_item' => __('Add New Video'),         'edit_item' => __('Edit Video'),         'new_item' => __('New Video'),         'view_item' => __('View Video '),         'search_items' => __('Search Videos'),         'not_found' =>  __('Nothing found'),         'not_found_in_trash' => __('Nothing found in Trash')     );     $args = array(         'labels' => $labels, // Set above         'public' => true, // Make it publicly accessible         'hierarchical' => true, // No parents and children here         'menu_position' => 5, // Appear right below "Posts"         'has_archive' => 'resources', // Activate the archive         'supports' => array('title','editor','comments','thumbnail','custom-fields'),         'taxonomies' => array('category', 'post_type'),         'public' => true,         'show_ui' => true,         'exclude_from_search' => true,         'query_var' => true,     );          register_post_type( 'videoer', $args );      } This works well in the wordpress admin area, and i can also display the posts correctly. I have given each post a category called `videoer` (the same name as the costum post type). Now if I want display all the post under the category `videoer` I get nothing. I have tried this on my `video-category.php`:                   <?php $loop = new WP_Query( array( 'post_type' => 'videoer', 'posts_per_page' => 100   )  ); ?>        <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>        <?php the_post_thumbnail(); ?>
<?php the_title() ?>
        <a href="<?php the_permalink() ?>">Read More             <?php endwhile; ?>      Any advice is welcome!


IF Custom field value equals ZERO

I am trying to use the following code to check for my custom field for a value of ZERO to then display my div               <?php      $mp_price_sort = get_post_meta('mp_product_price');     if ($mp_price_sort  == '0') { ?>
<?php echo do_shortcode('[shortcodes]'.$mp_buy_button.'[/shortcodes]'); ?>
     <?php } ?>       However it is interperting as a value of anything, thus displaying the div, but I need it to check for the number 0. How can I fix this?


Show list of categories in post editor only from current custom post type

How to show list of categories in post editor (admin area) only from current custom post type? ![enter image description here](http://i.stack.imgur.com/JnYAZ.png)


Catch and display error on save_post action

I wrote this function that adds data to an external db every time a custom post called 'event' is created. How can I prevent the save from happening if this function returns an error? At the moment, the info is not being added to the external db, and no error is being displayed even though I have a try/catch.                function add_campaign_to_SF( $post_id) {              if ('event' == $_POST['post-type']) {             try {                        $sObject = new stdclass();                   $sObject->Name = get_the_title( $post_id );                   $sObject->StartDate = date("Y-m-d", strtotime($_POST["events_startdate"]));                   $sObject->EndDate = date("Y-m-d", strtotime($_POST["events_enddate"]));                   $sObject->IsActive = '1';                        $createResponse = $mySforceConnection->create(array($sObject), 'Campaign');                        $ids = array();                         foreach ($createResponse as $createResult) {                             print_r($createResult);                             array_push($ids, $createResult->id);                         }                               } catch (Exception $e) {                             echo $mySforceConnection->getLastRequest();                             echo $e->faultstring;                              }         }       }           add_action( 'save_post', 'add_campaign_to_SF');


displaying an error before update_post_meta

I'm trying to restrict how many items you can associate with a post so in my save function I have:               add_action( 'save_post', array( $this, 'save_custom_items_data' ), 10, 2 );          public function save_custom_items_data( $post_id, $post ) {         if(count($related_items) > 5) {             // display error message here but the page redirects anyway...         } else {             update_post_meta( $post_id, '_custom-meta-items', $related_items );         }     }      how do I display an error here instead of saving the custom post meta?


make a mulitingual wordpress website Arabic-english

I want to make a website in both languages Arabic and English, in the way that I can change from Arabic to English from the upper menu. I want to make it as word-press based website and buy a theme to use it and base my website upon it. note that arabic is written from Right to left, so we have to take this into consideration as well. is there a possibility for that and how it can be done. if there any plugin I can do?


custom Image upload coding wordpress

Hello im working on WordPress plugin with separate data tables in same database. so far im doing okay with add new post. I want to add images to my post. I tried many things but so far I've got nothing. I don't know how to use inbuilt media uploader in WordPress with my own data table for saving the location on images so this is what i want custom code for upload images to a specific folder and save the location in separate table for retrieving the images for viewing I'm really stuck in here.. Thanks in advance


How to organize hierarchical structure in custom post type with taxonomy (like with categories)

can anyone help me with custom post type arhive? I want there organise taxonomy term structure like with categories. Full image url: http://i.stack.imgur.com/nzl4y.png ![enter image description here](http://i.stack.imgur.com/nzl4y.png)


[Plugin: Posts 2 Posts] Controling the display order of connections

My question resembles one I asked before: [Plugin: Posts 2 Posts] Changing display order of connections But now I want to display the connection in the SAME order I created them ! That is, if I attache quote#1 THEN quote#2 to an article, I want quote#1 to appear before quote#2 regardless of the creation date of these quotes, their alphabetical order or whatever. Don't know if I make myself clear o_O


Should I use function_exists() and/or add_action() in theme development?

I'm trying to get my theme ready for publication on WordPress.org I got this feedback: > function_exist() it is not preferable 3.0 design Now I wonder what I'm doing wrong. In the current structure I have: `functions.php`:               /* Load JBST functions on 'after_setup_theme'. */     add_action( 'after_setup_theme', 'jbst_theme_setup' );          if ( ! function_exists( 'jbst_theme_setup' ) ):     function jbst_theme_setup() {                  /* Load custom Skematik header functions. */         require( get_template_directory() . '/functions/skematik-header-functions.php' );     //more code     }      `/functions/skematik-header-functions.php` defines the function like:               add_action( 'skematik_header', 'skematik_doc_type', 9 );     function skematik_doc_type() {     ?>     <!DOCTYPE html>     <html <?php language_attributes(); ?>>     <head>     <meta charset="<?php bloginfo( 'charset' ); ?>" />     <meta name="viewport" content="width=device-width" />     <?php     }      In this case `skematik_doc_type` can be removed with `remove_action` but can't be overwritten, because it is not wrapped in a `function_exists()`. Will this be the problem? Do I have to wrap all functions in a `function_exists()` _and_ add them with `add_action`? What are the rules for using `function_exists()` or not?


Search page isn't returning any results

I've looked around and can't figure out what happened to my search page. It used to work but then I guess why I added my archives.php and a bunch of other things it stopped working, but I can't tell at what point in the last week it stopped working.I usually test almost everything on the site when I make changes but for some reason I didn't check the search function until near the end and then it was too late. This is the site.
             <?php if ( have_posts() ) : ?>
<?php printf( __( 'Search Results for: %s', 'toolbox' ), '' . get_search_query() . '' ); ?>
                                <?php /* Start the Loop */ ?>                 <?php while ( have_posts() ) : the_post(); ?>                          <?php get_template_part( 'loop', 'search' ); ?>                      <?php endwhile; ?>

<?php _e( 'Nothing Found', 'toolbox' ); ?>

<?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'toolbox' ); ?>
                         <?php get_search_form(); ?>

                  <?php endif; ?>
      And of course I have my php opening and closing tags, header & footer. I just didn't want to add everything. Currently, if you search for a word that you know is somewhere in the site it returns a NOTHING FOUND. I believe it's to do with my get_template_part as I don't quite understand the wordpress codex for it.               <?php get_template_part( 'loop', 'search' ); ?>      If I use               <?php get_template_part( 'content', 'search' ); ?>      It returns with an error ![enter image description here](http://i.stack.imgur.com/sa8AY.png) Which I have no clue what it means. What could be making the search function behave like this? It used to work. Any help is appreciated! **UPDATE**               <?php     /**      * @package Toolbox      */     <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'toolbox' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>
         <?php if ( 'post' == get_post_type() ) : ?>
Posted on: <?php the_time('F j, Y'); ?>
             <?php endif; ?>


how to show database content in wordpress post

I'm a beginner for WordPress. I have a database app written in PHP and MySQL and I need to convert it to WordPress and also I what to post the database rows info by shortcode were `id="x"` like:               [plugin id="1"]      It is a small database. Just give me a small demo code or link plz. I need it and help me to learn WordPress.


Programmatically adding posts

I'm about to create parser which would be inserting new custom posts. So, it's pretty simple               global $user_ID;     $new_post = array(         'post_title' => 'My New Post',         'post_content' => 'Lorem ipsum dolor sit amet...',         'post_status' => 'publish',         'post_date' => date('Y-m-d H:i:s'),         'post_author' => $user_ID,         'post_type' => 'post',         'post_category' => array(0)     );     $post_id = wp_insert_post($new_post);      But i have some extra logic in creating permalinks.               function my_post_type_link_filter_function( $post_link, $id = 0, $leavename = FALSE ) {         if ( strpos('%dgor%', $post_link) === 'FALSE' && strpos('%znak%', $post_link) === 'FALSE' ) {             return $post_link;         }         $post = get_post($id);         if ( !is_object($post) || $post->post_type != 'goroskop' ) {             return $post_link;         }         $day = wp_get_object_terms($post->ID, 'gday');         $month = wp_get_object_terms($post->ID, 'gmonth');         $year = wp_get_object_terms($post->ID, 'gyear');         if (  !$day || !$month || !$year ) {             return $post_link;         }         $post_link = str_replace('%gday%', $day[0]->slug, $post_link);         $post_link = str_replace('%gmonth%', $month[0]->slug, $post_link);         return str_replace('%gyear%', $year[0]->slug, $post_link);     }     add_filter('post_type_link', 'my_post_type_link_filter_function', 1, 3);      So, i need to replace some markers in my permalink structure based on custom taxonomy. The question is: **Is there any way to invoke this logic programmatically while inserting new custom post?**


wp_enqueue_script outside functions.php file?

I want to include an optional template part in the theme which requires some jQuery plugin. Is it ok to include the wp_enqueue_script in that specific file? Or it should always be included in the functions.php file? Also, is it ok to write some javascript code in that specific file? The script works, but my question is about WordPress coding standard.


How do I add a front menu button that redirects to another website or sub-domain?

_Hello there,_ > I would like to add a front menu button (viz. Home, About, Archive etc.) to > my blog that links to another website. WordPress only shows the pages that I > have created using dashboard in the front menu. I hope my question is clear. Let's assume I have a Yoga blog and a Yoga store at another website. I'd like to add a "STORE" button -- after my Home, About and other pages -- that links outside the WP blog. Thanks for your help. :) PS - I am using lightword theme.


Any known plugins for master admin login to edit all on front end?

Have a theme that accepts posts on the front end by users and gives them a front end dashboard too to edit... I was wondering if there are any known plug-ins for the admin to edit all as if they were logged in as a user? Basically a master login revealing the users dashboard info./options to edit on their behalf as admin master login? Shawn


switch_to_blog() performance considerations & alternatives

I'm currently in the conceptual phase for a multisite network. The rough idea is: There are multiple networked sites and all publish posts for their own. The network admin is able to establish "content links" between each of the blogs. A "content link" means, that the admin is able to configure the sharing of posts between the blogs in the backend. Either single (`-->`) or both way (`<->`). This results in the listing pages of a blog showing also posts from other blogs. _For example if we have three blogs the "content links" could be configured like this:_ > **A** <-> **B** > > **A** \--> **C** _This would result in:_ > **A** also shows the content from **B** > > **B** also shows the content from **A** > > **C** also shows the content from **A** and also from **B** (through > ancestry relation **B** -> **A** -> **C** ) Personally I would like to stick with WP_Query(), as I like the features I will get with it:   * pagination support,   * taxonomy queries,   * post_meta queries. But it seems like I'm stuck with using switch_to_blog() massively if I want to use WP_Query(). The system has to be laid out for approx. 100 blogs with 200 posts each, which means in the worst case I have to make use of 99 calls to switch_to_blog() to render a single post list/category page. Has anybody ever done massive content sharing between networked blogs or has an idea on howto to achieve a decent performance for this task?


Customizing the BuddyPress  blog loop

I would like to "omit" certain blogs from the regular BuddyPress blog loop. Either by blog ID or blog Name is fine. Has anyone had success doing this?


How do I log plugin (cron) actions?

Is there a recommended way to log (failed) cron actions from your plugin? For example, I have a plugin that synchronizes with an external service every hour. I want to log how much was changed, but also when the synchronization failed. What would you recommend here? A new database table? The Log Deprecated Notices plugin does this with a custom post type, but this might be too much overhead? I believe WordPress does not come with a standard logging package?


How do I pull excerpts from pages?

So I enabled custom excerpts on my pages with this function.               add_action('init', 'page_excerpts');          function page_excerpts() {         add_post_type_support( 'page', 'excerpt' );     }      However, When I enter a data into the excerpt field I still have the content returning in the loop instead of my newly added excerpt.               <?php the_excerpt(); ?>      Do I need to do anything else to force the content to be pulled from the excerpt field on pages?


Numbering lines of code with the <code> tag?

The wordpress tag is used to display code on a page (refer to: http://themeforward.com/demo2/2011/09/12/code-tags-in-post/) but I am having a hard time finding a function that will number the lines of code, as seen on http://themeshaper.com/2009/07/02/wordpress-theme-search-page-template- tutorial/ Does anybody know where this function can be found?


change the url in wordpress

I'm creating a wordpress website, And i have created "News" custom post type with taxonomy. My archive page URL is www.yourwebsite.com/news/ and taxonomy page URL is www.yourwebsite.com/news/india-news/ Now i want duplicate "www.yourwebsite.com/news/" URL to "www.yourwebsite.com/country/". Both page should be working. So please let me know how i can create duplicate page. Where i can fetch all the post from the "News" post type. and how i can assign "www.yourwebsite.com/country/" to that particular page. Thanks Gaurav...


Weird google bot crawl problem

I have moved my website to a VPS server. It is a Wordpress + Buddypress installation, latest versions. I don't understand why I can't see anything when I visit my site with Lynx - a text browser. I can see other sites using wordpress on the same server, but this one doesn't work. Also blogs created on the platform also work fine in Lynx, but the pages of the website don't. Guess that's why my website also was removed from google search results.


Get options from database using php class

I want to make a php class that gets an option from the wp database (which is an array of options) and be able to call this class with the name of the option and the class to return the options value. Does anyone know how would I go about doing this? EDIT: I have tried the following code               class N_Options {              function __construct($name) {                    if(isset($name)):                 $options = get_option(THEME_SPACE . '_options');                 $option = $options[$name];                 echo $option;             endif;         }          }      And I have tried to call the option using               new N_Options('option');      This retrieves the option from the database just fine now. However, I think this may be accessing the database too many times as I will be accessing this class over and over for all my options. Is there a way to store these options inside the class as an array variable and keep calling the class to look inside the variable without calling a new class for each option?


Can't find plugins in menu for wordpress 3.2?

Wordpress changed quite a bit from 3.1 to 3.2. I have played for an hour to find the plugin section but not success. Usually they would be on the left hand side in the menu. Now they are not there. Anyone knows where to find them and how to install them on xyz.wordpress site? This image is from 3.1. Plugin option is second from top. ![enter image description here](http://i.stack.imgur.com/ABEi2.png) Here is 3.2 menu. Can you find Plugins? ![enter image description here](http://i.stack.imgur.com/2SKud.png)


Keeping WP database synced across multiple developers using git

I'm working on improving my git workflow as it applies to my WordPress development projects. Often, when developing a content management system, I'll create a development server (like `http://dev.finalsitename.com`) containing the custom post types and taxonomies that will be used in the production version. This allows my client to begin adding their content to the site. While they are working on this task, I'm usually building out the look and feel as well as the custom programming/plugins that will be used on my localhost environment. To ensure that I don't overwrite any of their updates, I generally pull a copy of their database down and replace mine. However, there are times where I just need to hop into the WP admin area and change a setting or something else small... If there are multiple developers working on a WordPress project, we each do a (timestamped) database dump of our version of the site and include in in the root directory before committing and pushing their local branch back to the remote repository. The trouble with this approach is that the databases are often out of sync with no easy way to determine which to use. What are other developers doing to keep their databases in sync while still allowing multiple developers (and clients/content producers) to work on the same project?


Create built-in pages without creating actual pages

For example: `site.com/contact` (or `site.com/?page=contact` if not using permalinks) when someone goes to that page I want to load a theme template, like `page- contact.php` But I don't want to create a page in the dashboard for this work. How can I do this internally, within functions.php ? I know it's possible because that bbpress plugin does it somehow for the /users/ pages, which are not standard wordpress pages...


Hovercards and other hover over image functions don't work anymore!

This problem is driving me crazy. So, I've Jetpack installed and the Gravatar hovercards activated. I could live without them, but other "hover over image" functions (e.g. I'm using the Guan Image Annotation plugin that lets you add a note to an image in a post by hovering over it) don't work either. It still worked earlier today and all I did was activate and deactivate a few other plugins. I tried to figure out with plugins are causing the misfunction, but couldn't figure it out. Maybe it's not a plugin interfernence after all. I just can't seem to figure it out :( As I'm a total beginner I'm not sure, but I think both (hovercards and the mentioned plugin) work with javascript? So maybe something is interfering with that? I hope you can help me figure this out. My (under construction) website is here. Thanks a lot in advance for any kind of advice! :)


Fluid Featured Post Carousel Slider for Wordpress with no Javascript

I implemented a pure CSS Slider without Javascript on my Test-site with 5 image slides. How can i adapt the slider to show the 5 latest posts from my featured post category with thumb, title, excerpt and link to the post instead of the images? Thank you so much **Here is the Fiddle**


Pagination Comments Doesn't Show

what im trying to accomplish is adding a pagination to my function for comments. I think im on the right track with my code but I need some guidance.               <?php $comments = get_comments('number=24&amp;status=approve');     $true_comment_count = 0;     foreach($comments as $comment) :     ?>          <?php $comment_id = get_comment(get_comment_ID())->user_id; ?>     <?php $comment_type = get_comment_type(); ?>     <?php if($comment_type == 'comment') { ?>     <?php $true_comment_count = $true_comment_count +1; ?>     <?php $comm_title = get_the_title($comment->comment_post_ID);?>     <?php $comm_link = get_comment_link($comment->comment_ID);?>     <?php $comm_comm_temp = get_comment($comment->comment_ID,ARRAY_A);?>     <?php $comm_content = $comm_comm_temp['comment_content'];?>
               <img width="170" height="150" class=" avatar user-<?php echo $comment_id ?>-avatar" alt="" src="http://deafcube.com/wp-content/plugins/user-avatar/user-avatar-pic.php?id=<?php echo $comment_id ?>">
<a href="<?php echo($comm_link)?>" title="<?php comment_excerpt(); ?>"><?php echo($comment->comment_author)?> on      <?php echo $comm_title?>

           <?php } ?>     <?php if($true_comment_count == 24) {break;} ?>     <?php endforeach;?>
<?php paginate_comments_links($true_comment_count); ?>
      THANK YOU ALL!


Custom Caption on WP Nivo Slider

I'm trying to set the Post Title or Post Content as the caption in my Nivo Slider. Any ideas on how to do this?


Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?

For example I have 20 pages on a site. one of them is called bacon another called eggs. on the same site...lets say breakfast.com I have the permalinks set up properly and have used them successfully on all pages, including Eggs by way of this: www.breakfast.com/eggs?cooked=scrambled. This works 100% as it should. However, on a different page of Breakfast.com called sausage...this, does not work. www.breakfast.com/sausage?type=spicy this is causes a 404 error. I don't see why it would as it's the same format. I have verified that the page exists in my pages directory in WP-admin. If I strip away the GET variable the page works. Google is not helping me. Anyone have a similar experience?


Is it Possible to Extend WP Customize JS Methods?

I’m wondering if it’s possible to extend the methods of the anonymous `api` object in `wp-admin/js/customize-control.js`. I need to overwrite one of these methods with my own custom logic but I suspect it's not possible since it’s wrapped in an immediately invoked function expression:               /* globals _wpCustomizeHeader, _wpMediaViewsL10n */     (function( exports, $ ){     // code     })( wp, jQuery );      As far as I can see, I'm not able to extend the prototype from the window object because it's executed anonymously and not available from `window.wp.customize`. Any idea if such a thing is possible? There is even mention of overriding this in the .toggle() methods documentation / description: https://github.com/WordPress/WordPress/blob/master/wp- admin/js/customize-controls.js#L110, but I’m not sure if they mean by simply forking the whole JS file, dequeueing the WP version and enqueuing your own or if they mean or something different. Note that it seems like it should be possible with `wp.customize.{method}.extend({ foo: // replace method foo here })` but that only applies to the public base classes/objects, not those in `wp- admin/js/customize-control.js`


Transient API and caching Plugins

Hello wordpress NINJAS.... I am crazy about transient api and I have implemented it in my theme.My question is   1. If I use transient api is it required caching plugin? (I hate plugins!!!)   2. If I use transient and caching ,how will be the result?   3. Can I use transient against caching plugin?   4. Is caching plugin and transient work on same principle?


Where should my plugin POST to?

I'm creating a simple plugin to set a page as a homepage from the list pages (to appear next to edit, preview, trash actions etc), I was just wondering what that the most appropriate/secure place to submit this information to? By far the easiest way would be to just post back to the plugin file itself with a $_GET param, but that seems rather hacky and doesn't use a nonce or anything (my plugin does have `current_user_can()` in it. Code is as simple as this:               function add_post_actions($actions, $post) {         if($post->ID == get_option('page_on_front')) {             $actions['homepage'] = 'Your Homepage';         } else {             $actions['homepage'] = 'ID.'">Set As Homepage';         }              return $actions;     }          function change_to_homepage($postId) {         if ( ! current_user_can( 'manage_options' ) )             wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );              update_option('show_on_front', 'page');         update_option('page_on_front', $postId);     }


Use 'add_theme_support' instead of 'add_custom_image_header' In WordPress 3.4

I am debugging my theme using Debug Bar plugin, which is showing me this error (among a few others): > Notice: `add_custom_image_header` is deprecated since version 3.4! Use > `add_theme_support( 'custom-header', $args )` instead. Okay, clearly, it says I need to use this instead of this. The question is, `add_custom_image_header` has three parameters, namely:   * $header_callback   * $admin_header_callback   * $admin_image_div_callback How do I represent them in `add_theme_support` function? Like this?               $aahan_custom_header_args = array(         'wp-head-callback'       => '',         'admin-head-callback'    => '',         'admin-preview-callback' => '',     );     add_theme_support( 'custom-header', $aahan_custom_header_args );      Also, are `wp-head-callback`, `admin-head-callback`, and `admin-preview- callback`, the exact replacements for `$header_callback`, `$admin_header_callback`, and `$admin_image_div_callback` respectively?


Changing checkbox array from single to multiple select

I want to change the code below to allow for multiple checkboxes to be selected. It currently saves and updates only one selction. And to update the option again, I have to "uncheck" the previous selection then make another single selection for it to save.                   case 'tax_select':      $terms = get_terms( $field['id'], 'get=all' );      $selected = wp_get_object_terms( $post->ID, $field['id'] );      foreach ( $terms as $term ) {          printf( '<input type="checkbox" name="%s[]" value="%s" %s/>
', $field['id'], $term->slug, !empty( $selected ) && !strcmp( $term->slug, $selected[0]->slug ) ? ' checked="checked"' : '' );      }      $taxonomy = get_taxonomy( $field['id'] );      echo 'Manage ' . $taxonomy->label . '';      break;       NEWLY ADDED: HOW I AM SAVING THE DATA:                   // Save the Data     function save_custom_meta($post_id) {     global $custom_meta_fields;          // verify nonce     if (!wp_verify_nonce($_POST['custom_meta_box_nonce'], basename(__FILE__)))         return $post_id;     // check autosave     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)         return $post_id;     // check permissions     if ('page' == $_POST['post_type']) {         if (!current_user_can('edit_page', $post_id))             return $post_id;         } elseif (!current_user_can('edit_post', $post_id)) {             return $post_id;     }          // loop through fields and save the data     foreach ($custom_meta_fields as $field) {                 if($field['type'] === 'tax_select') continue;         $old = get_post_meta($post_id, $field['id'], true);         $new = $_POST[$field['id']];         if ($new && $new != $old) {             update_post_meta($post_id, $field['id'], $new);         } elseif ('' == $new && $old) {             delete_post_meta($post_id, $field['id'], $old);         }     } // end foreach              // save taxonomies     $post = get_post($post_id);     $category = $_POST['category'];     wp_set_object_terms( $post_id, $category, 'category' );     }     add_action('save_post', 'save_custom_meta');


Show preset taxonomy description

In educational courses database, institute is used as custom taxonomy. How can I display description of "institute" taxonomy in all related posts as one institute will have at least 50 posts (courses)...


Insert wordpress tags below posts via functions.php

I'm in the process of building my own Wordpress theme from scratch and my knowledge of PHP is limited. What I'm trying to do is insert tags below each post. I can do this by inserting code into my single.php file but I want to do this through the `functions.php` file. I have already inserted an author box below each post through the functions.php file. I got the code for that somewhere online and I would like to do the same thing with the tags. Here is the author box code in my `functions.php` file.               function get_author_bio($content='') {         global $post;         $post_author_name=get_the_author_meta("display_name");         $post_author_description=get_the_author_meta("description");         $html="
\n";         $html.="
About the author
\n";         $html.="
\n";         $html.="\n";         $html.="
".$post_author_name."
\n";         $html.= "
".$post_author_description."
\n";         $html.="
\n";         $html.="
\n";         $content .= $html;         return $content;     }     add_filter('the_content', 'get_author_bio');      It works great and it allows me to add HTML elements for easy CSS styling. I want something similar for the tags. Cab anyone help me?


_deprecated_argument for constants

i'm working on updating a theme and previously it had used a lot of php CONSTANTS to set up some options as true or false. we're going to be updating these "decisions" to use add_theme_support() instead. is it appropriate to use the _deprecated_argument() function to tell child themers that these constants are deprecated? if not, what is the best way to trigger a deprecation warning for a constant?


Where should a plugin or widget cache its results?

_Where should a plugin cache its re-usable results?_ I have read the code of several well-used Wordpress plugins, and it seems that the answer is not consistent. I have written several plugins myself, and I store things in a cache directory. But I just picked the location of the directory out of a hat, and my code creates the cache directory if it doesn't exist. This seems arbitrary. I know there are plugins that do caching. Suppose I don't want to use a plugin. I find that relying on the filesystem to cache results is easy for maintenance, diagnostics, and performance. Is there a good, more-or-less standard approach, or a blessed approach, to choosing a filesystem location for a cache?


After installing JetPack, can I delete the WordPress stats plugin?

After running the WordPress stats plugin for many years, I've decided to upgrade to JetPack. The installation went smoothly, I connected and authorized my blog with Wordpress.com, and I'm seeing stats. Is it safe to deactivate and delete my old WordPress stats plugin now? Or do I need to keep it in order to preserve my historical data? I'm a bit shocked that WordPress hasn't provided a step-by-step upgrade guide for this.


latest 5 posts using switch_to_blog loop

im sure i must be doing something wrong and would really appreciate a little help. I am trying to loop through all of my Sub Dir "Multisite" blogs using switch_to_blog, below:               global $wpdb, $blog_id, $post;         $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM wp_blogs ORDER BY blog_id" ) );         foreach ($blogs as $blog){                  switch_to_blog($blog->blog_id);             $globalquery = get_posts('numberposts=5&post_type=any');             restore_current_blog();              }         array_merge($globalquery, $portfolio);      It does work (kinda), it moves to the next blog (id = 2) and is retrieving posts, but goes no further and does not retrieve the main blog posts (id = 1). I am a self proclaimed php noob, but really enjoy learning and i think im doing quite well lol Please if someone could help me out? Regards Rory _**UPDATE_** I am trying to create a loop that i can pass into an already declared query:               // create query the portfolio (pass it to $wp_query)             $portfolio_query = new WP_Query( $portfolio );


Altering term_id and name via $wpdb class

$s = $_POST['submitterms'];     $querystr = "                 SELECT $wpdb->terms.*                 FROM $wpdb->terms                 WHERE                 lower($wpdb->terms.name) like '%$s%'              ";     $pageposts = $wpdb->get_results($querystr, OBJECT);     echo '
';     $x = 0;     while ($pageposts[$x]) {       $post = $pageposts[$x];       echo '
';       echo 'term_id . '">' . $post->name . '';       echo '
';       $x++;     }          echo '
';      I'm able to get term names that contains the characters i typed into the text box. But what i want to do is changing `term_id AS id AND name AS value` so that i can pass the variables like:               $post->id     $post->value     //i.e     echo 'id.'">'.$post->value.'';      I guess i need to change the MySQL code. What should I do?


Google fonts dropdown in Options Framework

Is there a way to add a Google Fonts dropdown to the Options Framework panel (http://wptheming.com/options-framework-theme/)


Add a link back to site on 'edit profile' page for users?

When users are on the 'edit profile' page, it's hard to tell how to get back to the site. I know you can click on the site name at the top left corner but it doesn't seem obvious. Is there a way to add a link back to the page they were on? Or perhaps a plugin I can install?


Missing parent page attribute

Suddenly the parent page attribute is missing on the page edit view. I'm using Wordpress 3.9.1 and the newest Avada theme. The parent attribute has worked. Now it is not shown as page attribute. I've updated Wordpress and the theme. It has not helped. I have switched the theme and set Avada back again and it worked for a short time. Now do not again. What can I do? Thanks!


What is the importance of writing a < WP 3.x compatible plugin nowadays?

I am currently writing a simple-ish plugin with custom posts and a couple functions, using post metadata and adding a couple of variables to the "options" table in the database. During my research, I saw some references in the WP Codex about making the plugin backwards compatible with versions before WP 3.x and I was just wondering how important it is now to incorporate that compatibility. For instance, the oldest version of WP I ever saw installed (by a client) was 3.2, or somewhere around there. I cannot imagine many people having anything older than 3.x but I could be wrong. I know in theory you should always try to make it perfectly compatible but, realistically, does anyone know how important it is to include that capability? Thanks


check if a taxnomy queried in $wp_query?

Is there a way to check if there is any taxonomy that has been queried in the global $wp_query?


Custom Homepage Pagination using WP_Query

I have a situation and all the searching I've done hasn't led me to a successful outcome. I have a static homepage template with a custom wp_query that looks like the following (which works on another site on a custom page-- Also, I have posts_per_page set to 1 for testing purposes and I have posts set to 1 in the dashboard):               <?php          global $paged;         global $bday_parties;         $temp = $bday_parties;          $bday_parties = null;               $bday_parties = new WP_Query();          $bday_parties->query('category_name=party-themes&posts_per_page=1&post_type=page'.'&paged='.$paged);         while ($bday_parties->have_posts()) : $bday_parties->the_post();      ?>          <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
             <?php get_template_part('partials/loop-homeparties'); ?>

          <?php endwhile; ?>
         <?php wp_pagenavi( array( 'query' => $bday_parties ) ); ?>
     <?php          $bday_parties = null;          $bday_parties = $temp;      ?>      The partials/loop-homeparties template is pulling meta values from custom meta boxes on a page and that content is making up the "posts" on the homepage (as well as on archive pages). Using the above query, I get the content on the home page, I get the nav links but when I click (the link shows the URL for the next page) the home page just reloads. I've been working on this for a couple of days now and the site needs to launch soon (this is holding me up). Since it works on another page successfully, I don't understand why it isn't working for me here. Any help would be appreciated. TIA!


Viewport meta tag disappearing

I have just started with Wordpress development and have searched high and low for an answer to this question. I am attempting to add the viewport meta tag to my header.php file:               <!DOCTYPE html>     <html <?php language_attributes(); ?>>              <meta charset="<?php bloginfo( 'charset' ); ?>">         <meta name="viewport" content="width=device-width, initial-scale=1">         <title><?php wp_title( ' | ', true, 'right' ); ?></title>         <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>"        />         <?php wp_head(); ?>          <body <?php body_class(); ?>>

                     <?php if ( ! is_singular() ) { echo '
'; } ?><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php esc_attr_e( get_bloginfo( 'name' ), 'blankslate' ); ?>" rel="home"><?php if ( ! is_singular() ) { echo '
'; } ?>
                                      <?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?>
      Unfortunately, when I load the page, the viewport meta tag just doesn't appear in the head. ~~I have Yoast SEO installed. Would it be causing this issue?~~ Here is the resulting head after disabling all plugins and clearing the browser cache:               <!DOCTYPE html>                                  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />         <title>Customize BlankSlate — WordPress</title>                            <link rel='stylesheet' href='X' type='text/css' media='all' />         <link rel='stylesheet' id='open-sans-css'  href='X' type='text/css' media='all' />         <link rel='stylesheet' id='colors-css'  href='X' type='text/css' media='all' />                  <link rel='stylesheet' id='imgareaselect-css'  href='X' type='text/css' media='all' />               Note: The X's are my own edits.


how do I queue my Child stylesheet/s *after* every Parent stylesheet/statement?

I'm using the well-written Oenology theme by Chip Bennett as the Parent to my own Child theme. In my development process, I've discovered that there are some challenges for people writing Child themes when it comes to controlling styles. I've just discovered that my main style.css file gets loaded before every other stylesheet link or statement in <head>, and this explains why I was having trouble overriding some of the Parent styles. further study of the problem shows that various Parent stylesheets and styles can be queued in the <head> in three places; `add_action('wp_print_styles',`, `add_action('wp_enqueue_scripts',`, and then `add_action('wp_head',`. to keep things simple, I'm planning to create two stylesheets. the first main 'style.css' sheet would only include the `@import url()` command, needed to load Oenology's main stylesheet. the second stylesheet would contain my Child rules. to make sure that it's loaded after _all_ of the other rules, I'd queue it using `add_action( 'wp_head',`. does this sound reasonable? or is there a better (more correct) way to do it? ~~btw, does anyone know what '/parent-theme/style.css **?MRPreviewRefresh=723** ' means?~~      ### Update wp_enqueue_style() doesn't appear to work in wp_head(). cheers,   Gregory


How to fetch all posts in a category that were published between two given dates?

I need to be able to get all posts in the blog that were published in between two dates. The get_posts() API call doesn't seem to provide a method for limiting the time period of the returned results to a particular date range. If this isn't available, how could this be done through direct queries. I've attempted to do this directly but I am not able to find where in the database are the columns and rows that correspond to the categorization of blog posts in a particular category.


Display hReviews from other websites such as yelp on your site?

Does anyone know of a plugin that reads hReview schema microformat from any website supporting it then can display the reviews on your wordpress site either with a php function or short code?


get_page() - Only variables can be passed by reference

When I try to use `get_page()` function I get the error message:               Only variables can be passed by reference      But what doesn't make sense is that I can use a work around that blows my mind: # First test               $test1 = get_page(49);      **Returns error message**               Only variables can be passed by reference      # Second test               $page = get_page_by_title( 'About' );     $test2 = get_page($page->ID);     echo 'ID:'.$page->ID.' Post title: '.$page->post_title;      **Returns no error**               ID:49 Post title: About      Can anyone shed some light on what I'm doing wrong?


What's the best way to customize the Wordpress Menu Page (in admin)

Helo, I would like to restyle/reorganize my Admin Menu Page (wp-admin/nav- menus.php). What's the best way of doing this? Can I just edit the page directly?


Prevent multiple counts by same user - WP PostViews plugin

I am using WP Post Views plugin to display the post number of views. To do so, I use:               <?php if(function_exists('the_views')) { the_views(); } ?>      **The problem is:** The plugin increments the number of a post views if the user just refreshes the post page. It will be good if the number of views increase only one time for a specific user. I thank you for your time.Your usual help is always appreciated. The link to the code source is :http://plugins.trac.wordpress.org/browser/wp- postviews/trunk/wp-postviews.php **Note:** I already managed, with the help of SE community, to exclude the views by post author using the following hack:               function remove_view_counter_wpse_102637() {       global $post;       $current_user = wp_get_current_user();            if (         is_single()          && !empty($current_user)         && $post->post_author == $current_user->ID       ) {         remove_action('wp_head', 'process_postviews');       }     }     add_action('wp_head', 'remove_view_counter_wpse_102637',1);      But I cannot manage to exclude the multiple counts by same user using the same logic.


Detecting top parent category fails on home page

I have the following method to detect a top level category. But it fails on home page returning alway true.               //detect parent category     function in_parent_category($cats,$_post=null){         foreach ((array) $cats as $cat) {             $descendants = get_term_children((int) $cat, "category");             if($descendants && in_category($descendants,$_post))             return true;                }         return false;     }      and then in template               <?php         if(in_parent_category(129)){             echo 'parent';         } else {             echo 'not parent';         }     ?>      Does anyone knwo to filter home page as well? **UPDATE** By filtering I mean that for some reason using the code above it will always return TRUE if I am on the home page like if the home page is under the top level parent width 129


Can't manage to make translate_user_role() work

I've been looking into wpse archives to solve my problem but I can't manage to do such a thing. I built this code :               $args = array('fields' => 'all_with_meta');     $users = get_users($args);     foreach ($users as $user) {            echo esc_html( translate_user_role( ucfirst ( $user->roles[0] ) ) );     }      I made a `print_r()`to see what I get. Everything is fine, I mean I grab user role but it does not translate by itself. Do I need to do more?


WordPress Mysql query and Duplicate

i've a problem with mysql query on my wordpress database. I've custom fields Country and City. At moment I have this query that show all the cities of "UK" Country               $querystr = "     SELECT wposts.*      FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta     WHERE wposts.ID = wpostmeta.post_id      AND wpostmeta.meta_key  = 'Country'      AND wpostmeta.meta_value  = 'UK'      AND wposts.post_type = 'post'      ORDER BY wpostmeta.meta_value DESC     ";     $pageposts = $wpdb->get_results($querystr, OBJECT);      This is the query with php foreach that show all the cities                 <?php           $querystr = "      SELECT wposts.*       FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta      WHERE wposts.ID = wpostmeta.post_id       AND wpostmeta.meta_key  = 'Country'       AND wpostmeta.meta_value  = 'UK'       AND wposts.post_type = 'post'       ";           $pageposts = $wpdb->get_results($querystr, OBJECT);           ?>      <?php if ($pageposts): ?>            <?php global $post; ?>       <?php foreach ($pageposts as $post): ?>         <?php setup_postdata($post); ?>              <?php echo get_post_meta($post->ID, 'city', true) ?> <br />            <?php endforeach; ?>           <?php endif; ?>      This query listed all the UK City grabs the data from my WordPress Custom Field "City". This query returns a list of Cities like:               Aberdeen     Aberdeen     Aberdeen     Aberdeen     Aberdeen     Belfast     Belfast     Belfast     Belfast     Belfast     Birchington     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Birmingham     Blackpool     Bournemouth     Bournemouth     Bournemouth     Bournemouth     Bournemouth     Bournemouth     Bournemouth     Bournemouth     Brighton         Brighton      etc.!!! as you can see there are duplicates of "city" field value, I need to show once the city and get a list like                     Aberdeen           Belfast           Birchington           Birmingham           Blackpool           Bournemouth           Brighton           Bristol      How can I get this? Thnks to everyone !!


functions.php return custom text

I am looking to add custom text to the site in functions.php. I am using multisite. Is there a hook to determine which site so I can alter the text? For example:               function greeting(){         if(site_name('one'){         echo 'hello';         } elseif(site_name('two')){         echo 'goodbye';         }     }


Loading scripts on specific pages using PHP in footer.php

I'm trying to load scripts only when needed on a particular page. I've got the following in my footer, but am struggling with the 'is nots' and also chaining the PHP together in an else if statement - which i think will be more elegant than the way i've written it now. Code is as follows:               <?php if (is_page('home') ) { ?>     <script type="text/javascript" src="<?php echo bloginfo('template_directory');?>/scripts/jquery.jcarousel.min.js"></script>      <script type="text/javascript">     jQuery(function($){     $('#mycarousel').jcarousel();     });     </script>     <?php } ?>               <!--news page lightbox custom JS-->      <?php if (is_single() ) { ?>     <script type="text/javascript" src="<?php echo bloginfo('template_directory');?>/scripts/slimbox2.js"></script>     <?php } ?>               <!--JS to load on pages apart from model pages AND news pages-->      <?php if ( ! is_page_template('modelPages.php') || ! is_single() ) { ?>     <script type="text/javascript" src="<?php echo bloginfo('template_directory');?>/scripts/jquery.easing.min.js"></script>      <script type="text/javascript" src="<?php echo bloginfo('template_directory');?>/scripts/supersized.3.2.7.min.js"></script>     <?php } ?>      Can anyone a) point me in the right direction of loading scripts only if the page is NOT single or using the template and also, advise who to write this in an else statement, please? Thanks


Moved site to 1&1 hosting, but is broken and redirecting to GoDaddy 404

I'm actually just trying to mirror a GoDaddy site on a subdirectory of my personal 1&1 hosting. I just strait up copy-pasted the file structure, and copied the Database, using a search replace tool to replace the base url with my new one. I then editted the wp-config with the new DB stuff. When I navigate to http://oneandone.com/wp for some reason its redirecting me to a GoDaddy 404 page. If I go to http://oneandone.com/wp/readme.html it displays the appropriate file correctly. In the options table in the db, I've verified that the siteurl is correct. **.htaccess**               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      Anyone have any insight? **Update** It may be of interest, that the problem persists even when wp-config has bad info for the database. I think this indicates that wp-config isn't even loading. The index.php file looks normal, as well as the .htaccess, so I'm totally at a loss here. **Update 2** http://oneandone.com/wp/index.php brings me to the expected Database Error page. Where http://oneandone.com/wp/ gets the godaddy 404 page. **FINAL UPDATE: PROBLEM RESOLVED** see my answer below


Display custom homepage text based on domain

I am running multisite for 5 sites. I have a theme where it doesn't have a text area at the top of the page but i want to put some introduction text on the homepage. I currently have all 5 sites using the same child theme to maintain the same look and layout. What is the best way to add the custom text to the homepage for each site based on the domain? Would I do this somehow editing the child theme file(s) with a shortcode and functions.php? I am a developer but pretty new to wordpress. A simple code example would be very helpful. Bonus points and kudos if there is a way to make this a widget that can be edited in the admin so I can change the text outside of the code.


Get unique post in parent category

I have a parent category and several child categories. I also have several posts that belong to the child categories. Each post can be belong to several categories. I want to know how to query the post table so when I want to show all posts in parent category, I'll get all the post under the child categories. the result have to unique post. Sorry for my bad english. Here is my code :               $cats = get_categories('child_of=95');           // loop through the categries     foreach ( $cats as $cat ) {         // setup the cateogory ID         $cat_id = $cat->term_id;         // Make a header for the cateogry         //echo "
".$cat->name."
";         // create a custom WordPress query         query_posts("cat=$cat_id&post_per_page=100");         // start the wordpress loop!         if (have_posts()) : while (have_posts()) : the_post(); ?>                  <?php // create our link now that the post is setup ?>
<?php the_title(); ?>
             <a href="<?php the_permalink();?>"><?php the_content(); ?>             <?php echo '
'; ?>              <?php endwhile; endif; // done our wordpress loop. Will start again for each category ?>     <?php } // done the foreach statement ?>      But I always get the duplicate posts.


Custom Taxonomy Meta Admin Column

I've added a custom taxonomy - shop_departments which is hierarchal. I've then added a meta field to this new taxonomy - term_meta[front_page] - which is all working fine. However, on the management screen for the taxonomy I want a column for this meta data so the user can see at a glance which departments are assigned to the front page. I can't work out how to add a column to this page. I want to do something like:               // Register the column     function front_page_column_register( $columns ) {     $columns['front-page'] = __( 'Front Page', 'my-plugin' );          return $columns;     }     add_filter( 'manage_edit-shopp_department_columns', 'front_page_column_register' );      Any help would be great, all the articles i've found talk about adding it to a posts or custom post-type edit page, not the taxonomy page itself!


Change slug with custom field

I want to change the slug of a post with a custom field. In example, if the custom field is "keyword" my post link will become: **_mysite.com/keyword._** If the custom field is empty, i want to generate a random key like **_mysite.com/xV5f7A_**. How can i do that without change the wordpress core? Any ideas are welcome! Thanks.


Multiple post selection

I want to enable my users to select multiple posts from a grid display of content. the selection will be used to make a bulk action based on the selection (for example - send an e-mail to all post authors. It seems a bit complicated to implement in wordpress so i seek your help... Is there any plugin that can do it? Are there other ways of achieving the same goal? (some kind of workaround to enable select and bulk action) If i should code it myslef - where do i start? i want an efficient proccess. would appreciate any kind of help / ideas.


How to override function twentyten_comment

I am running the _Twenty Ten_ theme. I want to override comment formatting for certain posts. After researching how to do this, I copied the `twentyten_comment` function from the parent theme (`twentyten`) into the `functions.php` file for my child theme (`twentyten-child`). To confirm that I am running the code from the child, I added code to display the word 'child' on the output. I also modified the parent `twentyten` `functions.php` file to output the word 'parent' if that code is used. (yes, I backed up the original file so I can restore it after I figure this out). When I view a post (in this case a question) and its comment (an answer) I see the word 'parent' on the page rather than 'child' so I know that making changes to the child code is meaningless until it is the code that gets executed. `twentyten_comment` is in an `if(function_exists())` statement in the parent theme so I should just be able to put a function named `twentyten_comment` in the child `functions.php` file to override it. I have not been able to effectively override the parent function. What am I missing? I even tried changing the function name in the child `functions.php` file and using that name in the `wp_list_comments` callback in `comments.php`. It fails to execute.


why is pre_get_posts not working

function include_category( $query ) {     if ( $query->is_home() && $query->is_main_query() ) {         $query->set( 'cat', '3' );     }     }     add_action( 'pre_get_posts', 'include_category' );      I put this piece of code in my index.php which controls the main page. I want to only show category 3 on the main page. I was using query_post until I realize that is not the most efficient way of doing things. The code should work but it doesn't. Any ideas or suggestions will be nice. thanks. Or if there is a way to do so with wp_query. What would the snippet of code for this function be? I been on this for hours on end. I could not get this to work.


Make uploads live outside of the WP folder

I'm working on a template that basically sets up WP in the following manner:   * /   * /wp   * /content/plugins   * /content/themes   * /media Using the /media folder to store and serve uploads on single-site installs is easy enough:               add_filter('pre_option_upload_path',      function($val) { return '../media'; });     add_filter('pre_option_upload_url_path',  function($val) { return '/media'; });      It seems a bit less trivial to change for multi-site installs. A cursory look in the WP code yields functions like `ms_upload_constants()` and all sorts of checks related to `is_multisite()` whenever uploads occur, and cursory googling yields little to nothing. Is there a documented procedure to make a WP multisite do a similar trick with `/media/$site_id` in the above setup? Or is it primarily a matter of tricking WP into writing into the correct location by using symb links (or something to that order)?


Different header for each page in child theme of twenty thirteen

I trying to create a child theme from theme twenty thirteen. One feature I want to add in my child theme is that I can specify (via Coding) a different header image on each page. I've asked the same for twenty eleven theme \- therefore it worked (but was is was not implemented in a child theme). Is there a way how I can do this within functions.php or do I need to override header.php like in twenty eleven?               <?php         if ( is_home() ) $my_header_image = get_header_image(); //gets default header, specified in custom_header.php         elseif ( is_page(26) ) $my_header_image =  get_bloginfo('stylesheet_directory').'/images/news_header.png";         elseif ( is_page(N) ) ...         else $my_header_image = get_header_image();      ?>     <img src="<?php echo $my_header_image; ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />      Regards, mybecks


How to avoid plugin name conflicts from the upgrade notifier?

I've wrapped a quick hack as a plugin to add Google Analytics to my site. Named it "Google Analytics" and, sure enough, WP offered me to upgrade my v0.1 plugin to some random plugin from the plugin repo. I vaguely recall it getting raised a few times around WP 2.7 to 3.0. Is there a new API available somewhere to disable this, or is the only way to avoid it still is to prefix plugin names (not their file name, but their actual name as shown in the Plugins screen) to make them unique? In my specific use case, the plugin is in `mc-ga/mc-ga.php` and is named "Google Analytics", along with a few other meta fields at the beginning of the plugin file header. WP yields an update notice based on "Google Analytics" (I couldn't locate a `mc-ga.php` plugin file in the repo). Does WP allow to add an extra field I'm not aware of, e.g. a repo URL or something truly unique, so as to avoid such conflicts?


Get all authors with at least one post of 'custom post type'

How can i achive that? I found count_user_posts and get_users, but how would I merge them into the desired result? Do I really have to use a WP DB Query?


Proper Way to Enqueue CSS for Front Page - template_redirect in functions.php?

I want to load some specific css to change color of body element of front/home page of WP. Within my themes function file, the following code seems to work, but can someone please tell me if it is "proper"?               //Adding and Encuing styles for Front Page     add_action( 'template_redirect', 'front_page_design' );          function front_page_design(){         if ( is_front_page() || is_home()) {             add_action('wp_enqueue_scripts', 'enqueue_index_styles');             function enqueue_index_styles() {             wp_register_style( 'home_page_style', get_stylesheet_directory_uri() . '/index-style.css' );             wp_enqueue_style( 'home_page_style' );             }         }     }      I had come across a blog by Mark Jaquith saying that template_include is for including, which is what I'm doing, right?


Shortlink in header points to 404, but actual page does not

I've inherited a website whose permalinks are 200 and open fine:               http://www.example.com/test-1      While looking at the source, the shortlink specified in the link tag points to 404s:               <link rel='shortlink' href='http://www.example.com/?p=6' />      I'm unsure of what the source of the problem may be. I've noticed that Jetpack had been enabled before, but is now deactivated. I can't say for sure it's one of the plugins. The following is a list of enabled plugins:   * !Share   * BackupBuddy   * Contact Form 7   * Facebook Social Plugin Widgets   * Gravity Forms   * NextGEN Gallery   * Pinterest "Pin It" Button Lite   * Platinum SEO Pack   * Really Simple CAPTCHA   * Referrer info for Gravity Forms   * Slimbox   * WordPress Mobile Pack


Comment text area in single blog post and show comments if approved

I'm modifying some existing code and trying to add the ability for user to leave comments on single post and then echo those comments based on approval. I need to add right below `<?php the_content(); ?>` What is the code I need to add below this to get comments?


How do you permanently remove default rewrite rules from the wp_options table?

We have tons of rewrite rules saved in our wp_options table and I'd like to permanently remove any entries that we're not using on our site (such as comment feeds, page attachments, etc.). What's the best way to clear these rules and prevent them from being saved to the database the next time flush_rules() is called? I'd prefer a solution that works in functions.php or as a standalone plugin, rather than editing core WP files such as wp-includes/rewrite.php.


Install theme on multiple domains

i'm hosting several sites. they all have the same base theme that i need to install. I want to develop this theme and have them updated on all the sites simultaneously. I have the following folder structure               /theme/      \ mytheme          /domain/         \ foo.com         \ foobar.com        \ foosite.com      Would there be any issue with symlinking each site with my theme into each site's `wp-config/theme/` folder? Not interested in multisite. Had to developed sites seperately.


custom search in theme doesnt work

the theme back end says Enable live search in posts and pages (post search is enabled by default). check boxes are Pages, knowledgebase, Articles, Faq, but they don't do anything. i think there's something wrong with the code, just cant figure it out.                if (gt_get_option('live_search_enable')) {           function remove_pages_from_search() {     global $wp_post_types;      }     add_action('init', 'remove_pages_from_search');          function gt_live_search() {         global $wpdb;              $post_status    =   'publish';         $search_term    =   "%".$_REQUEST['query']."%";              $search_post_type = gt_get_option('live_search_post_type');              $post_type = "'post'";              if ($search_post_type['page']) {             $post_type      .=  ",'page'";          }          if ($search_post_type['faq']) {             $post_type      .=  ",'faq'";          }          if ($search_post_type['knowledgebase']) {             $post_type      .=  ",'knowledgebase'";          }          if ($search_post_type['articles']) {             $post_type      .=  ",'articles'";          }               if (gt_get_option('live_search_in') == '2') {             $sql_query = $wpdb->prepare( "SELECT ID, post_title, SUBSTRING(post_content,1,100) as post_content, post_name from $wpdb->posts where post_status = %s and post_type in ( $post_type )and (post_title like %s or post_content like %s)", $post_status, $search_term, $search_term );         } else {             $sql_query = $wpdb->prepare( "SELECT ID, post_title, SUBSTRING(post_content,1,100) as post_content, post_name from $wpdb->posts where post_status = %s and post_type in ( $post_type )and post_title like %s", $post_status, $search_term );         }              $results = $wpdb->get_results($sql_query);              $search_json = array( "query" => "Unit", "suggestions" => array() );   // create a json array              foreach ( $results as $result ) {             $link   =   get_permalink( $result->ID ); // get post url                  $search_json["suggestions"][] = array(                                                     "value" => $result->post_title,                                                     "data"  => array( "content" => $result->post_content, "url" => $link )                                             );         }         echo json_encode($search_json); // conver array to joson string         die();     }     add_action('wp_ajax_search_title', 'gt_live_search');  // hook for login users     add_action('wp_ajax_nopriv_search_title', 'gt_live_search'); // hook for not login users              }      [admin options]                   $options[] = array( 'name' => __('Live Search', 'guerilla'),                         'title' => __("Live Search Settings",        'guerilla'),                         'type' => 'heading');          $options[] = array( 'name' => __('Enable Live Search', 'guerilla'),                         'desc' => __('Enable live search.', 'guerilla'),                         'id' => 'live_search_enable',                         'std' => '1',                         'type' => 'checkbox');              $search_post_type_array = array(                             'page' => __('Pages', 'guerilla'),                             'knowledgebase' => __('knowledgebase', 'guerilla'),                             'articles' => __('Articles', 'guerilla'),                             'faq' => __('Faq', 'guerilla'));              $search_post_type_defaults = array(                             'page' => '1',                             'knowledgebase' => '1',                             'articles' => '1',                             'faq' => '1');          $options[] = array( 'name' => __('Search Post Types', 'guerilla'),                         'desc' => __('Enable live search in posts and pages (post search is enabled by default).', 'guerilla'),                         'id' => 'live_search_post_type',                         'std' => $search_post_type_defaults,                          'type' => 'multicheck',                         'options' => $search_post_type_array);              $search_in_array = array(                             '1' => __('Title', 'guerilla'),                             '2' => __('Title and Content', 'guerilla'));          $options[] = array( 'name' => __('Search In', 'guerilla'),                         'desc' => __('Search for keyword in title and post/page content.', 'guerilla'),                         'id' => 'live_search_in',                         'std' => '1',                         'type' => 'radio',                         'options' => $search_in_array);


Disable the MySQL query in the main query

I would like to disable the MySQL portion of the main query, i.e. I want every step to be followed on this page EXCEPT step 4.3: http://codex.wordpress.org/Query_Overview What's the easiest way to go about doing that?


Uploaded image, but not showing

I have a reasonably fresh WordPress install on my Ubuntu Linux server and I uploaded an image to it for use in a blog post. I checked the path in WordPress settings and I checked the contents on the server:               $ ls -l /srv/www/wp-uploads/blog.linformatronics.nl/2013/01     total 320     -rw-rw-r-- 1 www-data www-data 22033 Jan 19 10:23 ccs5licence1-150x150.png     -rw-rw-r-- 1 www-data www-data 64195 Jan 19 10:23 ccs5licence1-300x214.png     -rw-rw-r-- 1 www-data www-data 22033 Jan 19 10:19 ccs5licence-150x150.png     -rw-rw-r-- 1 www-data www-data 71973 Jan 19 10:23 ccs5licence1.png     -rw-rw-r-- 1 www-data www-data 64195 Jan 19 10:19 ccs5licence-300x214.png     -rw-rw-r-- 1 www-data www-data 71973 Jan 19 10:19 ccs5licence.png      The files are actually uploaded through WordPress, so it has write access to the filesystem/directory. But when I try to use it in a blog post it shows a broken image and when I point the webbrowser directly to the image it throws an error 404 page: https://blog.linformatronics.nl/wp-uploads/2013/01/ccs5licence1.png From the settings => media page in WordPress:               Uploading Files     Store uploads in this folder /srv/www/wp-uploads/blog.linformatronics.nl         Full URL path to files       http://blog.linformatronics.nl/wp-uploads        I'm fairly new to WordPress, so I still need to find my way around a bit.


Widget HTML Display Problem

Hi I have created a plugin that places a Google Translator into a text widget in Wordpress. I have setup shortcode to do this - and the shortcode seems to be outputting the correct HTML, except that the HTML is not showing up INSIDE of the text widget as it should. Here is my plugin code: http://pastebin.com/BMbnEqAW Here is the page: http://www.richmindonline.com/test/ When I do a "View Page Source" from Firefox - I am noticing that the translator code is appearing BEFORE the text widget. So even though my shortcode is located inside of the text widget, the code shows up just above the text widget itself and is not wrapped inside of `id="text-widget"`. There are not stray div tags that I can find either. Are there any common problems with using javascript or shortcodes in a text widget that I should account for in my plugin?


Create a simple widget

I wanna create a simple widget that show an image and text with a link. Something like this: http://jsfiddle.net/aF4UR/ But I want to include this as a widget with fields. For example in the back end: Image: [insert image url here] Image Link [link] Title:[title here] Title link: [insert link here] Text:[text field] And in the front end display as the code in jsfiddle. Any help?


Unable to install WordPress on Plesk 11 Windows based machine

I am trying to install WordPress on a Windows server. The install was not able to create `wp-config.php` itself, so I created it and put in the database values. Now I get errors like this table doesn't exist and that table doesn't exist, so I checked the mysql db using phpmyadmin. It shows that no table has been created. I didn't get any confirmation page after trying to automatically create the `wp-config.php` file. When I run the install after manually creating the `wp-config.php` file I just get the errors. I think install process is not able to create the tables for WordPress. Is there a manual way I can import some sql script to create the tables? I have checked that php is able to connect to the db by changing the password in wp-config file and then it gives error that means php is able to connect to mysql. So I think if I can create the tables and insert values manually for WordPress i think it might work.


Breadcrumb display subcategory in parent category page

I'am using Avante theme for my WP website. All my posts have two categories : Main category and subcategory **◊** The problem is that my "Main Category" page displays subcategory in breadcrumb, it looks like:               Home > Main Category > Subcategory      And should be:               Home > Main Category      **◊** The default breadcrumb function is :               function the_breadcrumb() {              echo '
';         if (!is_home()) {             echo '
';             echo 'Home';             echo '

 ›
';             if (is_category() || is_single()) {                 echo '
';                 the_category('

 ›

 ');                      //PATCH I ADDED IN ORDER TO PREVENT ALPHABETICAL SORTING THAT ALSO DISPLAY THAT DAMNED SUBCATEGORY                 /*$cats=get_the_category('');                 $cid=array();                 foreach($cats as $cat)  { $cid[]=$cat->cat_ID; }                 $cid=implode(',', $cid);                 $numItems = count($cid);                 $i = 0;                      foreach((get_categories('orderby=id&include='.$cid)) as $category) { // notice orderby                     if($i === $numItems) {                         echo '
cat_ID).'">'.$category->cat_name.'
'; // keep a space after  as seperator                      }else{                         echo '
cat_ID).'">'.$category->cat_name.'

 ›
'; // keep a space after  as seperator                      }                     $i++;                 }*/                      if (is_single()) {                     echo '

 ›

';                     the_title();                     echo '
';                 }             } elseif (is_page()) {                 if($post->post_parent){                     $anc = get_post_ancestors( $post->ID );                          foreach ( $anc as $ancestor ) {                         $output = '
'.get_the_title($ancestor).'

/
';                     }                     echo $output;                     echo ' '.$title.'';                 } else {                     echo ' ';                     echo the_title();                     echo '';                 }             }         }         elseif (is_tag()) {single_tag_title();}         elseif (is_day()) {echo"
Archive for "; the_time('F jS, Y'); echo'
';}         elseif (is_month()) {echo"
Archive for "; the_time('F, Y'); echo'
';}         elseif (is_year()) {echo"
Archive for "; the_time('Y'); echo'
';}         elseif (is_author()) {echo"
Author Archive"; echo'
';}         elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "
Blog Archives"; echo'
';}         elseif (is_search()) {echo"
Search Results"; echo'
';}         echo '
';     }     if ( ! isset( $content_width ) ) $content_width = 980;     ?>      **◊** On the Subcategory page, the path is correct :               Home > Main Category > Subcategory      And the path is also correct in post page :               Home > Main Category > Subcategory > Title      **◊ What can I do to prevent the subcategory to be displayed in the parent category breadcrumb ?** **_Thank you in advance_**