Sending click events to Google Analytics in WordPress: the easy way

This is working in my WordPress site. Remember we are using the plugin “Per page head”, which allows you to add content into the section for a specific page, like custom JS or custom HTML. This is the custom code added: <script>// <![CDATA[ jQuery(document).ready(function($){ $(‘.class-name-of-the-button’).click(function() { ga(‘send’, ‘event’, { eventCategory: ‘Outbound Link’, eventAction: ‘click’, eventLabel: … Read more

Weird links found in wordpress footer

Sometimes a WordPress appliance service or a plugin makes a change to insert content in the footer of web pages at the web server level. If this was done here this can make it harder to find and remove. If your webserver is Apache try seeing if this file exists: /etc/apache2/mods-enabled/substitute.conf and then take a … Read more

Side effects of Script and Iframe in post

The recommended method for embedding iframes is using the <iframe> tag. It makes for better syntax and also allows you to control the iframe much better. For example, you are able to remove an iframe’s border, control scrolling options, etc. <iframe src=”https://jsfiddle.net/o7usdL0a/embed/result/” style=”width: 100%; height: 300px” scrolling=”no” marginwidth=”0″ marginheight=”0″ frameborder=”0″> </iframe> The <script async> and … Read more

Gutenberg extend blocks add new class name

Yes, you can do this via the classnames() function. import classnames from ‘classnames’; const withClass = createHigherOrderComponent( ( BlockListBlock ) => { return ( props ) => { let wrapperProps = props.wrapperProps; wrapperProps = { …wrapperProps, className={ classnames( ‘my-custom-class’, props.className ) } }; return <BlockListBlock { …props } wrapperProps={ wrapperProps } />; }; }, ‘withClass’ … Read more