
How to adjust the display position or blog widget in a particular page, or on any front.
PAGE front (home, porch, the homepage) blogs are already showing Posts (Recent Posts, Latest Posts).
So, no need for Posts widget on the homepage, but rather to show the widget "Posts" was only on the inside pages, the page posts, or "single post".
How do I show the recent posts widget or widgets only on certain pages? There are two that we must enter the code:
- HTML code to display the widget on the front page (home) only: <b: if cond = 'data: the blog.homepageUrl == Data: blog.url'> code closing </ b: if>
- HTML code to display the widget on the page in the (post) only: <b: if cond = 'data: the blog.pageType == & quot; item & quot;'> and code closing </ b: if>
Examples of the application of the first code (the widget only appears on the front page only) for Widget Posts:
1. "Layout"> Click "Add a Gadget"
2. Select the "Feed"
3. Enter this URL: http://namabloganda.blogspot.com/feeds/posts/default
4. Change the title or the "Widget Title" with the name Posts
5. Save!
The next step is to go to the Edit Template: Template> Edit HTML and find the code as shown below:
<b: widget id = 'HTML1' locked = 'false' title = 'Posts' type = 'HTML'>
<b: includable id = 'main'>
<! - Only display title if it's non-empty ->
<b: if cond = 'data: the title! = ""'>
<h2 class = "title"> <data: title /> </ h2>
</ b: if>
<div class = 'widget-content ">
<data: content />
</ div>
<b: include name = 'QuickEdit' />
</ b: includable>
</ b: widget>
Save <b: if cond = 'data: the blog.homepageUrl == Data: blog.url'> right after the <b: includable id = 'main'> and code closing </ b: if> stored just above the code </ b: includable>. The result will be like this:
<b: widget id = 'HTML1' locked = 'false' title = 'Posts' type = 'HTML'>
<b: includable id = 'main'>
<b: if cond = 'data: the blog.homepageUrl == Data: blog.url'>
<! - Only display title if it's non-empty ->
<b: if cond = 'data: the title! = ""'>
<h2 class = "title"> <data: title /> </ h2>
</ b: if>
<div class = 'widget-content ">
<data: content />
</ div>
<b: include name = 'QuickEdit' />
</ b: if>
</ b: includable>
</ b: widget>
Examples of the application of the code (display widgets on the page only)
Do the same as above steps. In the template you will have the code as shown below:
<b: widget id = 'HTML1' locked = 'false' title = 'Name Widget' type = 'HTML'>
<b: includable id = 'main'>
<! - Only display title if it's non-empty ->
<b: if cond = 'data: the title! = ""'>
<h2 class = "title"> <data: title /> </ h2>
</ b: if>
<div class = 'widget-content ">
<data: content />
</ div>
<b: include name = 'QuickEdit' />
</ b: includable>
</ b: widget>
Enter the code <b: if cond = 'data: the blog.pageType == & quot; item & quot;'> after the <b: includable id = 'main'> and the </ b: if> before </ b: includable> . The result will be like this:
<b: widget id = 'HTML1' locked = 'false' title = 'Name Widget' type = 'HTML'>
<b: includable id = 'main'>
<b: if cond = 'data: the blog.pageType == & quot; item & quot;'>
<! - Only display title if it's non-empty ->
<b: if cond = 'data: the title! = ""'>
<h2 class = "title"> <data: title /> </ h2>
</ b: if>
<div class = 'widget-content ">
<data: content />
</ div>
<b: include name = 'QuickEdit' />
</ b: if>
</ b: includable>
</ b: widget>
Other variations:
1. Widgets appear only in a static page:
<b: if cond = 'data: the blog.pageType! = "static_page"'>
2. The widget only appear on the page / post specific
<b: if cond = 'data: the blog.url == "Page URL Here"'>
That way Displays Widget "Posts" Only in Page Posts (Single Post) or how to bring other widgets on the front page or in the course.
0 Komentar untuk "How to display the Widget "Posts" Only in Page Posts (Single Post)"