If you are a Creative Photographer then wordpress theme Monet is for you. Monet is a delicate responsive grid-layout theme targeted at photographers and other creatives. Here I am sharing you some css tricks using which you can modify the header color, fonts, font family and more. If you have any Question feel free to ask in comment section.
To change font size, color and font family of Header title in homepage
Sometimes you may need to put some html code in the Homepage of your shopify site. Here I am sharing you the steps and code to create custom html section.
Create home-custom-html.liquid file under section ( screenshot attached )
Paste this code in the newly created home-custom-html.liquid
If you want to create a FAQ (Frequently Asked Question) page and want to show the Question & Answers in Accordion ( click and open), then you can use this code. Though there are plugins for that, but here I am sharing you the basic FAQ accordion html css and JQuery code so that you can use it without the use of plugins. Feel Free to message me in Skype if you need help.
Sometimes you may need to exclude specific product to appear in search result. Here I am sharing you a tricks which i got in shopify community.
So the tricks is, put a tag , for example “Special” tag in the product and that tagged product will be removed from search result. Here i am sharing the code
{% for item in search.results %}
{% assign hidden_tag = false %}
{% for tag in item.tags %}
{% if tag == 'special' %}
{% assign hidden_tag = true %}
{% endif %}
{% endfor %}
{% if hidden_tag == true %}
{% comment %}
If it contains the tag, do this
{% endcomment %}
{% else %}
{% comment %}
If it doesn't contain the tag, do this
{% endcomment %}
{% endfor %}
My knowledge of Shopify is little, but did some little works in Shopify which were little and JQuery and CSS based Job. I am sharing you a piece of code which can help anyone using shopify to create a simple Add To Cart button and put it anywhere and make it redirect to checkout page. Here is the code:
This code i used for one of my client and it works. Based on client’s requirement I redirect his site to different pages based on country ( Denmark, Netherlands, Poland, France and Germany. Here is the code:
<?php
$ip = $_SERVER['REMOTE_ADDR']; // This will contain the ip of the request
// You can use a more sophisticated method to retrieve the content of a webpage with php using a library or something
// We will retrieve quickly with the file_get_contents
$dataArray = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip));
//var_dump($dataArray);
// outputs something like (obviously with the data of your IP) :
// geoplugin_countryCode => "DE",
// geoplugin_countryName => "Germany"
// geoplugin_continentCode => "EU"
//echo "Hello visitor from: ".$dataArray->geoplugin_countryCode;
if($dataArray->geoplugin_countryCode=='DE'){
echo("<script>location.href = 'http://yoursiteurl.com/DE/';</script>");
}
else if($dataArray->geoplugin_countryCode=='NL'){
echo("<script>location.href = 'http://yoursiteurl.com/NL/';</script>");
}
else if($dataArray->geoplugin_countryCode=='FR'){
echo("<script>location.href = 'http://yoursiteurl.com/FR/';</script>");
}
else if($dataArray->geoplugin_countryCode=='PL'){
echo("<script>location.href = 'http://yoursiteurl.com/PL/';</script>");
}
else if($dataArray->geoplugin_countryCode=='IT'){
echo("<script>location.href = 'http://yoursiteurl.com/IT/';</script>");
}
else if($dataArray->geoplugin_countryCode=='DK'){
echo("<script>location.href = 'http://yoursiteurl.com/DK/';</script>");
}
else if($dataArray->geoplugin_countryCode=='ES'){
echo("<script>location.href = 'http://yoursiteurl.com/ES/';</script>");
}
else if($dataArray->geoplugin_countryCode=='PL'){
echo("<script>location.href = 'http://yoursiteurl.com/PL/';</script>");
}
?>
If you are using any custom font in your site and during your first visit that font not showing or working, then put this code in your .htaccess file. That will solve the font loading issue.
<FilesMatch "\.(ttf|otf|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
Twenty Twenty now arrived and become the new WordPress default theme. Mainly it is designed with the flexibility of the block editor at its core but you can use Visual Composer or Elementor too. You can use it for your organization or business and also for your traditional blog, the centered content column and considered typography makes it perfect for that as well. Here I am sharing some CSS Modifications which you can use
Here I am sharing you the code which will help to show an additional / extra tab in woocommerce single product page, and show Advanced Custom fields info in the description of that tab . Just change the field info and put it in your theme’s function.php and save it.
if(! function_exists('new_tab')){
add_filter('woocommerce_product_tabs','new_tab');
function new_tab($tabs){
$tabs['my_tab']=array(
"title"=> "Product Review",
"priority"=> 35,
"callback" =>"tab_desc",
);
return $tabs;
}
function tab_desc(){
global $product;
$id = $product->get_id();
echo get_field('review',$id); ;
}
}
Feel free to do comments if you have any question.