flatpress
flatpress copied to clipboard
Define array keys for use in templates
To display certain outputs only in static pages or entries or in categories, the following array keys must be defined so that no PHP warning is issued:
Undefined array key "entry" Undefined array key "cat" Undefined array key "category" Undefined array key "m" Undefined array key "y" Undefined array key "page" Undefined array key "paged" Undefined array key "comments"
Steps towards reproducibility:
Include the following queries in the header.tpl template:
{if $flatpress.params.entry}
{if $flatpress.params.entry}
:: <p>Output</p>
{/if}
{else}
{if $flatpress.params.cat}
:: <p>Output</p>
{/if}
{if $flatpress.params.y}
:: <p>Output</p>
{if $flatpress.params.m}
<p>Output</p>
{/if}
20{$flatpress.params.y}
{/if}
{/if}
https://github.com/flatpressblog/flatpress/blob/dabe687de82ac12099bac00eb6936d1377921e9c/index.php#L60
https://github.com/flatpressblog/flatpress/blob/dabe687de82ac12099bac00eb6936d1377921e9c/index.php#L84