Forum Replies Created
-
AuthorPosts
-
June 1, 2015 at 6:30 am in reply to: How to maintain "current-menu-item" in nav-primary when clicking nav-secondary #154366marksalvatoreMember
My javascript is already in the footer. Enqueue'ing a script does that.
I assumed all WP templates ran before javascript was called but that's not true. Looking at wp-settings, I see that "script-loader" is run BEFORE "nav-menu-template", the template that's re-writing the classes on the menu-item. So how do I prevent that without hacking core?It seems like I need a hook that can run javascript AFTER the nav-menu-template is called.
April 22, 2015 at 5:22 am in reply to: Assign a category when creating a new instance of a custom post type #148783marksalvatoreMemberThere's a setting in ACFs to associated the field group to a CPT. This will result in having only those fields display when a new CPT is created.
marksalvatoreMemberOh, got it now! I had it correct in the post, but not in my code. Thanks for keeping with me!
marksalvatoreMemberhmm.. Looking at the comma-delimited list of js that's loading in the footer, I see a long list of filenames, but none is the one I'm trying to load. But that's fine. At least I know the call is correct. Thanks for that. I should be able to figure it out from here.
By the way, why are you suggesting I use wp_enqueue_scripts() rather than admin_enqueue_scripts()? I only want it to load in the admin.
marksalvatoreMemberThanks Craig. I made the changes you suggested. How do I verify if it worked? I looked in the source for my javascript, but don't see it. Maybe it gets combined/compressed with the main script?
marksalvatoreMemberThe problem had to do with the values I assigned in my update queries. I confused template with current_theme.
I assigned:
template = Twenty Fifteen
stylesheet = twentyfifteen
current_theme = Twenty Fifteenwhen it should have been,
template = twentyfifteen
stylesheet = twentyfifteen
current_theme = Twenty FifteenmarksalvatoreMemberThose two files didn't need "fixing" if by that you mean placed in the expected path. They're both already there. What does "functions.require" refer to?
marksalvatoreMemberThe space in the theme name had nothing to do with it. Obviously I'm reaching here. See any issue in the log entry I put in the previous post?
marksalvatoreMemberRenaming the problem theme folder didn't solve it.
The log says it can't load a required file:
[17-Apr-2015 18:00:25 UTC] PHP Fatal error: require() [function.require]: Failed opening required '/Users/user/Sites/project/wp-content/themes/Twenty Fifteen/inc/custom-header.php' (include_path='.:/Applications/MAMP/bin/php/php5.3.29/lib/php') in /Users/user/Sites/project/wp-content/themes/twentyfifteen/functions.php on line 317twentyfifteen is a fresh set of files and both functions.php and custom-header.php are present. Maybe I need to use an escape character in the database for the space between Twenty and Fifteen?
marksalvatoreMemberThanks Christoph. I changed the name of the plugin folder, but still no luck.
marksalvatoreMemberThank you! That sounds like a great solution.
However, since I am comfortable programming in PHP, I'd like to know how to use the existing framework to do this. I don't need the code. I'm just looking for a description of how this would be done in Genesis?
-
AuthorPosts