Shortcode is the one of powerful feature in Wordpress which provides so much flexibility to enhance functionalities. Sometime you need to detect if current post/page have already specific shortcode. Here is the following two snippets which you could use for check specific shprtcode into your shortcode callback function. Snippet -1(Using has_shortcode() function) <?php add_shortcode('shortcode_name','shortcode_callback'); function shortcode_callback($atts){ global $post; $shortcode_feature = ' '; if (has_shortcode( $post->content , ' shortcode_name ' )){ // Apply your specific code here. } // Do whatever you want return $shortcode_feature; } Snippet -2 (Using strpos() function) $shortcode = '[shortcode_name'; $check = strpos( $post->content,$shortcode ); if ( $check !== false ) { //Return already matched } Prefer to use Snippet-1 using default function of wordpress. Cheers ...
Squarespace have awesome powerful feature to manage images using gallery feature. There is lot of flexible option to present images into different layout. Show images into masonry view is a passion. There is no inbuilt option for show images into masonry view. Here is the following steps to show your gallery images into Masonry view:- 1. Create a gallery page and upload your all images. 2. After uploading all images. Now time to show your all images using Squarespace Gallery Block. You could select your existing gallery page and select gallery type Grid. Now you could there is all gallery images showing. 3. Here is the following code you have to add into Advanced => PAGE HEADER CODE INJECTION of page setting to show your images in Masonry view. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/4.2.2/masonry.pkgd.js"></scrip...
Here is the following steps to create secondary menu into Squarespace website. 1. Enable Developer Mode a) First, Login into your Squarespace admin panel using /config at end of your website URL. like- https://your-domaine.com/config b) Navigate to Settings=>Advanced=> Developer Mode and enable developer mode. c) Now you will get details of your Squarespace SFTP account. Configure these details with your Filezilla or any other server connecting tool. 2. Menu Registration a)Please open template.conf file and find the navigations into JSON array. b) Apend your menu name and title into Navigation JSON array as given below. { "title": "Primary Navigation", "name": "topnav" }, c) Now update file on server and you could see new menu register into your Squarespace website under Pages section. 3. Display Menu You have successfully reg...
Comments
Post a Comment