Forum Replies Created
-
AuthorPosts
-
s-designMember
Hi Sakin,
So are you saying there is no way to do what I am trying to do with CSS? If no, is there some code I could add/edit in the catcheverest-menu.min.js file in my child theme that could make this work?
s-designMemberI would like to change the background color of the link that is the current page.
Example: When you are on the education page:
http://dev1.jhamtsegatsal.org/life/education/
and the screen is desktop size the color behind the current page link in the drop-down menu is black.#header-menu .menu .current-menu-item > a, #header-menu .menu .current_page_item > a,{ background-color: #000; }
But, when the screen size is mobile, I would like the background color to be the same color in the mobile menu for the current page link in the mini menu drop-down, to indicate what item is the current page.
Does that make sense?
I have tried different ways to style it to try and make it happen, but can’t seem to figure it out. If you can tell me the code for the
@media (max-width: 480px)
I can do it for the other@media
.Thank you for your help.
s-designMemberHi Sakin, I think I figured it out. I didn’t realize that if I turn ON the header featured image and turn OFF the content featured image — both in the theme options, then I don’t get a double image. It only displays my content featured image AS the header featured image. That solves my problem.
s-designMember@Sakin: Can you share what you did to help solve Bethann’s problem. It seems I am having the same issue.
In the Theme Options – Header Featured Image Options
I have selected:
Enable Featured Header Image – ENTIRE SITE, PAGE/POST FEATURED IMAGE
Page/Post Featured Image Size – FULL IMAGE
Featured HeaderImage Position – AFTER MENUIn the Test Page Settings – Content Featured Image Size
I have selected:
Default Layout Set in Theme OptionsWith these settings I have a featured image showing up both as a featured header image and as a featured image as apart of the content.
I am working locally so I don’t have a URL to share.
Thanks you for your help.
s-designMemberIt worked great! Thank you for all your help.
s-designMemberAfter thinking about it more… I am now wondering if there is a way to change only the small bit of code I need changed in the catcheverest-menu.min.js file using only my child-theme/functions.php, instead of what I did:
1. Copied and cloned the whole catcheverest-menu.min.js file.
2. Modify the tiny part I needed tweaked to create the desired effect.
3. Placed this new version I made into my child-theme file.
4. Then add the code in the functions file to replace the parent version with my child version (using the code in my previous post).I am thinking that if I can replace only the small part of code inside this file, instead of replacing the whole file, it would be better. This way if another part of the code in the catcheverest-menu.min.js file is modified when the parent theme is updated it won’t be overwritten by my replacing the whole file.
Is this line of thinking correct? If so, how do I replace only the small part of code?
Just to recap:
This is the original code in the catcheverest-menu.min.js file that I am wanting to change:.parents("ul, ol").length-1;t++){l+="- "}
I want to change it to this:
parents("ul, ol").length-1;t++){l+=" - "}
s-designMemberI put this code (see the code below) into my child theme functions.php, it works! The changes I wanted to make to the mini nav show up in the browser without changing the parent file: /js/catcheverest-menu.min.js
I placed this new file I created here: my-child-theme-name/js/catcheverest-menu.min.js
I just wanted to check with you to see if all my code is correct. If not what do I need to tweak? Thank you for all your help.
function catcheverest_remove_scripts() { // Remove parent theme small menu wp_denqueue_script( 'small-menu'); // Now register your styles and scripts here } add_action( 'wp_denqueue_script', 'catcheverest_remove_scripts', 20 ); // Load some javascripts for child theme add_action( 'init', 'load_child_js' ); function load_child_js( ) { wp_enqueue_script('small-menu', get_bloginfo('stylesheet_directory').'/js/catcheverest-menu.min.js', array('jquery')); }
s-designMemberThank you for this information.
I have created a child theme.
In the child theme I have been able to modify:
header.php
functions.php
footer.php
style.cssI can not get the files in sub-folders to be recognized, such as:
js/catcheverest-menu.min.js (related to the needed code modifications above)Any thoughts on why this might be happening?
Or, what I need to do to get those files to be recognized?s-designMemberThe second line of cod should be like this: but without the spaces after these “&”
parents("ul, ol").length-1;t++){l+="& nbsp; - & nbsp; "}
s-designMemberSorry here are the links to the screen shots.
Here is a screen shot of what the mini menu looks like before the code change:
Screen shot of unchanged mini navHere is a screen shot of what the menu looks like with the code changed:
Screen shot of new mini nav -
AuthorPosts