/home/techb158/l2hypotheques.com/wp-content/themes/pylon/inc
Edit: /home/techb158/l2hypotheques.com/wp-content/themes/pylon/inc/template-functions.php (3909B)
', esc_url(get_bloginfo('pingback_url')));
}
}
add_action('wp_head', 'pylon_pingback_header');
/**
* Get a list of registered sidebars, excluding footers.
*
* @return array
*/
function pylon_sidebars() {
$options = [];
$exclude = ['footer-1-widget-area', 'footer-2-widget-area', 'footer-3-widget-area', 'footer-4-widget-area'];
global $wp_registered_sidebars;
if (!empty($wp_registered_sidebars)) {
foreach ($wp_registered_sidebars as $sidebar) {
if (!in_array($sidebar['id'], $exclude)) {
$options[$sidebar['id']] = $sidebar['name'];
}
}
}
return $options;
}
/**
* Display next and previous post navigation on single posts.
*/
function pylon_single_post_pre_next() {
$prev_post = get_adjacent_post(false, '', true);
$next_post = get_adjacent_post(false, '', false);
if (empty($prev_post) && empty($next_post)) {
return;
}
echo '
';
if (!empty($prev_post)) {
echo '
';
}
if (!empty($next_post)) {
echo '
';
}
echo '
';
}
/**
* Convert hex color to RGB.
*
* @param string $hex Hex color string.
* @return string RGB values comma-separated.
*/
function pylon_hexcode_to_rgb($hex) {
$hex = ltrim($hex, '#');
if (strlen($hex) === 3) {
$hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];
}
if (strlen($hex) !== 6) {
return '0,0,0';
}
$r = hexdec(substr($hex, 0, 2));
$g = hexdec(substr($hex, 2, 2));
$b = hexdec(substr($hex, 4, 2));
return "{$r},{$g},{$b}";
}
/**
* Display WooCommerce cart icon in the menu if enabled.
*/
function main_menu_right_side() {
if (!function_exists('pylon_options') || !pylon_options('pylon_show_cart') || !class_exists('woocommerce')) {
return;
}
$count = WC()->cart->get_cart_contents_count();
$cart_url = wc_get_cart_url();
echo '
';
}