Skip to main content

Posts

Showing posts from August, 2018

WordPress line break not Working

Many WordPress users struggle around this issue of WordPress line break not working. In this article, we discuss some of the possible ways to get around this issue. 1. Use empty classes in HTML Elements You can make WordPress assume that your HTML elements contain certain attributes. This can be done by Adding attributes to the HTML elements with the use of empty classes. For example: Avoid writing: <p> <br> <span> Instead, write: <p class=""> <br class=""> <span class=""> 2. Disable Autop formatting The  Autop() function  in WordPress auto formats the paragraphs. The WordPress line break not working is due to the presence of a filter called “wpautop”. The “wpautop” filter executes whenever the content of a blog post is rendered. We can easily use the  remove_filter function  to disable the  wpautop filter . In the functions.php file you need to add the following code: remove_filter ('the_conten...

How to Disable WordPress Admin Bar for All Users Except Administrators

Disable Admin Bar for All Users Except for Administrators Paste this code in your theme’s functions.php file add_action( 'after_setup_theme' , 'remove_admin_bar' ); function remove_admin_bar() { if (!current_user_can( 'administrator' ) && !is_admin()) {    show_admin_bar(false); } } Disable Admin Bar for All Users If you want to disable it for all users, then simply put use this code in your theme’s functions.php file add_action( 'after_setup_theme' , 'remove_admin_bar' ); function remove_admin_bar() {    show_admin_bar(false); }

Wordpress media library not loading images

WordPress media library not loading images or Images are not displaying the images: Main cause of this issue is the plugin conflict, so please deactivate the plugin one by one and check that your issue resolved or not. WordPress always update it's software to avoid or overcome issues and it is depreciating the old functions. but some of our plugin using these functions and create problem. So in that case please update the plugin if possible otherwise deactivate it .

How to open iframe external link in parent window

To open a link in the parent window inside a Iframe you can use the one of the below methods: If We wants all the link to open in the parent window then use the below tag in the header: < head >< base target=" _parent ">< base ></ head >   We can also use the tag target =" _parent " in < a href=" aboutus " target=" _blank "/> tag   We can also use javascript parent.document.location.href = " http://example.com ";

Wordpress pagination 404 error "/page/2" - what to do?

The problem mainly arises because permalinks set to Custom Structure /%category%/%postname%/. I understand WordPress assumes "page" is a post from the category. That is totally normal behaviour. If you want to remove category base you will need to write some custom rewrite rules, not simple rules I must say. Configure category base to . (dot), put this code in the functions.php of your theme, or better in a plugin, and flush the rewrite rules (code from this post in Daily Web Kit): add_filter ( 'category_rewrite_rules' , 'vipx_filter_category_rewrite_rules' ); function vipx_filter_category_rewrite_rules ( $rules ) { $categories = get_categories ( array ( 'hide_empty' => false ) ); if ( is_array ( $categories ) && ! empty ( $categories ) ) { $slugs = array (); foreach ( $categories as $category ) { if ( is_object ( $category ) && ! is_wp_error ( $ca...