| Server IP : 65.109.86.83 / Your IP : 216.73.217.84 Web Server : nginx/1.14.1 System : Linux libra 4.18.0-553.51.1.el8_10.x86_64 #1 SMP Wed Apr 30 20:24:04 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.31 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/themes/zodiac22-child/ |
Upload File : |
<?php
function yqhoro_child_enqueue_styles()
{
$prefix = HORO_NAMESPACE_SMALL;
wp_enqueue_style($prefix . 'colors', get_stylesheet_directory_uri() . '/css/colors.css');
wp_enqueue_style($prefix . 'testimonials', get_stylesheet_directory_uri() . '/css/testimonials.css');
}
add_action('wp_enqueue_scripts', 'yqhoro_child_enqueue_styles', PHP_INT_MAX);
function __search_by_title_only($search, $wp_query)
{
global $wpdb;
if (empty($search)) {
return $search; // skip processing - no search term in query
}
$q = $wp_query->query_vars;
$n = !empty($q['exact']) ? '' : '%';
$search =
$searchand = '';
foreach ((array)$q['search_terms'] as $term) {
$term = esc_sql($wpdb->esc_like($term));
$search .= "{$searchand}($wpdb->posts.post_title LIKE '{$n}{$term}{$n}')";
$searchand = ' AND ';
}
if (!empty($search)) {
$search = " AND ({$search}) ";
if (!is_user_logged_in())
$search .= " AND ($wpdb->posts.post_password = '') ";
}
return $search;
}
add_filter('posts_search', '__search_by_title_only', 500, 2);
if (!function_exists('display_related_products')) {
function display_related_products($post_tag)
{
?>
<div class="related-products">
<?php $related_products = new WP_Query('tag=rucni'); ?>
<?php while ($related_products->have_posts()) : $related_products->the_post(); ?>
<a href="<?php the_permalink(); ?>" class="related-product">
<?php if (has_post_thumbnail()) : ?>
<?php the_post_thumbnail('full', ['class' => 'related-product-img', 'alt' => get_the_title()]); ?>
<?php endif; ?>
</a>
<?php endwhile;
wp_reset_query(); ?>
</div>
<?php
}
}
function get_pages_sitemap($includes)
{
// Add pages you'd like to exclude in the exclude here
$query = new WP_Query([
'post_type' => 'page',
'showposts' => -1
]);
if ($query->have_posts()) :
while ($query->have_posts()) :
$query->the_post();
$slug = get_post_field('post_name', get_the_ID());
if (in_array($slug, $includes)) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endif; ?>
<?php
endwhile;
endif;
$query->reset_postdata();
}
function get_similar_reads()
{
$post_id = get_the_ID();
$current_post_type = get_post_type($post_id);
$categories = get_the_category($post_id);
$first_cat_id = !empty($categories) ? $categories[0]->term_id : null;
if (!$first_cat_id) {
return;
}
$query_args = [
'category__in' => $first_cat_id,
'post_type' => $current_post_type,
'post__not_in' => [$post_id],
'posts_per_page' => 3
];
$query = new WP_Query($query_args);
if (!$query->have_posts()) {
return; // No posts found, so nothing to display
}
echo '<div class="my-3 row">';
while ($query->have_posts()) {
$query->the_post();
$cat_name = get_the_category()[0]->name ?? 'Uncategorized'; // Get the first category name
?>
<div class="col-md-4">
<a class="mb-2 d-block" href="<?php the_permalink(); ?>">
<img class="img-fluid" src="<?php echo get_the_post_thumbnail_url(get_the_ID(), 'small'); ?>"/>
</a>
<h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
<div class="text-muted d-none d-md-block">
posted in <a href="<?php echo esc_url(get_category_link($first_cat_id)); ?>"
title="View all posts in <?php echo esc_attr($cat_name); ?>"
rel="category"><?php echo esc_html($cat_name); ?></a>
on <?php echo get_the_date('m/d/Y'); ?>
</div>
</div>
<?php
}
echo '</div>';
wp_reset_postdata();
}