error, no result pages
This commit is contained in:
@@ -124,8 +124,8 @@ function dis2019_header_scripts()
|
||||
wp_register_script('lettering', get_template_directory_uri() . '/js/lib/jquery.lettering.js', array('jquery'), '1.0.0'); //
|
||||
wp_enqueue_script('lettering'); // Enqueue it!
|
||||
|
||||
// wp_register_script('clamp', get_template_directory_uri() . '/js/lib/clamp.min.js', array(), '1.5.1'); //
|
||||
// wp_enqueue_script('clamp'); // Enqueue it!
|
||||
wp_register_script('clamp', get_template_directory_uri() . '/js/lib/clamp.min.js', array(), '1.5.1'); //
|
||||
wp_enqueue_script('clamp'); // Enqueue it!
|
||||
|
||||
wp_register_script('dis2019scripts', get_template_directory_uri() . '/js/scripts.js', array(
|
||||
'jquery',
|
||||
@@ -323,7 +323,8 @@ function remove_thumbnail_dimensions($html)
|
||||
}
|
||||
|
||||
//Wrap aligned images to a div
|
||||
function wrap_aligned_images($content){
|
||||
function wrap_aligned_images($content)
|
||||
{
|
||||
return preg_replace('/<div class="wp-block-image"><figure class="(align[a-z]*)([ "])(.*)<\/figure>\s*/iU', '<div class="wp-block-image wp-block-image-aligned"><div class="alignedWrapper \1Wrapper"><figure class="\1\2\3 </figure></div>', $content);
|
||||
}
|
||||
add_filter('the_content', 'wrap_aligned_images');
|
||||
@@ -435,7 +436,22 @@ function misha_loadmore_ajax_handler()
|
||||
$args['posts_per_page'] = 6;
|
||||
|
||||
//First, define your desired offset...
|
||||
$offset = 14;
|
||||
$offset = get_theme_mod('dis-2019-posts-on-home');
|
||||
|
||||
// console_debug($args);
|
||||
if ($args['cat']) {
|
||||
// console_debug('cat query');
|
||||
$offset = get_theme_mod('dis-2019-posts-on-archive');
|
||||
}
|
||||
if ($args['s']) {
|
||||
// console_debug('search query');
|
||||
$offset = get_theme_mod('dis-2019-posts-on-archive');
|
||||
}
|
||||
|
||||
if ($args['tag']) {
|
||||
// console_debug('tag query');
|
||||
$offset = get_theme_mod('dis-2019-posts-on-tag');
|
||||
}
|
||||
|
||||
//Next, determine how many posts per page you want (we'll use WordPress's settings)
|
||||
$ppp = get_option('posts_per_page');
|
||||
@@ -493,8 +509,9 @@ add_action('pre_get_posts', 'dis_2019_more_posts_on_home', 1);
|
||||
function dis_2019_more_posts_on_home(&$query)
|
||||
{
|
||||
|
||||
|
||||
//Before anything else, make sure this is the right query...
|
||||
if (!$query->is_home() && !$query->is_archive()) {
|
||||
if (!$query->is_home() && !$query->is_archive() && !$query->is_search()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -503,12 +520,16 @@ function dis_2019_more_posts_on_home(&$query)
|
||||
return;
|
||||
}
|
||||
|
||||
//console_debug($query);
|
||||
// console_debug($query);
|
||||
|
||||
if ($query->is_home()) {
|
||||
$pposts = get_theme_mod('dis-2019-posts-on-home');
|
||||
} elseif ($query->is_tag()) {
|
||||
$pposts = get_theme_mod('dis-2019-posts-on-tag');
|
||||
} elseif ($query->is_archive()) {
|
||||
$pposts = get_theme_mod('dis-2019-posts-on-archive');
|
||||
} elseif ($query->is_search()) {
|
||||
$pposts = get_theme_mod('dis-2019-posts-on-archive');
|
||||
} elseif (!$query->in_the_loop()) {
|
||||
return;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user