nmhall
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Hueman] Nav menu not appearing on category pagesI guess I’ll just keep documenting in case anyone else encounters this problem. I eventually discovered that it’s not an issue with Option Tree (as I was investigating earlier).
It appears to be a conflict in a function that I put in the child theme. If you usecreate_post_type
as a function for making custom post types, then you’ve probably also had to include a function calledquery_post_type
to make those posts show up on their own archive pages. The problem is that this method makes the nav menu disappear on category.php or archive.php. To fix the problem you need to addnav_menu_item
toquery_post_type
, like so:add_filter('pre_get_posts', 'query_post_type'); function query_post_type($query) { if(is_category() || is_tag()) { $post_type = get_query_var('post_type'); if($post_type) $post_type = $post_type; else $post_type = array('nav_menu_item','post','calendar'); $query->set('post_type',$post_type); return $query; } }
If you need more info, this is where I eventually found the solution. Thanks to boyvanamstel for this github thread.
Forum: Themes and Templates
In reply to: [Hueman] Nav menu not appearing on category pagesDigging into the functions.php, I’m guessing that it has something to do with the built in Option Tree, specifically this part:
// Set layout based on page elseif ( is_home() && ( ot_get_option('layout-home') !='inherit' ) ) $layout = ot_get_option('layout-home',''.$default.''); elseif ( is_category() && ( ot_get_option('layout-archive-category') !='inherit' ) ) $layout = ot_get_option('layout-archive-category',''.$default.''); elseif ( is_archive() && ( ot_get_option('layout-archive') !='inherit' ) ) $layout = ot_get_option('layout-archive',''.$default.''); elseif ( is_search() && ( ot_get_option('layout-search') !='inherit' ) ) $layout = ot_get_option('layout-search',''.$default.''); elseif ( is_404() && ( ot_get_option('layout-404') !='inherit' ) ) $layout = ot_get_option('layout-404',''.$default.'');
I don’t know enough about ot_get_option to figure out what’s going on with layout-archive-category or how to change it though…
Forum: Plugins
In reply to: [Advanced Custom Fields: Validated Field] ACF Pro / 5Not seeing anything in the error log, it’s just not showing up.
Ah, that’s what I needed, thanks azherahmed!
I really hate doing this, but I went ahead and just commented out this portion of the above referenced code and I’m not getting errors anymore.
$settings['post']['id'] = ot_get_media_post_ID();
Fingers crossed it will do the job. I’ve seen this issue brought up on the theme dev’s site but still no solution.
Found this link, which helps somewhat: https://github.com/AlxMedia/hueman/issues/62
especially the link in that post to this:
https://premium.wpmudev.org/forums/topic/fatal-error-call-to-undefined-function-3I’ve done as the op said and removed this part from ot-loader.php:
public function shortcode( $settings, $post ) { // Set the OptionTree post ID if ( ! is_object( $post ) ) $settings['post']['id'] = ot_get_media_post_ID(); // No ID return settings if ( $settings['post']['id'] == 0 ) return $settings; // Set the fake shortcode $settings['ot_gallery'] = array( 'shortcode' => "[gallery id='{$settings['post']['id']}']" ); // Return settings return $settings; }
Now I’m getting the following error message though:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'OT_Loader' does not have a method 'shortcode' in /[ROOT]/wp-includes/plugin.php on line 192
I’m getting this very issue, a conflict between the Option Tree in the Hueman theme and the ACF plugin…
This is the site: https://nathanmhall.com, this is the most recent one I noticed the behavior on: https://nathanmhall.com/2013/06/13/kickstarter-for-first-time-novelists/
I don’t use any plugins to copy or clone posts (unless I misunderstood your question).
Thanks!
Forum: Plugins
In reply to: is_category() and in_category() not workingWhen I echo ‘this is cat 7’ I get ‘this is cat 7’.
After commenting out wp-loop2.php, I get it to work correctly… there must be something in my wp-loop2 that’s messing things up (which is strange, since I had it working yesterday).
Thanks for helping me pinpoint the problem!
Forum: Plugins
In reply to: is_category() and in_category() not workingOne small update:
When I insert
include (TEMPLATE . '/wp-loop.php');
like so:<?php
if ( is_single() ) {
$cats = wp_get_post_categories($posts[0]->ID);
$first_cat = ”;
if ($cats) {
$first_cat = $cats[0];
}
if ($first_cat == 7 ) {
include (TEMPLATE . ‘/wp-loop2.php’);
} else {
include (TEMPLATE . ‘/wp-loop.php’);
}
}
?>I get my comments template to pop back in, as well as the sidebar, though posts are still not showing up.
Forum: Plugins
In reply to: is_category() and in_category() not workingThanks for the response Michael, I tried it out but still got an empty content well.
I copied and pasted exactly what you had on the post above, so I might not have adjusted something that needed adjusting (sorry, I’m still learning php).
Here’s the code for the whole single.php code as it sits right now:
<?php get_header(); ?>
<div id=”content”>
<?php
if ( is_single() ) {
$cats = wp_get_post_categories($posts[0]->ID);
$first_cat = ”;
if ($cats) {
$first_cat = $cats[0];
}
if ($first_cat == 7 ) {
include ‘wp-loop2.php’;
} else {
include ‘wp-loop.php’;
}
}?>
<?php comments_template(); ?><div class=”navigation”>
<div class=”alignleft”><?php next_post_link(‘%link’, ‘« %title’); ?></div>
<div class=”alignright”><?php previous_post_link(‘%link’, ‘%title »’); ?></div>
</div>
</div><div id=”sidebar”>
<?php
get_sidebar();
?>
</div><?php get_footer(); ?>
Am I missing something?
I’ve given up on this for the moment as other work comes my way, hope to be able to post a solution in the near future.
Just adding a couple links for anyone else who comes across a similar problem, none of these quite offers a solution to what I’m looking for though:
https://codex.www.ads-software.com/Template_Tags/query_posts#Time_Parameters
https://www.ads-software.com/support/topic/267931?replies=2#post-1066144
bump
Forum: Fixing WordPress
In reply to: Archive Posts Are Not DisplayingAnyone have any suggestions for poddys? I’m having the exact same problem- my archived by month links are taking me back to the index page…
So for example, when I go to https://www.not_the_url.com/2009/01/ it just displays the index page rather than the posts for that month…
Any help is GREATLY appreciated!