Digital experiences for all disciplines
Forum Replies Created
-
-
Great! It works but for some reason after the last (excerpt) word there is no “…” indicating that there is more text. Do you have a idea where or what to add to show this?
Hi David, do I really have to include all of the code in the child functions.php file? Seems there is no shorter code right? 😉
Your code actually works but the custom.css has attached the Version of the main dante theme Version. I wanted to have the Version appended from the child/custom.css file declared in that particular file. This was just not working out for some reason so I came up with another solution. 😉
I am using header layout 6 (header-6). This said the link you posted before was quite helpful as I could use the code from Kyle: http://www.swiftideas.com/forums/topic/switch-desktop-menu-to-mobile-menu-earlier/#post-64003
The only problem is that for some reason at a resolution of 1024 x 768 px (landscape) the mobile menu is not visible. If I turn the view to 768 x 1024 px the menu shows up again. Very strange. I have checked this with Firebug and an iPad and get the same weird result.
I think there is some setting missing as for the original dante theme (http://dante.swiftideas.com/) the mobile view with the resolution mentioned above only shows at 768 x 1024 px.
Any idea how to fix this?
This reply has been marked as private.Hi David, unfortunately the site I am talking about is still on a staging server and not accessible from the internet but I could tell or give you the header information you’ll need. For now I can give you the source code from the main page.
This did not really works as expected so I had to do some research and testing and came up with this:
function parent_child_style_scripts() { wp_dequeue_style( 'sf-main' ); wp_deregister_style( 'sf-main' ); $theme_info = wp_get_theme(); wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array(), $theme_info->get( 'Version' ) ); } add_action('wp_enqueue_scripts', 'parent_child_style_scripts', 111 );
First we need to de-register the main child CSS from the main dante theme, otherwise we have two calls of the file. Ok. Then we need to get the parent and child CSS file with version number. And that’s it pretty much. Or do I miss something?
Hi. Can the code be modified in a way that the current (main) menu sub-menus are displayed without clicking at it?
For example, Main 2 (site) currently open and the menu should look like this:
Main 1
Main 2
Sub 2.1
Sub 2.2
Main 3
Main 4
Main 5When clicking at Main 4 the (Main 4) site should load an the menu looks like this
Main 1
Main 2
Main 3
Main 4
Sub 4.1
Sub 4.2
Sub 4.3
Main 5And pretty much the same if one clicks form here at Sub 4.2.
I hope this makes sense and you understand what I mean.
Thanks
Elias
Hello David,
I am not sure about the 20 characters but it’s way to short for our requirements. (See attached example)
The child-theme is already installed as we need to adjust also some other parts of the theme.
Waiting for your code snippet. 🙂
Elias
Attachments:
You must be logged in to view attached files.Hi. Is this feature already/now implemented with default sidebar settings for post and pages? I would need this badly as well. 😀
That’s right but then without the version number appended. Do you see the dilemma?!
I have just realized that with the above code the child CSS file will be called/implemented twice.
<link rel='stylesheet' id='parent-style-css' href='foo/wp-content/themes/dante/style.css?ver=4.6.1' type='text/css' media='all' /> <link rel='stylesheet' id='child-style-css' href='foo/wp-content/themes/dante-child/style.css?ver=1.1' type='text/css' media='all' />
and four lines below
<link rel='stylesheet' id='sf-main-css' href='http://www-stage.froglogic.com/wp-content/themes/dante-child/style.css' type='text/css' media='all' />
How can I remove the last call the one without the version number at the end? Is this called via the main Dante functions.php?
Hi Rui, your link to the additional documentation was very helpful as the code I was looking for is
function my_theme_enqueue_styles() { $parent_style = 'parent-style'; wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ), wp_get_theme()->get('Version') ); } add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
which works perfect and as I wanted.
This piece of code appends the version number of the child CSS which is defined in the header of the child CSS file.
Thanks!
Hello David,
we don’t use any caching plugin, CDN, Autoptimize plugin or any form of minification or server based browser cache.
I have found what I think solution on http://wordpress.stackexchange.com/a/158232 and http://www.green-box.co.uk/3-ways-easily-stop-wordpress-caching-styles/ but which one would be the best and easiest to implement?
For some reason something like this is already implemented for the main CSS file as one can see in the source code:
<link rel=’stylesheet’ id=’dante-parent-style-css’ href=’foo/wp-content/themes/dante/style.css?ver=4.6.1′ type=’text/css’ media=’all’ />
Maybe just attaching a timestamp to the Child CSS file would be enough. How is the best way to do this? I guess via the functions.php file in the child folder right?
-