Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.96.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : page.php
<?php
/**
 * Page Functionality
 *
 * @package  Zoo_Theme\Core\Common\Functions
 * @author   Zootemplate
 * @link     http://www.zootemplate.com
 *
 */

/**
 * List pages by slug
 *
 * @return  array
 */
function zoo_list_pages_by_slug()
{
    static $slugs = null;

    if (null === $slugs) {
        $slugs = [];
    } else {
        return $slugs;
    }

    $pages = get_pages();

    if (!$pages) {
        return $slugs;
    }

    foreach ($pages as $page) {
        $slugs[$page->post_name] = $page->post_title;
    }

    return $slugs;
}

/**
 * Get current page ID
 *
 * @return  int
 */
function zoo_get_current_page_id()
{
    global $wp_query;

    if (!$wp_query->is_main_query()) {
        return 0;
    }

    if ($wp_query->is_home() && $wp_query->is_front_page()) {
        return 0;
    } elseif ($wp_query->is_home() && !$wp_query->is_front_page()) {
        return (int)get_option('page_for_posts');
    } elseif (!$wp_query->is_home() && $wp_query->is_front_page()) {
        return (int)get_option('page_on_front');
    } elseif (function_exists('is_shop') && is_shop()) {
        return wc_get_page_id('shop');
    } elseif (isset($wp_query->post->ID)) {
        return (int)$wp_query->post->ID;
    } else {
        return 0;
    }
}
© 2025 XylotrechusZ