Warning: session_start(): open(/var/cpanel/php/sessions/ea-php74/sess_ksaj18sippselijg6dhh87kjcm, O_RDWR) failed: No such file or directory (2) in /home/mssoftpc/iqra.mssoftpc.com/admin/function.php on line 3

Warning: session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php74) in /home/mssoftpc/iqra.mssoftpc.com/admin/function.php on line 3
Theme Functions | IQRA CMS

Theme Functions

Want a successful Modern site?

Start with IQRA training; it’s easy and quick to your needs.

   Theme Functions   

 

  1. get_theme_dir($dir)

 

parametors

              1. dir (required)

 

dir

  1. __Dir__ 
$data = get_theme_dir(__dir__);

// output
// http://example.com/content/themes/iqratheme/

   

 

    2. current_active_theme($dir)

 

parametors

              1. dir (optional)

 

dir

  1. "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

   

 

    5. view($path, $dir = null)

  with view() function you can access "assets" directory.

Assets Location : - iqratheme/assets 

 

parametors

  1. path (required)
  2. dir (optional)

 

path

  1. "" (string)

 

dir

  1. img (for access images directory)
  2. css (for access css directory)
  3. js (for access js directory)
  4. vendor (for access vendor directory)

 

view('style.css' , 'css');

// output
// style.css file will included here

   

 

    6. removeDir($dir)

you can remove directory easily with removeDir function.

 

parametors

  1. dir (required)

 

dir

  1. Directory Location

 

removeDir('./content/theme/iqratheme/hello')

// hello directory removed

// for file remove use "unlink()"