Modify Page Title before output via wp_page_list

Very crude way of doing it: <?php $children = wp_list_pages(“title_li=&child_of=”.$post->ID.”&echo=0&exclude=&depth=1″); $children = str_replace(“Intro”, “Special”, $children); ?> Or alternatively you can look at using the new menus feature in WordPress 3.0. Build up you menu of pages, and in there you can assign a different menu name to the page title. http://en.support.wordpress.com/menus/

Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !

This would be the way I’d do it. Add the following to your functions.php; class Walker_Category_Posts extends Walker_Category { function start_el( &$output, $category, $depth, $args ) { parent::start_el( $output, $category, $depth, $args ); if ( $category->parent ) return $output; if ( $posts = get_posts( ‘posts_per_page=-1&no_found_rows=1&update_term_cache=0&cat=” . $category->term_id ) ) { $output .= “<ul>’; foreach ( … Read more

How to get a list of taxonomy terms which are being used only within certain post types?

I’m not a programmer so there’s probably a far more efficient/correct way of doing this. Put this in functions.php or a custom plugin: function get_terms_by_post_type( $taxonomies, $post_types ) { global $wpdb; $query = $wpdb->get_results( “SELECT t.*, COUNT(*) from $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN $wpdb->term_relationships AS r … Read more

TinyMCE – Add class to OL – selector doesn’t seem to get parent OL,UL, just LI’s (4.6.3)

I figured this out! I ended up running across this page today searching for something else and thought, THIS IS IT. I needed this property ‘selector’, because it seems like that guides what the selection should be targeting so I changed ‘block’ => ol to ‘selector’ => ‘ol’. function bb_mce_before_init_insert_formats( $init_array ) { $style_formats = … Read more

Populating a page with content from post custom fields

I suggest using shortcode, as this’ll easily allow you embed the song list anywhere in your content, in any page or post. UPDATE: I got a little carried away, and ended up with this! function song_list_shortcode( $attrs ) { $r = ( object )wp_parse_args( $attrs, array( ‘format’ => ‘%post_title – %link’, ‘link’ => ‘%song_key_name’, ‘key’ … Read more

Show template loaded

The following will show the current template file to logged in admins only. If you add to the top of your functions file, you should see this info as the first line. add_action(‘wp_head’, ‘show_template’); function show_template() { global $template; global $current_user; get_currentuserinfo(); if ($current_user->user_level == 10 ) print_r($template); } You will still need to follow … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)