adding my posts (author posts) in menu
You could use this: <a href=”https://wordpress.stackexchange.com/questions/54419/<?php echo home_url() .”/author/’ . get_the_author_meta( ‘user_login’, wp_get_current_user()->ID ); ?>” >My Posts</a>
You could use this: <a href=”https://wordpress.stackexchange.com/questions/54419/<?php echo home_url() .”/author/’ . get_the_author_meta( ‘user_login’, wp_get_current_user()->ID ); ?>” >My Posts</a>
query_posts should only be used for the main loop. Instead, use a new instance of the WP_Query class: $my_query = new WP_Query( array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 10, ‘order’ => ‘DESC’, ‘paged’=> $paged ) ); echo ‘<ul>’; while ( $my_query->have_posts() ) : $my_query->the_post(); if ( $my_query->current_post > 0 && ( $my_query->current_post + 1 ) … Read more
You have to drag and drop the menu itens by hand, maybe some code can put the posts automatically there too. About menus in WordPress: http://codex.wordpress.org/Appearance_Menus_SubPanel
In order to make it working you need to return updated data: function my_insert_post_data($data, $postarr){ $data[“post_parent”] = 123; $postarr[“parent_id”] = 123; $postarr[“post_parent”] = 123; error_log(print_r($data,true)); error_log(print_r($postarr,true)); return $data; } add_filter( ‘wp_insert_post_data’ , ‘my_insert_post_data’ , 99, 2 );
From what I recall, if a page is a child of another page, the pagename value is the full parent / child path. In your examples it would be pagename=questions/ask and pagename=questions/ed, though you say the first rule works, which is puzzling. also, side note – there’s a locate_template function that will correctly handle parent … Read more
I have managed to find the problem. Basically calling the google API from the footer was causing the maps to break and not function properly.
EDIT In single.php you should be using: <?php previous_post_link(‘%link’, ‘Previous’); ?> and <?php next_post_link(‘%link’, ‘Next’); ?>. Then you add this to your functions.php: function filter_next_post_link($link) { $link = str_replace(“rel=”, ‘class=”next” rel=”, $link); return $link; } add_filter(“next_post_link’, ‘filter_next_post_link’); function filter_previous_post_link($link) { $link = str_replace(“rel=”, ‘class=”prev” rel=”, $link); return $link; } add_filter(“previous_post_link’, ‘filter_previous_post_link’); Although this is not … Read more
move the div section from the start to after the if(have_posts()) { line, and move the corresponding closing divs to just before the closing bracket } of this if statement; full code: <?php global $post; $terms = get_the_terms( $post->ID , ‘movies’, ‘string’); $do_not_duplicate[] = $post->ID; if(!empty($terms)){ foreach ($terms as $term) { query_posts( array( ‘movies’ => … Read more
in your foreach you assign get_the_category() to $category, but then inside get_category_parents(), you pass $cat instead of $category.
If you have your custom post type rewrite rules set up properly, you shouldn’t need to create a new WP_Query in your template file. Comment out the new WP_Query line or rename your portfolio-single.php so WP pulls from the default single.php and see if it pulls the proper post. You can also call echo $post->ID … Read more