b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Developer Reference
  3. Website Skins/Themes
  4. Modifying evoSkins
  5. Template function parameters

Template function parameters

When you look at the provided Templates Tab/Skin or evoSkin you will see function calls like this for example:

<?php the_time() ?>

...which will display the time of the current post, using the default time format.

However, many of these functions can accept optional parameters between the brackets (). For example you could write:

<?php the_time( '%Y-%m-%d %H:%M:%S', 'Posted:' ) ?>

...which would display a full date & time for the current post, preceeded by the text 'Posted:'.

How do I know which optional parameters I can use?

The best way for you to learn about available optional parameters, is to look at the the template functions list and follow the link to the technical documentation for any specific function.

Notes about parameters

To add a parameter to a function, simply include it between the brackets (). If it is text (instead of a number), add quotes around the parameter. Examples:

<?php my_tag( 'my text parameter' ); ?>
<?php my_tag( 123 ); ?>

You may have to specify several parameters... In this case, you must separate them with commas, like this:

<?php my_tag( 'first param', 'second param' ); ?>

The order of parameters is important! You must follow the exact order of the parameters as indicated in the technical documentation.

If a function accepts 3 parameters and you only want to set the third one, you still have to provide the first two parameters. In this case, you could simply use the default values for these parameters, as specified in the technical documentation.

<?php my_tag( '', '#', 'second param' ); ?>

Please note: the default value for optional parameters is often '' or '#'.

Some template functions, like the_date(), display something only if in some conditions. They generally accept parameters to display something before and after the output, only when they display something.

<?php the_title( '<h1>', '</h1>' ); ?>

would display <h1>title of the post</h1> only if the post has a title

Created by fplanque • Last edit by fplanque on 2018-03-27 01:27 • •

No feedback yet

On this page

  • How do I know which optional parameters I can use?
  • Notes about parameters

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
      • Skin Development Primer
      • Loading additional resources into a skin
      • Where are the skin files?
      • CSS Guidelines
      • Targeted CSS Selectors
      • Introducing evoSkins
      • Modifying evoSkins
        • How to add custom CSS
        • Template function parameters
        • Edit Evoskins
        • Editing Templates
      • Creating evoSkins
      • Skin Tags / API
      • Styling widgets
      • Skin Quality Control
      • Using HTML 5 tags
      • Using Custom Item Templates
      • Using bootstrap classes in footers
      • Using Grunt
      • Dev Menu
      • How to add a Google Font (WebFont) ?
      • Custom Fields in a Template
      • Site Skins
    • Email Skins/Themes
    • b2evolution Files
    • Website Integration
    • Plugins
    • Debugging
    • Technical Reference
    • Hacks
    • Credits
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
Community software

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque