Can I remove a widget area without editing code?

I am dealing with a Wordpress setup which has 2 widget areas. One seems to be breaking the page, and I want to remove it. Here is the screenshot of my widget setup ![enter image description here](http://i.stack.imgur.com/i5vyT.png) How can I remove the Main Widget Area without editing any code? Is that possible? And if not possible, how can I remove this area in general? Thank you!! And here is the functions.php file:               /*      * Set up the content width value based on the theme's design.      *      * @see twentythirteen_content_width() for template-specific adjustments.      */     if ( ! isset( $content_width ) )         $content_width = 604;          /**      * Add support for a custom header image.      */     require get_template_directory() . '/inc/custom-header.php';          /**      * Twenty Thirteen only works in WordPress 3.6 or later.      */     if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) )         require get_template_directory() . '/inc/back-compat.php';          /**      * Twenty Thirteen setup.      *      * Sets up theme defaults and registers the various WordPress features that      * Twenty Thirteen supports.      *      * @uses load_theme_textdomain() For translation/localization support.      * @uses add_editor_style() To add Visual Editor stylesheets.      * @uses add_theme_support() To add support for automatic feed links, post      * formats, and post thumbnails.      * @uses register_nav_menu() To add support for a navigation menu.      * @uses set_post_thumbnail_size() To set a custom post thumbnail size.      *      * @since Twenty Thirteen 1.0      *      * @return void      */     function twentythirteen_setup() {         /*          * Makes Twenty Thirteen available for translation.          *          * Translations can be added to the /languages/ directory.          * If you're building a theme based on Twenty Thirteen, use a find and          * replace to change 'twentythirteen' to the name of your theme in all          * template files.          */         load_theme_textdomain( 'twentythirteen', get_template_directory() . '/languages' );              /*          * This theme styles the visual editor to resemble the theme style,          * specifically font, colors, icons, and column width.          */         add_editor_style( array( 'css/editor-style.css', 'fonts/genericons.css', twentythirteen_fonts_url() ) );              // Adds RSS feed links to  for posts and comments.         add_theme_support( 'automatic-feed-links' );              /*          * Switches default core markup for search form, comment form,          * and comments to output valid HTML5.          */         add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );              /*          * This theme supports all available post formats by default.          * See http://codex.wordpress.org/Post_Formats          */         add_theme_support( 'post-formats', array(             'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video'         ) );              // This theme uses wp_nav_menu() in one location.         register_nav_menu( 'primary', __( 'Navigation Menu', 'twentythirteen' ) );              /*          * This theme uses a custom image size for featured images, displayed on          * "standard" posts and pages.          */         add_theme_support( 'post-thumbnails' );         set_post_thumbnail_size( 604, 270, true );              // This theme uses its own gallery styles.         add_filter( 'use_default_gallery_style', '__return_false' );     }     add_action( 'after_setup_theme', 'twentythirteen_setup' );          /**      * Return the Google font stylesheet URL, if available.      *      * The use of Source Sans Pro and Bitter by default is localized. For languages      * that use characters not supported by the font, the font can be disabled.      *      * @since Twenty Thirteen 1.0      *      * @return string Font stylesheet or empty string if disabled.      */     function twentythirteen_fonts_url() {         $fonts_url = '';              /* Translators: If there are characters in your language that are not          * supported by Source Sans Pro, translate this to 'off'. Do not translate          * into your own language.          */         $source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'twentythirteen' );              /* Translators: If there are characters in your language that are not          * supported by Bitter, translate this to 'off'. Do not translate into your          * own language.          */         $bitter = _x( 'on', 'Bitter font: on or off', 'twentythirteen' );              if ( 'off' !== $source_sans_pro || 'off' !== $bitter ) {             $font_families = array();                  if ( 'off' !== $source_sans_pro )                 $font_families[] = 'Source Sans Pro:300,400,700,300italic,400italic,700italic';                  if ( 'off' !== $bitter )                 $font_families[] = 'Bitter:400,700';                  $query_args = array(                 'family' => urlencode( implode( '|', $font_families ) ),                 'subset' => urlencode( 'latin,latin-ext' ),             );             $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );         }              return $fonts_url;     }          /**      * Enqueue scripts and styles for the front end.      *      * @since Twenty Thirteen 1.0      *      * @return void      */     function twentythirteen_scripts_styles() {         /*          * Adds JavaScript to pages with the comment form to support          * sites with threaded comments (when in use).          */         if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )             wp_enqueue_script( 'comment-reply' );              // Adds Masonry to handle vertical alignment of footer widgets.         if ( is_active_sidebar( 'sidebar-1' ) )             wp_enqueue_script( 'jquery-masonry' );              // Loads JavaScript file with functionality specific to Twenty Thirteen.         wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2013-07-18', true );              // Add Source Sans Pro and Bitter fonts, used in the main stylesheet.         wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );              // Add Genericons font, used in the main stylesheet.         wp_enqueue_style( 'genericons', get_template_directory_uri() . '/fonts/genericons.css', array(), '2.09' );              // Loads our main stylesheet.         wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );              // Loads the Internet Explorer specific stylesheet.         wp_enqueue_style( 'twentythirteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentythirteen-style' ), '2013-07-18' );         wp_style_add_data( 'twentythirteen-ie', 'conditional', 'lt IE 9' );     }     add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );          /**      * Filter the page title.      *      * Creates a nicely formatted and more specific title element text for output      * in head of document, based on current view.      *      * @since Twenty Thirteen 1.0      *      * @param string $title Default title text for current view.      * @param string $sep   Optional separator.      * @return string The filtered title.      */     function twentythirteen_wp_title( $title, $sep ) {         global $paged, $page;              if ( is_feed() )             return $title;              // Add the site name.         $title .= get_bloginfo( 'name' );              // Add the site description for the home/front page.         $site_description = get_bloginfo( 'description', 'display' );         if ( $site_description && ( is_home() || is_front_page() ) )             $title = "$title $sep $site_description";              // Add a page number if necessary.         if ( $paged >= 2 || $page >= 2 )             $title = "$title $sep " . sprintf( __( 'Page %s', 'twentythirteen' ), max( $paged, $page ) );              return $title;     }     add_filter( 'wp_title', 'twentythirteen_wp_title', 10, 2 );          /**      * Register two widget areas.      *      * @since Twenty Thirteen 1.0      *      * @return void      */     function twentythirteen_widgets_init() {         register_sidebar( array(             'name'          => __( 'Main Widget Area', 'twentythirteen' ),             'id'            => 'sidebar-1',             'description'   => __( 'Appears in the footer section of the site.', 'twentythirteen' ),             'before_widget' => '',             'after_widget'  => '',             'before_title'  => '
',             'after_title'   => '
',         ) );              register_sidebar( array(             'name'          => __( 'Secondary Widget Area', 'twentythirteen' ),             'id'            => 'sidebar-2',             'description'   => __( 'Appears on posts and pages in the sidebar.', 'twentythirteen' ),             'before_widget' => '',             'after_widget'  => '',             'before_title'  => '
',             'after_title'   => '
',         ) );     }     add_action( 'widgets_init', 'twentythirteen_widgets_init' );          if ( ! function_exists( 'twentythirteen_paging_nav' ) ) :     /**      * Display navigation to next/previous set of posts when applicable.      *      * @since Twenty Thirteen 1.0      *      * @return void      */     function twentythirteen_paging_nav() {         global $wp_query;              // Don't print empty markup if there's only one page.         if ( $wp_query->max_num_pages < 2 )             return;         ?>
<?php _e( 'Posts navigation', 'twentythirteen' ); ?>

                      <?php if ( get_next_posts_link() ) : ?>
<?php next_posts_link( __( '← Older posts', 'twentythirteen' ) ); ?>
                 <?php endif; ?>                      <?php if ( get_previous_posts_link() ) : ?>
<?php previous_posts_link( __( 'Newer posts →', 'twentythirteen' ) ); ?>
                 <?php endif; ?>
                  <?php     }     endif;          if ( ! function_exists( 'twentythirteen_post_nav' ) ) :     /**      * Display navigation to next/previous post when applicable.     *     * @since Twenty Thirteen 1.0     *     * @return void     */     function twentythirteen_post_nav() {         global $post;              // Don't print empty markup if there's nowhere to navigate.         $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );         $next     = get_adjacent_post( false, '', false );              if ( ! $next && ! $previous )             return;         ?>
<?php _e( 'Post navigation', 'twentythirteen' ); ?>

                      <?php previous_post_link( '%link', _x( '← %title', 'Previous post link', 'twentythirteen' ) ); ?>                 <?php next_post_link( '%link', _x( '%title →', 'Next post link', 'twentythirteen' ) ); ?>
                  <?php     }     endif;          if ( ! function_exists( 'twentythirteen_entry_meta' ) ) :     /**      * Print HTML with meta information for current post: categories, tags, permalink, author, and date.      *      * Create your own twentythirteen_entry_meta() to override in a child theme.      *      * @since Twenty Thirteen 1.0      *      * @return void      */     function twentythirteen_entry_meta() {         if ( is_sticky() && is_home() && ! is_paged() )             echo '' . __( 'Sticky', 'twentythirteen' ) . '';              if ( ! has_post_format( 'link' ) && 'post' == get_post_type() )             twentythirteen_entry_date();              // Translators: used between list items, there is a space after the comma.         $categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) );         if ( $categories_list ) {             echo '' . $categories_list . '';         }              // Translators: used between list items, there is a space after the comma.         $tag_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) );         if ( $tag_list ) {             echo '' . $tag_list . '';         }              // Post author         if ( 'post' == get_post_type() ) {             printf( '%3$s',                 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),                 esc_attr( sprintf( __( 'View all posts by %s', 'twentythirteen' ), get_the_author() ) ),                 get_the_author()             );         }     }     endif;          if ( ! function_exists( 'twentythirteen_entry_date' ) ) :     /**      * Print HTML with date information for current post.      *      * Create your own twentythirteen_entry_date() to override in a child theme.      *      * @since Twenty Thirteen 1.0      *      * @param boolean $echo (optional) Whether to echo the date. Default true.      * @return string The HTML-formatted post date.      */     function twentythirteen_entry_date( $echo = true ) {         if ( has_post_format( array( 'chat', 'status' ) ) )             $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' );         else             $format_prefix = '%2$s';              $date = sprintf( '<time class="entry-date" datetime="%3$s">%4$s</time>',             esc_url( get_permalink() ),             esc_attr( sprintf( __( 'Permalink to %s', 'twentythirteen' ), the_title_attribute( 'echo=0' ) ) ),             esc_attr( get_the_date( 'c' ) ),             esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )         );              if ( $echo )             echo $date;              return $date;     }     endif;          if ( ! function_exists( 'twentythirteen_the_attached_image' ) ) :     /**      * Print the attached image with a link to the next attached image.      *      * @since Twenty Thirteen 1.0      *      * @return void      */     function twentythirteen_the_attached_image() {         /**          * Filter the image attachment size to use.          *          * @since Twenty thirteen 1.0          *          * @param array $size {          *     @type int The attachment height in pixels.          *     @type int The attachment width in pixels.          * }          */         $attachment_size     = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) );         $next_attachment_url = wp_get_attachment_url();         $post                = get_post();              /*          * Grab the IDs of all the image attachments in a gallery so we can get the URL          * of the next adjacent image in a gallery, or the first image (if we're          * looking at the last image in a gallery), or, in a gallery of one, just the          * link to that image file.          */         $attachment_ids = get_posts( array(             'post_parent'    => $post->post_parent,             'fields'         => 'ids',             'numberposts'    => -1,             'post_status'    => 'inherit',             'post_type'      => 'attachment',             'post_mime_type' => 'image',             'order'          => 'ASC',             'orderby'        => 'menu_order ID'         ) );              // If there is more than 1 attachment in a gallery...         if ( count( $attachment_ids ) > 1 ) {             foreach ( $attachment_ids as $attachment_id ) {                 if ( $attachment_id == $post->ID ) {                     $next_id = current( $attachment_ids );                     break;                 }             }                  // get the URL of the next image attachment...             if ( $next_id )                 $next_attachment_url = get_attachment_link( $next_id );                  // or get the URL of the first image attachment.             else                 $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );         }              printf( '%3$s',             esc_url( $next_attachment_url ),             the_title_attribute( array( 'echo' => false ) ),             wp_get_attachment_image( $post->ID, $attachment_size )         );     }     endif;          /**      * Return the post URL.      *      * @uses get_url_in_content() to get the URL in the post meta (if it exists) or      * the first link found in the post content.      *      * Falls back to the post permalink if no URL is found in the post.      *      * @since Twenty Thirteen 1.0      *      * @return string The Link format URL.      */     function twentythirteen_get_link_url() {         $content = get_the_content();         $has_url = get_url_in_content( $content );              return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );     }          /**      * Extend the default WordPress body classes.      *      * Adds body classes to denote:      * 1. Single or multiple authors.      * 2. Active widgets in the sidebar to change the layout and spacing.      * 3. When avatars are disabled in discussion settings.      *      * @since Twenty Thirteen 1.0      *      * @param array $classes A list of existing body class values.      * @return array The filtered body class list.      */     function twentythirteen_body_class( $classes ) {         if ( ! is_multi_author() )             $classes[] = 'single-author';              if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() )             $classes[] = 'sidebar';              if ( ! get_option( 'show_avatars' ) )             $classes[] = 'no-avatars';              return $classes;     }     add_filter( 'body_class', 'twentythirteen_body_class' );          /**      * Adjust content_width value for video post formats and attachment templates.      *      * @since Twenty Thirteen 1.0      *      * @return void      */     function twentythirteen_content_width() {         global $content_width;              if ( is_attachment() )             $content_width = 724;         elseif ( has_post_format( 'audio' ) )             $content_width = 484;     }     add_action( 'template_redirect', 'twentythirteen_content_width' );          /**      * Add postMessage support for site title and description for the Customizer.      *      * @since Twenty Thirteen 1.0      *      * @param WP_Customize_Manager $wp_customize Customizer object.      * @return void      */     function twentythirteen_customize_register( $wp_customize ) {         $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';         $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';         $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';     }     add_action( 'customize_register', 'twentythirteen_customize_register' );          /**      * Enqueue Javascript postMessage handlers for the Customizer.      *      * Binds JavaScript handlers to make the Customizer preview      * reload changes asynchronously.      *      * @since Twenty Thirteen 1.0      *      * @return void      */     function twentythirteen_customize_preview_js() {         wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130226', true );     }     add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' );


I lock the site's contents, click on a post, redirect to login, enter uname+password but fail to redirect to article

As stated in the following: http://wordpress.stackexchange.com/a/100573/16266 I lock the site's contents. I then click on a post. I am navigated to wp-login screen. I enter the correct username + password of admin. I am never returned back to the article but remain stuck in wp-login without any feedback. Please help..


Turning Wordpress Into full-featured website?

I just took 2 coffees worth of caffeine and started a very big project: Turning a wordpress-engined blog with a custom theme into a full-featured website. Can this be done? Is this legal? Has this been tried before? My searches on google were in vain as I only came up with tutorials to turn my front page into a static one or how to update my theme! lame... What I want to do: Take my current website and my new blog. Then take the content from the site (database, scripts, data) and the design, look and feel plus the user administration from the blog and mix them together. Is this possible? Can it be done with today's technology? :P... is it legal? Will it bother wordpress if I use their engine to manage my website, with them not getting anything in return? I want to take my custom designed theme from my blog, the way the blog manages users(register, login, administrator right to delete users etc). I then want to take the scripts I have for my website: content-fetching from mysql, content posting, rating, comments system, custom search and all kinds of scripts and put all of these into wordpress... Is there a way to do this without digesting the whole wordpress engine by myself? has this been done before so I could follow a tutorial? THANKS IN ADVANCE to anyone kind-hearted that will lend me a helping hand


Simple custom post query for all the posts or many of them not working

I am doing this query               $args = array(     'posts_per_page' => '-1',     'post_type' => 'custom_post_type',     'post_status' => 'publish'     );          query_posts( $args );      but it is not working I have around 800 posts in that custom type and the query_posts function is working just if posts_per_page < 519. I know is weird but if I do this               $args = array(     'posts_per_page' => '518', //or any lower number     'post_type' => 'custom_post_type',     'post_status' => 'publish'     );          query_posts( $args );      it does work but not with               $args = array(     'posts_per_page' => '519', //or bigger     'post_type' => 'custom_post_type',     'post_status' => 'publish'     );          query_posts( $args );      Any suggestion??? Thanks


How can I upload a csv file into Wordpress?

I have some customers in my site. My ERP system has customers along with their price reduction level. I extracted from my ERP the list of customers' Tax IDs and price reductions levels and I want to upload it in a custom table in Wordpress. Any idea how to automate that?


Appending meta value onto post content in WordPress during save_post

The problem seems pretty straight forward: Once the `save_post` action is fired, I would like to append the value of a meta key onto the end of the `post_content` if it's not already found within the post itself. I've attempted making a call to `wp_update_post()` from within a function tied to `save_post`, but as many of you will immediately object, `wp_update_post()` contains `do_action('save_post')` and as such creates an infinite loop. What other way (using the API) exists for one to update the content of a post based on said posts custom values once the post has been saved/edited without invoking a nightmarish infinite loop?


Integrating jSquares and Jquery with Wordpress loop

I am trying to integrate jSquares with wordpress and I am having a couple of issues. I am a beginner developer - but would love to solve this problem so that anyone can use jSquares with Wordpress. jSquares info can be found here: boedesign.com/blog/2009/10/22/jsquares-for-jquery/ This is my code so far:
          <?                      $boxes = array(     // sizes are styled through css and top, left css attributes are hard-coded on the div                     array('size' => 3, 'top' => 0, 'left' => 0),                         array('size' => 2, 'top' => 0,'left' => 224),                         array('size' => 2, 'top' => 78, 'left' => 224),                         array('size' => 3, 'top' => 0, 'left' => 336),                         array('size' => 2, 'top' => 0, 'left' => 560),                         array('size' => 2, 'top' => 78, 'left' => 560),                         array('size' => 2, 'top' => 156, 'left' => 0),                         array('size' => 3, 'top' => 156, 'left' => 112),                         array('size' => 2, 'top' => 156, 'left' => 336),                         array('size' => 1, 'top' => 156, 'left' => 448),                         array('size' => 1, 'top' => 195, 'left' => 448),                         array('size' => 2, 'top' => 156, 'left' => 504),                         array('size' => 1, 'top' => 156, 'left' => 616),                         array('size' => 1, 'top' => 234, 'left' => 56),                         array('size' => 1, 'top' => 234, 'left' => 336)); ?>                      <?php                  query_posts(array(                     'showposts' => 15,                      'post_type' => 'page',                      'posts_per_page=15',                      'orderby' => 'rand',                      'post__not_in' => array(33,145,31,148,109,111,113,29,209)));                           if (have_posts()) : while (have_posts()) : the_post();                  foreach ($boxes as $box); ?>                  <div class="js-image size-<?= $box['size']; ?>" style="top:<?= $box['top']; ?>px;left:<?= $box['left']; ?>px;">                  <a href="<?php the_permalink(); ?> "><img class="js-small-image" src="<? $image = wp_get_attachment_image_src ( get_post_thumbnail_id ( $post_id ), 'single-post-thumbnail' ); echo $image[0]; ?>"/>
                 <?php the_title(); ?>

<?php the_title(); ?>

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

                       <?php endwhile; endif; ?>      But the foreach ($boxes as $box) is only reflecting the last array for $boxes instead of one of each. I hope this makes sense. Any suggestions would be greatly appreciated!! Thanks for the advice! Here's where I am:                    <?php $query = new WP_Query(                  array('showposts' => 15,                   'post_type' => 'page',                   'posts_per_page=15',                   'orderby' => 'rand',                   'post__not_in' => array(33,145,31,148,109,111,113,29,209)));            foreach($query->$boxes as $box );            while ($query->have_posts()) : $query->the_post() ; ?>      I appreciate your help. I am trying to teach a lot of this to myself and post it for everyone else to use. I am still getting stuck - Invalid argument supplied for foreach()


Predefine magazine style layouts

I want my customer to be able to create a post by select between a significant number of magazine style layouts (possibly generated by me). Typically, they would have a number of images and pick a layout suitable for that number of images (or more). Perhaps one large image and two smaller with a block of text between them, or a 3x3 grid, or a 2x4 grid etc. **Is there any way to achieve this, or is this a no-no in Wordpress?** I'm a complete Wordpress amateur, just toying around with it right now. But I have good knowledge of MySQL, PHP and CSS, and considered writing everything myself, but thought it would be a time saver to use this framework. But before digging too deep I'd like to know it's even possible.


Localizing text from XML files

Do you guys know any way I could automatically pick up strings from .xml files and store them in a .po / .pot file, just like PoEdit does with the ones from .php files? The XML structure looks like this:               <?xml version="1.0" encoding="iso-8859-1"?>     <options>       <page id="content" label="Content Options" icon="4">         <section id="post" label="Content Options">           <option id="title" type="checkbox" default="yes" label="Show post title"></option>           <option id="comments" type="checkbox" default="yes" label="Show comments link"></option>           <option id="thumb_size" type="select" default="default" label="Thumbnail Size">             <value id="default" label="Default Size, (%s)" vars="default_size"></value>             <value id="100x100" label="Small (100x100)"></value>             <value id="150x150" label="Medium (150x150)"></value>             <value id="200x200" label="Large (200x200)"></value>           </option>              </section>       </page>     </options>      Strings within the "label" attribute should be detected by a gettext parser or something...


Proper Way to Remove Thumbnail Links In Gallery

I use the **`post_gallery` filter** in functions.php to replace the core gallery code, with the gallery code I've modified to suit my needs, like this:               function aahan_post_gallery($output, $attr) {         global $post;              static $instance = 0;         $instance++;              // We're trusting author input, so let's at least make sure it looks like a valid orderby statement         if ( isset( $attr['orderby'] ) ) {             $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );             if ( !$attr['orderby'] )                 unset( $attr['orderby'] );         }              extract(shortcode_atts(array(             'order'      => 'ASC',             'orderby'    => 'menu_order ID',             'id'         => $post->ID,             'itemtag'    => 'div',             'icontag'    => '',             'captiontag' => 'div',             'columns'    => 3,             'size'       => 'full',             'include'    => '',             'exclude'    => ''         ), $attr));              $id = intval($id);         if ( 'RAND' == $order )             $orderby = 'none';              if ( !empty($include) ) {             $include = preg_replace( '/[^0-9,]+/', '', $include );             $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );                  $attachments = array();             foreach ( $_attachments as $key => $val ) {                 $attachments[$val->ID] = $_attachments[$key];             }         } elseif ( !empty($exclude) ) {             $exclude = preg_replace( '/[^0-9,]+/', '', $exclude );             $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );         } else {             $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );         }              if ( empty($attachments) )             return '';              if ( is_feed() ) {             $output = "\n";             foreach ( $attachments as $att_id => $attachment )                 $output .= wp_get_attachment_link($att_id, $size, true) . "\n";             return $output;         }              $itemtag = tag_escape($itemtag);         $captiontag = tag_escape($captiontag);         $columns = intval($columns);         $itemwidth = $columns > 0 ? floor(100/$columns) : 100;         $float = is_rtl() ? 'right' : 'left';              $selector = "gallery-{$instance}";              $gallery_style = $gallery_div = '';         if ( apply_filters( 'use_default_gallery_style', true ) )             $gallery_style = "                          ";         $size_class = sanitize_html_class( $size );         $gallery_div = "

";         $output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div );              $i = 0;         foreach ( $attachments as $id => $attachment ) {             $count++;             $aahan_active = (1 == $count) ? ' active' : '';             $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);                  $output .= "<{$itemtag} class='item$aahan_active'>";             $output .= "$link";             if ( $captiontag && trim($attachment->post_excerpt) ) {                 $output .= "                    <{$captiontag} class='wp-caption-text gallery-caption'>                    " . wptexturize($attachment->post_excerpt) . "                    </{$captiontag}>";             }             $output .= "</{$itemtag}>";             if ( $columns > 0 && ++$i % $columns == 0 )                 $output .= '
';         }              $output .= "

\n";              return $output;     }     add_filter("post_gallery", "aahan_post_gallery",10,2);      Now, I am pretty sure that this line in the code is responsible for linking gallery thumbnails to their Attachment Page or full-size image:               $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);      How should I modify the line so that the thumbnails don't link to anything at all? (i.e. no `<a href="">` around thumbnails in gallery)


Why does my delete_post hook get called twice

Here is how I've implemented it:               add_action( 'delete_post', array( 'MyClassName', 'delete' ) );      In the delete function I was using a $wpdb->insert command to see whether the function gets called. But I see that the $wpdb->insert command is called twice (inserts two rows in my table). Any ideas as to why something like this might happen? I've also attempted to use the before_delete_post hook since it doesn't really make a difference to me but I get the same outcome. EDIT: It seems as though the delete function is called for each entry in the wp_posts table for some reason. So if the post has 3 revisions, the delete function will be called 4 times (the original post + 3 revisions). This is really weird behavior.


wp_nav_menu doesn't show on index page

I'm using calls to wp_nav_menu() in my header.php file. They're conditional, based on whether a user is logged in. This is in header.php:               <?php if ( is_user_logged_in() ) :             wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'user' ) );      else :              wp_nav_menu( array( 'container_class' => 'menu-header',  'theme_location' => 'visitor' ) );     endif; ?>      The menus are defined in functions.php:               add_action('init', 'menus_register');     function menus_register() {        if ( function_exists( 'register_nav_menus' ) )         register_nav_menus(array(                 'user' => __('Logged In'),                 'visitor' => __('Logged Out')         ));     }      The menus are defined and assigned in the admin. On every page, they work as I would expect them to, but not on the home page. On the home page, the correct container shows up, based on the condition, but the container is empty. What would cause the same function call in header.php to return an empty container just on the home page? -- edit -- Perhaps the menus_register() function in function.php is being called at the wrong time? Maybe there's some override in the theme that only applies to the homepage? I'm hoping folks with more experience can guide me in what to look for here.


Can I display a list of categories in a post?

Using the List Category Posts plugin by Fernando Briano is it possible to display a list of all the posts in a particular category and have the titles of posts as links to the posts? I am using that plugin to do this in the side bar as a widget but was hoping I could also do it on a post or page. Or if there is another plugin that can do that that would be good. Thanks.


How to get full content including template HTML

I'm looking to get the page content between the header and footer (as Wordpress already does) that includes the template HTML (as this is going to be an AJAX request). Is there a function that will allow me to do this? The only things I have found so far all relate to just getting the content straight from the database. It would also be great to get this content via the pages' permalink.


Create a link to a yearly archive of post for a custom post type?

I've got a custom post type, and I'm building an archives.php for it. I'd like the archive page to link to sub-pages. Each sub-page would list the CPT's by year. How can do this?


How to customize read more link

Situation is I have some posts which are showing in my home page there are some read more links(excerpts) after clicking on those links they go to the complete post page, now the issue is i want to open a pdf on one of the read more link, it is not working right now what i have done is I pasted the pdf url on the post page and thought it will open the pdf after clicking it but shows the page with the same url and not opening the pdf I know i am doing wrong what I am supposed to do. In nutshell how can i open any file such as .doc,image,pdf on read more link (excerpts) **I am using latest wp3.4 tweenty-eleven theme** I am complete beginner so don't laugh over any silly mistake of mine


Contact form 7 select box different value-text then content-text in option

DSoes anyone know how I can set a different valute in the select-options in contact form 7 plugin? Here is an HTML example of what I'm trying to do               <selct>     <option value="1">My car</option>     <option value="2">Your car</option>     </select>


Good methodology for upgrading a large/complex sites?

Imagine you have a large wp site that is on 3.1 and uses like all features wordpress has (lots of CPTs, is a network-install, has lots of pages/posts with different post-templates, has child themes for the blogs in the network) and also has +30 plugins installed - which are of course all outdated. You now need to upgrade to the current version. The upgrade task itself is done within 5 minutes, but how do you know everything is working afterwards? Basically you haven't developed the whole stuff by yourself and are just in charge of performing the upgrade. Clearly it will take you weeks to visit every post of the site and to try every little nifty backend feature to make sure it still works. So what I'm asking is: Can anyone describe his methodology of performing this kind of tasks? Are there any tools that can aid in this process? I'm looking for general advises or something like a step by step workflow like:   * let tool x index the whole site,   * perform the upgrade,   * run wp core unit tests,   * let tool x index the site again and diff the whole html output for unwanted changes,    * ....


Redirect after deleting post and keep track of pagination

I have a custom post list in the admin panel. This list is paginated, so this is it's url :   * `wp-admin/edit.php?post_type=xxx`, if I open the default page   * `wp-admin/edit.php?post_type=xxx&paged=n`, if I go to the nth page of the list Each time I delete permanently an item of that list I would like to be redirected to the same page of the list if this page still exists or to the previous page of the list if the same page is no longer relevant. Let's say I have three pages for a total of 22 items where page one has 10 items, page two has 10 items and page three has 2 items.   * if I delete the last item of page three, I should be redirected to page three (as there is still one item left there after deletion)   * If I delete the last item of page three now, I should be redirected to page two (as now, page three doesn't exist anymore)   * If I delete any item of page two, I should be redirected to page two (as page two still exists)   * If I delete any item of page one, I should be redirected to page one (as page one still exists) So far I'm just able to redirect to the default first page of the list like this:               function my_deleted_post_handler()      {         global $post;         $post_type = $post->post_type;          wp_redirect("http://www.xxxxxx.com/wp-admin/edit.php?post_type=".$post_type);         exit;        }     add_action('deleted_post','my_deleted_post_handler');      But I don't know how to get the page number I'm on after deletion (or I was on before deletion), so I can't redirect to the relevant page afterwards. I tried to retrieve `$_GET['paged']`, but the function above is triggered after the deletion when the "paged" variable is not part of the url anymore so it doesn't return any value. How to achieve this?


Display specific widgets in different area's around the page

I've installed the Jigoshop plugin to create an e-commerce site. It has several built in widgets that I want to use. Is it possible to pull out specific widgets and display them within a page template? Within Jigoshop it's specifically the cart, product search and layered nav. I don't just want to display them one under another. I want the cart in the top right of the page with the product search and nav on the left of the page so I need control of each one really.


Automatically tag posts based on user-defined words

1. I want to systematically add tags (/custom taxonomy terms) to all previous posts, from a predefined set of tags (i.e., not Yahoo tags or tags from 3rd-party APIs).    2. For future posts, I would like tags to be either suggested or added based on the content of posts.   3. Ideally: I would like a more customized way of recommending/adding tags than simply looking for the tag text in an entry; ideally I'd be able to specify a set of related words (such as with a term meta field) so that, for example, a tag of `Education` is added not just when "education" appears in a post but when some of a specified list appear in the post: `teachers, school, standardized tests, math`, etc. Can you recommend a plugin or strategy that would help achieve this? I'm open to ideas both simple and complex.


how can display a post on home screen without images

When i post something with an image, its also displayed over homepage.. And my post has image some images inside the content of the post.. and I am not using any featured image.. How can we display on the custom fields on home screen.. like I want to display 'Post title' and 'Post Date' and some 'post content' without images with limited characters. And when i click on post title, it should redirect to the original post where it has all details of the post.


Override a theme's WooCommerce template files with plugin

A plugin I'm working on, has it's own WooCommerce template files which override the default WooCommerce templates. I know I could make a child theme with a woocommerce folder but I'm trying to make these changes in a plugin to send to a client. This is what I tried, thinking that if my plugin folder contained a similar woocommerce folder structure I could override a specific template when it loads. For example with the checkout page:               add_filter( 'template_include', 'wc_template_check' );     function wc_template_check( $template ) {         if ( is_checkout() ){             return get_stylesheet_directory() . '/woocommerce/checkout/form-checkout.php';         }     }      My plugin form-checkout.php file contains a single string being echoed out for testing purposes.               <?php     /**      * Checkout Form      *      * @author      WooThemes      * @package     WooCommerce/Templates      * @version     2.0.0      */          echo "TEST";          ?>      This seems to override the entire checkout page template and displays `TEST` and nothing else. So clearly this method is wrong. How can I override the default woocommerce template files from my plugin?


Authors to be able to customize their author pages?

I'm trying to implement a sliding control panel where logged in users can change background colors, fonts, etc. the point being that they should only be able to do it on their own author pages, nowhere else. So to put it simply: User logs in, goes to his author page and the slider appears from where he can customize the appearance of the said author page. I have the slider working, but how can I save the customizations for each author page, so every user can have customized author page? Usually these kind of control panel sliders are used for the whole site where admin can do the customizations for the whole site and they are saved to a cookie. This one works the same way currently, but should I save the selections to database for each user or what? All recommendations, suggestions and everything else is most welcome. Here's how the control panel works from functions.php:                   add_action('header_top','control_panel');function control_panel(){         $admin_access = apply_filters( 'showcontrol_panel', current_user_can('switch_themes') );         if ( !$admin_access ) return;         if ( get_option('show_control_panel') <> 'on' ) return;         global $bg_texture_urls, $google_fonts; ?>

Example Colors

                          <?php                          $sample_colors = array( '6a8e94', '8da49c', 'b0b083', '859a7c', 'c6bea6', 'b08383', 'a4869d', 'f5f5f5', '4e4e4e', '556f6a', '6f5555', '6f6755' );                         for ( $i=1; $i<=12; $i++ ) { ?>                             <a class="et-sample-setting" id="et-sample-color<?php echo $i; ?>" href="#" rel="<?php echo $sample_colors[$i-1]; ?>" title="#<?php echo $sample_colors[$i-1]; ?>">                     <?php } ?>
Texture Overlays

                          <?php                          $sample_textures = $bg_texture_urls;                         for ( $i=1; $i<=count($bg_texture_urls); $i++ ) { ?>                             <a title="<?php echo $sample_textures[$i-1]; ?>" class="et-sample-setting et-texture" id="et-sample-texture<?php echo $i; ?>" href="#" rel="bg<?php echo $i+1; ?>">                     <?php } ?>                          <?php                          $google_fonts = $google_fonts;                         $font_setting = 'Lobster';                         $body_font_setting = 'Droid+Sans';                         if ( isset( $_COOKIE['header_font'] ) ) $font_setting = $_COOKIE['header_font'];                         if ( isset( $_COOKIE['body_font'] ) ) $body_font_setting = $_COOKIE['body_font'];                     ?>
Fonts

                          Header                         <select name="control_header_font" id="control_header_font">                             <?php foreach( $google_fonts as $google_font ) { ?>                                 <?php $encoded_value = urlencode($google_font); ?>                                 <option value="<?php echo $encoded_value; ?>" <?php selected( $font_setting, $encoded_value ); ?>><?php echo $google_font; ?></option>                             <?php } ?>                         </select>

                          Body                         <select name="control_body_font" id="control_body_font">                             <?php foreach( $google_fonts as $google_font ) { ?>                                 <?php $encoded_value = urlencode($google_font); ?>                                 <option value="<?php echo $encoded_value; ?>" <?php selected( $body_font_setting, $encoded_value ); ?>><?php echo $google_font; ?></option>                             <?php } ?>                         </select>

      <?php     }     add_action( 'template_redirect', 'load_scripts' );     function load_scripts(){         $slider_type = apply_filters( 'slider_type', get_option('slider_type') );         $template_dir = get_bloginfo('template_directory');         wp_enqueue_script('jquery_cycle', $template_dir . '/js/jquery.cycle.all.min.js', array('jquery'), '1.0', false);         $admin_access = apply_filters( 'showcontrol_panel', current_user_can('switch_themes') );         if ( $admin_access && get_option('show_control_panel') == 'on' ) {             wp_enqueue_script('colorpicker', $template_dir . '/js/colorpicker.js', array('jquery'), '1.0', true);             wp_enqueue_script('eye', $template_dir . '/js/eye.js', array('jquery'), '1.0', true);             wp_enqueue_script('cookie', $template_dir . '/js/jquery.cookie.js', array('jquery'), '1.0', true);             wp_enqueue_script('control_panel', get_bloginfo('template_directory') . '/js/control_panel.js', array('jquery'), '1.0', true);         }     }     add_action( 'wp_head', 'set_bg_properties' );     function et_bg_properties(){         global $bg_texture_urls;         $bgcolor = '';         $bgcolor = ( isset( $_COOKIE['bgcolor'] ) && get_option('show_control_panel') == 'on' ) ? $_COOKIE['bgcolor'] : get_option('bgcolor');         $bgtexture_url = '';         $bgimage_url = '';         if ( get_option('bgimage') == '' ) {             if ( isset( $_COOKIE['texture_url'] ) && get_option('show_control_panel') == 'on' ) $bgtexture_url =  $_COOKIE['texture_url'];             else {                 $bgtexture_url = get_option('bgtexture_url');                 if ( $bgtexture_url == 'Default' ) $bgtexture_url = '';                 else $bgtexture_url = get_bloginfo('template_directory') . '/images/body-bg' . ( array_search( $bgtexture_url, $bg_texture_urls )+2 ) . '.png';             }         } else {             $bgimage_url = get_option('bgimage');         }         $style = '';         $style .= '';         if ( $bgcolor <> '' || $bgtexture_url <> '' || $bgimage_url <> '' ) echo $style;     }          add_action( 'wp_head', 'font_properties' );     function font_properties(){         $font_style = '';         $font_color = '';         $font_family = '';         $font_color_string = '';              if ( isset( $_COOKIE['header_font'] ) && get_option('show_control_panel') == 'on' ) $header_font =  $_COOKIE['header_font'];         else {             $header_font = get_option('header_font');             if ( $header_font == 'Lobster' ) $header_font = '';         }              if ( isset( $_COOKIE['header_font_color'] ) && get_option('show_control_panel') == 'on' )                $header_font_color =  $_COOKIE['header_font_color'];         else              $header_font_color = get_option('header_font_color');              if ( $header_font <> '' || $header_font_color <> '' ) {             $header_font_id = strtolower( str_replace( '+', '_', $header_font ) );                  if ( $header_font <> '' ) {                  $font_style .= "<link id='" . $header_font_id . "' href='http://fonts.googleapis.com/css?family=" . $header_font . "' rel='stylesheet' type='text/css' />";                 $font_family = "font-family: '" . str_replace( '+', ' ', $header_font ) . "', Arial, sans-serif !important; ";             }                  if ( $header_font_color <> '' ) {                 $font_color_string = "color: #" . $header_font_color . " !important; ";             }                  $font_style .= "";             $font_style .= "";                  echo $font_style;         }              $font_style = '';         $font_color = '';         $font_family = '';         $font_color_string = '';              if ( isset( $_COOKIE['body_font'] ) && get_option('show_control_panel') == 'on' ) $body_font =  $_COOKIE['body_font'];         else {             $body_font = get_option('body_font');             if ( $body_font == 'Droid+Sans' ) $body_font = '';         }              if ( isset( $_COOKIE['body_font_color'] ) && get_option('show_control_panel') == 'on' )                  $body_font_color =  $_COOKIE['body_font_color'];         else              $body_font_color = get_option('body_font_color');              if ( $body_font <> '' || $body_font_color <> '' ) {             $body_font_id = strtolower( str_replace( '+', '_', $body_font ) );                  if ( $body_font <> '' ) {                  $font_style .= "<link id='" . $body_font_id . "' href='http://fonts.googleapis.com/css?family=" . $body_font . "' rel='stylesheet' type='text/css' />";                 $font_family = "font-family: '" . str_replace( '+', ' ', $body_font ) . "', Arial, sans-serif !important; ";             }                  if ( $body_font_color <> '' ) {                 $font_color_string = "color: #" . $body_font_color . " !important; ";             }                  $font_style .= "";             $font_style .= "";                  echo $font_style;         }} ?>


Getting custom taxonomy from custom post type

I have a custom post type called email_block and have a custom taxonomy called block_type. I need to loop through all the email blocks find out what custom taxonomy (block_type) they have. I know how get all the email block custom post types, it's finding the what block_type they belong to is what I'm struggling with. This is the code I have so far. I'm using a relationship field from advanced custom fields to filter what email blocks I want to display.               <?php          $posts = get_field('block_selector');          if( $posts ): ?>
         <?php foreach( $posts as $post): // variable must be called $post (IMPORTANT) ?>             <?php setup_postdata($post); ?>
                 <a href="<?php the_permalink(); ?>"><?php the_title(); ?>                 Custom field from $post: <?php the_field('author'); ?>
         <?php endforeach; ?>
         <?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly          endif; ?>


adsense code showing on random post thumb

I've followed the guide below, but have made a few edits to it and now i need some help: Add Adsense code in index.php I removed the following line from my code `if ( ! is_front_page() ) return;` and for the most part it works as intended, however i do have one problem. I use the plugin "random posts thumbnail" on my site.I also use a snippet of code to inject absence modules in between my posts like so:                if ( 7 === $count )             dynamic_sidebar( 'ad_widget_1' );      Thus after every 6 posts it should show an adsense module. However, for some reason they are being adsense modules are being injected after every 3 posts, which incidentally is right after where my "random posts thumbnails" plugin inserts it's content. Is it possible that my counting code is including the content generated by the plugin and if so how can i fix it?                   add_action( 'widgets_init', 'wpse_84250_register_ad_widgets' );              function wpse_84250_register_ad_widgets()         {             // used on the first page of main loop only             register_sidebar(                 array (                     'name'          => 'Ad Widget 1',                     'id'            => 'ad_widget_1',                     'before_widget' => '
',                     'after_widget'  => '
'                 )             );             register_sidebar(                 array (                     'name'          => 'Ad Widget 2',                     'id'            => 'ad_widget_2',                     'before_widget' => '
',                     'after_widget'  => '
'                 )             );         }          add_action( 'loop_start', 'wpse_84250_show_ad_widgets' );          function wpse_84250_show_ad_widgets()     {         static $count = 0;              if ( ! is_front_page() )             return;              if ( 'loop_start' === current_filter() )             return add_action( 'the_post', __FUNCTION__ )                 && add_action( 'loop_end', __FUNCTION__ );              $count += 1;              if ( 6 === $count )             dynamic_sidebar( 'ad_widget_1' );              if ( 11 === $count or 'loop_end' === current_filter() ) {             dynamic_sidebar( 'ad_widget_2' );             remove_action( 'the_post', __FUNCTION__ );         }     }


Jetpack Mobile Theme not active on iPhone

I have installed and activated the Jetpack plugin, and activated the Mobile Theme module. However, the mobile theme does not display on my iPhone. I have cleared the cache on Safari. Site is here.


Including wp-load.php redirects the whole site to wp-admin/install.php

I want to give access of pages for a site that is not actually in wordpress. Client already have the wordpress website. I know that if i include the wp- load.php file outside from wordpress then i can use all the wordpress functionality into that site. I tried with               define('WP_USE_THEMES', true);     require("../foldername/wp-load.php");      but when i tried to access the url(`http://example.com/page`), it goes to `http://example.com/page/wp-admin/install.php`, I don't know why it needs installation, even the wordpress already installed.


Wordpress Theme Breaking on Migration to Live Site

I've developed a Wordpress site locally and have recently been trying to upload it to the server. Although every time I do so, the child theme I have created for the parent seems to break. I can't figure out why this is, as I can't see anything that has changed. It says that "the parent theme is missing. Please install the "Propulsion" parent theme." although it is clearly there, and can be activated. It might be worth mentioning too that when I originally migrated the site, nothing would show up when I tried to visit the site, not even an error message. Support from Dreamhost then told me that no theme was activated, and activated the default theme for me. It was from here that I could see the error with the child theme. I would just try and delete and reinstall the child theme, although when I do so I lose all of my theme options, custom templates etc. which have taken me quite a while to build, so really would be terrible if I had to start from scratch. Is there a way I can perhaps export all this data from my local copy if I can't get it working through a normal migration? I'm testing all this on a mirror of the site through Dreamhost, i'm not sure if that might have anything to do with the problem? Any help would be greatly appreciated, i've been battling with this for a while and am getting a little desperate! Thanks again, Jack


Can I display the widget admin in the page admin?

I would like to show the 'Appearance -> Widgets' menu underneath the text field in 'Pages -> new/edit'. Is it possible to take one part of the admin and show it elsewhere? Reading some of the answers, it seems this question get's misunderstood. I'm looking for a way to **show the widgets admin** **on the page edit admin screen**.


Incorrect filenames in load-scripts.php parameters

I'm attempting to load the media upload js file in a widget. The code works on my development machine and on the staging site but not on the live server. The error I get is that wp.media is undefined. I enqueue the scripts & styles I need with:               public function enqueue_admin_scripts($hook) {              if( $hook != 'widgets.php' )             return;              wp_enqueue_style('thickbox');         wp_enqueue_script('media-upload');         wp_enqueue_script('thickbox');         wp_enqueue_script('shw', get_template_directory_uri().'/js/custom-media.js');          }      However when viewing the link that is created, I see the following: `http://xxx.com/wp-admin/load- scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,jquery-ui- core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui- draggable,jquery-ui-dr&load%5B%5D=oppable,admin-widgets,svg- painter,heartbeat,wp-auth-check,jquery-ui-position,wp- pointer,thickbox,underscore,shortcode,media- uplo&load%5B%5D=ad&ver=3.8.1` As you can see `media-upload` has been displayed as `media-uplo&load` so the media functions are never included. Has anybody come across anything like this before or can give me some advice on where to start debugging?


Add specific word to default page permalink

Right now I am working on one of my client's project. Its all about amazon product display. My client wants me to change the permalinks of all posts, pages, serch results, archive pages, categorypages, all custom post type pages. I am very new to Rewrite API. I have read the documentation provide on wordpress codex here https://codex.wordpress.org/Function_Reference/WP_Rewrite and here https://codex.wordpress.org/Rewrite_API as well as on the interne but can't able to make the things clear. Can anyone help me to generate custom permalinks for my pages ? Right now, **Page url looks like** http://mysite.com/?page_id=2 **if its default permalink** and http://mysite.com/sample-page/ **if its post name permalink**. **I wants the page url looks like** http://mysite.com/info/sample-page. Here **info** is static word I want to be added to my page url. How can I achieve this ? Can anyone help me out in this situation ? I have already wasted my 2 days in this issue and I am sure its really simple for the one who already worked with this. Quick help much appreciated. Thank You, Aezaz


using rewrites to secure login page

I'm trying to be sneaky with iis to secure a wordpress login page (not my choice to run a windows server, but that's the reality of things). It's worked so far, only the login page itself loads itself before forwarding you to the admin panel so after a successful (or unsuccessful) login the first rule kicks in and sends you to the dummy page. My rules so far:               <rule name="redirect" patternSyntax="ECMAScript">         <match url="^installbase/wp-login\.php" />         <action type="Rewrite" url="installbase/index.php?page=403-forbidden" />     </rule>          <rule name="login" patternSyntax="ECMAScript">         <match url="^sneakyURLforLoggingIn" />         <action type="Rewrite" url="installbase/wp-login.php" />     </rule>      1: I'm sure there's a more efficient way to do this 2: once wordpress accepts the login it sends you to the 403 page, requiring the user to then manually navigate to /wp-admin/. That's less than ideal. Any thougths on how to solve this catch-22? Or is there a better way to accomplish the same thing?


Sample Theme Options page for Multisite - what to consider

I used Theme Options page from the Tutorial of Ian Stewart in some of my WP site, and it works just fine. What I did externally was this (closest English Tuts). All those sites were single sites. But now I'm dealing with a WordPress Network. As I'm developing a single theme for all the sub-sites, I'm placing the `theme-options.php` into my theme as a common file. As per my search, I got a conditional statement:               global $blog_id;         if( $blog_id == '1' ) {        //do things for first site     }      Do I need to echo the same code of the `theme-options.php` under two such block to activate different thing in different site?   Or, do I need to made two different `theme-options.php` and conditionally load them for different site?                global $blog_id;          if( $blog_id == '1' ) {         require_once ( get_template_directory() . '/theme-options.php' );      } elseif ( $blog_id == '2' ) {         require_once ( get_template_directory() . '/theme-options-bengali.php' );      } else {         require_once ( get_template_directory() . '/theme-options.php' );      }      Please note: Two of my site's settings, in many cases could be different and I'd need to grab them differently for the front-end.


How to Update User Meta Field other than from profile?

I have created a dynamic meta field that is generated for each post type. I used the following to create the meta-field:               <?php             $args=array(     'post_type' => 'Course',     'status' => 'approve'     );                             $allposts = get_posts( $args );                             foreach ( $allposts as $post ) {                              $course_name = $post->post_name;                             $post_course_meta = $_POST[$post->post_name];                             $radio_status = get_user_meta( $user->ID, $course_name, true );                             ?>                                        <input type="radio" name="<?php echo $post->post_name; ?>" value="Did not start" <?php if ($radio_status == 'Did not start' OR $radio_status == '' ) { ?>checked="checked"<?php }?> />Did not start"
     <input type="radio" name="<?php echo $post->post_name; ?>" value="Started" <?php if ($radio_status == 'Started' ) { ?>checked="checked"<?php }?> />Started
     <input type="radio" name="<?php echo $post->post_name; ?>" value="Finished" <?php if ($radio_status == 'Finished' ) { ?>checked="checked"<?php }?> />Finished      And to save it:               function save_educadme_courses_for_user( $user_id ) {           if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }              $args=array(             'post_type' => 'Course',             'status' => 'approve'             );         $allposts = get_posts( $args );              foreach ( $allposts as $post ) {         $course_name = $post->post_name;         $post_course_meta = $_POST[$post->post_name];         update_user_meta( $user_id, $course_name, $post_course_meta );         }//end of master loop          }      And to display & save, I am using               add_action( 'show_user_profile', 'educadme_courses_for_user' );     add_action( 'edit_user_profile', 'educadme_courses_for_user' );     add_action( 'personal_options_update', 'save_educadme_courses_for_user' );     add_action( 'edit_user_profile_update', 'save_educadme_courses_for_user' );      Now, everything is **working fine if I wanted to update through the profile itself**. However, I don't intent to do that. I want to be able to also edit through the profile edit page, but, mainly, I want to be able to also update the meta field by hooking an update function to actions which are run on different parts of the website. However, when I try to do that, **the update** I run through the external function **doesn't update the value of the radio** or at least when I open the profile page, it saves original value I set through the profile. For instance, I wanted to test this function:               function testtt() {         if ( is_user_logged_in() ) {         update_user_meta( $user_id, 'research-introduction', 'Finished' );         }     }     add_action( 'wp_footer', 'testtt' );      But nothing happened! The value (radio button) that was checked through the profile update page is still selected. I changed a bit of code and was able to make it work the other way around, to fetch value and update but **not have any effect** when edited through the **profile page**. This brought me to the question, can I allow or use updates both ways? If yes, what am I doing wrong please? Thanks!


How to get date of post when using wp_get_recent_posts()?

I get the latest posts this way:               $args = array( 'numberposts' => '2' );     $recent_posts = wp_get_recent_posts( $args );      Then I loop through them and get information about the post this way:               $recent_posts[0]["post_title"]      How can I get the date the post was published?


Passing more options to: wp.media.gallery.edit

I am calling the media gallery edit screen like so on the front end:               wp.media.gallery.edit('[gallery ids="70,71,72"]');      The right images get loaded (70,71,72), but the media library shows just a few random selection of images, when I go to the Add to Gallery tab. First I would like the correct amount of images to show up, when called on front end. Second I would then like to restrict the images shown to the user to the images uploaded to the current post only. In another try I used the 'uploadedTo' parameter to pass a post id, like in this example at the very bottom of the page: Restricting Users to View Only Media Library Items They Have Uploaded? That worked fine. Unfortunately. this does not give me the gallery view I would like with the sidebar on the left.


Display total unique custon field results

I need show total results of a custom_field:   * Each post has a field "city";   * How many unique cities are registered? Ex.:   Madrid + Paris + Madrid + London = 3 cities


Form That Submits Content Securely

I have built a WP site for a client. One of the pages has a form which my client's customers will use to submit material to my client, and one of the required fields is a file upload. My client requires that the material submitted via that form reach my client securely. I see no WP contact form plugin that achieves this. (The ones that call themselves "secure", such as fast secure contact form, use that term in a different sense: protection against people submitting malicious content via the form.) Here is the approach I'm now thinking of:   1. I use a standard plugin to create the form (I'm using contact form 7).   2. The contents of the form submission are _not_ emailed to my client. She just receives an email notification that the form was submitted.   3. I've installed the plugin contact form DB, so that my client can access the contents of the submission from the WP admin. But there are still at least two issues that need to be resolved:   1. I need to make contact form 7 submit the content securely.   2. My client needs to be able to view the submitted content in the WP admin securely. Regarding issue # 1, it it's too much of a hassle to figure out how to make contact form 7 or any of the other WP contact form plugins submit the content securely, I could code the form myself. I see a plugin called Dagon Design that calls itself secure -- but the example they give is a form with a non-secure url, and the action of the form also is non-secure, leading me to believe that this plugin too is not using "secure" in the sense that I need. Any assistance on how to implement this, or any suggestions for an alternative approach, would be welcome.


Breadcrumb is not generating the correct post page url

I have created a custom posts type cities and the code for its deceleration is `register_post_type('City',$args);`                 $labels = array(     'name' => _x('Cities', 'post type general name'),     'singular_name' => _x('City', 'post type singular name'),     ......  );      and I Installed prime-strategy-bread-crumb to generate the breadcrumbs but the exact url for cities page is http://www.abc.com/wordpress/cities/ and the url generated by the breadcrumb is http://www.acb.com/wordpress/city/ which ultimately takes me to the archive page of post type city so do I have to make changes in the plugin file or is it all due to page url because the url of single city post is //www.abc.com/wordpress/city/shimla/ and code to display the breadcrumbs is in this page.


code highiglight not working comment

SyntaxHighlighter Evolved plugin installed on my blog. Code highlight working on post,but no comments.. I am showing the comment form with the different codes :                   <form  method="post" name="commentform" onsubmit="return false" id="commentform">         <textarea name="comment" id="commentr" cols="50" rows="10" tabindex="4">  </textarea>         <input type="hidden" name="send" id="send" value="1" />                  <input type="submit" class="sendmain" name="sendmain"  onclick="_sendmain('<?php echo $post->ID; ?>');" value="Send" />         </form>      What do you think the problem? My English is bad, I'm sorry. Thanks..


making users able to add their own products wp e-commerce

I am using wp e-commerce plugin to build a simple e-commerce website. The problem is that I want to allow all users to post their products on the website. Right now, only the admin can add products. Does anyone know if it's possible to give users the privilege to post products?


how to find the current page is isngle activity page in buddypress?

I want to check whether the current page is "Single activity page" or not, I ned like ths, `if(is_single_activity())` or               if(is_page('is_single_activity'))      Thanks


Inserting into WP DB

I had initially asked a question based on my code (which has since been removed), I need some help/guidance in creating a plugin. Scenario: I have created a custom post type (CPT), now I need to insert values into the CPT from a database table external to the wp environment. This routine needs to run once every hour, no of rows can range from 50 - 500. What is my best course of action? Side question: Do I separate my CPT code from the insert routine code?


How to add a user dashboard page?

I'm developing a Wordpress theme for the first time and I don't know how to create a custom user dashboard page, such that when a user logs in via a custom login form, he/she is not directed to Wordpress dashboard, but to a page where user specific information is shown. He/she should also be able to edit his/her information without leaving the page. The user (with low priority role) should not be able to access Wordpress dashboard.


Custom post type structure for posts with multiple child posts

I'm developing a site for an African language translation company and am currently trying to think of the best way to structure the site I have a custom post type of "Languages" set up, with posts like Arabic, Somali, Swahili etc but each of these posts need "sub" posts within them i.e History, Where is it spoken, Dialects, Alphabet & Writing system What would be the best way of setting this up? There are going to be around 140 languages so I don't think setting up individual posts for the 3/4 sub pages for each language is a good way to go as we'd be looking at over 500+ posts I'm wondering if I can set up "base" posts for the 3/4 sub pages seeing as the titles will always be unique, just the content will be different


Wordpress hooks/filters insert before content or after title

trying to insert content before the post content in my functions.php - I know how to use the regular wp hooks, but unsure how to insert into other areas. Tried this, but it kills content on any other post type:               function property_slideshow( $content ) {      if ( is_single() && 'property' == get_post_type() ) {         $custom_content = '[portfolio_slideshow]';         $custom_content .= $content;         return $custom_content;         }      }     add_filter( 'the_content', 'property_slideshow' );      How do I make this conditional?


How to add section above header for custom post types

I want to include a horizontal section at the very top of my site, above the header, that shows the next six events. I've created a custom post type called "events", and I've created about 150 events. That's all fine, but what I'm having trouble with is figuring out how to create this new section above the header to get these events to display. Would I need to edit each page's PHP to add that? Or is there something more global.


Using Microsift Word/Outlook for content publishing to Wordpress

I am tasked with building an tool to allow users to publish to Wordpress from their PC using MS Word and Outlook. I know, completely defeat the purpose of having Wordpress, but the basic requirement are:   1. Format must be preserved, including images   2. Providing an interface for categorizing and tagging the document   3. Does not involve the WP web UI. (Users insist on using Word as the publishing tool)   4. Workflow should be simple as possible, ie invoke in Word, select categories/tags, publish. After doing some research, I think this could be achieved by creating an VBA macro that saves Word to html format, and sending it via http to wordpress XMLRPC However, I haven't quite work out how to include the images, and how to keep the category from Wordpress and the macro in sync. I would like to hear from anyone who have experience in this and suggestion on how to implement this.


redirect to homepage after login

I have installed a site in my localhost. I have used a static home page with a wordpress login in it. The blog is hosted at localhost/blog. (i have followed the wordpress guide on how to get the wordpress index by keeping it inside a sub folder) the issue im having is once the user is logged in it automatically redirects to the /blog path. But i want to redirect it to the main home page. This is what i have tried so far Added the below code to the functions.php               /* redirect users to front page after login */         function redirect_to_front_page() {         global $redirect_to;         if (!isset($_GET['redirect_to'])) {             $redirect_to = get_option('siteurl');         }     }     add_action('login_form', 'redirect_to_front_page');       added plenty of login redirect modules but none of them work, all of those simply redirects to the blog page.


Upload file without attaching it to a POST

I've brought files with html file field and I'm trying to attach file to wordpress attachments using `media_handle_upload`               $attach_id = media_handle_upload ( $file_handler, null );      the I've specified second parameter as `null` because I don't want to attach it with any post, but it returns some WP Error, since it is may be not allowed to `media_handle_upload` without `post id`               WP_Error Object     (         [errors] => Array             (                 [upload_error] => Array                     (                         [0] => Array                             (                                 [0] => 0                                 [1] => 0                                 [2] => 0                             )                          )                  )              [error_data] => Array             (             )          )      is it possible to upload images with wordpress default without assigning it to any post?


Change Post Meta via AJAX from the posts list table

I've been looking around for this for a while but haven't found anything as of yet. I have a custom post type - "books" and this post type has a custom meta field of "availability". I would like to have a column for the post type that you can click on the availability link and it would change the custom meta value from "yes" to "no" and update the text link to display either "yes" for the value being yes or "no" for the value being no. I have made the post column, and I have got the column displaying the value, just need to get it to work with ajax which is where I have no idea where to start! I have studied a plugin I found on here not long back about changing a post status from a column using ajax but I cant see how to change this to work with custom meta values - Custom column for changing post status via ajax I would love any help or even pointing in the right direction with this as it has been eating away at me for days now!


Adding a line of text to php code

My wordpress theme has a button to turn breadcrumbs on or off. I want to leave the breadcrumb turned off and place a line of text where the breadcrumb would display on all pages except the home page. You can see the breadcrumb here: http://greenesrelease.com/what-is-it/ I see in the `sub_page_header.php` where the breadcrumb is called               if(!is_front_page() &&  ( get_option('rttheme_breadcrumb_menus') || get_option(THEMESLUG.'_show_search') )){         $info_bar = TRUE;     }else{$info_bar = FALSE;}


wordpress title and category as result

Please have a look a the code below!Its from a WordPress plugin. How can I get the result $search = post title (space ) category name                // Relation: Post title.     if( $relation === 'posttitle' ) {      global $post;      $search     = ( isset( $post->post_title ) ) ? $post->post_title : '';     }      Its from a WordPress plugin related-youtube-videos. I want to display you tube base on title and category! This plugin has no option for both! https://wordpress.org/plugins/related-youtube-videos/ related-youtube-videos\lib\RelatedYouTubeVideos\API.php


YouTube Sidebar Widget - YouTube service unavailable

I'm using WordPress 3.5 and YouTube Sidebar Widget 1.3.2. The plugin display service is unavailable. Why have I encountered service unavailable? The YouTube video is set to be public and embeddable.


hide an author_meta on a post if the Co-author function is active

I want to hide an `author_meta` on a post if the Co-author function is active on a post. For example: This is how it looks with one author > By Author Name | Contributor Published: 05/03/2013 2:00 pm EST Contributor is the meta Here is how it looks currently with a co-author is added > By Author Name, Author Name, Author Name, and Author Name | Contributor > Published: 05/03/2013 2:00 pm EST I would like to hide the Contributor meta (or title meta) on this type of post. I am using the Co-Authors Plus Plugin. The source for the coauthors_posts_link function is:               function coauthors_posts_links( $between = null, $betweenLast = null, $before = null, $after = null, $echo = true ){         return coauthors__echo('coauthors_posts_links_single', 'callback', array(             'between' => $between,             'betweenLast' => $betweenLast,             'before' => $before,             'after' => $after             ), null, $echo );     }


Get custom thumbnail sizes

If I use:               add_image_size('main_image', 750, 375, true);      to add additional thumbnail size. Then how can i get that size if i have only key `main_image`.


Passing the page ID to a login php script

I'm trying to create a simple registration process which goes like this,   1. A visitor clicks on a link (which is viewable only after entering some information such as name, email, phone etc.)    2. This link takes the visitor to a simple registration form that captures all the required info.   3. And on successful validation of the form redirects the visitor back to the actual URL. To do this, first I thought of passing the actual URL as a variable to the php login script but then anybody can see this URL in the status bar of their browsers and would be able to bypass the registration process completely. Now I believe another way to do this is to pass the actual ID of the destination URL as a variable to the login PHP script. Can anyone help me on how to actually go about this? The registration form can be a seperate PHP file that opens as a popup or can be a form thats embedded in one of the pages.


I need help in designing a custom post type

I've been sitting on this for three days and I still haven't figured out a good way to solve this problem—that's why i want to ask a community about it. I'm creating a page, which will have some historical routes in my city. I therefor need to create a custom post-type, which will be the route. Route have points. Each point store multiple data: name, content, GPS- coordinates, author, etc. So I need to create a repeatable area called `point` and there I'll insert all the data I need (amount of points is dynamic so this area need to be repeatable). I've done that with help from this question: Create more Meta Boxes as needed It works fine, but there's a problem because the content-field needs to be the TinyMCE-editor and for now I'm stuck on the part where i add a repeatable area through jQuery, because I can't add TinyMCE to it in a easy way. Is this a good plan or should I try another solution?


Which social connect plugin do you recommend?

I'm searching a social connect plugin which allows users to register/login using the following sites and support MULTISITE 1)Facebook 2)Twitter 3)Google 4)Yahoo 5)Others (optional) I've tried many plugin but none of them met my requirements. Plugins that support facebook,twitter,google,yahoo has security issues. I've tried otto's simple facebook and twitter connect. It is a good plugin but it doesn't support multisite, also there is no yahoo connect. Social connect has everything,support multisite, but its not working properly. Many times its not redirect to the dashboard after connect. I tried wordpress social login plugin too. But after connect its just fill dummy emails for everything even you connect with google,yahoo,etc. I don't want to use third party plugins like janrain,gigya etc... Because after some limit i need to pay money to use their services. Is there any good plugin available that support multisite and has high security,facebook,twitter,google,yahoo connect features ? Thanks


Pagination not working in some author pages

I have an author archive page to display authors' posts. In some of the authors the pagination works, but in some cases it doesn't. Where is the problem? Here is my code:               <?php     $paged = (get_query_var('page')) ? get_query_var('page') : 1;     $wpfp_before = "";     echo "
";          if ($wpfp_before):     echo '
'.$wpfp_before.'
';     endif;     $favorite_post_ids = get_user_meta($user_id, 'wpfp_favorites', true);     if ($favorite_post_ids) {     $favorite_post_ids = array_reverse($favorite_post_ids);     $post_per_page = wpfp_get_option("post_per_page");     $page = intval(get_query_var('paged'));          $qry = new wp_query(array('post_type' => 'videosprogram' ,  'post__in' => $favorite_post_ids ,'posts_per_page' => 3,'paged' => $paged ) );                                while ($qry->have_posts() ) : $qry->the_post();               //Loop ....               endwhile; wp_pagenavi( array( 'query' => $qry ) ); ?>      UPDATE:- i try this way :-               function cpt_on_author_page( $query ) {         $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));         //$author_name = get_post_meta($curauth->id, 'author_name', true);         if ( $query->is_author() && $query->is_main_query() ) {             $query->set( 'post_type', 'videosprogram' );             $query->set( 'posts_per_page', 1 );             $query->set( 'meta_key' , 'show_program_editors');             $query->set( 'meta_value' , $curauth->id);                    }     }     add_action( 'pre_get_posts', 'cpt_on_author_page' );      but not show me any post


Remove post title

Is there a way to remove the post title? or atleast not require me to enter a post title. I have migrated from tumblr to wordpress and I didn't need to have a title with tumblr so I was wondering if I could do the same with wordpress?


Where can I store common cross-site text (e.g. headings, titles etc.)

I am developing a site that I want to hand over to a client once complete. The core page 'content' is manageable, but there are elements of content (common headings, titles etc.) that are shared across multiple pages & sections within the site, and I would like to give the client a single 'admin page' where they can set all of this information; there are about 25 bits of configurable content - all of them small strings.


Choose to Display Post Thumbnail?

I noticed the website http://gawker.com/ does something cool with images in posts - some posts have a large featured image above the title, others have none and just have images in the content. My best bet on how to achieve this in WordPress is to add `<?php the_post_thumbnail('large'); ?>` above the title and make a selectable option to display or not display the_post thumbnail in the post edit screen. It would need to only apply to the post (and not the excerpt)... I'm not sure how I would create that option. I would appreciate if anybody knows how this would be done, can direct me to a somewhat relevant tutorial, or has a better idea of how to achieve this.


Set home page to last page of a certain category

I want to create a new website with reversed pagination (I mean latest post is found in last page , while oldest one is found in first page) I could do that already with "Default Sort Ascend" plugin. Now what I want is to set front page to be the last page of a specific category (even with redirection) ... ANY HELP ??


Disable adding of new post (custom post type)

How do I disable adding of new posts of a particular custom post type? Found this code in Log Deprecated Notices plugin:                   $screen = get_current_screen();         if ( self::pt == $screen->id && ( $screen->action == 'add' || $_GET['action'] == 'edit' ) )             wp_die( __( 'Invalid post type.', 'log-deprecated' ) );         if ( self::pt != $screen->post_type )             return;


Stop wordpress from removing HTML attributes

I try to insert a post with `html tag` with `class` attribute, like this: `<dl class="dl-horizontal">`, but after saving the post, WP removes an attribute.   How can I fix it?   The only way I've found, is to make a `shortcode`:               add_shortcode('attr', 'html_attr');     function html_attr( $atts, $content = null ){      extract( shortcode_atts( array(         'tag' =>"",         'attr'=>""       ), $atts ) );          return "<" .  $tag . " " . $attr . " >";     }      But I don't think that it's a right way...


How to: When a bp Group created, automatically create a wp category

example: a user creates a group "cats" automatically a category "cats" would be created with the slug "cats" or a user creates a group "Fat Cats" automatically a category "Fat Cats" would be created with the slug fat-cats. I see there is a function wp_create_category : However,to be frank, i'm lost. Have tried, with adding this near end (line310) of child- theme/groups/create.php but no dice Any help or ideas really welcome


Has anyone managed to integrate the wp_editor inside a widget?

Adding this in the widget form method:               wp_editor($text, $this->get_field_id('text'));         seems to work. But after you press the "Save" button the widget goes funky... Adding `_WP_Editors::editor_js();` makes it show after you press the save button, but then other things start to act weird. I think it has something to do with the javascript from the footer. Has anyone successfully integrated wp_editor inside a widget?


Publish issue after upgrading to 3.3

I have a weird issue after upgrading to WP 3.3. Currenty I have a Dreamhost dedicated server with WP 3.2. I've tried two times to upgrade to WP 3.3 and both times I had the same issue. First time, I tried to upgrade directly from the admin panel. Everything seems to be OK but all the updates against the DB perform errors. Let say, I tried to write a new post and nothing was saved. I tried to change some options in a plugin a a message is displayed "Are you sure you want to to this?" without any button to continue... After a fresh installation of WP3.2, I get restore the content tables (not the wp_option) and everything works fine again. Few days ago I tried again to upgrade, but this time from console. I uncompress the wp zip file and in the instalation directory and then entered in the admin panel. A message saying some upgrade in the DB appeared. After pressing OK button, seems everything works fine until I tried again to publish something... The issue of posts disapearing happened again. Also, this time on every page change, the message "The DB needs to be upgrade" appeared again, but no these times, no change were needed. Everything seems too weird for me. And also, WP does not provides any log or information about what is happening. Could anyone help? Thanks a lot. Alberto


Fix permission error for deleting custom post from front-end?

I need both Admin and Editor role users to be able to delete a custom post type from the front-end. I found the code to create a post delete link, but whenever either role tries to delete there is an error: Forbidden You don't have permission to access /wp-admin/post.php on this server. Any ideas? Is it because this is a custom post type? The post delete code is included below. In function.php:               function wp_delete_post_link($link = 'Delete This', $before = '', $after = '')     {     global $post;     if ( $post->post_type == 'page' ) {     if ( !current_user_can( 'edit_page', $post->ID ) )     return;     } else {     if ( !current_user_can( 'edit_post', $post->ID ) )     return;     }     $link = "ID, 'delete-post_' . $post->ID) . "'>".$link."";     echo $before . $link . $after;     }      Inserted into page:               <?php wp_delete_post_link('Delete', ' ', ' ') ?>


When I use rewind_post() it shows menu items in my loop

I have code like below (I removed all the uneeded HTML and stuff for this post). The code is for my author.php page. So it shows some author data at the top of the page then runs `rewind_post()` so it can show the post's by that user. The problem is for the admin, it is showing all the menu items as post in this loop/list               <?php     get_header();          if (have_posts()) :         the_post();     ?>              View my website:<a href="<?php the_author_meta('user_url'); ?>">          <?php } ?>          <?PHP         rewind_posts();         while (have_posts()) : the_post();                  $format = get_post_format();             if ( false === $format ){                 $format = 'standard';             }             get_template_part( 'format', $format );              endwhile; /* rewind or continue if all posts have been fetched */ ?>          <?php get_sidebar(); ?>     <?php get_footer(); ?>      And the file included in the get_template_part is simply the basic stuff like `<?php the_content(__( 'read more...', 'vigilance' )); ?>`


Wordpress get current user data from external php page

I have a php page at the same level as the template / theme on wordpress. What I need it be able to get the current logged in user details from this page. I have tried this:               require_once($_SERVER['DOCUMENT_ROOT'] .'/wp-load.php');            global $current_user;       $current_user = wp_get_current_user();       var_dump($current_user);      But it's returning nothing ... 0 as user_id and nothing on the other fields. I'm I missing something? UPDATE: This is the result of the var_dump: [object Object]1object(WP_User)#79 (10) { ["data"]=> NULL ["ID"]=> int(0) ["id"]=> int(0) ["caps"]=> array(0) { } ["cap_key"]=> NULL ["roles"]=> array(0) { } ["allcaps"]=> array(0) { } ["first_name"]=> string(0) "" ["last_name"]=> string(0) "" ["filter"]=> NULL }


wp_mail script with jquery post

need to send an email from a page when a form is submitted. Thought i'd use jquery post but not really sure where to start. Would i use wp_mail? And if so how could it be called ? Sorry if that seems vague. Just trying to send an email to the client before a form posts its data to another site;               $('#donationForm').submit(function() {          // send email to client before moving onto worldpay payment form               //  send data to worldpay....     this.submit();          });      best, Dc


Including custom fields in search?

I use custom fields for lots of my content on both Posts and Pages, so that half of the text will be in the main post body and the other half in a custom field. Unfortunately, when doing this only the text in the post body is searchable. I want to have all the custom fields included in the search (just joined together as one). Preferably without installing a plugin, as all the plugins I have seen do not seem to be able to do this or they add loads of options I don't need. I just would like one search box, that uses WordPress's default search but finds words in custom fields as well as those in the main body. Is this possible?


How do I include the category next to the title of a post?

On the main page in WordPress all I want is the category to come before the title of the article posted. So for example if it's a Review, I'd like the article name to be Review: Super 8. Okay so if you go to my site www.r3entertainment.org it displays the names of each of the articles on the main page. What I want, is for the name of the category the article is in to be placed before the title just on the main page there so people know what type of article it is. And by the names of the articles on the main page I don't mean the 'Latest Content' widget. I mean the boxes that appear below the huge slider box. Each box has a different article in it. I mean if you can get it to effect the latest content widget too that'd be cool. Didn't think about that. xD ## Thanks. The new code looks like this:                    $getCAT = get_the_category();     $firstCAT = $currentCat[0]->cat_name;<?php if(have_posts()): ?><?php while(have_posts()): ?><?php the_post(); ?>                 <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">

<?php the_time('dS'); ?> <?php the_time('M'); ?><?php the_time('Y'); ?>

<a href="<?php the_permalink();?>"><?php the_title( $firstCAT,"",true ); ?>

by <?php the_author(); ?>
                     <?php the_content(); ?>                     <?php wp_link_pages('
'.__('Pages:').' ', '
', 'number'); ?>
       Did I do something wrong?


Migrating problem - featured images

I'm trying to migrate a WP install using default export and import tool. Everything is peachy except featured images. For my post thumbnails I'm using default Featured Image option with 7-8 predefined image sizes in my functions.php. Problem - after importing, Wordpress is just putting original picture in img src for thumbnail. Not resized one as is should be, but largest one which was uploaded originally. This is not even an option, because there are over 2000 posts, but I can't even fix this by setting featured image again by selecting image from media library -- I have to upload the image again, and then it works. I guess import/export tool doesn't save all the settings/metadata it should, but I can't figure out how to solve this. Image files (original and resized ones) are on server and in proper folder, and code is set up properly as well.


Like to store multiple passwords in db table wp_posts field post_password?

I like to have a multiple password access for a page. And i was thinking of just adding 200 passwords in post_password field but that's too simple and post_password is varchar(20). How else can i have multiple passwords?


Wp Enviroment problem with included file

i have a file i am including across site to index.php, single.php etc. This file behaves really strage and acts like it not part of   wordpress Enviroment meaning: i get errors on get_bloginfo('template_url') and it won't   get the values from my options page. Any idea what this might happen? **Here is the include code i have in my index.php (somewhere mid page):**               <?php include(get_bloginfo('template_url') .'/extras/floater.php'); ?>      (it includes the file so problem aint there) **Here is the actuall "floater.php" code... :**               <?php         function establishParms() {         // get yes/no values and urls..         $facebook = get_option('sg_show_facebookfloater');         $twitter = get_option('sg_show_twitterfloater');         $mail = get_option('sg_show_mailfloater');                  // facabook             if($facebook == "Yes") {                 $facebook = '

';             }                   // twitter             if($twitter == "Yes") {                 $twitter = '

';             }                   // mail             if($mail == "Yes") {                 $mail = '

';             }          }     ?>

             <?php echo $facebook; ?>             <?php echo $twitter; ?>
<?php echo ''; ?>

<?php echo ''; ?>

        .   Nothing Special there also so.. i am left with no answer to think of. Also... had a nother weird problem with this site (which works great on localhost)   i have a function that did a simple thing inside function.php file:               function setPaths() {         $templateUrl = get_bloginfo('template_url');         $imagesUrl = get_bloginfo('template_url')."/images/";     }      But when trying to use $templateUrl in index.php file it gave me nothing.. Would love for your help :)   Cheers, Sagive _**REVISION:_** Here is an example of an error i got:               Fatal error: Call to undefined function get_bloginfo() in /home/workspac/public_html/sagive/wp-content/themes/sagive-spaceJunkie/extras/floater.php on line 29