<commit_before><?php

  // For now this is in footer instead
  /*
	add_action( 'wp_head', create_function( '',  
	   'echo \'<!--[if lt IE 9]><script src="'.get_template_directory_uri() . '/assets/js/vendor/respond.min.js"></script><![endif]-->\';'
	) );
  */

  // Register wp_nav_menu() menus (http://codex.wordpress.org/Function_Reference/register_nav_menus)
  /*
  register_nav_menus(array(
    'common_navigation' => __('Common Navigation', 'org'),
    'connect_navigation' => __('Connect Navigation', 'org'),
  ));
  */

add_post_type_support( 'page', 'excerpt' );

update_option('image_default_link_type', 'none' );

//  https://gist.github.com/mkdizajn/7352469
//----------------------------------------------------------/
//  responsive images [ 1) add img-responsive class 2) remove dimensions ]
//----------------------------------------------------------/
 
function bootstrap_responsive_images( $html ){
  $classes = 'img-responsive'; // separated by spaces, e.g. 'img image-link'
 
  // check if there are already classes assigned to the anchor
  if ( preg_match('/<img.*? class="/', $html) ) {
    $html = preg_replace('/(<img.*? class=".*?)(".*?\/>)/', '$1 ' . $classes . ' $2', $html);
  } else {
    $html = preg_replace('/(<img.*?)(\/>)/', '$1 class="' . $classes . '" $2', $html);
  }
  // remove dimensions from images,, does not need it!
  //$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
  return $html;
}
add_filter( 'the_content','bootstrap_responsive_images',10 );
add_filter( 'post_thumbnail_html', 'bootstrap_responsive_images', 10 );


function capitala_portfolio($params) {
  global $post;  
  
  //query subpages  
  $args = array(  
      'category_name' => 'misc'
    , 'post_type' => 'post'  
    , 'orderby' => 'menu_order'
    , 'order' => 'ASC'
  );  
  $posts = new WP_query($args);  

  $html = null;

  $html .= print_r($posts, true);

  $html .= 'This is a portfolio.';

  return $html;
}
add_shortcode('capitala_portfolio', 'capitala_portfolio'); 


function spl_tutorial($params) {  
    global $post;  
    
    //query subpages  
    $args = array(  
        'post_parent' => $post->ID
      , 'post_type' => 'page'  
      , 'orderby' => 'menu_order'
      , 'order' => 'ASC'
    );  
    $subpages = new WP_query($args);  <commit_msg>portfolio<commit_after><?php

  // For now this is in footer instead
  /*
	add_action( 'wp_head', create_function( '',  
	   'echo \'<!--[if lt IE 9]><script src="'.get_template_directory_uri() . '/assets/js/vendor/respond.min.js"></script><![endif]-->\';'
	) );
  */

  // Register wp_nav_menu() menus (http://codex.wordpress.org/Function_Reference/register_nav_menus)
  /*
  register_nav_menus(array(
    'common_navigation' => __('Common Navigation', 'org'),
    'connect_navigation' => __('Connect Navigation', 'org'),
  ));
  */

add_post_type_support( 'page', 'excerpt' );

update_option('image_default_link_type', 'none' );

//  https://gist.github.com/mkdizajn/7352469
//----------------------------------------------------------/
//  responsive images [ 1) add img-responsive class 2) remove dimensions ]
//----------------------------------------------------------/
 
function bootstrap_responsive_images( $html ){
  $classes = 'img-responsive'; // separated by spaces, e.g. 'img image-link'
 
  // check if there are already classes assigned to the anchor
  if ( preg_match('/<img.*? class="/', $html) ) {
    $html = preg_replace('/(<img.*? class=".*?)(".*?\/>)/', '$1 ' . $classes . ' $2', $html);
  } else {
    $html = preg_replace('/(<img.*?)(\/>)/', '$1 class="' . $classes . '" $2', $html);
  }
  // remove dimensions from images,, does not need it!
  //$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
  return $html;
}
add_filter( 'the_content','bootstrap_responsive_images',10 );
add_filter( 'post_thumbnail_html', 'bootstrap_responsive_images', 10 );


function capitala_portfolio($params) {
  global $post;  
  
  //query subpages  
  $args = array(  
      'category_name' => 'portfolio'
    , 'post_type' => 'post'  
    , 'orderby' => 'menu_order'
    , 'order' => 'ASC'
  );  
  $posts = new WP_query($args);  

  if ($posts->have_posts()) : 
    while ($posts->have_posts()) : $posts->the_post(); 
      $html .= $post->post_name;
      $html .= '<br>';
    endwhile; 
  endif;

  $html = null;

  $html .= print_r($posts, true);

  $html .= 'This is a portfolio.';

  return $html;
}
add_shortcode('capitala_portfolio', 'capitala_portfolio'); 


function spl_tutorial($params) {  
    global $post;  
    
    //query subpages  
    $args = array(  
        'post_parent' => $post->ID
      , 'post_type' => 'page'  
      , 'orderby' => 'menu_order'
      , 'order' => 'ASC'
    );  
    $subpages = new WP_query($args);  
{'fraction_non_alphanumeric': 0.24061254457730227, 'fraction_numerical': 0.007551919446192574, 'mean_word_length': 2.6452599388379205, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 42, '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': '867446', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1586, 'n_words': 327}