How to display paginated posts from all categories?

A basic WP_Query instance and loop will work (untested): $posts = new WP_Query( array( ‘paged’ => get_query_var( ‘paged’, 1 ), ) ); while ( $posts->have_posts() ) { $posts->the_post(); … } $current_page = 1; if ( isset( $_GET[‘paged’] ) ) { $current_page = absint( $_GET[‘paged’] ); } echo paginate_links( array( ‘base’ => add_query_arg( ‘paged’, ‘%#%’ ), … Read more

Paginate_Links page 2 doesn’t work

I believe the mistake is using get_query_var( ‘paged’ ): this comes from the main query, not from your custom query. Try this (untested): $current_page = 1; if ( isset( $_GET[‘page’] ) ) { $current_page = absint( $_GET[‘page’] ); } And then replace uses of get_query_var( ‘paged’ ) with $current_page.

I have issue with decoding json ex. ‘{“a”:”b”}’

One of two things is happening here: Invalid JSON If the value of $extra isn’t a properly-constructed JSON string, then json_decode( $extra ) is returning null. echo null; won’t print anything to the screen. Valid JSON If $extra is a valid JSON string, When you json_decode() it, you’ll get an object (specifically, a stdClass object). … Read more

Want to add custom post type for facebook feed

You need to add the post via function call wp_insert_post. where you need to pass the parameter of post type as name of your custom post type. $wordpress_post = array( ‘post_title’ => ‘Post title’, ‘post_content’ => ‘Post Content’, ‘post_status’ => ‘publish’, ‘post_author’ => 1, ‘post_type’ => ‘custom_post_type’ ); wp_insert_post( $wordpress_post ); Hope this helps

adding a (left or right) sidebar with underscores

First you’ll want to register your sidebar with register_sidebar(), if you haven’t done it already. You can find a basic example on the function’s documentation. To render the sidebar area within your sidebar template file use dynamic_sidebar(). You can wrap that in if statement with is_active_sidebar(), if the sidebar should only be displayed when it … Read more

WordPress send Ajax where click button

@sergio Here is the working answer you can check if there is still any issue paste it here and it if it works well you can upvote the answer to help others. The issue it when you click button your $(this).prop(‘files’)[0] is not working because not this scope to the button element. $(‘body’).on(‘click’, ‘#enviar_fichero’, function() … Read more