User Tools

Site Tools


themes:template_tags

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
themes:template_tags [2014/01/19 16:26]
datiswous [Return Functions]
themes:template_tags [2014/06/30 22:59] (current)
shawn_a [Echo / output functions]
Line 6: Line 6:
 ===== Echo / output functions ===== ===== Echo / output functions =====
  
-\\ +==get_page_content()==
-**get_page_content()**+
 <​code><?​php get_page_content();​ ?></​code>​ <​code><?​php get_page_content();​ ?></​code>​
 Echos the page's content. No options. Echos the page's content. No options.
  
-\\ +==getPageContent(),​ returnPageContent()==
-**getPageContent(),​ returnPageContent()**+
 <​code><?​php getPageContent('​slug'​);​ ?> <​code><?​php getPageContent('​slug'​);​ ?>
 <?php returnPageContent('​slug'​);​ ?></​code>​ <?php returnPageContent('​slug'​);​ ?></​code>​
Line 18: Line 16:
 This function comes in handy for those, who want to have custom content boxes in template, and display them on f.e. homepage. This function comes in handy for those, who want to have custom content boxes in template, and display them on f.e. homepage.
  
-\\ +==get_page_excerpt( $n=200, $html=false )==
-**get_page_excerpt( $n=200, $html=false )**+
 <​code><?​php get_page_excerpt($length,​ $html); ?></​code>​ <​code><?​php get_page_excerpt($length,​ $html); ?></​code>​
 Echos an excerpt of the page's content. You can also set the length of the excerpt in characters and if HTML should be included in the excerpt. ''​$length''​ default is 200, ''​$html''​ default is FALSE. Since version 2.02  Echos an excerpt of the page's content. You can also set the length of the excerpt in characters and if HTML should be included in the excerpt. ''​$length''​ default is 200, ''​$html''​ default is FALSE. Since version 2.02 
  
-\\ +==get_page_meta_keywords( $echo=true )==
-**get_page_meta_keywords( $echo=true )** +
 <​code><?​php get_page_meta_keywords();​ ?></​code>​ <​code><?​php get_page_meta_keywords();​ ?></​code>​
 Echos/​Returns the page's keywords and/or tags. No options. Echos/​Returns the page's keywords and/or tags. No options.
  
-\\ +==get_page_meta_desc( $echo=true )==
-**get_page_meta_desc( $echo=true )** +
 <​code><?​php get_page_meta_desc();​ ?></​code>​ <​code><?​php get_page_meta_desc();​ ?></​code>​
 Echos/​Returns the page's META description. No options. Echos/​Returns the page's META description. No options.
  
-\\ +==Not active yet:== 
-<del>**get_page_meta_description( $echo=true )**+<del>==get_page_meta_description( $echo=true )==
 <​code><?​php get_page_meta_description();​ ?></​code>​ <​code><?​php get_page_meta_description();​ ?></​code>​
 Standardized alias for the get_page_meta_desc() function above.</​del>​ For v. 3.4  Standardized alias for the get_page_meta_desc() function above.</​del>​ For v. 3.4 
  
-\\ +==get_page_title( $echo=true )==
-**get_page_title( $echo=true )** +
 <​code><?​php get_page_title();​ ?></​code>​ <​code><?​php get_page_title();​ ?></​code>​
 Echos/​Returns the page's title. No options. ​ Echos/​Returns the page's title. No options. ​
  
-\\  +==get_page_clean_title( $echo=true)==
-**get_page_clean_title( $echo=true)** +
 <​code><?​php get_page_clean_title();​ ?></​code>​ <​code><?​php get_page_clean_title();​ ?></​code>​
 Echos/​Returns the page's title, stripped of all HTML. No options. ​ Echos/​Returns the page's title, stripped of all HTML. No options. ​
  
-\\ +==get_page_slug( $echo=true)==
-**get_page_slug( $echo=true)** +
 <​code><?​php get_page_slug();​ ?></​code>​ <​code><?​php get_page_slug();​ ?></​code>​
 Echos/​Returns the page's slug. No options. Example would be the word '​download'​ in the URL //​get-simple.info/​download//​. ​ Echos/​Returns the page's slug. No options. Example would be the word '​download'​ in the URL //​get-simple.info/​download//​. ​
  
