Adding link to dashboard sidebar, nested under custom post type

This should do it. function register_additional_page(){ add_submenu_page(‘edit.php?post_type=tree’, ‘Bulk Process’, ‘Bulk Process’, ‘activate_plugins’, ‘tree_bulk_process’, ‘render_bulk_tree_process’); } add_action(‘admin_menu’, ‘register_additional_page’); And the function that renders the page. function render_voucher_list_page(){ ?> <h2>Hello World</h2> <?php } Change post_type=tree to your Custom Post Type, Bulk Process to the menu title, activate_plugins to your desired user capability, tree_bulk_process to your page ‘slug’ … Read more

Posts in sidebar only by admin

You need to add an author parameter to the query that is creating $cust_loop. You didn’t post that part of your code but something like: $cust_loop = new WP_Query( ‘author=123’ ); Or: $cust_loop = new WP_Query( ‘author_name=rami’ ); Note: Both of those taken (almost) straight from the Codex paged for WP_Query.

Sidebar limiting to 10 posts?

Your problem is that you’re using query_posts(), when you need to be using WP_Query(). To display all posts (by ignoring pagination, use the posts_per_page parameter: $cat_query_args = array( // Include posts from category with ID $cat_id ‘cat’ => $cat_id, // Include all posts ‘posts_per_page’ => -1 ); $cat_query = new WP_Query( $cat_query_args ); if ( … Read more

WordPress Queries Not Working?

For the sidebar bit, you should be using a new Wp_Query: if ( $query->is_category(‘movies’) ): $movies = new Wp_Query(‘tag=movie-reviews’); while ( $movies->have_posts() ) : $movies->the_post(); get_template_part( ‘sidebar-reviews’, get_post_format() ); endwhile; else: get_template_part( ‘no-results’, ‘index’ ); endif; You don’t need query filters for anything except the main loop on a page.

Split the content of the_content();

I am guessing, at least partially, but it sounds like the FaceBook content is loaded as a filter on the_content, which you run on both blocks of content. The quick fix, keeping most of your code intact, would be to remove the FaceBook filter for the first array, then put it back for the second. … Read more

Stuck with sidebar registering

get_sidebar(‘dfth’) looks for a sidebar-dfth.php file in your template directory. If not found, it loads the default sidebar. To call the sidebar you registered in a template, use e.g. <?php if ( is_active_sidebar( ‘dfth’ ) ) : ?> <div class=”first dfth-widgets”> <?php dynamic_sidebar( ‘dfth’ ); ?> </div><!– .first –> <?php endif; ?>

Need to setup grid like thumbnail of recent posts on sidebar

You could use wp_get_recent_posts() to get the latest posts, like: <h2>Recent Posts</h2> <ul> <?php $args = array( ‘numberposts’ => ‘5’ ); $recent_posts = wp_get_recent_posts( $args ); foreach( $recent_posts as $recent ){ echo ‘<li><a href=”‘ . get_permalink($recent[“ID”]) . ‘” title=”Look ‘.esc_attr($recent[“post_title”]).'” >’ . $recent[“post_title”].'</a> </li> ‘; } ?> </ul> Then, use get_the_post_thumbnail() to get the Featured … Read more

Change twentytwelve sidebar responsive relocation?

The fast way to do this is to just change how it is loaded, open index.php and move this code: <?php get_sidebar(); ?> From line 73 and put it under get_header(); ?> around line 18, so it should look like: get_header(); ?> <?php get_sidebar(); ?> <div id=”primary” class=”site-content”> // rest of twentytwelve code. Ps. I … Read more

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