Joy
(@joyously)
Check your error log (you should have WP_DEBUG on for development). It sounds like there was an error before the page finished output.
Compare what is different from your theme to a theme that works.
Thanks @joyously. I don’t think it helped in this case but this is someone that I wasn’t aware of that I’m sure will come in handy.
This is the only error in the log
[12-Jun-2020 00:42:39 UTC] PHP Warning: Use of undefined constant all – assumed ‘all’ (this will throw an Error in a future version of PHP) in /Applications/MAMP/htdocs/wordpress2/wp-content/themes/theindependentinvestor/functions.php on line 8
This is the line that it’s referring to which is only for the styleheet
wp_enqueue_style('style', get_stylesheet_uri(), NULL, microtime(), all);
Found this issue. I had to register the categories for the custom posts. I can see where this would be a problem if this was going to be a real production site. You wouldn’t be able to add new categories in the dashboard.
This was the fix for my situation
function my_query_post_type($query) {
if ( is_category() && ( ! isset( $query->query_vars['suppress_filters'] ) || false == $query->query_vars['suppress_filters'] ) ) {
$query->set( 'post_type', array( 'invest',
'Advisors',
'Cryptocurrencies',
'Derivatives',
'Equities',
));
return $query;
}
}
add_filter('pre_get_posts', 'my_query_post_type');
Joy
(@joyously)
The warning is saying that all should be 'all', so it’s a string instead of an undefined constant.
Should your code for post_type be the slugs?
Corrected that thanks. That was just a response I found on another thread asking the same question so I don’t fully understand what it all means. I just replaced the categories with mine.
That said I spoke too soon. After including this code the posts from my custom post page displayed together by category when the category was clicked. However, the posts from the other post page (wordpress default or whatever you call it) stopped working when a category was clicked. Fixed one post page and broke the other.
Back to square one