-\\ +==get_page_url( $echo=false )==
-**get_page_url( $echo=false )** +
 <​code><?​php get_page_url();​ ?></​code>​ <​code><?​php get_page_url();​ ?></​code>​
 Echos/​Returns the page's full URL. Options: TRUE for "​return",​ FALSE or blank for "​echo"​. Example would be //​get-simple.info///​ Echos/​Returns the page's full URL. Options: TRUE for "​return",​ FALSE or blank for "​echo"​. Example would be //​get-simple.info///​
  
-\\ +==get_parent( $echo=true )==
-**get_parent( $echo=true )** +
 <​code><?​php get_parent();​ ?></​code>​ <​code><?​php get_parent();​ ?></​code>​
 This will echo/return the slug value of a particular page's parent This will echo/return the slug value of a particular page's parent
  
-\\ +==get_page_date( $i="l, F jS, Y - g:i A",​$echo=true )==
-**get_page_date( $i="l, F jS, Y - g:i A",​$echo=true )** +
 <​code><?​php get_page_date();​ ?>, <?php get_page_date('​F jS, Y'); ?></​code>​ <​code><?​php get_page_date();​ ?>, <?php get_page_date('​F jS, Y'); ?></​code>​
 Echos the page's last saved date. Option is not needed, but can be used for formatting: use any string combination [[http://​www.php.net/​date|from PHP's date function]]. Default format is "l, F jS, Y - g:i A" ​ Echos the page's last saved date. Option is not needed, but can be used for formatting: use any string combination [[http://​www.php.net/​date|from PHP's date function]]. Default format is "l, F jS, Y - g:i A" ​
  
-\\ +==get_header( $full=true )==
-**get_header( $full=true )** +
 <​code><?​php get_header();​ ?></​code>​ <​code><?​php get_header();​ ?></​code>​
-Echos the page's header. No options. This automatically creates the meta tags ('​description',​ '​keywords',​ '​canonical'​ and '​generated'​). If ''​$full''​ is FALSE, will not generate the ''<​link rel="​canonical"​ ...>''​. Place this code within your theme'​s ''<​head>''​ ''</​head>''​ tags.  **Many plugins need this tag to be in place.**+Echos the page's header. No options. This automatically creates the meta tags (<del>'​description',​</​del> ​'​keywords',​ '​canonical'​<​del> ​and '​generated'​</​del>​). If ''​$full''​ is FALSE, will not generate the ''<​link rel="​canonical"​ ...>''​. Place this code within your theme'​s ''<​head>''​ ''</​head>''​ tags.  **Many plugins need this tag to be in place.**
  
-\\ +==get_footer()==
-**get_footer()** +
 <​code><?​php get_footer();​ ?></​code>​ <​code><?​php get_footer();​ ?></​code>​
 Echos the page's footer. No options. This mainly is used to introduce a plugin hook that can be called at the bottom of any template footer. ​ **Many plugins need this tag to be in place.** Echos the page's footer. No options. This mainly is used to introduce a plugin hook that can be called at the bottom of any template footer. ​ **Many plugins need this tag to be in place.**
  
-\\  +==get_site_url( $echo=true )==
-**get_site_url( $echo=true )** +
 <​code><?​php get_site_url();​ ?></​code>​ <​code><?​php get_site_url();​ ?></​code>​
 Echos/​Returns the website'​s domain. No options. For example, this echos //​get-simple.info//​ from any page on the GetSimple website. ​ Echos/​Returns the website'​s domain. No options. For example, this echos //​get-simple.info//​ from any page on the GetSimple website. ​
  
-\\ +==get_theme_url( $echo=true )==
-**get_theme_url( $echo=true )** +
 <​code><?​php get_theme_url();​ ?></​code>​ <​code><?​php get_theme_url();​ ?></​code>​
 Echos/​Returns the website'​s theme directory URL. No options. ​ Echos/​Returns the website'​s theme directory URL. No options. ​
  
-\\ +==get_site_name( $echo=true )==
-**get_site_name( $echo=true )** +
 <​code><?​php get_site_name();​ ?></​code>​ <​code><?​php get_site_name();​ ?></​code>​
 Echos/​Returns the website'​s title. Options: TRUE for "​return",​ leave blank for "​echo"​. Site name is taken from the settings page.  Echos/​Returns the website'​s title. Options: TRUE for "​return",​ leave blank for "​echo"​. Site name is taken from the settings page. 
  
