Media query for large screen

Here is media query for large screen. You can apply the breakpoints and enjoy the work.

@media screen and (min-width: 1400px) {

}
@media screen and (min-width: 1600px) {

}
@media screen and (min-width: 1900px) {

}

Settings defined in website scopes are ignored in magento2

Today I will show you how you can fix the Settings defined in website scopes are ignored.

This is a core bug in 2.1.3 – https://github.com/magento/magento2/issues/7943

The change you need to make is to vendor/magento/module-store/Model/Config/Processor/Fallback.php

Change this

/**
* Retrieve Website Config
*
* @param array $websites
* @param int $id
* @return array
*/
private function getWebsiteConfig(array $websites, $id)
{
foreach ($this->websiteData as $website) {
if ($website[‘website_id’] == $id) {
$code = $website[‘website_id’];
return isset($websites[$code]) ? $websites[$code] : [];
}
}
return [];
}
To

/**
* Retrieve Website Config
*
* @param array $websites
* @param int $id
* @return array
*/
private function getWebsiteConfig(array $websites, $id)
{
foreach ($this->websiteData as $website) {
if ($website[‘website_id’] == $id) {
$code = $website[‘code’];
return isset($websites[$code]) ? $websites[$code] : [];
}
}
return [];
}

Note the line

$code = $website[‘code’];

Redmi mobile suddenly not starting

Some people like me may get the issue of Redmi mobiles suddenly switched off and not booting. That’s really very irritating. In the mobile age I think no one can live without…. 🙂

So I tried to find the issue. First I tried to use another charger and no luck!! Whole day my mobile was switched off. I was thinking what Can I do… So I tried to connect mobile to my Laptop… but still no luck. That was not charging and not starting… I worried may be I have to go to Redmi customer service but once again I google on about this issue and find many tricks as I have applied above but no works.

Finally I found a solution and that worked for me, then I thought I have to write that on my blog.. May be this trick will work for other people…

Push Vol down and power for around 15 second, It will show MI BUNNY fastboot mode and press till vibrate!!

That’s it.

PS : The issue caused due to app/system hang.

Enable error reporting in joomla

Sometime is not easy to find the site issues. So we must have to enable the error reporting while in development. Joomla uses PHP and when PHP has problems, it reports them to you.

Here is short tutorial for enable error reporting in joomla.

1- Go to Site > Global Configuration > Server > Error Reporting.
2- You have five choices: System Default: this allows error reporting to be determined by the php.ini file on your server. Development will show all error reporting.

System Default this allows error reporting to be determined by the php.ini file on your server.
None will disable all error reporting.
Simple will show Errors and Warnings but won’t show Notices.
Maximum will show Errors, Warnings and Notices.
Development will literally overwhelm you with feedback. If you’re not a developer, please don’t use this option.

 

Disble error reporting in joomla

Sometime is not easy to find the site issues. So we must have to enable the error reporting while in development. Joomla uses PHP and when PHP has problems, it reports them to you. However, often these errors will appear on your site and will be visible to visitors. So we must have to disable theme.

Here is short tutorial for enable or disable error reporting in joomla.

1- Go to Site > Global Configuration > Server > Error Reporting.
2- You have five choices: System Default: this allows error reporting to be determined by the php.ini file on your server. None will disable all error reporting.

System Default this allows error reporting to be determined by the php.ini file on your server.
None will disable all error reporting.
Simple will show Errors and Warnings but won’t show Notices.
Maximum will show Errors, Warnings and Notices.
Development will literally overwhelm you with feedback. If you’re not a developer, please don’t use this option.

How to change continue reading link text in wordpress

How to change continue reading link text in wordpress. In this tutorial I will show you how you can change the “continue reading” text in wordpress. If you want to modify continue reading link with Read more , you can use this function in your functions.php file.

function my_code_excerpt_more( $more ) {
return ‘ ‘ . __(‘Read More’, ‘your-text-domain’) . ‘‘;
}
add_filter( ‘excerpt_more’, ‘my_code_excerpt_more’ );

May be your theme does have another text except “continue reading”, so this trick also will work for those.

How to change length of post excerpt in wordpress theme

In this case here is little code and that will help!! You will have to use the code in functions.php file

