Using AJAX Pagination

This time we’re going to create a simple “Load More” button with ajax. There won’t be any automatic scrolling yet(soon in my future tutorials).

This was an original answer from StackOverflow. Credits to the person who provided this wonderful solution.

First let’s start with creating the shortcode to display the blog posts. This will be a regular loop and using “post” as the post type.

Next we need the ajax script. We’re going to hook it inside “wp_head”.

Finally the ajax hook in order for this snippet to work.

Using Enclosing Shortcode

In this short snippet we’re going to make use of enclosing shortcode. It’s very useful if you want to use a div with specific class multiple times.

function div_enclose_callback($atts = [],$content = null){
	$a = shortcode_atts( array(
		'class' => '',
	), $atts );

	ob_start();
	?>
	<div class="<?php echo $a['class'] ?>" ><?php echo $content; ?></div>
	<?php

	return ob_get_clean();
}
add_shortcode( 'div_enclose', 'div_enclose_callback' );

The usage would be this.

[div_enclose class='custom']Test[/div_enclose]
<!--expected output:-->
<div class='custom'>Test</div>

Using Output Buffer in Shortcode

If you’re using a shortcode to display a customize content with lots of HTML tags output buffering is your tool. It’s a common Issue when using a shortcode is we echo it’s output, in return the output doesn’t follow the layout of the builder.

function display_me_properly_callback(){
  ob_start();
  ?>
  <h2>Hello</h2>
  <p>This is a test.</p>
  <?php
  return ob_get_clean();
}
  
add_shortcode("display_me_properly","display_me_properly_callback");

Using Add Filter

This will be a simple snippet to show the usage of add_filter() in WordPress. I will show you how you a simple usage of this powerful WordPress hook!

function rda_hello_world_callback(){

	echo  apply_filters( 'rda_hello_text', "Hello world!" );

}

Then here's the snippet to modify our message in the shortcode.

function rda_hello_text_callback( $text ) {

	$text = $text . ' Good morning!';

	return $text;

}

add_filter( 'rda_hello_text', 'rda_hello_text_callback' );

Now if you're done with it, our output would be like this.

Hello world! Good morning!

Eat that frog, I meant your hardest task.

Yes, I know a frog an amphibian. Something that you wouldn’t even dare to touch. Same way you think about that task you don’t even bother looking at.

Mark Twain has this famous quote.

“If the first thing you do each morning is to eat a live frog, you can go through the day with the satisfaction of knowing that that is probably the worst thing that is going to happen to you all day long.”

I learned about him in one of  Brian Tracy’s article. The frog is your task, you gonna deal with it no matter what or it’s just going to stay in your pending list forever along with the other ones who are also lost in the abyss.



Incorporate it into a habit ,  whenever you wake up do it first in the morning. Use a smartphone or any tool to track your progress. Having that feeling of accomplishing that hardest task that you’re stressing about is one of the most satisfying things you could achieve.

I hope you enjoy my blog! It would really help if you give me a feedback, I’ll really appreciate it. Submit feedback

Using Reddit to Improve

Reddit, our procrastination buddy, the place where we always get drowned in its fun stuff. There’s a lot of stuff you could find there, a subreddit catered for your personal preference.

With that given, there’s also a bunch of subreddit catered for personal growth, also reddit greatly influence me that’s why I’m able to blog  Smartphone Minimalism and turning goals into habits.



With that said I’m going to share with you a brief overview of subreddits that will greatly improve your way of life and hopefully increase your productivity. Take your time and check each subreddit which will greatly help you.

My Top 5 Subreddits

1. r/getdisciplined/ –  If you want advice to stop a bad habit and start a good one redditors here respond very quickly.

2. r/selfimprovement/ – Subreddit for people who want to improve. Pretty straightforward, redditors here will provide you tips and advice on how you can grow that skill.

3. r/howtonotgiveafuck/ – If you want to let go of that fear, be daring and know what you can be, this active community is yours.

4. r/productivity/ – Ok you have a deadline you wanna meet? Join this group. Lots of tips and workflows you can learn if you join this community.

5. r/Frugal/ – I personally like this group, if you want to improve your relationship with money you need to join this community.

I hope you enjoy my blog! It would really help if you give me a feedback, I’ll really appreciate it. Submit feedback