Jonas Bj?rn Pedersen
Forum Replies Created
-
@anastas10s I will let you know what I find out. However just looking at the response from @shameemreza makes me think that the problem might be with our setup of google tag manager.
@dlim_vernier, I’m kind of relived to not be the only one struggling with this.
@shameemreza thank you for that explaination, I will look into this. The site is using Goolge Tag Manager that is coupled together with Google Analytics.Forum: Themes and Templates
In reply to: [GeneratePress] Social icons on right widget sidebar not alignedI just had the same issue. I resolved it by setting padding-bottom:0. For me margin-bottom didn’t work. I used the selector @diggeddy suggested and added it to the additional css section
Forum: Plugins
In reply to: [PHP Code Widget] Making my own plug-inOh I misread your first response.
So say that I have the following code in the widget:
<?php bloginfo('name'); ?> - © <?php echo date('Y'); ?>
Is this the code to put in the plugin?
- This reply was modified 6 years, 9 months ago by Jonas Bj?rn Pedersen.
Forum: Plugins
In reply to: [PHP Code Widget] Making my own plug-inThank you for the answer, however I’m still not quite sure which of the code I should use. Is it the only part, to use? This is the code between the lines of
echo $before_widget;
andecho after_widget;
. In the custom html widget I still can’t use the <?php ?> tags. Sorry for all the questions, but I’m still new to this.if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ob_start(); eval('?>'.$text); $text = ob_get_contents(); ob_end_clean(); ?> <div class="execphpwidget"><?php echo $instance['filter'] ? wpautop($text) : $text; ?></div> <?php
EDIT: Figured out how to use the php tags (<php> and </php>, but the widget reads it like normal text). Can you help with this?
- This reply was modified 6 years, 9 months ago by Jonas Bj?rn Pedersen.
I realize this might be the wrong forum to post the answer since most of it is related to the MonsterInsights plugin, but since the thread already exists this seemed the easiest thing to do. Feel free to delete the post, if you find it irrelevant.
Since I had trouble finding a solution online I will tell you what I did, to solve this. However I kinda did it in another way, where the cookies will be created only if the user accepts cookies. Pressing “No” or not doing anything the analytics cookies will not exist.
You need to access the source code for MonsterInsights. In wordpress achieve this by navigating to Plugins -> Editor. Then set the plugin to edit as the MonsterInsights plugin and press select. In “Includes -> Frontend -> Tracking” there is a file called class-tracking-analytics.php open it and find the line starting with
(function(i,s,o,g,r,a,m)
[around line 200 for me]. All you need to do is to insert this code on the line above the function<?php if ( function_exists('cn_cookies_accepted') && cn_cookies_accepted() ) { ?>
and this on the line below the function<?php } ?>
Anyone able to help?
Well thank you. Sorry about the immediate lack to streaming, but we didn’t quite have the time to do it.
Forum: Plugins
In reply to: [Cookie Notice & Compliance for GDPR / CCPA] Cookie notice not showing upWell I got it fixed, by inserting this line to my footer file; <?php wp_footer(); ?> just above the line with </body>
You are now officially my hero!!
It totally worked, and fixed a problem I had with a cookie plugin.
That is possible.
Where would I call that method and how. I’m still learning php and the wordpress setup.
- This reply was modified 6 years, 12 months ago by Jonas Bj?rn Pedersen.
We use a custom theme.
Btw, the btn prefix for class names, has been replaced with read.
Actually are you sure I need to untick the “Don’t include the GA code snippet”, because the light version of MonsterInsights does not support click/event tracking.
Hi,
Sorry about not clearing that up. I actually did do that part. In the following link the image shows how I set it up, https://imgur.com/a/KoljII don’t think we have any caching plugin but, I didn’t set up the website.
I can’t see any caching plugin on the list of plugins, so I guess not.