g3legacy
Forum Replies Created
-
Forum: Hacks
In reply to: Taxonomy bugGetting rid of default tags and registering my own custom tax’. The first two bits of code are done on the “init” hook.
//IMPORTANT de-register the default post tag taxonomy register_taxonomy( 'post_tag', array() ); //register our new post tag taxonomy $custom_tag_args = array( 'label' => 'My Tags', 'public' => TRUE, 'hierarchical' => FALSE, 'rewrite' => array( 'slug' => 'tag' ) ); register_taxonomy( 'my_tags', NULL, $custom_tag_args );
Attaching the new tax’ to certain post types
//register to both posts and press releases register_taxonomy_for_object_type( 'my_tags', 'press_release' ); register_taxonomy_for_object_type( 'my_tags', 'post' );
Adding a new column I can modify and removing the default column. I did this because I couldn’t find a hook for the default count column.
function rd_custom_column( $column ) { //error_log( print_r( $column, 1 ) ); //add our new post_count $column[ 'post_count' ] = 'Post Count'; //remove the old post count unset( $column[ 'posts' ] ); return $column; } add_filter( 'manage_edit-my_tags_columns', 'rd_custom_column', 10, 1 );
This code gets the real post count and makes the link.
function rd_filter_custom_taxonomy_columns( $return, $column, $term_id ) { //coloumn name = post_count if( $column != 'post_count' ) return $return; //get the current screen for additional information $screen = get_current_screen(); $post_type = $screen->post_type; $taxonomy = $screen->taxonomy; $query = "SELECT COUNT( posts.ID ) FROM wp_posts posts INNER JOIN wp_term_relationships rel ON posts.ID = rel.object_id INNER JOIN wp_term_taxonomy tax ON rel.term_taxonomy_id = tax.term_taxonomy_id WHERE tax.term_id = " . $term_id . " AND posts.post_type = '" . $post_type . "'"; global $wpdb; $count = $wpdb->get_results( $query, 'ARRAY_N' ); $term_object = get_term_by( 'id', $term_id, 'my_tags' ); //var_dump( $term_object ); $args = array( 'taxonomy' => $taxonomy, 'term' => $term_object->slug, 'post_type' => $post_type ); //build the link with query string echo "<a href='" . esc_url ( add_query_arg( $args, 'edit.php' ) ) . "'>" . $count[0][0] . "</a>"; } add_filter( 'manage_my_tags_custom_column', 'rd_filter_custom_taxonomy_columns', 10, 3 );
Forum: Fixing WordPress
In reply to: Custom post types vs post formatsWell, using that code inside the single.php template will allow you to “include” whatever template you want to process the post inside the loop. Where possible it’s pretty cool to use get_template_part(), because it means you can “share” the code between different templates. Best thing to do is experiment a bit, what I’ve shown you should be enough to get you started. Check out the functions on the Codex, and if you’re still stuck, post some code back here so I can take a peek.
Forum: Fixing WordPress
In reply to: Website scrolling lag (not caused by background)It looks like it’s one of the many javaScript files on your site, if you turn jS off it’s buttery smooth.
Unless you’re much of a coder, you’re probably going to need someone to identity the script and fix/remove it. I know that’s not much help, but that looks like the issue.
You’ve also got a LOT of jS files, you could do with them being joined together to cut server requests.
Dan
Forum: Fixing WordPress
In reply to: Custom post types vs post formatsWell, you could choose “image” as the format for the new post format, then you make a template which displays only the data you want. In your single.php template you can query the post format, and then get a different template depending on what’s been chosen in the admin area, using get_template_part(); E.g;
$format = get_post_format( $post->ID ) ? get_post_format( $post->ID ) : 'standard' ;
get_template_part( 'post', $format );
The template would be called post-standard.php if no format was selected. Hope that helps..
Forum: Fixing WordPress
In reply to: Category archive season?You could add a category for season 2012 and tick that as well as any other category you need, or, you could make those 25 categories children of a season 2012 category. Either will allow you to group all posts by the 2010 season, or any other season you wish.
Forum: Fixing WordPress
In reply to: Category archive season?That’s the same sort of thing. If you really have no idea what you’re doing, why don’t you buy a pre-made theme with some styling you like? Then you can drop in your content and organise it until you’re happy with the result.
It’s going to be “tags” or “categories” either way, all posts in WordPress have to be grouped somehow, even if it’s to one default category.
Forum: Plugins
In reply to: [Genesis Responsive Slider] Responsive Slider is itty bittyTry using this as the selector;
div.home-featured.widget-area
Forum: Plugins
In reply to: [Genesis Responsive Slider] Responsive Slider is itty bittyThere will be a way to target just the slider CSS, when I’m back at the computer I’ll take another look…
Dan
Forum: Fixing WordPress
In reply to: wordpress child pages don't show on hover for non membersI’m glad to hear it’s fixed. You might want to put the nav code back how it was as well, just in case you need it!
Forum: Fixing WordPress
In reply to: wordpress child pages don't show on hover for non membersThe membership plugin is probably your issue then, it may be stopping pages you want to show the public from being viewed. Maybe read up on the plugin a bit and see if it’s set up correctly.
Forum: Fixing WordPress
In reply to: wordpress child pages don't show on hover for non membersThe fact that this doesn’t happen when you’re logged in is very weird. I really can’t think of anything else other than privacy settings. If you make a new menu in appearance -> menus, call it “nav” and add items to it, indent them for the child pages and see if it works. If not, I’m out of ideas at the moment.
Well, there’s plenty of good themes out there, or get one made for you. You could get someone to take all the design and functionality of your current theme and move it to the newest WP version, that way you’d see minimal difference but you’d be more secure and probably faster. WP has changed quite a lot over time, I think so anyway.
You can’t just drop in that code, you need the bits that go with it : )
If the theme is that old it might be nice to get a new theme anyway? Something responsive and pretty ; )
Forum: Fixing WordPress
In reply to: Image rotation issues and incorrect mobile browser displayOnce the image has been rotated it can’t change – an image is an image. I can think of two possibilities;
– Clear your cache(s) on your devices and you may be seeing an “older” image
– There is some CSS transform that’s rotating images, although I think it’s unlikely. I work with tablet and phones a lot, and I’ve not seen this issue, you have to deliberately rotate an image.Some screenshot may help someone on the forum know a little more about what’s going on.
Dan
Forum: Fixing WordPress
In reply to: no theme displayI don’t know much about hosting to be honest, but I can see stuff like your stylesheet is still pointing at the old domain;
<link rel="stylesheet" type="text/css" media="all" href="https://burundi.terilynn.ca/wp-content/themes/selecta/style.css" />
– that will be why it looks like it does. The should be because of the setting in the wp_options table – namely the site url and home page url settings. I can’t remember for sure, but if you look in the options table you should find it on pages 1 and 2.