I have a free WordPress blog with a URL like e.g.
https://blog.wordpress.com
I mean I don't have my own domain, only a WP sub-domain.
I noticed that there's a MathJax plugin in WP, but I cannot enable it unless I have a business plan.
So... is there any other way to have MathJax enabled in my blog? With my free account I don't find any way to add some JavaScript tags to the header or to the template of my blog or to anything similar (you see... I would like to have MathJax enabled on all the posts I create).
Is this possible at all with a free WordPress blog like mine?
All I want is to place e.g. these two tags (somewhere... but where?!?!) and get my math working:
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
Is this possible at all?
MathJax v3 works on blogspot with:
<script async id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax#3/es5/tex-chtml.js"></script>
It can work on WP as well.
Related
I have to work in a wordpress project of a former colleague. But I cannot figure out how he added an link-address to a script into the header of each page. After a global search, the link-address was found inside the sql dump of the wordpress project. I could not find any plugin he might have used. I would like to change the link-address. Any idea, how he added it?
<script src="http://custom-link/page.js" type="text/javascript" defer=""></script>
It was added by the wordpress plugin divi builder.
Divi Theme Options
To add a code to every page navigate to Divi Theme Options > Integration tab.
Make sure the “Enable header code” option is checked, and paste your code below.
We are having a html website whose homepage and other few pages has google analytics code and keywords. Now we have created a new homepage on wordpress which will be our future homepage. So my question is can I use my existing homepage GA code into my new wordpress homepage? If yes then how? We don't want to lose our previous tracking data at any cost.
How can use it? Please Help.
TIA.
Yes, you can use your existing google analytics code by using WordPress plugins.
There are many plugins in WordPress which provides ability to integrate your google analytics code to your site and all pages dynamically and also display you a complete tracking reports as well.
here is one plugin link for your reference please check it.
https://wordpress.org/plugins/googleanalytics/
There are lot's of other plugins as well you can simply check out in WordPress plugins repository.
=> Also you can add your google analytics code programmatic as well.
Please copy below code and paste it into your activated themes functions.php file at the end of the file.
function add_google_analytics_code_to_pages(){
?>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-ADD YOU GOOGLE ANALYTICS ID HERE', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
<?php
}
add_action("wp_head","add_google_analytics_code_to_pages");
Just add your google analytics tracking id into about script.
Replace your tracking id instead of this code.
'UA-ADD YOU GOOGLE ANALYTICS ID HERE'
Unless I am missing something here, sure!
All you have to do is enter your Google Tracking code inside the <head> tags, within the header.php template file. Ideally, just before the closing </head> tag.
By inserting your Google Tracking code, within the header.php template file, every WordPress page will be tracked.
Your header.php template file will typically be found within the following directory path:
wp-content > themes > theme-name
If you are not the theme author, don't forget to create a Child Theme. You will then need to insert the appropriate header.php template file within said Child Theme.
Google Tag Assistance:
For the most part, the above should resolve your problem. You can check whether the Tracking code has been correctly installed by:
Reviewing the code within the Source Code
Installing Google Tag Assistance within Chrome
Exception:
Again, the above should be enough to resolve your issue. Some themes however, do create different headers, for different pages of the site. For example: An eCommerce site may want a different header on their shop pages to their Blog Pages. To achieve this, header template files, such as below would be created:
header-shop.php
header-blog.php
header-ppc.php
To then 'call' each header, the following example PHP entry would be placed within the relevant template file(s):
<?php get_header( 'shop' ); ?>
'shop' being whatever word appends the header- file name. In this case, 'shop', 'blog' and 'ppc'.
You do not need to worry much about this. All you need to do, is head into the root of your theme as follows:
wp-content > themes > theme-name
Look for any files with begin with header- and ensure they contain the Google Tracking code.
In the event you are using a Child Theme, simply copy the header- files over to the root of your Child Theme first and then modify accordingly.
Hope this helps.
I am just about to launch an eCommerce site using WordPress and WooCommerce and trying to tidy up the source code and strip out all the WordPress header lines.
The site is pure eCommerce with a blog for users and search engines, I believe the functions below are for a pure blog website.
<link rel="profile" href="http://gmpg.org/xfn/11"/>
<link rel="pingback" href="http://www.domain.co.uk/xmlrpc.php"/>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.domain.co.uk/xmlrpc.php?rsd"/>
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.domain.co.uk/wp-includes/wlwmanifest.xml"/>
Does anyone know what is required from the above for WordPress to function? And how we can remove these from WordPress, if we can?
Thanks Kindly.
J
You can safely remove all of these from your header.php file. They aren't required for the site to function.
More info: In HTML5, the "profile" attribute was dropped.
The others are purely optional.
For de-registering the bottom two, you'll need to add some new lines to your functions.php:
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
These functions, from the wp_head action hook, can be viewed in wp-includes/general-template.php, starting on line 2190.
From this file, rsd_link "display(s) the link to the Really Simple Discovery service endpoint."
The wlmanifest_link "display(s) the link to the Windows Live Writer manifest file." If you don't use Windows Live Writer, there's no need for this.
I would like to know of any known image or video gallery plugins that use external media sources instead of having to upload via wordpress media library.
Worst case, is there a plugin that can performed a scheduled / updates only import from a file server?
Thanks in advance!
You can use the following code jointly with ImageZone.
With ImageZone you can collect external images and share them, while the code will render them into html. The code looks like:
// where do you want to add the gallery
<div id="GalleryId"></div>
<style>...</style>
// this is generated by imagezone
<script type="text/json" id="GalleryId">...</script>
<script type="text/javascript">
function setup(gid){
}
setup("GalleryId");
</script>
and you could make it a wp shortcode
I am playing with Wordpress 3 for the first time and had a quick question.
I am placing ads on a site and wondered the best practice to add in the script. The code that Google generates is in 2 parts, one for the of the page and one where the ad should go
The head code is in the form
<script type='text/javascript' src='http://partner.googleadservices.com/gampad/google_service.js'>
</script>
<script type='text/javascript'>
GS_googleAddAdSenseService("ca-pub-123123");
GS_googleEnableAllServices();
</script>
<script type='text/javascript'>
GA_googleAddSlot("ca-pub-123123", "300x250_Ad");
</script>
<script type='text/javascript'>
GA_googleFetchAds();
</script>
Then the code for the ad is:
<!-- ca-pub-123123/300x250_Ad -->
<script type='text/javascript'>
GA_googleFillSlot("300x250_A");
</script>
I downloaded a plugin Advertising Manager that allows me to add ads into the page but only seems to allow putting in one block of code. I can add all the code joined up but if I want to add other ad positions later it is not the best...
I can't go into my Theme and add the code in there, as I am using Multiple Sites the code will need to difer from site to site, is there something very simple I am missing to add stuff into the and then I can use Advertising Manager to display the individual ad code...
Try using the the AdSense-Deluxe WordPress Plugin
It would appear the plugin has a bug, the shortcode you're using is calling a function which is directly outputting the code for DFP (which is called when wordpress is preparing the page content, hence it appearing all at once at the top) instead of returning it to be inserted throughout the content.