EVERYTHING LATEST

Tech News and Articles

A as irregular to noting phase and to and raising rewritten film if been his took question. Decelerate upon positives on need peacefully.
Ghost Knowledgebase Themes

Show content on the specific page in ghost

When we develop our theme, we need to show content only for specific page. It can be homepage, blog page, post page, single page or others. I will show you how to show the content only for the specific page.

 

  1. To show the content only for homepage {{#is "home"}}{{/is}}
{{#is "home"}}
<p>Showing the content only for homepage</p>
{{/is}}

 

2. For post page, you can use this code as wrapper {{#is "post"}}{{/is}}

{{#is "post"}}
    <h2>Post title</h2>
    <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Esse quisquam, quae repellat eveniet sed suscipit!</p>
{{/is}}

 

3. For page, you can the content only for page {{#is "page"}}{{/is}}

{{#is "page"}}
    <h2>Page title</h2>
    <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Esse quisquam, quae repellat eveniet sed suscipit!</p>
{{/is}}

 

4. For the Author page, you can show the content only for the authors. {{#is "author"}}{{/is}}

{{#is "author"}}
    <h2>Author Name</h2>
    <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Esse quisquam, quae repellat eveniet sed suscipit!</p>
{{/is}}

 

5. For the Tag page, you can show the tag page content {{#is "tag"}}{{/is}}

{{#is "tag"}}
    <h2>Tag Name</h2>
    <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Esse quisquam, quae repellat eveniet sed suscipit!</p>
{{/is}}

 

6. {{#is "paged"}}{{/is}} is used to show the content only for other pages not on page 1. The page can be 2, 3, 4, 5, or more

{{#is "paged"}}
    <h2>Tag Name</h2>
    <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Esse quisquam, quae repellat eveniet sed suscipit!</p>
{{/is}}
Enamul Haque

I am a freelance web developer and founder of ElectronThemes. I do blogging and be eager to know new things that make better our developing world. I work on WordPress, react, ghost, laravel. I love to work on an open source project and available on skype: enamul.iu.moni

× Shopping Cart

Your cart is empty.