Pagination not displaying

You need to add your query variable to the global used on the function, in that case “$wp_query“, just like that: <?php $yourQuery_args = [‘posts_per_page’ => ‘7’,]; $yourQuery = new WP_Query( $yourQuery_args ); $wp_query = $yourQuery; get_template_part(‘pagination’); ?>

Index.php is ordering posts strangely

You shouldn’t modify the main query like that. Instead, make a secondary loop: // The Query $args = array( ‘post_status’ => ‘publish’, ‘post_type’ => ‘post’, ‘orderby’ => ‘date’, ‘order’ => ‘desc’, ); $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); // Do output … Read more

Sending Parameter Failed

When an action is defined, the parameters passed to the callback are defined as well. For example, you can define an action with 4 parameters: $a = 1; $b = 2; $c = 3; $d = 4; do_action( ‘name_of_my_action’, $a, $b, $c, $d ); Then, when you hook in that action, you can tell how … Read more

Rewrite old post images to https

It’s very primitive method but works in any case; Make a dump from MySQL Open it with text editor or maybe another tool you liked (If your dump is so big, you’ll need a strong computer.) Find all http://example.com, replace with https://example.com and save. Rename/move the old database for backup, import the edited database. Leave … Read more

Add a short code to a plugin

Here is the code that you need to pull content from a wordpress page you will require the id number of the page and add it into the shortcode. [example page_id=”21″][/example] function example_shortcode( $atts, $content = null) { extract( shortcode_atts( array( ‘page_id’ => ” ), $atts ) ); // Will display our page content of … Read more