-\\ +==Not active anymore:== 
-<del>**get_site_email( $echo=true )** </​del>​+<del>==get_site_email( $echo=true )== </​del>​
 <​del><​code><?​php get_site_email();​ ?></​code></​del>​ <​del><​code><?​php get_site_email();​ ?></​code></​del>​
 was: Echos the administrator'​s email address as set in the settings page. No options. ​ was: Echos the administrator'​s email address as set in the settings page. No options. ​
 (Since Version 3.0 of GetSimple, this tag is obsolete, as there is no clear definition, whose'​s mail-address should be printed because of the multi-user-system) (Since Version 3.0 of GetSimple, this tag is obsolete, as there is no clear definition, whose'​s mail-address should be printed because of the multi-user-system)
  
-\\ +==get_site_credits( $text ='​Powered by ' )==
-**get_site_credits( $text ='​Powered by ' )** +
 <​code><?​php get_site_credits();​ ?></​code>​ <​code><?​php get_site_credits();​ ?></​code>​
 Echos the string "​Powered by GetSimple Version"​. Option: Specify the text to prefix. Echos the string "​Powered by GetSimple Version"​. Option: Specify the text to prefix.
  
-\\ +==get_component($id)==
-**get_component($id)** +
 <​code><?​php get_component( '​component_slug'​ ); ?></​code>​ <​code><?​php get_component( '​component_slug'​ ); ?></​code>​
 Echos the component'​s contents. Required option is the component slug, which can be taken from the components page within the theme page.  Echos the component'​s contents. Required option is the component slug, which can be taken from the components page within the theme page. 
  
-\\ +==get_navigation( $currentpage = get_page_slug(false),​ $classPrefix = ""​ )==
-**get_navigation( $currentpage = get_page_slug(false),​ $classPrefix = ""​ )** +
 <​code><?​php get_navigation( '​tour'​ ); ?></​code>​ <​code><?​php get_navigation( '​tour'​ ); ?></​code>​
-Returns a list of pages that are added to the main menu from each of their edit screens. Required option is what is shown above. This creates a class of '​current'​ on the ''<​li>''​ element that is currently the active page. You need to supply the ''<​ul>''​ or ''<​ol>'' ​+Returns a list of pages that are added to the main menu from each of their edit screens. Required option is what is shown above. This creates a class of '​current'​ on the ''<​li>''​ element that is currently the active page. You need to supply the ''<​ul>''​ or ''<​ol>''​
  
-\\ +''​get_navigation''​ will add a class to each menu ''<​li>''​ with the id of the menu items slug, if these slug classes conflict with other css rules (BUG #605), say generic ones such as ''​.menu''​ ''​.main''​ then you can add an optional prefix that will be prepended to the class names to make them more unique and less likely to conflict with other classes. 
-**menu_data( $id = null, $xml=false )** + 
 +==menu_data( $id = null, $xml=false )==
 <​code><?​php menu_data();​ ?>, <?php menu_data('​page-slug'​);​ ?></​code>​ <​code><?​php menu_data();​ ?>, <?php menu_data('​page-slug'​);​ ?></​code>​
 This function outputs an array of menu specific data for developers to create their own menus instead of using the GS default ''​get_navigation()''​ function. If you pass it a slug of a specific page, you will only get that page's menu data.  This function outputs an array of menu specific data for developers to create their own menus instead of using the GS default ''​get_navigation()''​ function. If you pass it a slug of a specific page, you will only get that page's menu data. 
 ===== Return Functions ===== ===== Return Functions =====
  
-====return_page_title()====+==return_page_title()==
 <​code><?​php return_page_title();​ ?></​code>​ <​code><?​php return_page_title();​ ?></​code>​
 Returns the page's title. No options, since 2.0  Returns the page's title. No options, since 2.0 
  
-====return_page_slug()====+==return_page_slug()==
 <​code><?​php return_page_slug();​ ?></​code>​ <​code><?​php return_page_slug();​ ?></​code>​
 Same as get_page_slug,​ but it returns the slug. No options. Can be used to make page-specific IDs for CSS styling. ​ Same as get_page_slug,​ but it returns the slug. No options. Can be used to make page-specific IDs for CSS styling. ​
  
-====return_site_ver()====+==return_site_ver()==
 <​code><?​php return_site_ver();​ ?></​code>​ <​code><?​php return_site_ver();​ ?></​code>​
 Returns the version of GetSimple you are running. No options. ​ Returns the version of GetSimple you are running. No options. ​
themes/template_tags.1390148804.txt.gz · Last modified: 2014/01/19 16:26 by datiswous