ajax response -1 in wordpress theme

Pay attention that your ajax request will work only for logged in users. If you want to make it working for everybody, you have to add one more action wp_ajax_nopriv_myajaxpagination with the same hook: function videospage(cnt) { var pageno=cnt; jQuery.ajax({ type: “POST”, url: “<?php echo admin_url(‘admin-ajax.php’); ?>”, data: { action: “myajaxpagination”, pageno: pageno, }, success: … Read more

How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?

In your main loop file, check the $args. It filters the query. you can use the same query on other pages using your own options. suppose, on another page, you want to fetch the posts of a different category. your query parameters may be like: $args = array( ‘post_type’ => ‘post’, ‘cat’ => ‘DIFFERENT_CATEGORY’, ‘posts_per_page’ … Read more

Theme options save routine clashes with plugin save

maybe you have to change the structure of your theme options page and use add_theme_page() to avoid this type of problems /* REGISTER THEME OPTION PAGE */ if ( ! function_exists( ‘RMH_admin_menu’ ) ): function RMH_admin_menu() { global $theme_name; add_theme_page( ‘Opções para o tema ‘.$theme_name, ‘Temas Opções’, ‘edit_theme_options’, ‘RMH-theme-options’, ‘RMH_theme_options’ ); } add_action( ‘admin_menu’, ‘RMH_admin_menu’ … Read more

How do I get standard posts to open up in their own template when using get_template_part()?

There’s actually nothing to fix. In Twenty Eleven, this is used in index.php: <?php get_template_part( ‘content’, get_post_format() ); ?> …and this is used in single.php: <?php get_template_part( ‘content’, ‘single’ ); ?> The design intent here is that all posts, regardless of post format, will display the same in single-post view, but that posts with defined … Read more

How can I prevent posts with no title showing up in my query?

Please find below a quick solution to your problem first query for all empty titles place the result in an array query again for post__not_in see below sample code $query = new WP_Query(‘post_title=\’\”); $a_empty_titles = array(); while($query->have_posts()){ $query->the_post(); array_push( $a_empty_titles ,$query->post->ID); } wp_reset_postdata(); wp_reset_query(); echo count($a_empty_titles); $query = new WP_Query( array( ‘post__not_in’ => $a_empty_titles ) … Read more