2is3
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: 301 home redirection to newly created page<strike>Update: If you go to ‘Tools > Redirection > Modules’ and completely delete that WordPress module, it seems to fix the bug.</strike>
Nevermind, that didn’t work really. Now you can’t create redirects… bah!
Forum: Fixing WordPress
In reply to: 301 home redirection to newly created pageYup, I’m having the same issue on a couple of sites I work with. Anytime a new page or new custom post type is created (does not occur with new posts).
A new row is added to the wp_redirection_items table where the ‘URL’ is ‘/’ and the ‘action data’ is the slug to the new page.
Forum: Fixing WordPress
In reply to: How to get grandparent page in classes.php?Also, you can get the Root parent by adding this snippet to your functions.php:
function get_root_parent($page_id) { global $wpdb; $parent = $wpdb->get_var("SELECT post_parent FROM $wpdb->posts WHERE post_type='page' AND ID = '$page_id'"); if ($parent == 0) return $page_id; else return get_root_parent($parent); }then use this in your template:
$root_parent = get_root_parent($post->ID);Forum: Fixing WordPress
In reply to: How to get grandparent page in classes.php?adding a get_post() seems to make it work:
<?php $current = $post->ID; $parent = $post->post_parent; $grandparent_get = get_post($parent); $grandparent = $grandparent_get->post_parent; echo 'current: '.$current.'<br />'; echo 'parent: '.$parent.'<br />'; echo 'grandparent: '.$grandparent; ?>Forum: Themes and Templates
In reply to: Styling the nextpage tagsI totally know what you mean robertm, I would like to see a way to class the current page number. I mean heck, even these forums do it:
View screen grab: http://www.flickr.com/photos/2is3/2984968936/
<p id="pages"><span class='page-numbers current'>1</span> <a class='page-numbers' href='/support/forum/3/page/2'>2</a> <a class='page-numbers' href='/support/forum/3/page/3'>3</a> <span class='page-numbers dots'>...</span> <a class='page-numbers' href='/support/forum/3/page/3298'>3298</a> <a class='next page-numbers' href='/support/forum/3/page/2'>Next »</a>