Same posts within a paginated page

I have a specific template that displays only posts from a category (350). When I paginate my posts, the posts stay the same. Below is some code that makes up this template. Any ideas how to correct this?               <?php if (is_front_page()) { ?>         <?php get_template_part('home'); ?>     <?php } else { ?>            <?php          $et_ptemplate_settings = array();         $et_ptemplate_settings = maybe_unserialize( get_post_meta($post->ID,'et_ptemplate_settings',true) );              $fullwidth = isset( $et_ptemplate_settings['et_fullwidthpage'] ) ? (bool) $et_ptemplate_settings['et_fullwidthpage'] : false;              $et_ptemplate_blogstyle = isset( $et_ptemplate_settings['et_ptemplate_blogstyle'] ) ? (bool) $et_ptemplate_settings['et_ptemplate_blogstyle'] : false;              $et_ptemplate_showthumb = isset( $et_ptemplate_settings['et_ptemplate_showthumb'] ) ? (bool) $et_ptemplate_settings['et_ptemplate_showthumb'] : false;              $blog_cats = isset( $et_ptemplate_settings['et_ptemplate_blogcats'] ) ? (array) $et_ptemplate_settings['et_ptemplate_blogcats'] : array();         $et_ptemplate_blog_perpage = isset( $et_ptemplate_settings['et_ptemplate_blog_perpage'] ) ? (int) $et_ptemplate_settings['et_ptemplate_blog_perpage'] : 10;         ?>                  <div id="content" class="clearfix<?php if($fullwidth) echo(' pagefull_width');?>">

                     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>                         <?php query_posts('cat=350'); ?>
<?php the_title(); ?>
                              <?php the_content(); ?>                         <?php wp_link_pages(array('before' => '
'.esc_html__('Pages','Minimal').': ', 'after' => '
', 'next_or_number' => 'number')); ?>
                             <?php $cat_query = '';                              if ( !empty($blog_cats) ) $cat_query = '&cat=' . implode(",", $blog_cats);                             else echo ''; ?>                             <?php                                  $et_paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' );                             ?>                             <?php query_posts("showposts=$et_ptemplate_blog_perpage&paged=" . $et_paged . $cat_query); ?>                             <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                                         <?php the_content(); ?>
                                   <?php endwhile; ?>
                                     <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }                                     else { ?>                                          <?php get_template_part('includes/navigation'); ?>                                     <?php } ?>
                              <?php else : ?>                                 <?php get_template_part('includes/no-results'); ?>                             <?php endif; wp_reset_query(); ?>
                           <?php endwhile; endif; ?>

                  <?php if (!$fullwidth) get_sidebar(); ?>
                <?php get_footer(); ?>     <?php } ?>


How to use str_replace() outside the loop?

Is there any way to use `str_replace()` in Wordpress outside the loop? I want to change my html markup which starts before the loop. I need something like this:               function content_magic($content) {             str_replace('
','
',$content);             return $content;         }     add_filter('the_content','content_magic');      But this works only for markup within the loop. Please help me!


Echo Messages By Checking current_time()

Before asking for help I would like to clarify that I don't have advanced skills on PHP. What I want to achieve is to display different messages for every period of time that I set **_(I need this to LOOP every day)_**. After reading this -> http://codex.wordpress.org/Function_Reference/current_time I tried to check:               $my_time = current_time('mysql');     if ($my_time >= 14 && $my_time <= 16) {         echo 'Do your homework';     } else if ($my_time > 14 && $my_time <= 18) {         echo 'Clean up the house';     } else if ($my_time > 18 && $my_time <= 20) {         echo 'Go Shopping';       .       .       .       .       .     } else {         echo 'Lets start over!'     }      Where 14, 16, 18, 20 is the time (24hour format). However this did not work. When I echo current_time('mysql'), it returns the date and the time so even if it could work, it wouldn't loop because of the date, right? Thanks in advance.


Featured image for news page

Is it possible to display a featured image on a news page that uses index.php? I'm currently using wp_query to display posts from a specific category on the news page. Each post has his own featured image which isn't displayed on the index/news page but only for the post itself. If i place `<?php the_post_thumbnail();? >` before the query it displays all featured images for the posts shown on the news page but not the featured image which I've setup for the news page itself. How can I solve this? If it's even possible as the codex says that the featured image is only for post and pages. The news page is a page but uses index.php instead of page.php.


Output 2 items within the Loop

I have a query that loops through `<li>`'s and displays the number of `<li>`'s I have. Is there a way I can make the loop pull 2 `<li>`'s at a time rather than one?               // 5 list items
     <?php while(has_posts()): the_post(); ?>

<?php the_content(); ?>

     <?php endwhile; ?>
      output

content 1

content 2

content 3

content 4

content 5

      and how I would like it to output...

                content 1                content 2

        etc...
      I hope you understand what I am trying to do. Thanks!


User defined password at registration - registration email sends auto generated pass

Updating some meta fields on registration and providing the user the option to pick a password yet the registration email sends the auto generated password. User defined password works and not emailed pass.               add_action( 'user_register', 'jwh_register_extra_fields', 100 );     function jwh_register_extra_fields( $user_id, $password = '', $meta = array() )  {     $userdata = array();          $userdata['ID'] = $user_id;     if ( $_POST['password'] !== '' ) {         $userdata['user_pass'] = $_POST['password'];     }          $userdata['first_name'] = $_POST['first_name'];     $userdata['last_name'] = $_POST['last_name'];     $userdata['user_url'] = $_POST['user_url'];          $new_user_id = wp_update_user( $userdata );     }


Wordpress Custom Post Type Repeated 404 Errors

I've got a WordPress CPT that I've had running for a couple weeks. There weren't any problems with it. In the last couple days, it's been going haywire. Every few minutes, WordPress forgets that the page exists and returns a 404 error. This can be fixed by flushing the permalink rules in the admin panel, but a few minutes later the same things happens and it has to be fixed again. Does anyone know what could be causing this, or how to fix it? Errors: Some of these:               [Fri Sep 24 04:11:17 2010] [error] [client 150.254.160.253] Invalid method in request \\n\\n      More of these (tv2 is the slug for the CPT):               [Fri Sep 24 03:25:15 2010] [error] [client 67.142.166.25] File does not exist: /var/www/vhosts/default/htdocs/tv2      And a ton of these:               [Fri Sep 24 03:58:36 2010] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/


User registration followed by automatic login

I am using a plugin modified for my purposes. What I am after is after the user has registered for it to automatically log them in and return them to the current page. At the moment it sends them an email with their username and password. They then have to log in using those details.


Make this jQuery toggle snippet target each list item individually

I'm currently using this little jQuery toggle snippet to show/hide child categories using the wp_list_categories function;               $('.sidebar ul.children').hide(); // Start by hiding child categories          $(".sidebar li.parent-item").hover(function () {     $(".sidebar ul.children").slideToggle("slow");      But currently hovering over any list item with the class `parent-item` makes every child menu toggle. Is there a way to make it work only on the list item that is hovered over?


Assign a Custom Role to a Custom Post?

I been looking around for this, but couldn't find a way. The scenario is: I have a custom post type 'Company', and I'm creating Company type posts through my plugin's code. When I create a new Company post, I set the author as Admin. Now further down the code, I'm creating a custom role 'Representative' and assigning users to this role through my code again. What I want to do is, assign a Representative to a Company Post as an author. But I can't even see this user(Rep.) in the dropdown for switching authors. Is there any argument that I need to pass to wp_insert_user or register_post_type or add_role/add_cap for achieving this? Thanks in advance!


Making my plugin multi-site compatible

I want my plugin to be installed on each blog and create database tables per blog. I have this code:               register_activation_hook( __FILE__, 'install1' );     function install1() {         global $wpdb;              if (function_exists('is_multisite') && is_multisite()) {             // check if it is a network activation - if so, run the activation function for each blog id             if (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) {                         $old_blog = $wpdb->blogid;                 // Get all blog ids                 $blogids = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs"));                 foreach ($blogids as $blog_id) {                     switch_to_blog($blog_id);                     _install2();                 }                 switch_to_blog($old_blog);                 return;             }            }          _install2();             }          function _install2()     {         require_once WP_PLUGIN_DIR . '/pluginfolder/functions/database.php';         require_once WP_PLUGIN_DIR . '/pluginfolder/functions/general.php';         $db_error = false;              $sql_file = WP_PLUGIN_DIR . '/pluginfolder/ossq.sql';         os_db_connect(DB_HOST, DB_USER, DB_PASSWORD);         os_set_time_limit(0);         os_db_install(DB_NAME, $sql_file);         if ($db_error != false) {                  //  echo 'instalation successfull';         } else {                   }      The code is inspired on this blog post [http://shibashake.com/wordpress- theme/write-a-plugin-for-wordpress-multi-site] The SQL File consist of:               DROP TABLE IF EXISTS address_book;     CREATE TABLE address_book (        address_book_id int NOT NULL auto_increment,        customers_id int NOT NULL,        entry_gender char(1),        entry_company varchar(255),        entry_firstname varchar(255) NOT NULL,        entry_lastname varchar(255) NOT NULL,        entry_street_address varchar(255) NOT NULL,        entry_suburb varchar(255),        entry_postcode varchar(255) NOT NULL,        entry_city varchar(255) NOT NULL,        entry_state varchar(255),        entry_country_id int DEFAULT '0' NOT NULL,        entry_zone_id int DEFAULT '0' NOT NULL,        PRIMARY KEY (address_book_id),        KEY idx_address_book_customers_id (customers_id)     );      However, Its not working, the plugin does create tables just like on a regular wordpress but not on each blog on the multisite environment. Please help!


Group Posts By Custom Meta Value: Date

I have a post with a custom meta value which is populated via a jQuery datepicker and it gets stored in the following format: yyyy/mm/dd - is there a way I can group all posts from the same day together easily? I'm not using Wordpress's publish date, as I need to have future posts published. I know using the function 'the_date()' will by default in Wordpress only show the date once per x amount of posts, giving the appearance they're grouped. Is there anything that does something similar with a custom meta date value?


Turn post into simple slideshow

I'm new to WordPress development, but I've coded a template page for a friend. I'm trying to convert the following html into a single post:

                 This is the title ▶

Cum sociis natoque penatibus et magnis dis parturient montes,               nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque               eu, pretium quis, sem

Nulla consequat massa quis enim. Donec pede justo, fringilla vel,               aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut,               imperdiet a, venenatis

      However, I am not sure where to begin. The loop in the `index.php` seems far too simple for this kind of customisation. Am I missing something?


Get Core Functionality from Within a (Secondary) Plugin File

I have a plugin with the following structure:               myplugin.php        includes/authentication.php      I can access core WordPress functionality inside myplugin.php fine, but when I try to access stuff such as `add_action('init', 'myaction')` inside authentication.php, I receive a PHP error. I tried including the WordPress wp-load.php file in order to gain core functionality, but the WordPress repository doesn't accept plugins that load wp-config or wp-load files. What is the best way to proceed in this situation and why don't I have access to core WordPress functions from a plugin that is loaded.


What is/are the best thing(s) I can do to make my WordPress blog more popular?

What are the best things that I can do to get my Wordpress blog out there? What are good plugins that I can use to get listed in Googles search? Is there anything/anywhere else I can register my Wordpress blog to attract more visitors?


How is a URL getting mapped to a page template

While I was on vacation, a contractor has done some work on a charity website which I created and own as a volunteer. He has added a 'landing page' www.mydomain.com/xxxxx and has a landing page consisting of HTML and no php in the theme directory named 'landing.php'. There does not appear to be a page named xxxxx and I don't believe that there is any plugin helping with the mapping of url to page template. Maybe I'm being stupid and naiive on this but can anyone enlighten me as to how an access to www.mydomain.com/xxxxx gets mapped to use the landing.php template. I thought that I knew Wordpress pretty well but this very basic question has me completed stumped. I've been through pretty much all of the options on the dashboard (including permalinks) but can't see any obvious mapping mechanism. Can anyone tell me where my blind spot might be, please ? From Settings->Reading Front Page Displays : Your Latest Posts Not sure any of the other items are important. Landing.php is here               <?php          /**      * Template Name: Landing Page      * Description: A Page Template that is Landing Page      *      * @package WordPress      * @subpackage Twenty_Eleven      * @since Twenty Eleven 1.0      * Created By : Sanjay Dhameliya      */     ?>


Wordpress in sub directory wp-admin problem

I have WordPress 3.3.1 installed in a sub directory on my site just to use as a staging test site. It seems the root sites `.htaccess` is creating problems for Wordpress wp-admin page. I've set the `WordPress Address (URL)` and `Site Address (URL)` to point correctly to the sub directory url. If I haven't got any `.htaccess` inside my subdirectory (wp root) = wp admin (login page) works. If I add a `.htaccess` like below, the page works and if you are logged in to wp-admin it sort of works **BUT** every time you try to save something = blank page, if you **aren't** logged in and try to login = blank page.               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /subcataloged/cliens-wp/          RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      # Summary: [.htaccess in wp root (www.domain.com/sub/cat/)] == Site (except wp-admin) works as expected. [No htaccess] == Site CSS, images, js is rewritten incorrectly to the root folders, Wp-admin works fine. How can I solve this? Is there a `.htaccess` for WP 3.3.1 I can use? This is my `.htaccess` for my **OTHER WEB ROOT** site (not WP):               Header unset Pragma     FileETag None     Header unset ETag          # cache images/pdf/css/js docs for 10 days = 864000, 31536000 = 1 year     <FilesMatch "\.(ico|pdf|jpg|jpeg|png|gif|js|css)$">       Header set Cache-Control "max-age=31536000, public, must-revalidate"       #Header unset Last-Modified     </FilesMatch>          # cache html/htm/xml/txt diles for 2 days     <FilesMatch "\.(html|htm|xml|txt|xsl)$">       Header set Cache-Control "max-age=7200, must-revalidate"     </FilesMatch>          #Gzip     <ifmodule mod_deflate.c>     AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/javascript text/css application/x- javascript application/javascript image/x-icon     </ifmodule>     #End Gzip               # -FrontPage-     RewriteEngine on     RewriteBase /          #Gamla sidor gör rewrite till nya:     RewriteRule ^nyheter/$ %{SCRIPT_URI}senaste-projekt/ [R]     RewriteRule ^webben/$ %{SCRIPT_URI}tips-for-webben/ [R]     ###          RewriteRule ^utvalda-projekt/$ / [L]     RewriteRule ^senaste-projekt/$ %{SCRIPT_URI}index.php [L]     RewriteRule ^webbportfolio/$ %{SCRIPT_URI}views/webbport.php [L]     RewriteRule ^universitetet/$ %{SCRIPT_URI}views/uniport.php [L]     RewriteRule ^kontakta-mig/$ %{SCRIPT_URI}views/kontakt.php [L]          RewriteRule ^presentation/$ pres.php [L]     RewriteRule ^tips-for-webben/$ webben.php [L]     RewriteRule ^CV/$ views/cv.php [L]     RewriteRule ^CV-en/$ views/cv_en.php [L]          RewriteRule ^goeco/$ goeco.php [L]     RewriteRule ^eld/$ fire.php [L]     RewriteRule ^movie-night/$ movienight/ [R]               RewriteRule ^webbtutorials/$ tutorials.php [L]     RewriteRule ^sokhjalp/$ search.php [L]     RewriteRule ^valj_ratt_webblasare/$ valja_webblasare.php [L]     RewriteRule ^mina_bloggar/$ blog.php [L]          RewriteRule ^(.*)/lightbox/css/(.+)$ %{SCRIPT_URI}/lightbox/css/$2 [R]     RewriteRule ^(.*)/lightbox/js/(.+)$ %{SCRIPT_URI}/lightbox/js/$2 [R]     RewriteRule ^(.*)/portfolio/(.+)$ %{SCRIPT_URI}portfolio/$2 [R]     RewriteRule ^(.*)/css/(.+)$ %{SCRIPT_URI}css/$2 [R]     RewriteRule ^(.*)/img/(.+)$ %{SCRIPT_URI}/img/$2 [R]     RewriteRule ^(.*)/grafik/(.+)$ %{SCRIPT_URI}/grafik/$2 [R]     RewriteRule ^(.*)/js/(.+)$ %{SCRIPT_URI}/js/$2 [R]     RewriteRule ^(.*)/uni_portfolio/(.+)$ %{SCRIPT_URI}/uni_portfolio/$2 [R]     RewriteRule ^(.*)/dokument/(.+)$ %{SCRIPT_URI}/dokument/$2 [R]          IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*          <Limit GET POST>     order deny,allow     deny from all     allow from all     </Limit>     <Limit PUT DELETE>     order deny,allow     deny from all     </Limit>


My sub-directory with another wordpress website uses the primary theme

I have a website http://www.mesotheliomalawfirmattorneys.com/ and I have a subdirectory which is http://www.mesotheliomalawfirmattorneys.com/memes/ witha different theme, but if I click on one of the posts in the subdirectory it uses the primary theme and I get a 404 any help would be greatly appreciated


How To Create a Meta Box with Html Content with Instructions to Site Editors When Editing a Post or Page?

I would like to add a custom Meta Box with Html content in the screens New and Edit Posts/Pages (`/wp-admin/post.php?post=POST_ID&action=edit`), so that I could display a list of editorial guidelines for my editors to follow. Or, even better, is there a plugin to do this so that I don't have to go into the code every time we want to edit these guidelines?


Custom shortcode breaks my page

Okay so I'm trying to create a wordpress shortcode called chapter, i.e. `[chapter]text[/chapter]`. What this does is it first checks if the content entered is already in the database, if it's not it will add it to the database and will also add a count to another table. Then it outputs this in a div This is the code I have               function chapters( $atts, $content ) {         $postid = get_post($my_id);              $result_chaptertitle = mysql_query("SELECT * FROM ltd_chapters_titles WHERE chaptertitle='$content' AND postid='$postid'");         $num_rows_chaptertitle = mysql_num_rows($result_chaptertitle);              $result_chaptercount = mysql_query("SELECT * FROM ltd_chapters WHERE postid='$postid'");         $num_rows_chaptercount = mysql_num_rows($result_chaptercount);              if ($num_rows_chaptertitle == 0) {             mysql_query("INSERT INTO ltd_chapters_titles (postid, chaptertitle) VALUES ('$postid','$content')");         }              if ($num_rows_chaptercount == 0) {             mysql_query("INSERT INTO ltd_chapters (postid, chapter) VALUES ('$postid', 1)");         } else {             mysql_query("UPDATE ltd_chapters SET chapter=chapter+1 WHERE postid='$postid'");         }              $chaptercount = mysql_query("SELECT chapter FROM table WHERE postid='$postid'");              mysql_query("UPDATE ltd_chapters SET count='$chaptercount' WHERE postid='$postid' AND chaptertitle='$content'");              return '

'.$content.'

';          }     add_shortcode('chapter', 'chapters');      When I apply this in a post, the entire content of the post doesn't show up on the page and everything afterwards isn't rendered as well (so no footer etc.) However the div that the `the_content();` is in is closed of like it should though Can anyone offer me any insight into what I have been doing wrong? I'm pretty new to PHP


Templates have disappeared from drop down lists

I think this happened when I upgraded to 3.4, or it might have happened more recently. The template drop down list is now missing most of my templates. Pages that were using the templates are still working but when I go to edit the page the drop down says 'Default template' and the template it is currently using is not shown in the drop down box. does anyone have any ideas why they disappeared or what I can do to get them back?


BuddyPress - Search members by name and also by username

Im trying to find a way to set the members search by name and also by username. Now it seems to search only by name. Thanks in advance.


How to create new category for custom post type?

I have create a custom post type named "jobs", and I want to create a set of category for that, ie like "PHP Jobs", "Python Jobs" etc.               $args = array(         'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'show_ui' => true,          'show_in_menu' => true,          'query_var' => true,         'rewrite' => true,         'capability_type' => 'post',         'exclude_from_search' => false,         'has_archive' => true,          'hierarchical' => false,         'menu_position' => 2,         'taxonomies' => array( 'post_tag', "category"),         'menu_icon' => WJ_PLUGIN_URL .'/images/admin_menu_icons.png',       );          register_post_type('jobs', $args);      But this is nt listing that category or I can't assign a new post to that category. While `$post = wp_insert_post( $post, false );` I tried this also.               $args = array(     ..     ..     ..     'taxonomies' => array( 'post_tag', "job_category"),           register_taxonomy( 'job_category', 'jobs', array( 'hierarchical' => true, 'label' => 'Jobs Categories', 'query_var' => true, 'rewrite' => true ) );      No effect.


Adding guestbook to my wordpress site

I´m trying to add something like a guestbook, where the user can write about our services, something like comments with few more content like country, facebook page... should i do this with a single page extending the default comments using with wordpress or i have to add a new content type? How can i give the user permission tu publish without register?


Custom Post Type URL doesn't work anymore

Suddenly one of my custom post types stopped working properly. More precisely, I have a custom post type called Apps where I have a few posts. Everything was working properly until I've created a new taxonomy using a plugin, then I've imported about 2-300 terms using an array in `functions.php` and then I've created a custom template for that taxonomy. Right after, the Apps posts couldn't be accessed anymore - even if nothing changed to them, the URL doesn't work, I get a Page Not Found error. I reverted back to the original settings - delete the new taxonomy and terms, disable plugin, but I still get a 'page not found' error when I try to access the Apps posts. You can see the behavior on this website.


Taxonomy/Custom post type structure suggestion on a movie site

I am building a movie database site and I am wondering in a problem and asking how should I solve this problem. I have several custom post types `movie`, `actor`, `person` and others. I want to integrate **award** feature for movies and actors. So I'll be able to assign awards to a movie. Now, when I am assigning an award to a movie, there are several fields:   * Award Name (e.g: oskar, mtv movie award, etc)   * Year (which year the award was given)   * Category (which category, e.g: Best Actor, Best song etc)   * Receipents (which `actors`, `person` (custom post type) won the prize ) So, I should be able to browse to a `movie` and see the award info (example). If I go to a particular `award`, I should be able to see the awards by year. If I go to a `actor` or `person` profile, I should be able to see which awards they got in which year. Now help to structure the **_custom post type_** / **_custom taxonomy_** assignments. How should I assign the awards?


Theme Option fields not showing

This is my theme option code link. Why can't I see my fields?. I got this tutorial from WordPress Premium Theme Admin Part 2. I don't want tab in this theme option, so what are codes here, I need not to mention?               //create custom admin menu's     // add the main menu      add_action('admin_menu', 'my_theme_menu');      function my_theme_menu(){          // the settings          $page_title = "My Themes Admin";          $menu_title = "Theme Settings";     /*     * Please not that this changed in the latest wordpress     * versions from a number to words for user capabilities.     * This would of been 7 but now you should use 'administrator'.     */     $capability = 'administrator';          $menu_slug = "theme-settings";          $function = "main_theme_menu_plugin";          $icon_url = ""; // could be anything jpg, png, gif          $position = '5';          add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); // create the menu          }          wp_enqueue_script( 'jquery' );  //this code here  enables jquery          // Here we add the jQuery UI script to our theme header          wp_register_script( 'jquery-ui-script', plugins_url('/js/jquery-ui-1.8.16.custom.min.js', __FILE__)); //this part registers the new script          wp_enqueue_script( 'jquery-ui-script' ); //this part puts the script in to our page header          // Here we add the jQuery UI theme Css to our header     $myThemeStyleUrl = plugins_url('/css/ui-lightness/jquery-ui-1.8.16.custom.css', __FILE__); //set the path to our css          wp_enqueue_style('jquery-ui-style', $myThemeStyleUrl,'1.0','screen'); // this puts the css in the header          // Here we add the code that enables the tabbed menu     add_action('admin_head', 'enableTabMenu_plugin');          function enableTabMenu_plugin(){      ?>                    <?php          }          function main_theme_menu_plugin() {          // Social Settings Page     function socialSettings(){          $social = '
' . settings_fields( 'ty-option-group' ) . '
Social Settings

<form action="" method="post" name="socialform">Facebook: <input id="facebook" type="text" name="facebook" value="' .  get_option('ty-facebook') . '" />           Twitter: <input id="twitter" type="text" name="twitter" value="'. get_option('ty-twitter') .'" />           LinkedIn: <input id="linkedin" type="text" name="linkedin" value="' . get_option('ty-linkedin') .'" />           Flickr: <input id="flickr" type="text" name="flickr" value="'. get_option('ty-flickr') .'" />           Skype: <input id="skype" type="text" name="skype" value="'. get_option('ty-skype') .'" />           <input id="social-button" class="button-primary" style="margin-top: 10px;" type="button" value="Save Social" />     </form>

     ';          return $social;     }          // Save Social Settings Data      add_action('wp_ajax_slider_my_action', 'saveSocialSettings'); //ajax callback     function saveSocialSettings() {         // set default values         if(get_option('ty-facebook') == ""){                  update_option( 'ty-facebook', 'Facebook URL...');              }              if(get_option('ty-twitter') == ""){                  update_option('ty-twitter', 'Twitter URL...');              }              if(get_option('ty-linkedin') == ''){                  update_option('ty-linkedin', 'Linkedin URL...');              }              if(get_option('ty-flickr') == ''){                  update_option('ty-flickr', 'Flickr URL...');              }              if(get_option('ty-skype') == ''){                  update_option('ty-skype', 'Skype URL...');              }              // Save data to option fields         if(! empty($_POST)){                  $facebook = $_POST['ty_facebook'];             $twitter = $_POST['ty_twitter'];             $linkedin = $_POST['ty_linkedin'];             $flickr = $_POST['ty_flickr'];             $skype = $_POST['ty_skype'];                  // save the form values to the option fields             update_option( 'ty-facebook', $facebook);             update_option( 'ty-twitter', $twitter);             update_option( 'ty-linkedin', $linkedin);             update_option( 'ty-flickr', $flickr);             update_option( 'ty-skype', $skype);              }          }     }


Getting "Invalid argument supplied for foreach()" Warning

I am on the last step in a tutorial that I followed here , called "Using the data". I tried using//               $album_repeatable = unserialize($post_meta_data['album_repeatable'][0]);               echo '[ul class="album_repeatable"]';               foreach ($album_repeatable as $string) {                   echo '[li]'.$string.'[/li]';               }               echo '[/ul]';      But I get the Warning as stated in Question Title// " _Warning: Invalid argument supplied for foreach()_ " What exactly is the issue here?


WP_Query or get_posts?

When using the 'fields' => 'ids' parameter, is it better to create a new WP_Query in the code below rather than doing get_posts? How would the loop look if I used WP_Query?               function myplugin_delete_image_items( $postid ) {              $args = array(             'post_type'     => 'myplugin_image_item',              'cache_results' => false,   // Disable caching, used for one-off queries             'no_found_rows' => true,    // We don't need pagination, so disable it             'fields'        => 'ids',   // Returns post IDs only             'meta_query'    => array(                                     array(                                     'key'     => 'myplugin_image_id',                                     'value'   => $postid,                                     'compare' => 'LIKE'                                      )             )                            );              $image_item_ids = get_posts( $args );          foreach( $image_item_ids as $image_item_id )  {                           $purge = wp_delete_post( $image_item_id, true ); // delete the image item, skipping trash             }         wp_reset_postdata();     }


Scheduling posts via sql

I got 10k posts with dates that are in the future. I imported my posts as a draft cause it seems quicker. I have used phpmyadmin to set the status of the posts to future with this sql command: `UPDATE wp_posts SET post_status = 'future' WHERE post_status != 'static';` The problem is when I go look at my posts they all say missed schedule when the date hasn't gone past yet! Is there any fix to fix the scheduling?


updating one custom meta field only

i am trying to update only one custom field that is store in serialized form. By updating that field my other custom meta fields becomes blank/empty. how can i update only a specific meta value inside the serialized data.               update_post_meta( $pId, 'my_meta', $new_data );      Many Thanks,


Ubuntu 12.04, Nginx and MySQL issue with Wordpress Database

Twice I installed a fresh LEMP Ubuntu 12.04 instalation on my server and started to build a wordpress site on my VPS following This tutorial. Now, for the second time, after a while I can't write do anything (write posts, update configurations, etc) because I get timeouts. My resources are: 512 mb Ram, 1 CPU and 20gb of SSD. I'm running on Ditital Ocean. I tried to fix it but couldn't find any similar issues around, but I suspect the problem has to do with the database because I can still update plugins, which does only add files to the folders that already exists. The weird thing is that both times I had everything working perfectly and all of a sudden I started to get these problems. Last time the site even stopped working and the screen only showed that the site was Temporarily Unavailable. Do you know what can have happend to get to this stage? Thank you!


Template redirect template loaded, but the header 404

I've created a template redirect for a given url, ex.: test.com/test Test is page is not exists, i'm just checking the url from query_vars, if its match, i load the template with               include(file.php);     exit;      **The page loads and show what i expect, but the title is Page not found.** I solve this with a filter, but i saw that the whole page comes with a 404 status. Btw i saw that the builtin multisite activation message also has a 404 header. (I'm working on localhost.) How can i solve this without creating the page itself in wp?


Custom post type pagination - always return first page

I have custom post template archive-product.php for custom post type "product". In this template paging does not work:   * numbers are displayed   * all numbers links redirect to first page                  <?php if (($numParent) == 4) {?>              do stuff              <?php } elseif (($numParent) == 3) {                   $paged = 1;               if ( get_query_var('paged') ) $paged = get_query_var('paged');               if ( get_query_var('page') ) $paged = get_query_var('page');              query_posts = array('post_parent'=> $post->ID, 'post_type'=>'product','paged' => $paged, 'posts_per_page' => 10);              while ( have_posts() ) : the_post();?>                      do stuff                  <?php endwhile; ?>             <?php if ( function_exists( 'wp_pagenavi' ) ) {                 wp_pagenavi();             };          } endif;?>      How to fix paging?


front page won't change templates

I have tried changing the template of the attached page and changing which page is attached as the home page, no effect for either. The front page remains the same. I am at my wits end with this one!!


User Meta stuff

Ok I am trying to make a page the list user meta. http://pastebin.com/rw1t7Mgp The part I am stuck on is `$our_children = get_user_meta ($user_id,"our_children");` it is a meta field with an array in it. `a:1:{i:0;a:2:{s:4:"Name";s:6:"Elisha";s:3:"Age";s:2:"13";}}` How do I display the data in that array? `//foreach ( $our_children as $children ) { echo '<tr><td>'. $our_children-> Name .'</td><<td>'. $our_children-> Age .'</td></tr>'; //}` Doesn't seem to work?


How to make affiliate links show up in profile area

I have created a memberships site that is offering four different programs in it which people are able to put their own id for each program in.   What I want to achieve is to create a custom field to be called and displayed to their links to their referrals. Any ideas on the code for this would be greatly appreciated.


remove post and categories/tags count from right now dashboard widget

I know it is easily possible to add a post-type count for a custom post type to the right now dashboard widget. However I wonder if it is also possible to remove stuff from this widget. E.g. I don't have normal posts on my current wordpress site and I don't need the count to say 0 posts and 0 categories and 0 tags all the time. Is it possible to remove those counts?


Pagination not working on template page

I have the following code, but it is not working.               if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }                         elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }                         else { $paged = 1; }              query_posts( array(   'post_type' => 'custom_news',                                'post_status' => 'publish',                               'posts_per_page' => 5,                               'offset'=>1,                               'tax_query'=>array(                                                   array(                                                           'taxonomy' => 'news_catalog',                                                           'field' => 'slug',                                                           'terms' =>$slug2                                                       )                                                 ),                               'paged' => $paged                           )                   );
              <?php         global $wp_query;                    if (  $wp_query->max_num_pages > 1 ) : ?>
                           <?php                    global $wp_rewrite;                   $pagination_args = array(                  'base' => @add_query_arg('paged','%#%'),                  'format' => '',                  'current' => max( 1, get_query_var('paged') ),                  'total' => $wp_query->max_num_pages,                  'prev_text'=>'Atgal',                  'next_text'=>'Toliau',              );                 if( $wp_rewrite->using_permalinks() )               $pagination_args['base'] = user_trailingslashit( trailingslashit( remove_query_arg('s',get_pagenum_link(1) ) ) . 'page/%#%/', 'paged');                        if( !empty($wp_query->query_vars['s']) )               $pagination_args['add_args'] = array('s'=>get_query_var('s'));                 echo paginate_links( $pagination_args ); ?>
                                  <?php endif;          wp_reset_query();         ?>
      Any suggestions to why it is not working Here is the full template page code, check if you can help me out:               <?php           /*          Template Name: Catalog Page Listings          */          ?>          <?php ob_start(); get_header(subpage); ?>          <?php include(TEMPLATEPATH."/sidebar_left.php");?>          <?php global $wp_query;          $post_id = $wp_query->post->ID ;          $post = get_post( $post_id );          $slug = $post->post_name;           $slug2 = $post->post_name;           if($slug =='ligu-gydymas'){              ?> <?php              $slug='ligu-gydymas' ;              $slug2='homeopatijos-ligu-gydymas' ;              }else if($slug=='mityba-2'){                  ?><?php                  $slug='mityba';                  $slug2='mityba';                          }else if($slug=='dieta-2'){                  ?><?php                  $slug='dieta';                  $slug2='dieta';                       }else if($slug=='sportas-2'){                  ?><?php                  $slug='sportas';                  $slug2='sportas';                  ?><?php                          }else if($slug=='psichologija'){                  ?><?php                  $slug='psicholigija-sveika-gyvensena';                  $slug2='psicholigija-sveika-gyvensena';                       }else if($slug=='auklejimas'){                  ?><?php                  $slug='vaiku-prieziura-ir-auklejimas';                  $slug2='vaiku-prieziura-ir-auklejimas';                       }else if($slug=='patarimai'){                  ?><?php                  $slug='mamoms-patarimai';                  $slug2='mamoms-patarimai';                        }else if($slug=='veido-prieziura-2'){                  ?><?php                  $slug='grozis';                  $slug2='veido-prieziura';                         }else if($slug=='kuno-prieziura-2'){                  ?><?php                  $slug='kuno-prieziura';                  $slug2='kuno-prieziura';                          }else if($slug=='intymu-2'){                  ?><?php                  $slug='intymu';                  $slug2='intymu';                          }else if($slug=='idomybes-2'){                  ?><?php                  $slug='idomybes';                  $slug2='idomybes';                        }else if($slug=='patarimai-2'){                  ?><?php                  $slug='verta-zinoti';                  $slug2='verta-zinoti';                        }else if($slug=='homeopatija-siandien'){?>                  <?php }                  else if($slug=='maisto-papildu-reiksme'){?>                  <?php }                  else if($slug=='gyvenimo-budas' || $slug=='manksta-online'){?>                  <?php }                  else if($slug=='planavimas' || $slug=='nestumas' || $slug=='gimdymas' || $slug=='po-gimdymo' || $slug=='vaiko-psichologija' || $slug=='vaiku-ligos' || $slug=='vaiku-mityba' || $slug=='auklejimas' || $slug=='seima' || $slug=='patarimai' || $slug=='laisvalaikis'){?>                  <?php }                  else if($slug=='plauku-prieziura' || $slug=='ranku-prieziura' || $slug=='koju-prieziura' || $slug=='odos-prieziura' || $slug=='stilius'){?>                  <?php }                  else if($slug=='lytiskai-plintancios-ligos'){?>                  <?php }                  else if($slug=='kiti-gydymo-budai' || $slug=='naujienos' || $slug=='fitoterapija'){?>                  <?php }                                                            ?>

<?=$post->post_title ; ?>

                               <?php query_posts( array( 'post_type' => 'custom_news',               'post_status' => 'publish','posts_per_page' => 1 ,                  'tax_query'=>array(array(                      'taxonomy' => 'news_catalog',                      'field' => 'slug',                      'terms' =>$slug)))); ?>            <?php if ( have_posts() ) :  while ( have_posts() ) : the_post(); ?>

                             <?php $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>                             <?php if ($thumb == '') $thumb = catch_that_image(); ?>                         <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">                 <img  src="<?php echo catch_filter_image(get_the_ID()) ; ?>" />
<a href="<?php the_permalink() ?>" rel="bookmark"> <?php the_title(); ?>

<?php the_content_limit("250",""); ?>

          <?php      endwhile;      endif;      wp_reset_query();     ?>

           <?php       /////////////////////test//////////////////////////test////////////////////////test//////////////////////////test////////////////////      // Define custom query parameters      $custom_query_args = array(   'post_type' => 'custom_news',                            'post_status' => 'publish',                           'posts_per_page' => 1,                           'offset'=>1,                           'tax_query'=>array(                                               array(                                                       'taxonomy' => 'news_catalog',                                                       'field' => 'slug',                                                       'terms' =>$slug2                                                   )                                             ),                           'paged' => $paged                       );     // Get current page and append to custom query parameters array                    $custom_query_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;     // Instantiate custom query     $custom_query = new WP_Query( $custom_query_args );     // Pagination fix     $temp_query = $wp_query;     $wp_query   = NULL;     $wp_query   = $custom_query;         // Output custom query loop     if ( $custom_query->have_posts() ) {         while ( $custom_query->have_posts() ) : $custom_query->the_post();            echo get_the_title();         endwhile;     }     // Reset postdata     wp_reset_postdata();                   // Custom query loop pagination     previous_posts_link( 'Older Posts' );     next_posts_link( 'Newer Posts', $custom_query->max_num_pages );     // Reset main query object     $wp_query = NULL;     $wp_query = $temp_query;                       /////////////////////test//////////////////////////test////////////////////////test//////////////////////////test////////////////////                                                     if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }                     elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }                     else { $paged = 1; }          query_posts( array(   'post_type' => 'custom_news',                            'post_status' => 'publish',                           'posts_per_page' => 5,                           'offset'=>1,                           'tax_query'=>array(                                               array(                                                       'taxonomy' => 'news_catalog',                                                       'field' => 'slug',                                                       'terms' =>$slug2                                                   )                                             ),                           'paged' => $paged                       )               );      ?>            <?php if ( have_posts() ) :  while ( have_posts() ) : the_post(); ?>
                             <?php $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>                             <?php if ($thumb == '') $thumb = catch_that_image(); ?>                              <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">                           <img class="thumbnain_img_size"  src="<?php echo catch_filter_image(get_the_ID()) ; ?>" />
<a href="<?php the_permalink() ?>" rel="bookmark"> <?php the_title(); ?>

<?php the_content_limit("50",""); ?>

                    <?php      endwhile;     endif;      ?>

     <?php //posts_nav_link( ' | ', '<<Prev', 'Next>>' ); ?>
          <?php     global $wp_query;                if (  $wp_query->max_num_pages > 1 ) : ?>
                       <?php                global $wp_rewrite;               $pagination_args = array(              'base' => @add_query_arg('paged','%#%'),              'format' => '',              'current' => max( 1, get_query_var('paged') ),              'total' => $wp_query->max_num_pages,              'prev_text'=>'Atgal',              'next_text'=>'Toliau',          );             if( $wp_rewrite->using_permalinks() )           $pagination_args['base'] = user_trailingslashit( trailingslashit( remove_query_arg('s',get_pagenum_link(1) ) ) . 'page/%#%/', 'paged');                    if( !empty($wp_query->query_vars['s']) )           $pagination_args['add_args'] = array('s'=>get_query_var('s'));             echo paginate_links( $pagination_args ); ?>
                              <?php endif;      wp_reset_query();     ?>
          Reklama
                               <?php query_posts( array( 'post_type' => 'custom_ads',               'post_status' => 'publish','posts_per_page' =>3,'offset'=>8,                  'tax_query'=>array(array(                      'taxonomy' => 'Ads_catalog',                      'field' => 'slug',                      'terms' =>'image')))); ?>            <?php if ( have_posts() ) :  while ( have_posts() ) : the_post(); ?>                                         <a target="_blank" href="<?= get_post_meta(get_the_ID(),'ads_url',true); ?>"> <img width="120" height="60"  src="<?= bloginfo('template_url')."/media/ads/".get_post_meta(get_the_ID(),'ads_img_thmb',true); ?>">                                <?php endwhile; endif; ?>           <?php wp_reset_query(); ?>

                              <?php include(TEMPLATEPATH."/sidebar_right.php");?>           <?php get_footer(); ?>


Showing Post Counts of One's (Author) Own in the admin post list

How can I show user's post counts of one's (Author) own in the admin post list (edit.php) instead of all post count of the system? like published (10), Draft (5) ... of his own or logedin user. Thanks in advance.


Custom Post Type, Custom Columns List

I've basically done a full plugin and now just "prettifying" it sort-of. One thing I'm doing is re-doing the columns for listing the "posts" I made. This part is fine, and all columns are replaced as needed, however, there's one column that puzzles me.. the title field. :/                   add_action( 'manage_posts_custom_column', array( &$this, '_wp_filter_visitor_column_view' ) );         add_filter( 'manage_edit-visitor_columns', array( &$this, '_wp_filter_visitor_columns' ) );              public function _wp_filter_visitor_column_view( $column )         {             global $post;             if ( $column == "title" )             {                 $name = get_post_meta( $post->ID, 'v_f_name', true );                 $name .= ' ' . get_post_meta( $post->ID, 'v_l_name', true );                 echo $name;             }             elseif ( $column == "type" )             {                 echo "Not available right now...";             }             elseif ( $column == "loggedin" OR $column == "workstation" )             {                 $workstation = get_post_meta( $post->ID, 'v_workstation', true );                 if ( $column == "workstation" ) echo $workstation;                 elseif ( $column == "loggedin" ) echo ( !empty($workstation) OR !isset( $workstation ) ) ? 'No' : 'Yes';             }             elseif ( $column == "id" )             {                 echo get_post_meta( $post->ID, 'v_id', true );             }         }              public function _wp_filter_visitor_columns( $columns )         {             $columns = array(                     'cb' => '<input type="checkbox" />',                     'title' => 'Name',                     'type' => 'Type',                     'loggedin' => 'Logged In?',                     'id' => 'Visitor ID',                 );                  return $columns;         }      The column header for "title" => "Name" appears properly, but the column data displays the default title of "Auto Draft" because I'm not using the post's title field. Do I need to the post's title field for custom post types or will auto-generated titles suffice? I have no need for the title field and would rather use the postmeta table for storing my data. -Zack P.S. I was following this tutorial for creating the columns.


Target pages using a specific page template

I need to target all pages using a specific page template with a conditional tag (like is_page()). Anyone done something like that before?


Custom page template, not acting as page

I have defined several page templates on my site http://178.21.128.82/. When I set my pages to use one of these page templates, wordpress seems to stop treating it as a page:   * It is not accepted in the is_page() conditional tag   * The body class "page" is not present (instead its showing "home"). Only when I use the default page template for my pages they are truly treated as a page by wordpress. Anyone got a clue what´s going on? Thanks! Added:               query_posts('meta_key=wpfp_favorites&orderby=meta_value');          if ( have_posts() ) : while ( have_posts() ) : the_post();         $start = get_post_meta($post->ID, '5Start', true);         $stop = get_post_meta($post->ID, '6Slutt', true);              if(is_active($start, $stop)) {              $offer = print_offer($post->ID, $start, $stop);             echo $offer;         }          endwhile;     endif;


Link to post meta page (like WordPress does for categories)

I've got a few different categories, and each has it's own page. And obviously WordPress automatically links to the category template page: `category.php`. However, is it possible to do this with custom post meta? I need to get all posts with a certain meta, and show them as if it's a category page (with it's own URL). Here is the example of the array I'm using, for the WP_Query. It gets all posts with a `meta_value => 'top-yes'`:               $top_category =         array(         'posts_per_page' => 3,         'post_type' => 'post',         'meta_key' => 'top-radio',         'meta_value' => 'top-yes',         'post_status' => 'publish',         'orderby' => 'date',         'order' => 'DESC'     );      Can I link to a custom template, and can WordPress generate it's own URL, like it does with categories? `(http://site.com/post-meta/post)`


Salesforce lead tracking with contact forms plugins

I am using Contact Form 7 on my website and would like to integrate Salesforce lead tracking with it. I was able to add a hidden field with my oid as suggested on this site But when I submit the contact form after adding this, it just gets stuck and never actually returns. As soon as I remove the hidden field, it starts working fine. Has anyone been able to integrate the lead tracking system with Wordpress Contact Form plugins? I also tried using cform with the instructions provided here. But this gives a warning that fopen failed. I assume thats because fopen does not allow write operations with HTTP wrappers. Not sure how the author managed to get it working! Would appreciate any help on this! I do not want to use the salesforce Web-to- lead form. Thanks.


Applying my own css classes in wp_menus 3?

Have this function :               class my_walker extends Walker_Nav_Menu {                  function start_el(&$output, $item, $depth, $args) {                      global $wp_query;                 $indent = ( $depth ) ? str_repeat("\t", $depth) : '';                      $class_names = $value = '';                      $classes = empty($item->classes) ? array() : (array) $item->classes;                 $classes[] = 'menu-item-' . $item->ID;                      $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item));                 $class_names = ' class="' . esc_attr($class_names) . '"';                      $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args);                 $id = strlen($id) ? ' id="' . esc_attr($id) . '"' : '';                      $output .= $indent . '<li' . $id . $value . $class_names . '>';                      $attributes = !empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) . '"' : '';                 $attributes .= ! empty($item->target) ? ' target="' . esc_attr($item->target) . '"' : '';                 $attributes .= ! empty($item->xfn) ? ' rel="' . esc_attr($item->xfn) . '"' : '';                 $attributes .= ! empty($item->url) ? ' href="' . esc_attr($item->url) . '"' : '';                      $item_output = $args->before;                 $item_output .= '<a' . $attributes . '>';                 $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;                 $item_output .= '</a>';                 $item_output .= $args->after;                      $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);             }              }      I need to add my own counter instead of item->ID to add $myCounter(that will increment). This :               $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args);      To this :               $id = apply_filters('nav_menu_item_id', 'menu-item-' . $myCounter, $item, $args);      I want to adjust to crazy css menu.How can I do this? Thanks in advance.


localhost redirect to old url

I am using mamp and recently i needed to have multisite functionality enabled. WordPress showed me error to change it from localhost:8888 to localhost which i did. After that i also updated the wp_option entry too in site_url and home_url. But now whenever i do localhost/mysite, it does to localhost:888/mysite .I tired clearing history but nothing happened. What can be wrong and how do i fix it?


FTP Username and password wrong while installing theme

I followed Failed to connect to FTP Server 127.0.0.1/:21 And was able to solve that problem. But now when I try to upload the theme then I get username and password failure. I have added following lines in wp-config.php               define( 'FS_METHOD', 'ftpext' );     define( 'FTP_BASE', '/var/www/wordpress/' );     define( 'FTP_CONTENT_DIR', '/var/www/wordpress/wp-content/' );     define( 'FTP_PLUGIN_DIR ', '/var/www/wordpress/wp-content/plugins/' );     define( 'FTP_USER', 'username' );     define( 'FTP_PASS', 'password' );     define( 'FTP_HOST', 'localhost' );     define( 'FTP_SSL', false );      How I can resolve this problem?![enter image description here](http://i.stack.imgur.com/Q31pt.png) **UPDATE** : I tried this link and removed all values for ftp which are in wp-config.php But still same error.


Microsoft Word documents to Wordpress pages adding paragraph tags

I have read through a variety of different questions here and on Google. I think my question has an answer that I do not want. Anyways, I have been given 10 or so different documents with a fair amount of formatting within each. Each page needs to be given `<p> </p>`. I fear that the solution is simply coding each and every line. Very tedious but the WordPress paste into doesn't cut it. Anyone found any good solutions?


Change login CSS

Is there a filter or something that would remove: `html,body {height:100%;}` declaration in the login page? I have made a custom login page and the `html, body {height: 100%;}` is conflicting in my style. Wordpress loads the `html,body {height:100%;}` declaration from wp-admin/css/wp-admin.css and I would like to keep the wp-admin.css file intact. I cannot override the function with `height: auto;` If there is a better way of doing it please tell me :) Update 25.07.2013 html,body `{height:auto;}` Will not work somehow I have to remove it completely.


display custom field from inner blog in the main homepage of wordpress multisite

I'm using wordpress MU network and I have the main site and all the inner blogs. as people may know it is very hard in wordpress MU to make "relationship" between the main site and the inner blogs. also there is not enough information and soutions on the web regarding wordpress MU unfortunately. (also posted this question and no one ever responded) anyway, in order to display some values from the inner blogs in the main site's homepage I had to use this plugin: http://wordpress.org/plugins/wordpress-mu-sitewide-tags/ which does pretty nice work but not perfect. anyway, what I am trying to accomplish is to create a simple custom field, use it in the post editor of one of the # inner # blogs and display the value in the main site's homepage.. does anyone know how to do it? Thanks


I need to disable responsive feature of a theme called Meet GavernWP

This question is deleted. Actually this question was showing up in my google search results and it was ruining up my seo.


get_category only returning details for 'uncategorized'

I'm using the ACF Taxonomy field add-on to select a category and (hopefully) return details for that category, e.g. slug, title etc.   The custom field `get_field('category_test')` returns the category ID, in this case being `4`, I then want to use this category ID to fetch the category slug in one instance, and the category title in another.      I'm trying this in my functions.php:               function get_cat_slug($cat_id) {     $cat_id = (int)$cat_id;     $category = &get_category($cat_id);     return $category->slug;     }      and calling it in my page.php using `echo get_cat_slug(get_field('category_test'));` but the slug that is being returned is `uncategorized` instead of the category 'test' with the ID of 4. Even trying this `$catinfo = get_category(get_field('category_test'));` returns the array for `uncategorized`, everything I try doesn't seem to work, is there any reason for this? Any suggestions would be greatly appreciated!


Logged out of my wordpress using SSL

I downloaded an SSL plugin and unknowingly locked myself out. Everything I try to log into the admin site, it redirects me. I tried to set up a FTP, using filezilla (this is after I got locked out. I've been doing everything on the wordpress). I don't know how to go on about from here. I don't see any of my plugins in Filezilla ( i am connected). What should i do?


Two searchforms with different categories/posts per page

For a project I'm working on, I need two different searchforms. One is a global searchform that is always visible in the header of the page, that searches everything in the website. The other one however, only appears on a news page, and I need that one to only search for and display posts in the category "news". I use the following code in search.php in order to have two unique searchforms, which is working like intended               if(isset($_GET['search-type'])) {         $type = $_GET['search-type'];         if($type == 'main') {             load_template(TEMPLATEPATH . '/main-search.php');         } elseif($type == 'news') {             load_template(TEMPLATEPATH . '/news-search.php');        }     }      And in functions.php I have this code, which displays 5 posts per page on the search results page which is working and what I want as well               function searchfilter($query) {         if ($query->is_search()) {             $query->set('posts_per_page', 5);         }         return $query;     }     add_filter('pre_get_posts', 'searchfilter');      However, for the second searchform, which is news-search.php, I need that one to only search in the category "news". I heard query_posts() is bad so I shouldn't be using that, but how else could I achieve this? I'm sorry if the answer is super easy or obvious, but I'm pretty new to Wordpress :) I've looked here on stackexchange and on google, but I'm having trouble putting it together to make it work. Any help would be greatly appreciated!


Process uploads with phpThumb before generating thumbnails

I was wondering if anyone knew a way (via function, plugin, or another method) of using phpThumb to process an image on upload, and then for Wordpress to generate it's usual image sizes from both the original and the processed image? Basically I'm using phpThumb to generate an alpha channeled version of the image, to use in some specific areas, using this (where the h & w are the measurements or the original image, which could be variable) `<img src="phpThumb/phpThumb.php?src=black.jpg&h=487&w=320&iar=1&fltr[]=mask|originalimage.jpg&f=png&hash=xxxxxx">` If I then set a bunch of custom image-sizes, for example: `add_image_size( 'normal-large', 800, 400, false );   add_image_size( 'normal-medium', 600, 300, false );   add_image_size( 'normal-small', 40, 200, false );   add_image_size( 'mask-large', 800, 400, false );   add_image_size( 'mask-medium', 600, 300, false );   add_image_size( 'mask-small', 40, 200, false );` I'd like for the three normal-x sizes to generate from the original image, as per normal, and then the three mask-x sizes to be generated, using the processed version of the image. Cheers


Saving comments not with PostID but different unique identifier

so here is the deal: I want comments to be saved not with the post ID but with another unique identifier. With disqus there is a way to do this with javascript:               /* * * CONFIGURATION VARIABLES: THIS CODE IS ONLY AN EXAMPLE * * */     var disqus_shortname = 'example'; // Required - Replace example with your forum shortname     var disqus_identifier = 'a unique identifier for each page where Disqus is present';     var disqus_title = 'a unique title for each page where Disqus is present';     var disqus_url = 'a unique URL for each page where Disqus is present';      Is there any way to create WordPress comments _not_ associated with the posts ID? Can I somehow define another unique identifier? **EDIT** : Why do I need to do this? I want users to be able to comment on outfits. Here's the code I added already to the submit button:               <p class="form-submit">         <input name="submit" type="submit" id="submit" value="Send">         <input type="hidden" name="comment_post_ID" value="28" id="comment_post_ID">         <input type="hidden" name="comment_parent" id="comment_parent" value="0">         <input type="hidden" name="comment_outfit_ID" id="comment_outfit_ID" value="190">     </p>      I need the value of `comment_outfit_ID` inserted into the `wp_comments`-Table. I already created a new column for that: > ![enter image description here](http://i.stack.imgur.com/rms87.png) I found following functions doing the insert: File `wp-comments-post.php` in root folder, Line 89:                  $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');        $comment_id = wp_new_comment( $commentdata );      File `comment.php` under `/includes`, Line 1283:                   $data = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_karma', 'comment_approved', 'comment_agent', 'comment_type', 'comment_parent', 'user_id');         $wpdb->insert($wpdb->comments, $data);      But I dont know how I can add my new variable to these functions.


How to display post from current Taxonomy in archive page?

I am using the following code to display a random post from the current category in category archive page (using archive.php). However, when in Tag or Taxonomy archive pages, the post is not correctly displayed from the current Tag or Taxonomy (due to the limitation of category only). How can I modify to make it work with Tag and Taxonomy (or just Taxonomy since Category and Tag are also Taxonomies). Thanks!               // assign the variable as current category     $currentcategory = $cat;          // concatenate the query     $args = 'showposts=1&cat=' . $currentcategory . '&orderby=rand';          $random_query = new WP_Query( $args );          // The Loop          if ( $random_query->have_posts() ) {     while ( $random_query->have_posts() ) {     $random_query->the_post();          // custom template for the random post          }          } else {          // no posts found          }          // Restore original Post Data     wp_reset_postdata();      Edited code in regarding to s_ha_dum's answer:               <?php // The Query          if (is_tax() || is_category() || is_tag() ){         $qobj = $wp_query->get_queried_object();          // concatenate the query         $args = array(             'posts_per_page' => 1,             'orderby' => 'rand',             'tax_query' => array(                 array(                     'taxonomy' => $qobj->taxonomy,                     'field' => 'id',                     'terms' => $qobj->term_id                     )                 )             );     }          $random_query = new WP_Query( $args );          // The Loop     if ( $random_query->have_posts() ) {         while ( $random_query->have_posts() ) {             $random_query->the_post(); ?>          //HTML tempalte          <?php   }     } else {         // no posts found     }     /* Restore original Post Data */     wp_reset_postdata(); ?>


Where does wordpress store emails user enters when writing comments?

I'd like to do some kind of newsletter. My idea is to get emails users entered when they were commenting my blog and send daily email to them all. Where does wordpress keep that emails? Is there any recommendation for doing some kind of newsletter/subscription? Which plugins do you recommend?


Faster way to wp_insert_post & add_post_meta in bulk

I have a csv file that I want to insert that consists of ~1,500 rows and 97 columns. It takes about 2-3 hours to do a full import and I'd like to improve this if there is a way. Currently for each row I'm doing a $post_id = wp_insert_post and then an add_post_meta for the 97 associated columns with each row. This is pretty inefficient... Is there a better way to go about this in a way that a could get a post_id keep the relationship between post and its post_meta values? Right now I'm trying this on my local machine with wamp but will have it running on a VPS


How do I get multiple pages by title?

In my plugin, I need to find any posts of a custom post type that have a certain title. I was using this:               $my_post = get_page_by_title( $title, OBJECT, 'my_custom_post_type' );      This works great, but if there is more than one post with the same title, get_page_by_title will only return one result. According to the Codex article on get_page_by_title, this is the correct behavior for the function. How do I retrieve all the posts with a given title, rather than just one?


How to add a select menu to this metabox code?

I'm using a metabox script that works great for having absolute control over the design and placement of the metabox fields. There is one problem: I can't remember where I found the script and need to add a select box. This script does not use arrays as most metabox scripts do. What function can I use to sucessfully add a select box?               // Add the Inventory Meta Boxes          function add_inventory_metaboxes() {         add_meta_box('inventory_information', 'Inventory Information', 'inventory_information', 'inventory', 'side', 'default');     }          // The Event Location Metabox          function inventory_information() {         global $post;              // Noncename needed to verify where the data originated         echo '<input type="hidden" name="inventorymeta_noncename" id="inventorymeta_noncename" value="' .         wp_create_nonce( plugin_basename(__FILE__) ) . '" />';              // Get the location data if its already been entered         $stocknum = get_post_meta($post->ID, '_dappcf_i_stocknum', true);         $vin = get_post_meta($post->ID, '_dappcf_i_vin', true);         $saleprice = get_post_meta($post->ID, '_dappcf_i_priceone', true);         $internetprice = get_post_meta($post->ID, '_dappcf_i_pricetwo', true);         $milage = get_post_meta($post->ID, '_dappcf_i_mileage', true);         $carfaxurl = get_post_meta($post->ID, '_dappcf_i_carfaxurl', true);              // Echo out the fields         echo '
Stock #: <input type="text" name="_dappcf_i_stocknum" value="' . $stocknum  . '" class="widefat" style="width:80px" />                  Milage: <input type="text" name="_dappcf_i_mileage" value="' . $milage  . '" class="widefat"  style="width:80px" />                  VIN: <input type="text" name="_dappcf_i_vin" value="' . $vin  . '" class="widefat"  style="width:200px" />';         echo '
Sale Price: <input type="text" name="_dappcf_i_priceone" value="' . $saleprice  . '" class="widefat"  style="width:80px" />                  Internet Price: <input type="text" name="_dappcf_i_pricetwo" value="' . $internetprice  . '" class="widefat"  style="width:80px" />';         echo '
CarFax url: <input type="text" name="_dappcf_i_carfaxurl" value="' . $carfaxurl  . '" class="widefat"  style="width:170px" />';     }          // Save the Metabox Data          function txpbs_save_events_meta($post_id, $post) {              // verify this came from the our screen and with proper authorization,         // because save_post can be triggered at other times         if ( !wp_verify_nonce( $_POST['inventorymeta_noncename'], plugin_basename(__FILE__) )) {         return $post->ID;         }              // Is the user allowed to edit the post or page?         if ( !current_user_can( 'edit_post', $post->ID ))             return $post->ID;              // OK, we're authenticated: we need to find and save the data         // We'll put it into an array to make it easier to loop though.              $station_meta['_dappcf_i_stocknum'] = $_POST['_dappcf_i_stocknum'];         $station_meta['_dappcf_i_vin'] = $_POST['_dappcf_i_vin'];         $station_meta['_dappcf_i_priceone'] = $_POST['_dappcf_i_priceone'];         $station_meta['_dappcf_i_pricetwo'] = $_POST['_dappcf_i_pricetwo'];         $station_meta['_dappcf_i_mileage'] = $_POST['_dappcf_i_mileage'];         $station_meta['_dappcf_i_carfaxurl'] = $_POST['_dappcf_i_carfaxurl'];              // Add values of $station_meta as custom fields              foreach ($station_meta as $key => $value) { // Cycle through the $station_meta array!             if( $post->post_type == 'revision' ) return; // Don't store custom data twice             $value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)             if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value                 update_post_meta($post->ID, $key, $value);             } else { // If the custom field doesn't have a value                 add_post_meta($post->ID, $key, $value);             }             if(!$value) delete_post_meta($post->ID, $key); // Delete if blank         }          }          add_action('save_post', 'txpbs_save_events_meta', 1, 2); // save the custom fields


Image Uploader API

I want to create a widget for my theme that will let me upload an image to WP and crop it to a certain size. Can anyone point me to the codex page or a tutorial on how to a bare bone implementation of it?


How to edit a user profile on the front end?

How can I edit a user profile in the front end with a form?   first name, last name, username, email address and password


Where to hook register_settings for Settings API when also want to update options outside of Settings API?

The Settings API is a convenient way to add administrative options. Tutorials on the settings API hook register_setting to admin_init. But what if you also want to programmatically change the same options outside of the Settings API? For example, use the Settings API to maintain a base value for option X. In addition, each new post automatically increments option X via a direct update_option function call. Unfortunately, if option X is registered, update_option triggers a call to the validation function associated with the registered setting. The validation fails ~~because the update_option argument isn't passed~~ because I screw up the different validation required from the different sources of options change. Where should register_setting for option X be hooked to allow option X also to be updated outside of the Settings API? Alternatively, where should unregister_setting for option X be hooked to allow the direct update_option call to work without the Settings API sanitization/validation function call? Update: t31os below helpfully provided some illustrative code. Here is a small addition to his code:                   function __construct() {             add_action( 'admin_init', array( $this, 'admin_init' ) );             add_action( 'admin_menu', array( $this, 'admin_menu' ) );             add_action('add_meta_boxes', array( &$this, 'add_regtest_box' )); //added hook             }             //added functions         function add_regtest_box() {                 global $post;                 add_meta_box( 'regtest_box', 'Registered Setting Test', array( &$this, 'regtest_box_contents'), 'post' , 'side' , 'high' );             }            function regtest_box_contents() {                 update_option( 'test-option', array('fieldone'=>-11,'fieldtwo'=>8) );                 $new_vals = get_option( 'test-option' );                 print_r( $new_vals );             }      If you "add new post" from the dashboard, you'll notice that the metabox on the top right shows fieldone with a value of 11, not -11. That's because the update_option function call in regtest_box_contents is putting the option values through the sanitizing/validating function that was registered (register_setting) to the option. In this case, that's t31os's update_option function, which applies absint() to the option value passed through. The question is how to avoid that function call, e.g. just have the option updated to -11.


Filtering multiple meta_values

I'm trying to create a filter using two meta_values. Example. If the current page has meta values red and blue, only display queried pages that have both red and blue and none that have just red or just blue. I thought this could be accomplished with two meta values `'meta_value' => $red, $blue` but apparently it's not available. Below is where I found myself before the block. I've done a ton of research and simply can't find a method that works. Any help would be appreciated.               $red = get_post_meta($post->ID, 'red', true);     $blue = get_post_meta($post->ID, 'blue', true);     $args = array(     'post_type' => page,     'nopaging' => true,     'post_parent' => 1440,     'meta_value' => $red, $blue     );          query_posts($args);


How do I create filters for custom post types?

Sorry the question might not make sense. I basically have a custom post type called "Projects" and I need to create a way to filter attributes of the project like "name", "type", etc. For example if I have a project type called airplane, and another project type called airplane. I would want to be able to search for all projects with the name airplane, and display those in the loop. I have looked into Taxonomies, but I do not know how to use them effectively. Thanks


Wordpress Menu - creating a fake link

I like to create Web site mockups for clients using Wordpress. Typically I will only create the landing page and a believable navigation menu. To keep from creating extraneous pages I will create a Custom Link using "#" and then enter whatever menu name. The problem I run into is when I mouse-over the menu link I get a straight cursor symbol instead of the typical mouse-over hand symbol. Basically I am looking for a simple solution, if it exists, so that when a client mouses-over one of these menu links the cursor changes to the hand so it 'feels' like a real link.


WP List Table in custom post type

I want to use WP_List_Table class on a custom post type to create a whole new admin panel (the original one will exist, but I want to have several others with specific filters and criteria set upon them). I've tried the smashing tutorial, but I don't know how to apply them into the existing post/page object (they use it for pure database tables outside wordpress standard tables for post/pages/custom types).


Admin Menu - Highlight top-level menu when on a sub-menu page (without showing sub-menu)

This is the current situation:   * I am writing a plugin that has a top-level menu page   * The plugin also contains other sub-menu pages   * The sub-menu pages are not assigned a parent slug (thus they do not appear in the admin menu) My requirement is to do the following:   * Have only the top-level menu page menu item in the admin menu (no sub-menu page menu items should appear)   * Highlight the top-level menu page menu item when on a sub-menu page * * * I've tried giving a parent slug to the sub-menu pages. This, of course, makes it appear as expected under the top-level menu item. I then tried to remove the sub-menu item, by using remove_submenu_page. However, since that removes the entire sub-menu page, it doesn't solve the problem. I believe the logical thing to do, is to give a parent slug, since the top- level menu item will need to know that the page being accessed falls under it. The problem then, is not showing the sub-menu page's menu item. I am unable to find a function that deals directly with the menu items. * * * Is this the right approach or is there a better alternative? Is there a action/filter/hook I can utilise to carry out what I need to do? **Edit #1:**   Did some further research/testing. Setting the menu_title parameter to null or '' in the add_submenu_page call makes the title not appear. However, the <li> that contains the sub-menu item still does exist and can be interacted with. When there are numerous sub-menu pages (as in my case), the empty <li> elements will add-up and create a long blank area on the menu. This is far from ideal and as such, I'm still searching for a solution. **Edit #2:** Tried manipulating the $submenu global after the comment from @s_ha_dum. However, any removal of the menu section pertaining to a page also results in removing the page similar to remove_submenu_page and thus rendering that page inaccessible.


Can I use the same nonce for multiple requests on the same page?

Or does this break the purpose of the nonce, which I admint I don't quite understand it? :) For example on two ajax requests that run on page load, or when something is clicked:                $.ajax({        type: 'post',        url: 'admin-ajax.php',        data: { action: 'foo',                _ajax_nonce: '<?php echo $nonce; ?>' }      });           $.ajax({        type: 'post',        url: 'admin-ajax.php',        data: { action: 'foo2',                _ajax_nonce: '<?php echo $nonce; ?>' }      });


Redirecting or displaying a message on first login

I've been trying to decipher a way to display a message to a user on first login and can't seem to get it to work. I'm not sure what I'm missing, or if there's something else I need to do. Any help would be appreciated. I feel like I missing something here.               function ap_new_user_message() {         $current_user = wp_get_current_user();         $user_ID = $current_user->ID;         //global $user_ID;         if( $user_ID ) {             $user_info = get_userdata( $user_ID );             // If user_registered date/time is less than 48hrs from now             // Message will show for 48hrs after registration             if ( strtotime( $user_info->user_registered ) > ( time() - 172800 ) )             echo '
display a message
';         }     }      Alternatively, If I could find a way of determining how many days it's been since a user was created I could do something similar. Perhaps by adding to the user meta table?               function first_login($login) {         global $user_ID;         $user = get_userdatabylogin($login);         update_usermeta( $user->ID, 'first_login', date(), time() );       }     add_action('wp_login','first_login');      And then calling for it               if first_login(date, time) == (today, ago) {     #do something     }      **Update:** Milo's code worked great. However, I needed it to work with Eric Meyer's Simple Modal Login. I found this function within simplemodal-login.php and peter's login redirect.                       function login_redirect($redirect_to, $req_redirect_to, $user) {             if (!isset($user->user_login) || !$this->is_ajax()) {                 return $redirect_to;             }             if ($this->is_plugin_active('peters-login-redirect/wplogin_redirect.php')                     && function_exists('redirect_to_front_page')) {                 $redirect_to = redirect_to_front_page($redirect_to, $req_redirect_to, $user);             }             echo "
$redirect_to
";             exit();         }      and added Milo's redirect to it like so:                   function login_redirect($redirect_to, $req_redirect_to, $user) {             $regtime = strtotime($user->user_registered);             $now = strtotime("now");             $diff = $now - $regtime;             $hours = $diff / 60 / 60;             if (!isset($user->user_login) || !$this->is_ajax()) {                 return $redirect_to;             }             if ($this->is_plugin_active('peters-login-redirect/wplogin_redirect.php')&& function_exists('redirect_to_front_page')) {                 $redirect_to = redirect_to_front_page($redirect_to, $req_redirect_to, $user);             }             if( $hours < 48 ){                 $redirect_to = "/somepage/"; // it's been less than 48 hours, redirect to message.             }             echo "
$redirect_to
";             exit();         }      Now I just need to determine how to force a model popup when a users reaches a certain page.


How to exclude my home page from url of my internal pages?

I just definsed at Setting> Reading a page I have created called "home" as my homepage. The change was ok, but since them all my internal pages url shows an extra /home/in their urls. How can I avoid it? Examples: Before: www.mydomain/internalpage/ After the change: www.mydomain* _/home/_ *internalpage/


Script will not print in head if path to file is correct

I'm dealing with a rather hackish implementation, where `header.php` has this line: `include_once "tracking.php";`. Inside `tracking.php`, there are these lines:               <script type="text/javascript" src="/wp-content/themes/themename/js/jquery-1.3.2.min.js"></script>       <script type="text/javascript" src="/wp-content/themes/themename/js/jquery.cookie.js"></script>      However, as long as the paths to those .js files are correct, they don't get printed in the page's head. If I introduce a typo so that the path is incorrect, then they do get printed! I realize this is not an optimal way of including these files. However, does anyone have an idea as to why they aren't being printed if the path used is correct?


How to display content from external db with relevant urls

I am working on a website that needs to display information about electronic resources which is stored in an external database. This information will be presented three different ways (alphabetical by letter, by category, and a detail view of a specific resource) and needs to have a unique url that a user could bookmark or which can be sent in an email (i.e. all the art resources would be found at something like /resourcecategoryart or /resourcecategory?category=art. I am new to wordpress and I do not know best practices or expected design patterns. I have the functions that run the queries I need and display the relevant information, but I do not know how to get them to work with a wordpress site. Do I create one page for each of the types of display (3) and then pass a variable in the url that gives it the value the function needs to query and display? Do I instead make a page for each possible instance (one for each of the couple hundred resources for their detail display, one for each letter of the alphabet, and one for each category type) and just have them include the relevant code? Any pointers towards resources or suggestions on how to handle this would be much appreciated. Thanks,


Turn on and off custom post type from admin?

Is it possible to "deactivate" a custom post type and then later if you feel like using it again you can simple "activate" it again?


Why is this plugin not working?

I am currently learning WordPress Plugin Development. I was trying to insert data into a custom table by means of a plugin. Such that, when an action hook is fired, the data is inserted. It is a pretty simple code here but not getting executed although on debugging I found that the commented echo statement within the function does get executed. Here is the code -               <?php     /*     Plugin Name: What the wpdb     Description: Making use of wpdb     Version: 1.0     Author: Navin Nagpal     License: GPLv2     */     add_action('wp_head','nn_do_dbstuff');          function nn_do_dbstuff(){     global $wpdb;     //echo 'Text';     $values = array(         'column1'=>'Navin',         'column2'=>22);     $formats_values = array('%s','%d');     $wpdb->insert($wpdb->custom,$values,$formats_values);     }     ?>      My table is named wp_custom and it has three fields including the 'id' field which is the primary key


Allow a subscriber to be an author and view only his post

I have recently upgraded from 2.9.2 to 3.3.1. Im using the edit flow plugin to assign different status to posts and allowing users to register and create a post with a specific status. In the previous version, users could VIEW their posts as long as they were the author. In the new version of WP, this is not the case - they see a 404 page. I dont think this is an edit flow problem but a feature of the new WP. How does one allow users(subscribers) to view ANY post status provided they are logged in?


WP-Members redirect if member ALREADY logged in

I am using the plugin WP-Members. My Wordpress front page is the login page for WP-Members. In my theme functions.php I have used this WP-Members filter and function to redirect members to the posts page once they have logged in.               add_filter( 'wpmem_login_redirect', 'my_login_redirect' );          function my_login_redirect()     {     // return the url that the login should redirect to     return 'http://mydomain.com/specials/';     }      And this is working as designed. However, when someone returns to the site and is already logged in from a previous session this redirect does not detect their logged in status and redirect them. I assume because the function is not called until someone logs in. I am experienced with programming but new to working in WordPress. I have not been able to find any information on how to resolve this, although I strongly suspect it is out there. Can anyone help point me in the right direction? I appreciate everyone's help and guidance in advance. Thank you!


With Wordpress themes, where do I store the images and files relatively?

In pure HTML, I'm used to storing the files relative to where the particular HTML file is, such as `css/style.css`. However, with the theme I'm using with Wordpress, "Responsive" I don't know where the images are to be stored. Can you even use relative linking with wordpress?