How to find the data:post.body or post body in blogger template?

In blogger template, <data:post.body/> is the tag which prints out the full body of your post. This is important to know where this tag is to do things around post body. But the problem is, in some templates there can more than one <data:post.body/>. So how to find which one is the one that prints your post? Unfortunately there is only one way, debugging.

Beginner? Better watch the video tutorial instead

Login to your blogger account.

If you have multiple blogs then click on Template from the dropdown menu beside the blog name as follows

Otherwise, click on the Template menu item on the left hand side menu as follows

Anyway, in the Template page, click on Edit HTML button


Now you will see the template code for you blog. After the loading is complete, click anywhere in the code editor and press CTRL+F to find text in the code. At the top-right corner of the code editor a search box will appear.

Click on the search box and type <data:post.body/> and hit Enter. Notice the line number and hit enter again, notice the line number again. If this line number is that same as the previous one, then this means, you have only one <data:post.body/> in your template, otherwise, you have more than one, and to find them all, keep hitting Enter and notice the line number

So you now know how to find <data:post.body/> in your template.

If you have multiple <data:post.body/> in your template then, before each of those <data:post.body/> tag write this <h1>First</h1>, here 'First' is for the first <data:post.body/>, write 'Second' for the second <data:post.body/> and so on. Now save your template by clicking on the Save Template button at the top-left side of the code editor. 

After saving is complete, go to your blog and notice which <h1 /> tag is appearing before your post body. If 'First' is appearing then the first <data:post.body/> is the actual <data:post.body/>.

That's it, you just debugged your code to find out which <data:post.body/> is the actual one working. Now go back to your template code editor and again find all those <data:post.body/> and remove the <h1></h1> tag you added to debug, but only before the actual <data:post.body/>, write something like <!-- POST BODY HERE -->, a comment, so that the next time you come to the code editor and search for POST BODY HERE to find the actual <data:post.body/>.

Just don't forget to remove all the <h1></h1> tags you used for debugging.


Never Miss What"s New !

No SPAM, only email notification if new posts were published.

Recommended Recommends


Contact Us