DEV Community

Cover image for How to Add Quote of the Day on Blog Post
Ayush Sharma
Ayush Sharma

Posted on

How to Add Quote of the Day on Blog Post

Ever wondered how some blogs seamlessly weave wisdom into their content? The secret might be the daily dose of inspiration - a "Quote of the Day."

This post will crack the code, showing you how to effortlessly add these powerful elements to your blog post and keep your readers coming back for more.

You can implement a 'Quote of the Day' element in three ways on your blog post. We will delve into each method from the easiest to the difficult ones.

Method 1: Using the embed provided by Quotes Websites.

Many quotes websites provide embeddable code to display Quote of the Day on your blog. Let's use the one I found at Success Trending. The only thing you need to do is copy the HTML code and paste that into the HTML section of your blog post. Here is how beautiful it looks.

Method 2: Using the WordPress Plugins.

If you are using WordPress, you can take advantage of various plugins that are available for use. Just install one of the plugins like Quote of the Day by BrainyQuote and you should be able to display various quotes from the BrainyQuotes collection.

Method 3: Create a Quote of the Day by using HTML and CSS.

This is another way to add quotes of the day to your blog post. The Codepen has different types of Quote of the Day code blocks that you can use to display the Quote of the Day on your blog post.

  <header class="text-center">
    <h1> Quote Of The Day</h1></header>
  <div class="container text-center">
    <button type="button" class="btn btn-default btn-lg" id="randomquote" onclick="javascript:showRandomQuote()"><i class="fa fa-bookmark"></i> New Quote</button><a href="" class="btn btn-default btn-lg" onclick="javascript:tweet()" id="tweet"><i class="fa fa-twitter"></i>Tweet This!</a>
    <div class="quoteContainer">
      <div id="quote"></div>
      <br />
      <div id="author"></div>
      <br />
    </div>
  </div>
Enter fullscreen mode Exit fullscreen mode

Look at the Codepen that you can take inspiration from. Using the HTML, CSS, and JavaScript as shown in the below Codepen, anyone can easily add a 'Quote of the Day' to their blog post. You could be creative and customize it the way you want.

So, what are you waiting for? Start sprinkling your blog with quotes and ignite inspiration in your readers. A well-selected quote can make an impression and entice readers to return for your daily dose of wisdom. Don't forget to share your favorite method in the comments below – let's spark a conversation!

Top comments (0)