e-smartsolution » Smartsolution

Smartsolution

All 404 redirect by .htaccess and PHP

2019-01-14 20:59:52 e-smartstolution

All 404 redirect by .htaccess and PHP

1- Edit or create the file ..htaccess:

ErrorDocument 404 /404.php

 

2- Create the file php 404.php

<?php
//on .htacessErrorDocument 404 /404.php
header(‘location:https://www.ukgoodbye.co.uk/shop’);
?>

Example:

https://ukgoodbye.co.uk/shop/thisfileNOtExisit

 

 

Posted in: Website developerWordpressTagged in: 404htaccess Read more... 0 comments

carouFredSel, FadeIn effect

2019-01-04 18:12:45 websitedeveloper

carouFredSel, FadeIn effect

scroll { fx : “scroll” }
Indicates which effect to use for the transition.
Possible values: “none”, “scroll”, “directscroll”, “fade”, “crossfade”, “cover”, “cover-fade”, “uncover” or “uncover-fade”.

Example:

jQuery(document).ready(function($){
$(‘#divtestimonials’).carouFredSel({
responsive: true,
width: ‘100%’,
scroll: 1,
auto:4000,
scroll: {
fx:’fade’,
items: 1,
duration: 1000

},
items: {
width: lalargeur,
height: 250, // optionally resize item-height
visible: {
min: 1,
max: 1

}

}
});

Posted in: Website developerWordpressTagged in: CarouFredSelWP Read more... 0 comments

Make Fancybox appear on top of the page

2018-12-31 11:53:38 e-smartstolution

Make Fancybox appear on top of the page
When setup a link to an image using fancybox but when the user clicks on the thumbnail the fancybox box won’t appears on the top all your content. Like you can see on the next image:


An easy and quick solution for that is setup the z-index of fancybox container

.fancybox-container{
z-index:9999999999!important;
}

Now us result that your image should appear on the top of everything:
FancyBox on the top of everything

Posted in: Website developerWordpressTagged in: !importantFancyBoxZ-index Read more... 0 comments

Solution for this, The hook name can only contain numbers, letters, dashes, periods and underscores, WP 5.0.2 and ACF

2018-12-26 15:31:54 websitedeveloper

Solution for this, The hook name can only contain numbers, letters, dashes, periods and underscores.
Environment:
Wordpress:5.0.2

Error message:
…The hook name can only contain numbers, letters, dashes, periods and underscores. hooks.min.js:1:1495
o
http://localhost:8888/esse/wp-includes/js/dist/hooks.min.js:1:1495
i/<
http://localhost:8888/esse/wp-includes/js/dist/hooks.min.js:1:1707
add_action
http://localhost:8888/esse/wp-content/plugins/advanced-custom-fields-pro/assets/js/acf-input.min.js:1:1933

http://localhost:8888/esse/wp-content/plugins/acf-enhanced-message-field/js/input.js:19:2

http://localhost:8888/esse/wp-content/plugins/acf-enhanced-message-field/js/input.js:1:2
..

Resulting the ACF repeater won’ t save the content. Any solution?

1- After a long time investigating it looks like ACF(Avanced Custom Field), or/and ACF Repeater & Flexible Content Collapser is not working on the WordPress Version 5.0.2.
The urgent and quick solution for me was going back the previous version of WordPress.
WP version 5.0.2 and ACF

Posted in: Website developerWordpressTagged in: ACF Read more... 0 comments

Exclude category Wordpress ,WP_Query category__not_in or cat -cat_ID not working

2018-12-11 21:21:29 websitedeveloper

Exclude category WordPress ,WP_Query category__not_in or cat -cat_ID not working

Here is the example:

$recent_posts_query_args = array(
‘posts_per_page’ => 5,
‘post_status’ => ‘publish’,
‘order’ => ‘DESC’,
‘post_type’ => ‘product’,
‘category__not_in’=>array(43)
$recent_posts = new WP_Query( $recent_posts_query_args );

It suppose to not include the articles where the category has code 43, but is not working.

The reason is not working is because, the category 43 is not WP category code is tag code 43 for post type “product”, so to do so you will need filter using tax_query

$recent_posts_query_args = array(
‘posts_per_page’ => 5,
‘post_status’ => ‘publish’,
‘order’ => ‘DESC’,
‘post_type’ => ‘product’,
‘tax_query’=>array(array(
‘taxonomy’ => ‘product_cat’,
‘terms’ => 43,
‘field’ => ‘id’,
‘operator’ => ‘NOT IN’,
))

);
$recent_posts = new WP_Query($recent_posts_query_args );

Posted in: Website developerWordpressTagged in: post_typetermsWPwp_query Read more... 0 comments