/* Changed excerpt length to 200 words*/
function your_code_excerpt_length( $length ) {
return 20;
}
add_filter( ‘excerpt_length’, ‘your_code_excerpt_length’, 200 );

If you are not ok with the limit of 200, you can change to to any integer number you like.

How to use post excerpt in WordPress Twenty Fifteen theme

In this tutoarial, I will show you, how you can fix the post excerpts issue in the WordPress Twenty Fifteen theme.
Twenty Fifteen theme has greatl layout, Neat & clean content area, great readability settings and other features Twenty Fifteen is going to be favorite of many bloggers. Most of the blog users expect post excerpts on front page. The Twenty Fifteen shows full article on front page, category page, search page etc . There are number of articles on front page, category page, archive pages, search page etc so the length of webpage becomes huge and webpage size also increases. This can be avoided by showing post excerpt in Twenty Fifteen.

For fixing excerpts issue, Look in the content.php which need to be modified for post excerpt.

/* translators: %s: Name of current post */
the_content( sprintf(
__( ‘Continue reading %s’, ‘twentyfifteen’ ),
the_title( ‘‘, ‘‘, false )
) );wp_link_pages( array(
‘before’ => ‘

‘,
‘link_before’ => ”,
‘link_after’ => ”,
‘pagelink’ => ‘‘ . __( ‘Page’, ‘twentyfifteen’ ) . ‘ %’,
‘separator’ => ‘, ‘,
) );
?>

You can see from the block of code shown above that full content of each post is displayed through the the_content() function. If we change this block of code to show full content for single post and post excerpt for all other cases, then purpose will be solved.

if ( is_single() ) :
Full post content

else :
Post excerpt

endif;

So for now we will have to modify our code. Look below I have modified the code

‘, ‘‘, false )
) );

wp_link_pages( array(
‘before’ => ‘

‘,
‘link_before’ => ‘‘,
‘link_after’ => ‘
‘,
‘pagelink’ => ‘‘ . __( ‘Page’, ‘twentyfifteen’ ) . ‘ %’,
‘separator’ => ‘, ‘,
) );
else :

/* translators: %s: Name of current post */
the_excerpt( sprintf(
__( ‘Continue reading %s’, ‘twentyfifteen’ ),
the_title( ‘‘, ‘‘, false )
) );

wp_link_pages( array(
‘before’ => ‘

‘,
‘link_before’ => ‘‘,
‘link_after’ => ‘
‘,
‘pagelink’ => ‘‘ . __( ‘Page’, ‘twentyfifteen’ ) . ‘ %’,
‘separator’ => ‘, ‘,
) );
endif;

?>

Now we have done!! This piece of code will work perfectly on the wordpress site.

WordPress blog excerpt not working in Themes

Some of the themes in wordpress does not display excerpt on blog page, category pages or archive pages. This is because theme does not include the experts code in the theme file.

This is a very simple tutorial that anyone can implement and take advantage of this built-in feature. The benefit of implementing this tutorial is that it decreases page load time and it increases the pageview count.

So we will have to update theme as per our need. For this process we will have to edit index.php file, archive.php file, and category.php file and find the code

<?php the_content(); ?>

If this is there then replace it with

<?php the_excerpt(); ?>

 

How to reset admin password in Magento 2

This is easy and complicated too!! There are two different methods to restore your admin password. The first one is quite easy while the second is more complicated..

In the first solution there is you need to reset password your email address stored in magento site.For this you need to open the admin panel of your store and click on the «Forgot your password?» link. Then, fill in your email address associated with the admin account and hit the «Retrieve Password» button.

In a moment, you’ll receive receive an email with the link that allows you to reset your current password or set a new one. Click on that and add your new password.

The second method is little complicated using phpMyadmin. First, you need to login to cPanel if you have one installed. Then, in the «Databases» section of the cPanel, select the phpMyAdmin link and copy the following sql query:
UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxYourNewPassword', 256), ':xxxxxxx:1') WHERE username = 'admin';

The xxxxxxx character sequence is a cryptographic salt.
it is saved in app\etc\env.php file


array (
'key' => '763701df77e6cba98d5e9a1bb3d935cv', //cryptographic salt
),
...