Forum Replies Created
-
AuthorPosts
-
endolilParticipant
multiple pages 😉
endolilParticipantThat was a good hint, Anita! Thank you!
For some reason I can't get any output when I use
add_action('genesis_before', 'my_code');
or
add_action( 'wp_body_open', 'my_code' );so I ended up using this
add_action( 'wp_footer', 'my_code' );to add a noscript tag from the google tag manager into the page.
It's not ideal but it works.
I have no idea why the other "add_actions" don't work in my child theme. It's mysterious. I never had this problem before.endolilParticipantI am still struggling with adding the code to the body:
// additional code that goes into the document body // in this case it is the Google Tag Manager noscript code function gtm_body_code() { // get code for the body $gtm_body_code = get_field('google_code_body', 'option'); // check if activated $gtm_body_code_active = get_field('google_code_body_active', 'option'); // if code exists and is activated if($gtm_body_code_active == TRUE && $gtm_body_code) : echo $gtm_body_code; endif; } add_action( 'before_genesis', 'gtm_body_code' ); add_action( 'wp_body_open', 'gtm_body_code' );
Both actions don't seem to trigger that the code is being added.
I have this in my functions.phpAny idea why this does not work??
endolilParticipantThank you so much!
I am going to try to get before_genesis to run and I already managed to use the wp_head function to add the code to the header. And yes, I do think it's fine if it is not very high up in the html head tag.And the blocking of scripts is probably something our marketing team will look into as I am only adding the code for now and have nothing to do with the actual tracking and analysis.
Thanks for mentioning it!
endolilParticipantThank you, Victor.
the lowest priority would be 0, right?
add_action( 'wp_head', 'my_script', 0 );
So genesis_before is not depreciated???
And when I add this to my functions.php (child theme), nothing happens:
function gtm_body_code() {
// get code for the body
$gtm_body_code = get_field('google_code_body', 'option');// check if activated
$gtm_body_code_active = get_field('google_code_body_active', 'option');// if code exists and is activated
if($gtm_body_code_active == TRUE && $gtm_body_code) :
echo $gtm_body_code;
endif;echo "body code"; // just to test
}
add_action( 'genesis_before', 'gtm_body_code' );`Any idea why this is (not) happening?
February 14, 2018 at 8:25 am in reply to: Genesis updated with modern CSS code? = Flexbox for column layouts for example? #216526endolilParticipantSome child theme authors are developing child themes around the new CSS standards.
@victor
I see and yes, it makes sense.
I am developing my own child theme and I was wondering why the framework has not made the leap to flexbox but still keeps using "old-school code". Genesis is titled with "industry standard". In this context it does not feel like it.
However, I love it anyways!this is a community-based forum, not official support. The Genesis developers will not comment here.
@Andrea
Thanks for letting me know.endolilParticipantThanks Brock,
the keywords were " Their purpose is aesthetic." ...
I think so. It makes sense.I am building my own theme based on Genesis and I don't need these little extras since I started using AnimateCSS, which is really cool, especially in combination with jQuery (events).
So I will just delete this fluff from my child's theme style.css and save some bytes. 😀
Thanks again!
endolilParticipantI have to admit that I created a problem that had nothing to do with the code I posted here.
For layout purposes I created a class and with that I tried to eliminate some gaps, which worked with some included content that was not going into the normal content. Well, later my "no-margin" class was added under some circumstances and I didn't notice it.
.no-margin #genesis-content {
height: 0px;
}I just could not see my content anymore.
lol
now it's fixed and all works as it should!
Sorry for the confusion.endolilParticipantThank you Victor!
Tried it and it doesn't work.
Any other ideas? -
AuthorPosts