How to add HTML text to every page using Google Optimize? - google-optimize

I would like to add a few lines of HTML to every single product page on my website.
However, it only works on one URL. I'm really sure my URL targetting is setup correctly.
I've selected an element on the page – and used "HTML" and "Insert" to add the code to the page. However it doesn't work on every page.

Related

replacing anchor # to full url in wordpress posts

I trying to replace the anchor "#downloadbutton" to the full url in all posts.
for example:
#downloadbutton = https://mywebsite.com/kindness-and-gentleness/#downloadbutton
#downloadbutton = https://mywebsite.com/islamic-etiquette/#downloadbutton
#downloadbutton = https://mywebsite.com/hindrances-on-the-path/#downloadbutton.
The reason for this is that when I create excerpts which include anchors from the posts. The anchor urls are not working except if i go back to and change the anchor #download to absolute (full) url. and there many posts. Is there any way to do it through php snippets. Am using wordpress.
Thanks in advance
You can't remove hyperlinks hooks from the url. Hyperlinks hooks are just a way to navigate to a specific content more quickly. For example https://ownwebsite.com/#testimonials will show you the testimonials section straight away on page load.
The only thing you can do is replace the url from the button with your specific url, that way instead of having an hyperlink hook button, you would have a regular plain'ol button that redirect you to a page or else..
You can learn more about the <a> html5 tag behaviour # https://www.w3schools.com/tags/tag_a.asp and you can see a live example of the behaviour # https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_a_href_anchor

wordpress disable print &nbsp on DOM

I'm an Italian's student and i've some problems with Wordpress 4.9.6. In particular it prints some "&nbsp" on DOM, i don't understand why happens (if someone could tell me, i would be more happy)!
I've already tryed the code below:
remove_filter('the_content', 'wpautop');
This doesn't work because it applies the filter in all pages of my theme and it breaks the structure created from WP editor.
So the question is:
is there a way to apply the code above only for a specific page?
In my case the page requested is a single post page (for all single post pages).
Here an image of my DOM with inspector of Chrome about what happens:
URL problem's link
Check your content/text in "Code view" on edit page.
Seems like break lines.. (several 'Enter' pressed)

After submitting course create form in moodle 2.8 showing alert "This page should automatically.." message

I am using moodle 2.8
I have added some css code in course/edit.php to hide some form fields on for trainer/student role.
But when I submit form from trainer account showing alert message like
"This page should automatically redirect. If nothing is happening please use the continue link below."
and show "Continue" link.
I guessed, reason may be adding css in php script. but just I want to hide that message so my form should be submitted directly like admin area.
In almost every case, this error is because there is some extra output on the page that should not be there.
Usually it is caused by extra spaces before the opening '< ?php' tag in a file or incorrectly including a closing '?>' tag at the end of the file, followed by whitespace.
In this case, it may well be related to adding output to the wrong part of the page, by adding CSS to edit.php. If you want extra CSS on the page you should add it to the theme, or you may be able to add it via the theme settings. Note that every page has unique classes added to the 'body' tag, so you can use that to write CSS that only applies to a single page in Moodle.

Like button on each page

I have a like button on my main page (master page in asp.net).
I added a like button on each dynamic page.
When I try to enter the link:
http://www.friend.co.il/details.aspx?id=2321
to one of the dynamic page in face book developer page:
http://developers.facebook.com/docs/reference/plugins/like/
I get the same number of like as the total site number and not just a number for the specific page.
Any body know whats I'm doing wrong?
Using Facebook's URL Linter on your dynamic page's URL shows that it has Open Graph tags that refer to your website's main page. As a result, Facebook thinks that the canonical URL for http://www.friend.co.il/details.aspx?id=2321 is http://www.friend.co.il/.
You should either remove the meta tags from your subpages, or construct them so that they properly represent the content on each page.
Remove your og:url meta tag and also be sure to not include the Facebook javascript file multiple times like you are currently doing.

print stylesheets - how to print all pages of paginated content?

I'd like to use CSS to specify a stylesheet for printing (instead of the "print friendly view"). The problem is that my web site has long article content that is paginated. When printing a paginated article using CSS, only the current single page gets printed instead of the whole article.
Is there any way to control the printing so that when the user prints the "all pages" view is printed instead of just a single page?
Sometimes you need to create custom output, just for printing. Same stylesheet, just with all the content on one go instead of paginated.
I sometimes put a parameter "printmode=1" or something, then load the content into a hidden iframe on the same page and print it from in there.

Resources