<commit_before><?php
/**
 * Sage includes
 *
 * The $sage_includes array determines the code library included in your theme.
 * Add or remove files to the array as needed. Supports child theme overrides.
 *
 * Please note that missing files will produce a fatal error.
 *
 * @link https://github.com/roots/sage/pull/1042
 */
$sage_includes = [
  'lib/assets.php',    // Scripts and stylesheets
  'lib/extras.php',    // Custom functions
  'lib/setup.php',     // Theme setup
  'lib/titles.php',    // Page titles
  'lib/wrapper.php',   // Theme wrapper class
  'lib/customizer.php', // Theme customizer
  'lib/nav-walker.php' // Theme customizer
];

foreach ($sage_includes as $file) {
  if (!$filepath = locate_template($file)) {
    trigger_error(sprintf(__('Error locating %s for inclusion', 'sage'), $file), E_USER_ERROR);
  }

  require_once $filepath;
}
unset($file, $filepath);


// EXCERPT LENGHT
function custom_excerpt_length( $length ) {
	return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

// DELETE COMMENTS BUTTON ON ADMIN
add_action( 'admin_init', 'my_remove_admin_menus' );
function my_remove_admin_menus() {
    remove_menu_page( 'edit-comments.php' );
}

// REMOVE POST FORMAT SUPPORT
add_action('after_setup_theme', 'remove_post_formats', 11);
function remove_post_formats() {
    remove_theme_support('post-formats');
}

function iproRenderNoticias($post){
?>
		<div class="width100">

			<!--<div style="float:right; color:#777;  padding-bottom:8px;"><?php echo get_the_date(); ?></div>-->

			<div class="iproRenderNoticias width100">
			<a class="fullLink" href="<?php echo get_the_permalink(); ?>"></a>
			<div class="color2 strong" style="padding:0px 10px 8px 12px"><?php $terms = get_the_term_list($post->ID,'category' , '', ' / ');  echo strip_tags( $terms );?></div>
				<div class="col-md-5 col-sm-5 col-xs-12 maxsize">
					<?php
						$destacada = get_field('imatge-destacada');
            $size ="medium";
						if( $destacada ){ ?>
							<?php echo wp_get_attachment_image( $destacada, $size ); ?>
						<?php }else{
							echo '<img src="'. get_template_directory_uri() . '/dist/images/thumb-escola-ciutat-alba.jpg' . '" />';
						}
						?>


				</div>
				<div class="col-md-7 col-sm-5 col-xs-12" style="padding-left:15px;">
						<div class="medpadtop iproTitle darkgrey" style="text-transform:uppercase;"><?php if ( get_post_status ( $post->ID ) == 'private' ) echo '<img style="width:15px; margin-top:-4px;" src="'. get_template_directory_uri() . '/dist/images/locked.png' . '" />'; ?> <?php echo get_the_title($post->ID); ?></div>
						<div class="color1 minpadbottom"><?php echo get_the_date(); ?></div>
						<!--<div class="iproText color1"><?php if (has_excerpt( $post->ID )) echo get_the_excerpt($post->ID); ?><br />&nbsp;</div>-->
						<div class="iproText"><?php echo get_the_excerpt(); ?></div>
						<img class="plusbutton" src="<?php echo get_template_directory_uri() . '/dist/images/plus.png'; ?>" />
				</div>
			</div>
		</div>
<?php
}

function iproRenderNoticiasSidebar($post){
?>
		<div class="width100 bgwhite">

			<div class="iproRenderNoticiasSidebar width100 bgwhite">
			<a class="fullLink" href="<?php echo get_the_permalink(); ?>"></a>
				<div class="darkgrey text-left"><?php if ( get_post_status ( $post->ID ) == 'private' ) echo '<img style="width:15px; margin-top:-4px;" src="'. get_template_directory_uri() . '/dist/images/locked.png' . '" />'; ?> <?php echo get_the_title($post->ID); ?></div>
				<div class="color1 text-right"><?php echo get_the_date(); ?></div>
			</div>
		</div>
<?php
}<commit_msg>salto de custom field a thumbnail de nuevo<commit_after><?php
/**
 * Sage includes
 *
 * The $sage_includes array determines the code library included in your theme.
 * Add or remove files to the array as needed. Supports child theme overrides.
 *
 * Please note that missing files will produce a fatal error.
 *
 * @link https://github.com/roots/sage/pull/1042
 */
$sage_includes = [
  'lib/assets.php',    // Scripts and stylesheets
  'lib/extras.php',    // Custom functions
  'lib/setup.php',     // Theme setup
  'lib/titles.php',    // Page titles
  'lib/wrapper.php',   // Theme wrapper class
  'lib/customizer.php', // Theme customizer
  'lib/nav-walker.php' // Theme customizer
];

foreach ($sage_includes as $file) {
  if (!$filepath = locate_template($file)) {
    trigger_error(sprintf(__('Error locating %s for inclusion', 'sage'), $file), E_USER_ERROR);
  }

  require_once $filepath;
}
unset($file, $filepath);


// EXCERPT LENGHT
function custom_excerpt_length( $length ) {
	return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

// DELETE COMMENTS BUTTON ON ADMIN
add_action( 'admin_init', 'my_remove_admin_menus' );
function my_remove_admin_menus() {
    remove_menu_page( 'edit-comments.php' );
}

// REMOVE POST FORMAT SUPPORT
add_action('after_setup_theme', 'remove_post_formats', 11);
function remove_post_formats() {
    remove_theme_support('post-formats');
}

function iproRenderNoticias($post){
?>
		<div class="width100">

			<!--<div style="float:right; color:#777;  padding-bottom:8px;"><?php echo get_the_date(); ?></div>-->

			<div class="iproRenderNoticias width100">
			<a class="fullLink" href="<?php echo get_the_permalink(); ?>"></a>
			<div class="color2 strong" style="padding:0px 10px 8px 12px"><?php $terms = get_the_term_list($post->ID,'category' , '', ' / ');  echo strip_tags( $terms );?></div>
				<div class="col-md-5 col-sm-5 col-xs-12 maxsize">
					<?php
          	//$destacada = get_field('imatge-destacada');
            //$size ="medium";
						if( has_post_thumbnail() ){ ?>
							<?php the_post_thumbnail('medium'); ?>
						<?php }else{
							echo '<img src="'. get_template_directory_uri() . '/dist/images/thumb-escola-ciutat-alba.jpg' . '" />';
						}
					?>


				</div>
				<div class="col-md-7 col-sm-5 col-xs-12" style="padding-left:15px;">
						<div class="medpadtop iproTitle darkgrey" style="text-transform:uppercase;"><?php if ( get_post_status ( $post->ID ) == 'private' ) echo '<img style="width:15px; margin-top:-4px;" src="'. get_template_directory_uri() . '/dist/images/locked.png' . '" />'; ?> <?php echo get_the_title($post->ID); ?></div>
						<div class="color1 minpadbottom"><?php echo get_the_date(); ?></div>
						<!--<div class="iproText color1"><?php if (has_excerpt( $post->ID )) echo get_the_excerpt($post->ID); ?><br />&nbsp;</div>-->
						<div class="iproText"><?php echo get_the_excerpt(); ?></div>
						<img class="plusbutton" src="<?php echo get_template_directory_uri() . '/dist/images/plus.png'; ?>" />
				</div>
			</div>
		</div>
<?php
}

function iproRenderNoticiasSidebar($post){
?>
		<div class="width100 bgwhite">

			<div class="iproRenderNoticiasSidebar width100 bgwhite">
			<a class="fullLink" href="<?php echo get_the_permalink(); ?>"></a>
				<div class="darkgrey text-left"><?php if ( get_post_status ( $post->ID ) == 'private' ) echo '<img style="width:15px; margin-top:-4px;" src="'. get_template_directory_uri() . '/dist/images/locked.png' . '" />'; ?> <?php echo get_the_title($post->ID); ?></div>
				<div class="color1 text-right"><?php echo get_the_date(); ?></div>
			</div>
		</div>
<?php
}
{'fraction_non_alphanumeric': 0.18767274737423992, 'fraction_numerical': 0.014648977335544499, 'mean_word_length': 4.046722454672246, 'pattern_counts': {'":': 0, '<': 119, '<?xml version=': 0, '>': 131, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1916365', 'n_tokens_mistral': 2794, 'n_tokens_neox': 2513, 'n_words': 546}