Theme Functions
Want a successful Modern site?
Start with IQRA training; it’s easy and quick to your needs.
Theme Functions
parametors
1. dir (required)
dir
- __Dir__
$data = get_theme_dir(__dir__);
// output
// http://example.com/content/themes/iqratheme/
parametors
1. dir (optional)
dir
- "dir" (string)
$theme = current_active_theme();
// output
IQRA Theme
$theme = current_active_theme('dir');
// output
http://example.com/content/themes/iqratheme/
3. include_current_theme_dir($dir = null)
parametors
1. filename (optional)
$theme = include_current_theme_dir();
// output
// content/themes/iqratheme/
$theme = include_current_theme_dir('hello.php');
// output
hello.php (included)
4. get_current_theme_dir($dir = null)
parametors
1. dir (optional)
$theme = get_current_theme_dir();
// output
// http://localhost/iqra/content/themes/iqratheme/
$theme = get_current_theme_dir('hello.php');
// output
// http://localhost/iqra/content/themes/iqratheme/hello.php
with view() function you can access "assets" directory.
Assets Location : - iqratheme/assets
parametors
- path (required)
- dir (optional)
path
- "" (string)
dir
- img (for access images directory)
- css (for access css directory)
- js (for access js directory)
- vendor (for access vendor directory)
view('style.css' , 'css');
// output
// style.css file will included here
you can remove directory easily with removeDir function.
parametors
- dir (required)
dir
- Directory Location
removeDir('./content/theme/iqratheme/hello')
// hello directory removed
// for file remove use "unlink()"