| Server IP : 77.68.64.21 / Your IP : 216.73.216.219 Web Server : Apache System : Linux hp3-wp-1011378.hostingp3.local 3.10.0-1160.144.1.el7.tuxcare.els9.x86_64 #1 SMP Fri Jul 10 17:06:31 UTC 2026 x86_64 User : csh2668128 ( 2112425) PHP Version : 8.1.34 Disable Function : shell_exec,exec,system,popen,set_time_limit MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/domains/vol4/924/3261924/user/htdocs/wp-content/themes/holsworthyschool/ |
Upload File : |
<?php
/********************* SETUP ****************************************/
if ( ! function_exists( 'holsworthyprimaryschool_setup' ) ) :
function holsworthyprimaryschool_setup() {
add_theme_support( 'woocommerce' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'menus' );
add_theme_support('html5', array('search-form'));
add_image_size( 'slideshow', 1200, 500, true);
}
endif; // holsworthyprimaryschool_setup
add_action( 'after_setup_theme', 'holsworthyprimaryschool_setup' );
function holsworthyprimaryschool_scripts() {
// Bootstrap stylesheet.
wp_enqueue_style( 'awesomefonts-style', get_template_directory_uri() . '/css/font-awesome.min.css' );
// Bootstrap stylesheet.
wp_enqueue_style( 'bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css' );
// main script
wp_enqueue_script( 'main-script', get_template_directory_uri() . '/js/main.js');
wp_enqueue_style( 'wpb-google-fonts', 'https://fonts.googleapis.com/css?family=Lato:300,400', false );
// Theme stylesheet.
wp_enqueue_style( 'holsworthyprimaryschool-style', get_stylesheet_uri() );
// Load the html5 shiv.
wp_enqueue_script( 'holsworthyprimaryschool-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3' );
wp_script_add_data( 'holsworthyprimaryschool-html5', 'conditional', 'lt IE 9' );
}
add_action( 'wp_enqueue_scripts', 'holsworthyprimaryschool_scripts' );
/********* DISPLAY LATEST NEWS ARTICLE SHORTCODE **********/
function displayLatestNewsShortCode() {
$data = "";
$the_query = new WP_Query( 'post_type=post&posts_per_page=8&orderby=date&order=DESC' );
while ($the_query->have_posts()) : $the_query -> the_post();
$data .= '<p style="margin-bottom:0px;text-align:left;"><a href="'.get_the_permalink(get_the_ID()).'"><h3 style="text-align:left;">'.get_the_title(get_the_ID()).'</h3></a></p>';
endwhile;
wp_reset_postdata();
return $data;
}
add_shortcode('display-latest-news', 'displayLatestNewsShortCode');
/********* DISPLAY LATEST NEWS ARTICLE SHORTCODE **********/
function displayLatestNewsForCategoryShortCode($atts_in) {
$atts = shortcode_atts(array(
'catid' => '-1'
), $atts_in);
$data = "";
$args = array(
'post_type' => 'post',
'posts_per_page' => 4,
'orderby' => 'date',
'order' => 'DESC',
'cat' => $atts['catid']
);
$the_query = new WP_Query($args);
while ($the_query->have_posts()) : $the_query -> the_post();
$data .= '<p style="margin-bottom:0px;text-align:left;"><a href="'.get_the_permalink(get_the_ID()).'"><h3 style="text-align:left;">'.get_the_title(get_the_ID()).'</h3></a></p>';
endwhile;
wp_reset_postdata();
return $data;
}
add_shortcode('display-latest-news-for-category', 'displayLatestNewsForCategoryShortCode');
?>