Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attemtping to fix troubleshooting pages issues #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions navis-jiffy-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,19 +491,20 @@ function add_to_query( $query ) {
}

// add custom post type to the main loop
//add_filter( 'pre_get_posts', 'jp_get_posts' );
/***
function jp_get_posts( $query ) {
$var = false;
if (isset($query->query_vars['suppress_filters'])){
$var = $query->query_vars['suppress_filters'];
}
if ( is_home() && false ==$var ){
$query->set( 'post_type', array( 'post', 'jiffypost') );
add_filter( 'pre_get_posts', 'jp_get_posts' );

function jp_get_posts( $query ) {
if (is_home() || is_tag() || is_category()) {
if (isset($query->query_vars['post_type']) && is_array($query->query_vars['post_type'])) {
$query->set( 'post_type', array_merge(array('jiffypost' ), $query->query_vars['post_type']) );
} elseif (isset($query->query_vars['post_type']) && !is_array($query->query_vars['post_type'])) {
$query->set( 'post_type', array('jiffypost', $query->query_vars['post_type']) );
} else {
$query->set( 'post_type', array('post','jiffypost') );
}
}
return $query;
}
***/



// check to see if the embedly API key has been set
Expand All @@ -517,12 +518,12 @@ function jiffy_notice_embedly() {
add_action('admin_notices', 'jiffy_notice_embedly');
}

/* Flush rewrite rules on activation
//Flush rewrite rules on activation

if ( is_admin() && $_GET['activate'] && $_SERVER['SCRIPT_NAME'] == '/wp-admin/plugins.php' ) {
if ( is_admin() && isset($_GET['activate']) && $_SERVER['SCRIPT_NAME'] == '/wp-admin/plugins.php' ) {

add_action( 'init', 'flush_rewrite_rules', 12 );
} */
}

new Navis_Jiffy_Posts;