rcmck
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Put this code inside page?That should work if you add it to a php template file. If you are adding it into a post/page’s content in wp-admin you’ll need some type of php execution plugin to handle that. Such as:
http://ww.wp.xz.cn/extend/plugins/exec-php/Forum: Hacks
In reply to: Count Of Posts in Given Category With Specific Custom MetaSELECT COUNT(tr.object_id) FROM wp_term_relationships tr, wp_terms t, wp_term_taxonomy tt, wp_postmeta m WHERE t.term_id = tt.term_id AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tt.taxonomy = 'category' AND m.post_id = tr.object_id AND m.meta_value != '' AND m.meta_key = 'Your Custom Meta' AND t.name = 'Name of the Category'Forum: Themes and Templates
In reply to: Problem with page template, shows differently on different pagesThe first one is the one on the messed up page.
Forum: Fixing WordPress
In reply to: How to wp_enqueue twitter bootstrap css before styles.css is loadedIf you are loading your style.css in header.php remove that then add and edit below to your functions.php file. Make sure you have the wp_head function in your header.php.
add_action('wp_enqueue_styles', 'my_styles'); function my_styles(){ wp_enqueue_style('twitter', 'twitter-css-file-uri'); wp_enqueue_style('theme-css', get_stylesheet_uri(), 'twitter'); }Forum: Fixing WordPress
In reply to: Admin Login Trouble/wp-login doesn’t exist.
You have to go to /wp-login.php or /wp-admin
Forum: Hacks
In reply to: Action while post is being publishedThe action save_post is what you are looking for if you are trying to save data from the post form.
As far as editing the post form you should look at add_meta_box function.
Forum: Themes and Templates
In reply to: Problem with page template, shows differently on different pagesThe problem is most definitely in` your styles. And here’s where:
line 242.custom-layouts.singular #content { margin: 0 7.6%; position: relative; width: auto; }Is overriding your width and margin settings that you have for the #content element on your homepage, line 152:
.three-column #content { margin: 0 34% 0 26.4%; width: 40.4%; }Forum: Fixing WordPress
In reply to: Have WP Accept Login from Site Member Home PagePost your form to wp-login.php and set the get variable redirect_to to wherever you want them to land if its a successful login. Of course if there are errors they will be stuck on your wp-login.php.
For example:
<form action="http://mysite.com/wordpress/wp-login.php?redirect_to=http://mysite.com" method="post">Make sure you use the same input field names as wp-login.php for login and password: log and pwd.
Forum: Hacks
In reply to: make extra columns in user.php sortableSimple class to add sortable user meta columns to wp-admin/users.php table. (You can also add wp_users columns).
/** * Add columns to the wp-admin user's table * * @param array $args Associative array where key is wp_usermeta meta_keys or wp_users column names and the value is the display name * @return none; */ if(!function_exists(load_sortable_user_meta_columns)){ add_action('admin_init', 'load_sortable_user_meta_columns'); function load_sortable_user_meta_columns(){ //THIS IS WHERE YOU ADD THE meta_key => display-title values $args = array('nickname'=>'Nickname', 'user_registered'=>'Date Registered'); new sortable_user_meta_columns($args); } } if(!class_exists(sortable_user_meta_columns)): class sortable_user_meta_columns{ var $defaults = array('nicename', 'email', 'url', 'registered','user_nicename', 'user_email', 'user_url', 'user_registered','display_name','name','post_count','ID','id','user_login'); function __construct($args){ $this->args = $args; add_action('pre_user_query', array(&$this, 'query')); add_action('manage_users_custom_column', array(&$this, 'content'), 10, 3); add_filter('manage_users_columns', array(&$this, 'columns')); add_filter( 'manage_users_sortable_columns', array(&$this, 'sortable') ); } function query($query){ $vars = $query->query_vars; if(in_array($vars['orderby'], $this->defaults)) return; $title = $this->args[$vars['orderby']]; if(!empty($title)){ $query->query_from .= " LEFT JOIN wp_usermeta m ON (wp_users.ID = m.user_id AND m.meta_key = '$vars[orderby]')"; $query->query_orderby = "ORDER BY m.meta_value ".$vars['order']; } } function columns($columns) { foreach($this->args as $key=>$value){ $columns[$key] = $value; } return $columns; } function sortable($columns){ foreach($this->args as $key=>$value){ $columns[$key] = $key; } return $columns; } function content($value, $column_name, $user_id) { $user = get_userdata( $user_id ); return $user->$column_name; } } endif;