Jeff Sherk
Forum Replies Created
-
Thanks Mike!
That removes the text, but it stills leaves a blank between the “E-Mail Address again:” text and input text box. I might need to hardcode a change to remove it?
Looking at the page source, I see this:
<div style="text-align:left;"> <span style="font-size:x-small; font-weight:normal;">Please enter your E-mail Address a second time.</span> <br> <input id="si_contact_email2_1" type="email" size="40" value="" name="si_contact_email2" style="text-align:left; margin:0;"> </div>The three things that would need to be done in order enable/disable it thru CSS would be (1) Move the BR tag inside the span tag, and (2) assign a class name to the span, and (3) add a section in the Style area so you could hide/unhide the span. If the span is hidden, then the BR tag would not come into effect and the blank line would not appear!
So something like this:
<div style="text-align:left;"> <span class="some-new-class">Please enter your E-mail Address a second time.<br></span> <input id="si_contact_email2_1" type="email" size="40" value="" name="si_contact_email2" style="text-align:left; margin:0;"> </div>And then in Style you would have a new entry for “some-new-class” with this in it:
font-size:x-small; font-weight:normal;Thanks
EDIT: Had to change my br tags to BR so they dont get removed!
Ok thanks I understand now!
I was wanting to acutally display my facebook news feed on my website.. so everything I put up on facebook would also be on my website!
Forum: Fixing WordPress
In reply to: Assist with plugin to change Author column in Edit Posts viewOkay, after several hours of searching and playing around, I came up with the following plugin that does 4 things on the Edit Posts admin page:
1- Removes the Author column.
2- Adds a new column called realAuthor which displays the whats stored in the custom meta data field called ddfmName.
3- Adds a new column called realAuthorEmail which displays the whats stored in the custom meta data field called ddfmEmail.
4- Adds a new column called ID and displays the Post ID number (older versions of WP did this by default).<?php /* Plugin Name: Display ID & Custom fields Version: 0.1 Plugin URI: Description: On the Edit Posts list view page, it will display the Real Authors name and email, and the Post ID. All submissions to the blog are made by the 'anonymous' author (#5), but the persons real name and email are stored in the meta-data custom fields called 'ddfmName' and 'ddfmEmail'... This Real Name and Email will be displayed. Author: Jeff Sherk Author URI: */ /////////////////////////////////////////////////////////////// //Add realAuthor column function jds_realAuthor_column($column) { $column['realAuthor_column'] = '<abbr style="cursor:help;" title="ID">realAuthor</abbr>'; unset($column['author']); //remove the original author column since we don't need it return $column; } function jds_realAuthor_column_content($column,$ID) { global $post; if( $column == 'realAuthor_column' ) { if ($post->post_author == '5') { // 5 is author = 'anonymous' $realAuthor = get_post_meta($ID, 'ddfmName', true); //use TRUE to return single value as string echo $realAuthor; } else { $originalAuthor = get_the_author($post->post_author); //If it's not anonymous then get original author/admins name echo '<a href="https://www.forerunnertv.com/more/wp-admin/edit.php?author='.$post->post_author.'"><strong>'.$originalAuthor.'</strong></a>'; //This is how the the original Author column displays it, so we do it that way too! } } } //Add realAuthor to posts only since it does not apply to pages add_filter('manage_posts_columns', 'jds_realAuthor_column', 5, 2); add_action('manage_posts_custom_column', 'jds_realAuthor_column_content', 5, 2); /////////////////////////////////////////////////////////////// //Add realAuthorEmail column function jds_realAuthorEmail_column($column) { $column['realAuthorEmail_column'] = '<abbr style="cursor:help;" title="ID">realAuthorEmail</abbr>'; return $column; } function jds_realAuthorEmail_column_content($column,$ID) { global $post; if( $column == 'realAuthorEmail_column' ) { if ($post->post_author == '5') { // 5 is author = 'anonymous' $realAuthorEmail = get_post_meta($ID, 'ddfmEmail', true); //use TRUE to return single value as string echo '<a href="mailto:'.$realAuthorEmail.'?subject=Your submission to ForerunnerTV.com">'.$realAuthorEmail.'</a>'; } } } //Add realAuthorEmail to posts only since it does not apply to pages add_filter('manage_posts_columns', 'jds_realAuthorEmail_column', 5, 2); add_action('manage_posts_custom_column', 'jds_realAuthorEmail_column_content', 5, 2); /////////////////////////////////////////////////////////////// //Add ID column function jds_id_column($column) { $column['id_column'] = '<abbr style="cursor:help;" title="ID">ID</abbr>'; return $column; } function jds_id_column_content($column,$ID) { if( $column == 'id_column' ) { echo $ID; } } //Add ID to both posts and pages add_filter('manage_posts_columns', 'jds_id_column', 5, 2); add_action('manage_posts_custom_column', 'jds_id_column_content', 5, 2); add_filter('manage_pages_columns', 'jds_id_column', 10, 2); add_action('manage_pages_custom_column', 'jds_id_column_content', 10, 2); ?>Forum: Plugins
In reply to: Changing the default length of the_excerptI also tried the same solution that is shown in the codex:
add_filter(‘excerpt_length’, ‘my_excerpt_length’);
function my_excerpt_length($length) {
return 250; // Or whatever you want the length to be.
}And it does not appear to work or make any difference on WP 2.8.4 … the excerpt remains at 55!
Forum: Fixing WordPress
In reply to: Pages don’t work with custom permalinks and categoriesI’m assuming you ACTIVATED the plugin as well?
I am honestly not very well versed in WP code or plugins… I had a problem, and was able to find the above fix for it… sorry, but I do not have any suggestions for why it does not work for you.
Forum: Fixing WordPress
In reply to: Default navigation is giving a 404 errorYes, you turn the above code into a plugin…
Copy the above code into a text file, and then save the text file, and rename it with a .php extension… let’s call the file fix-category-pages.php
Now create a folder in the wp-content/plugins directory with the same name as the name of the file you created above (except no .php)… so let’s call the folder fix-category-pages
So yo should now have this:
/wp-content/plugins/fix-category-pages/fix-category-pages.phpNow just go to your WP dashboard and go to the plugins section and activate the plugin and you should be good to go!
Forum: Plugins
In reply to: Detecting already installed pluginsI am writing a mod and it needs to know if specific plugin is activated or not. The following code will deterine if any plugin is activated or deactivated, you just need to put the plugins directory (if it uses one) and the main plugin file name (including the .php).
For example, I needed to find out if the Post Notification plugin was active… it’s directory within the plugins directory is called ‘post-notification‘, and the main file is called ‘post_notification.php‘
<?php $plugin_name = 'post-notification/post_notification.php'; $is_active = is_plugin_active($plugin_name); if ($is_active == '1') { echo '<span style="color: green;">ACTIVE!</span>'; } else { echo '<span style="color: red;">Deactivated.</span>'; } ?>Forum: Fixing WordPress
In reply to: Can I limit Export or Import of posts to Draft only?I modified the wp-admin/includes/export.php in my WP 2.5 install to export Posts only with a status of Draft. This mode should be very similar for most versions of WP.
In the wp-admin/includes/export.php file, look for this line:
$post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");Just BEFORE it, add the following line:
//NOTE: This modification ignores your choice of Author, and chooses them all! $where = " WHERE post_type = 'post' AND post_status = 'draft' ";Forum: Fixing WordPress
In reply to: Category slug and page slug the same… which one wins?I’ll try it, thanks.
Forum: Fixing WordPress
In reply to: Custom Permalinks and PagingI re-wrote the barefoot plugin for WP 2.7.1 and this fixed my problem… maybe it will help others as well. It also works with WP-PageNavi…
[code]
<?php
/*
Plugin Name: Fix Paging in Category Listings
Plugin URI:
Description: Fixes a bug where next/previous page links are broken in category listings
Version: 0.6
Author: Doug Smith (modified by Jeff Sherk)
Author URI:Modified on March 23, 2009 by Jeff Sherk for WordPress 2.7.1
Based on original plugin info listed below:
Plugin Name: Fix Paging in Category Listings
Plugin URI: http://www.thinkbarefoot.com
Description: Fixes a bug where next/previous links are broken in category by year/month listings
Version: 0.5
Author: Doug Smith
Author URI: http://www.thinkbarefoot.comCopyright 2007 Doug Smith (email: dsmith@thinkbarefoot.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.*/
/**
* Function to fix problem where next/previous buttons are broken on list
* of posts in a category when the custom permalink string is:
* /%category%/%year%/%monthnum%/%postname%/
* The problem is that with a url like this:
*
* /category/2007/10/page/2
*
* the 'page' looks like a post name, not the keyword "page"
*
* MODIFIED ON March 23, 2009 by Jeff Sherk
* Permalink structure was /%category%/%post_id% which looked like
* http://www.mysite.com/wordpress/news/27
* When attempting to go to another page, it looked like this
* http://www.mysite.com/wordpress/news/27/page/2
* but would generate a 404 error .
*
* This modification takes $query_string['category_name'] and chops the '/page'
* off the end. It also takes $query_string['paged'] and sets it equal to
* $query_string['p'], and then unsets $query_string['p'].
* 'p' is not needed, but 'paged' is needed in order to make it work correctly
*/
function fix_page_in_category_from_query_string($query_string) {//Check to see if the 'p' and 'category_name' are set in $query_string
if ( isset($query_string['category_name']) && isset($query_string['p']) ) {$category_name = $query_string['category_name'];
$category_len = strlen($category_name);//Check to see if the 'category_name' has '/page' on the end of it
if (substr($category_name, $category_len-5,5) == '/page') {//Remove '/page' from the end of 'category_name'
$query_string['category_name'] = substr($query_string['category_name'],0,$category_len-5);//Set 'paged' equal to the page you want to go to
$query_string['paged'] = $query_string['p'];//Unset 'p' since we don't need it anymore because we set 'paged' instead
unset($query_string['p']);
}
}
return $query_string;
}add_filter('request', 'fix_page_in_category_from_query_string');
?>
[/code]
Forum: Fixing WordPress
In reply to: Default navigation is giving a 404 errorI re-wrote the barefoot plugin for WP 2.7.1 and this fixed my problem… maybe it will help others as well. It also works with WP-PageNavi…
[code]
<?php
/*
Plugin Name: Fix Paging in Category Listings
Plugin URI:
Description: Fixes a bug where next/previous page links are broken in category listings
Version: 0.6
Author: Doug Smith (modified by Jeff Sherk)
Author URI:Modified on March 23, 2009 by Jeff Sherk for WordPress 2.7.1
Based on original plugin info listed below:
Plugin Name: Fix Paging in Category Listings
Plugin URI: http://www.thinkbarefoot.com
Description: Fixes a bug where next/previous links are broken in category by year/month listings
Version: 0.5
Author: Doug Smith
Author URI: http://www.thinkbarefoot.comCopyright 2007 Doug Smith (email: dsmith@thinkbarefoot.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.*/
/**
* Function to fix problem where next/previous buttons are broken on list
* of posts in a category when the custom permalink string is:
* /%category%/%year%/%monthnum%/%postname%/
* The problem is that with a url like this:
*
* /category/2007/10/page/2
*
* the 'page' looks like a post name, not the keyword "page"
*
* MODIFIED ON March 23, 2009 by Jeff Sherk
* Permalink structure was /%category%/%post_id% which looked like
* http://www.mysite.com/wordpress/news/27
* When attempting to go to another page, it looked like this
* http://www.mysite.com/wordpress/news/27/page/2
* but would generate a 404 error .
*
* This modification takes $query_string['category_name'] and chops the '/page'
* off the end. It also takes $query_string['paged'] and sets it equal to
* $query_string['p'], and then unsets $query_string['p'].
* 'p' is not needed, but 'paged' is needed in order to make it work correctly
*/
function fix_page_in_category_from_query_string($query_string) {//Check to see if the 'p' and 'category_name' are set in $query_string
if ( isset($query_string['category_name']) && isset($query_string['p']) ) {$category_name = $query_string['category_name'];
$category_len = strlen($category_name);//Check to see if the 'category_name' has '/page' on the end of it
if (substr($category_name, $category_len-5,5) == '/page') {//Remove '/page' from the end of 'category_name'
$query_string['category_name'] = substr($query_string['category_name'],0,$category_len-5);//Set 'paged' equal to the page you want to go to
$query_string['paged'] = $query_string['p'];//Unset 'p' since we don't need it anymore because we set 'paged' instead
unset($query_string['p']);
}
}
return $query_string;
}add_filter('request', 'fix_page_in_category_from_query_string');
?>
[/code]
Forum: Fixing WordPress
In reply to: Default navigation is giving a 404 errorMy permalink is set to Custom: /%category%/%post_id%, and I am using WP 2.7.1 with the WordPress Default theme. The problem occurs with or without using PageNavi 2.40, so the problem must with WordPress itself, not the plugin.
I tried installing this plugin as a fix, but it did not do anything:
http://barefootdevelopment.blogspot.com/2007/11/fix-for-wordpress-paging-problem.htmlWhen I go to a category page (let’s call it ‘stuff’) like http://www.mysite.com/wordpress/stuff it correctly shows the posts for the first page of the category, and if you hover over the Older Entries links is says
http://www.mysite.com/wordpress/stuff/page/2but if you click it, you get a 404 Error.
I have posted a bug in the WordPress tracker, but if anybody knows of a solution it would be greatly appreciated.
Thanks
Forum: Fixing WordPress
In reply to: Custom Permalinks and PagingI am having a similar problem… my permalink is set to Custom: /%category%/%post_id%, and I am using WP 2.7.1 with the WordPress Default theme.
When I go to a category page (let’s call it ‘stuff’) like http://www.mysite.com/wordpress/stuff it correctly shows the posts for the first page of the category, and if you hover over the Older Entries links is says
http://www.mysite.com/wordpress/stuff/page/2but if you click it, you get a 404 Error.
I have posted a bug in the WordPress tracker, but if anybody knows of a solution it would be greatly appreciated.
Thanks
Genius!
The original wline.gif is 4 pixels wide by 3 pixels high.
I created a new gif that is 12 pixels high by 3 pixels wide, and colored it solid yellow. It now highlights the misspelled words in yellow, which for me (being color blind) makes it about 100 times easier to see!
Thanks scribu
It’s part of the editor that is built into WP2.5 … so I think you would say it’s part of the core.
When you go to create a new post or edit an existing post, it shows up as one of the available buttons.
Thanks