| Server IP : 74.208.250.37 / Your IP : 216.73.216.114 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : miferval ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/alexvillarreal/wp-content/themes/alex-villarreal/ |
Upload File : |
<?php
//update_option('siteurl','http://alexvillarreal.com/site');
//update_option('home','http://alexvillarreal.com/site');
// Register Custom Navigation Walker
require_once('wp_bootstrap_navwalker.php');
// Adding JQuery properly
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
wp_deregister_script('jquery');
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js", false, null, true);
wp_enqueue_script('jquery');
}
//CHANGE GIF Contact Form 7
function my_wpcf7_ajax_loader () {
return get_stylesheet_directory_uri() . '/img/loader.gif';
}
add_filter('wpcf7_ajax_loader', 'my_wpcf7_ajax_loader');
// THEME Menus register
function alex_menus () {
register_nav_menu( 'menu_principal', 'MenĂº principal' );
register_nav_menu( 'menu_footer', 'MenĂº footer' );
}
// Custom URL of search IF ENGLISH
function redirect_search() {
if (is_search() && !empty($_GET['s'])) {
wp_redirect(home_url('/search/').urlencode(get_query_var('s')));
exit();
}
}
add_action('template_redirect', 'redirect_search' );
// Custom pagination links
function THEME_pagination_links () { return 'class="CSS CLASSES TO APLY"'; }
add_filter('next_posts_link_attributes', 'THEME_pagination_links');
add_filter('previous_posts_link_attributes', 'THEME_pagination_links');
// Get parent total category post count
function parent_category_postcount($id) {
$cat = get_category($id);
$count = (int) $cat->count;
$taxonomy = 'category';
$args = array(
'child_of' => $id,
);
$tax_terms = get_terms($taxonomy,$args);
foreach ($tax_terms as $tax_term) {
$count += $tax_term->count;
}
return $count;
}
// Search just for posts
function SearchFilter($query) {
if ($query->is_search) { $query->set('post_type', 'post'); }
return $query;
}
add_filter('pre_get_posts','SearchFilter');
// Custom excerpt
function custom_excerpt_length( $length ) { return 30; }
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
// Custom more
function custom_excerpt_more( $more ) { return '...'; }
add_filter( 'excerpt_more', 'custom_excerpt_more' );
// Adding my functions to WP
add_action('init', 'alex_menus'); // Adding support of menus
add_theme_support( 'post-thumbnails' ); // Adding support of feature images
?>