Custom Post Type children and grand-children in one list

When i lost track with all the crappy code, i decided to start all over 🙂 And so i found the solution: <?php // Define variables $post_type=”file”; $taxonomy = ‘file-category’; $taxonomy_terms = get_terms($taxonomy); global $current_page_id; $current_page_id = get_the_ID(); // Start if if ($taxonomy_terms) { // Start Foreach foreach ($taxonomy_terms as $taxonomy_term) { // Start arguments … Read more

Need a conditional to test if title of parent page matches title of child page

solution here as function: function testchildren () { global $post; $childtest = get_pages(‘child_of=”.$post->ID); if( count( $childtest ) != 0 ) { return false; } else { return true; } } and implementation as markup: <?php if (have_posts()) : while (have_posts()) : the_post() ; ?> <h2><?php $parent_title = get_the_title($post->post_parent); echo $parent_title; ?> </h2> <?php if ( … Read more

“Static” Child Menu with Accordian

I’ve figured this out. I think one of the examples in the WordPress Codex is supposed to be the solution but simply doesn’t work. Here is what worked for me: <?php if ($post->post_parent) { $ancestors=get_post_ancestors($post->ID); $root=count($ancestors)-1; $parent = $ancestors[$root]; } else { $parent = $post->ID; } $children = wp_list_pages(“title_li=&child_of=”. $parent .”&echo=0″); if ($children) { ?> … Read more

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