Storing query variable and then using wp_reset_query

wp_reset_query(); resets the query to the original main query of the page. Therefore, storing the query in another variable is redundant and unnecessary. Updated code: $args = array( ‘cat’ => 15, ‘paged’ => $paged ); $custom_query = new WP_Query( $args ); while ($custom_query -> have_posts()) : $custom_query -> the_post(); endwhile; my_pagination(); //call function wp_reset_query(); //#3. … Read more

Customize the previous_post_link output

I would just filter previous_post_link and next_post_link. This way, your template stays clean, and you move the extra logic to the functions.php. Example, not tested: add_filter( ‘previous_post_link’, ‘filter_single_post_pagination’, 10, 4 ); add_filter( ‘next_post_link’, ‘filter_single_post_pagination’, 10, 4 ); function filter_single_post_pagination( $output, $format, $link, $post ) { $title = get_the_title( $post ); $url = get_permalink( $post->ID ); … Read more

wp theme.. Could not create directory

If you can log into your host with SSH or FTP, it’s an easy fix. Like the comments said before, check your permissions for the WordPress directory. For example, if you check the hosting directory with ls -al (typically /var/www, as on DigitalOcean), they should look something like this: drwxrwxr-x 6 www-data www-data 4096 Nov … Read more

How to understand a specific bit of WordPress syntax

That’s a Shortcode. It may be possible to find the function that renders that shortcode and copy/paste it into your own plugin, making it theme-independent, however, how easy that will be to do depends on how the shortcode works- if it depends on additional php functions, JavaScript, and CSS embedded within the theme.