All posts by murdah

myStickySidebar – Sticky Sidebar for any WordPress Theme

Plugin glues your website’s sidebar, making it permanently visible while scrolling.
Sticky sidebar plugin will work out of box with some themes which use “#secondary” element id for sidebar such as: Twenty Seventeen, Twenty Sixteen, Twenty Fourteen, Twenty Twelve, Total, Flat Bootstrap, Bolid Theme and many more… Continue reading myStickySidebar – Sticky Sidebar for any WordPress Theme

PageSpeed Insights – Minify HTML function for WordPress

This is one little touch to speed up the things and make your WordPress a little bit faster.

To check if function is active inspect code with Firefox browser, if all of code is in one line you are all set, html is compressed and minimized… This is one of the steps to do to achieve maximum browsing experience… Other way to check if html is minimized is Google’s PageSpeed Insights

Disable CSS style in myStickymenu options

As some of you probably already noticed, there is a new option in latest version of myStickymenu plugin v1.8.1. I added this option because of site optimization, in case that you want all your CSS code inside of a single file, to achieve faster loading speeds.

To use this advanced option, some CSS is need to be added into your theme style.css file. Code you need will be generated in head element by the plugin. You should set up your desired style settings in plugin options first, since this is the code that will be generated. After you Enable “Disable CSS” option all style settings will be overridden by CSS, so you will not be able to change background color in plugin settings for example, you will need to do it in CSS style.

Simplest way to find and see CSS code that you will need is to use Firefox or Chrome, right click on the page with working myStickymenu on it and select “View page source”. So look in the header section of the code and search for myStickymenu style inside, it should look similar to this:

Copy this CSS code (everything inside style) and put it to your style.css somewhere at the end of file. Customize it furthermore to suite your needs.

Now you can Enable “Disable CSS” option in plugin settings, and plugin should use CSS style from the style.css file instead generating it in the head…

How to Paginate WordPress Comments

In some cases when you have a lot of comments on a post, you want to split them into pages so user don’t need to scroll a lot. Lot of blogs or websites will never need this, but as I said in some cases this will be needed.

To set it up first go to Settings / Discussion and change comment option like bellow:

Enable check box – Enable threaded (nested) comments “5” levels deep.
Enable check box – Break comments into pages with “7” top level comments per page and the “last” page displayed by default.
Comments should be displayed with the “newer” comments at the top of each page.

So now everything works, your comments are paginated and click on older comments link will add “/comment-page-2#comments” to the end of your URL and get you to second page. All this is good but there is one slight problem with page Title Meta Tag, which will be the same for every comment page. This is no good at all since it will downgrade Google SEO and get you Duplicated Title Tags Warning.

To fix this navigate to your theme folder inside wp-content/themes/your-theme or even better your-theme-child and edit header.php file. Find this line: (it could be different on different themes)

<title><?php wp_title( '|', true, 'right' ); ?></title>

and change it to something like this:

<?php wp_title( '|', true, 'right' ); 
$page_comment = get_query_var('cpage');
if ($page_comment > 0) {echo ' | Page '.$page_comment;}?>

That should be it, your post comment pages will now should be SEO Friendly and shorter to scroll, therefore more user friendly.

How to remove category base url from WordPress

This was mind bugling for me for some time now, every method I tried gave me some kind of error such as broken child category or broken pagination. But at the end I found out the simple solution without of adding any Plugin or editing .htaccess file… To make this work you will need to create the page (in wp dashboard) and page template for every category (this will add possibility of custom category template for each individual category as well). Continue reading How to remove category base url from WordPress