FG Wordpress Template With Twig
Installation
- Install wordpress
- Install Timber plugin (twig)
- Install Metabox plugin (http://metabox.io)
- run
composer update
on the root of the theme (this install symfony yaml parser for reading settings)
- Select theme.
- On local machine run npm install to install grunt task runner.
- Select google fonts, update Gruntifile.js, and run
grunt googlefonts
- Run grunt watch and update css or js to upload assets.
File Structure
โโโ 404.php
โโโ composer.json
โโโ functions.php
โโโ include
โย ย โโโ shortcodes
โย ย โย ย โโโ accordion.php
โย ย โย ย โโโ ajax.php
โย ย โย ย โโโ carousel.php
โย ย โย ย โโโ custom-template.php
โย ย โย ย โโโ email.php
โย ย โย ย โโโ tabs.php
โย ย โย ย โโโ twig.php
โย ย โย ย โโโ gallery.php
โย ย โย ย โโโ link.php
โย ย โย ย โโโ page-gallery.php
| |
โย ย โโโ shortcodes.php
โย ย โโโ theme-settings.php
โโโ index.php
โโโ page-templates
โย ย โโโ blank.php
โย ย โโโ contact.php
โย ย โโโ full-width.php
โย ย โโโ landingpage.php
โย ย โโโ listings.php
โย ย โโโ modular.php
โโโ README.md
โโโ screenshot.png
โโโ style.css
โโโ twig-templates
โโโ base.twig
โโโ footer.twig
โโโ header.twig
โโโ partials
โย ย โโโ article-list-element.twig
โย ย โโโ article.twig
โย ย โโโ awards.twig
โย ย โโโ blog-sidebar.twig
โย ย โโโ blog-tags-cats.twig
โย ย โโโ bootstrap-carousel.twig
โย ย โโโ breadcrumbs.twig
โย ย โโโ contact-sidebar.twig
โย ย โโโ gallery.twig
โย ย โโโ modal-inner.twig
โย ย โโโ navigation.twig
โย ย โโโ realtor-directory.twig
โย ย โโโ responsive-list.twig
โย ย โโโ social-sharing.twig
โย ย โโโ specials.twig
โโโ wp
โโโ archive.twig
โโโ index.twig
โโโ page-404.twig
โโโ page-blank.twig
โโโ page-contact.twig
โโโ page-full-width.twig
โโโ page-landing-twig
โโโ page-listings.twig
โโโ page-modular.twig
โโโ page.twig
โโโ single.twig
Shortcodes
[accordion] & [panel]
Creates Bootstrap accordions., (*1)
The [accordion] shortcode does not accept any attributes. All content of an [accordion] shortcode which is not a [panel] shortcode (or content nested therein) is ignored., (*2)
The [panel] shortcode accepts the following attributes:, (*3)
Attribute |
Description |
id |
An HTML ID which shall be used for the panel (one will be automatically generated if this is not supplied) |
title |
A title for the panel |
active |
default false, opens accordion if true |
The content of the [panel] shortcode shall be used as the content of the panel in the accordion., (*4)
[collapse] & [panel]
Creates Bootstrap collapse., (*5)
The [collapse] shortcode accepts these attributes.
All content of an [collapse] shortcode which is not a [panel] shortcode (or content nested therein) is ignored., (*6)
Attribute |
Description |
iconup |
the icon that is shown next to text to indicate up, the down arrow is same but rotated 90deg |
fontfamily |
for the icon default is FontAwsome |
The [panel] shortcode accepts the following attributes:, (*7)
Attribute |
Description |
id |
An HTML ID which shall be used for the panel (one will be automatically generated if this is not supplied) |
title |
A title for the panel |
active |
default false, opens accordion if true |
The content of the [panel] shortcode shall be used as the content of the panel in the accordion., (*8)
[carousel] & [slide]
Creates Bootstrap carousels., (*9)
The [carousel] shortcode accepts the following attributes:, (*10)
Attribute |
Default |
Description |
controls |
true |
If "false" then the carousel shall not have controls for moving between the slides |
id |
myCarousel |
An HTML ID which shall be used for the carousel (one will be automatically generated if this is not supplied) |
indicators |
true |
If "false" then the carousel shall not have indicators indicating which slide is currently active (and how many slides there are) |
innerclass |
An HTML class (or list of classes) which shall be applied to the inner container of the generated Bootstrap carousel |
outerclass |
An HTML class (or list of classes) which shall be applied to the outer container of the generated Bootstrap carousel |
All content of a [carousel] shortcode which is not a [slide] shortcode is ignored., (*11)
The [slide] shortcode accepts the following attributes:, (*12)
Attribute |
Description |
alt |
The alt text for the image which appears on the slide |
caption |
A caption which shall appear on the slide (defaults to no caption) |
title |
The title of the slide (defaults to no title) |
url |
The URL of the image which shall appear on the slide |
All content of a [slide] shortcode is ignored., (*13)
[custom-template] & [custom-item]
Allows a specified Twig template to be rendered., (*14)
The [custom-template] shortcode accepts one attribute explicitly:, (*15)
Attribute |
Description |
template |
Specifies the file name of the template which shall be rendered |
Any other attributes of the shortcode have their values passed through as variables in the template., (*16)
Note that if you specify the "data" attribute it will be overwritten and its value will therefore be inaccessible (see below)., (*17)
The [custom-item] shortcode creates an entry in the array passed through to the rendered template as the "data" variable. The entry shall have a property corresponding to each attribute of the [custom-item] shortcode in addition to a "content" property which contains a string containing the contents of the shortcode. Note that because of this if you use the "content" attribute of a [custom-item] shortcode it will be overwritten and therefore its value will be inaccessible., (*18)
[tabs] & [tab]
Creates Bootstrap tabs., (*19)
The [tabs] shortcode does not accept any attributes. All content of a [tabs] shortcode which is not a [tab] shortcode (or content nested therein) is ignored., (*20)
The [tab] shortcode accepts the following attirbutes:, (*21)
Attribute |
Description |
active |
If "true" then the tab-in-question shall be the default active tab, if no tab is marked as active the first tab shall be active by default |
id |
An HTML ID which shall be used for the panel (one will be automatically generated if this is not supplied) |
title |
A title for the tab |
The content of the [tab] shortcode shall be used as the content of the tab., (*22)
[pills] & [pill]
Creates [Bootstrap pills]., (*23)
The [pills] shortcode does not accept any attributes. All content of a [pills] shortcode which is not a [pil] shortcode (or content nested therein) is ignored., (*24)
The [pill] shortcode accepts the following attirbutes:, (*25)
Attribute |
Description |
active |
If "true" then the tab-in-question shall be the default active tab, if no tab is marked as active the first tab shall be active by default |
id |
An HTML ID which shall be used for the panel (one will be automatically generated if this is not supplied) |
title |
A title for the tab |
The content of the [tab] shortcode shall be used as the content of the tab., (*26)
[ajax]
The [ajax] shortcode is used to load page content via ajax. The page that the ajax code is on requires you to use No Template or the blank template., (*27)
The [ajax] shortcode accepts the following attribute., (*28)
Attribute |
Description |
template |
is used to load the twig template it is going to wrap the content around |
[link]
The [link] shortcode accepts the following attribute., (*29)
Attribute |
Description |
id |
The post id which will convert it to url (preferred method) |
href |
The complete url |
attr |
use any attribute ie class="myclass" target="_blank" |
[link id="2"]contact us[/link] --> contact us, (*30)
[link href="https://google.com" attr="target=_blank" ]Search Engine[/link] --> <a href="https://google.com" target="_blank">Search Engine</a>
[email]
Attribute |
Description |
label |
If you require the label to be something different |
[email label="email"]webmaster@example.com[/email], (*31)
[twig]
Allows you to add twig functions, as well as obtain global twig variables., (*32)
[twig]{{config.company.booking.url}}[/twig], (*33)