CodeStar Typography Field Implementation

Too enqueue Google fonts ,write the code in your main functions.php –

[php]
if ( ! function_exists( ‘cs_wp_enqueue_scripts’ ) ) {
function cs_wp_enqueue_scripts() {

$enqueue_fonts = array();
$google_fonts = array();
$google_fonts[] = cs_get_option( ‘maintenance_main_typography_one’ );
$google_fonts[] = cs_get_option( ‘maintenance_main_typography_two’ );

if ( ! empty( $google_fonts ) ) {
foreach ( $google_fonts as $font ) {
if( isset( $font[‘font’] ) && $font[‘font’] == ‘google’ ) {
$variant = ( isset( $font[‘variant’] ) && $font[‘variant’] !== ‘regular’ ) ? ‘:’. $font[‘variant’] : ”;
$enqueue_fonts[] = $font[‘family’] . $variant;
}
}
}

if ( ! empty( $enqueue_fonts ) ) {
wp_enqueue_style( ‘maintenance-google-fonts’, esc_url( add_query_arg( ‘family’, urlencode( implode( ‘|’,
$enqueue_fonts ) ) , ‘//fonts.googleapis.com/css’ ) ), array(), ‘1.0’, true );
}

}
add_action( ‘wp_enqueue_scripts’, ‘cs_wp_enqueue_scripts’ );
}
[/php]

Read More “CodeStar Typography Field Implementation”

Code Snippets in PhpStorm

Go to Settings and start typing Live Template. On the right panel click on the + sign.
Write your Abbreviation, Description, and Template Text.

For instance, The Abbreviation is the Scom*, Description is Section Comment and Template Text is –
/*—————————————————————-
01.$s$
—————————————————————–*/

$s$ is to set the cursor point and it’s done.

Now write your abbreviation like Scom* and press the button you chose like tab/enter, you will get the output.

Cheers!

VC Element Customization

Write the code in functins.php To add and remove param of VC Elements –

[php]
/*—————————————————————-
VC Elements Customization
—————————————————————–*/
// After VC Init
add_action( ‘vc_after_init’, ‘vc_after_init_actions’ );

function vc_after_init_actions() {

//*******************//
// VC TEXT REMAPPING //
//*******************//

// Remove Params
if ( function_exists( ‘vc_remove_param’ ) ) {
vc_remove_param( ‘vc_row’, ‘el_class’ );
}

// Add Params
$vc_row_new_params = array(

// Example
array(
‘type’ => ‘colorpicker’,
‘holder’ => ”,
‘class’ => ‘mat-gradient’,
‘heading’ => __( ‘Gradient Beginning Color’, ‘matland’ ),
‘param_name’ => ‘mat_gradient_begin’,
‘value’ => ‘#4e7dff’,
‘description’ => __( ‘used the as the gradient background beginning color’, ‘matland’ ),
‘admin_label’ => false,
‘dependency’ => ”,
‘weight’ => 0,
‘group’ => ‘Custom Group’,
),
array(
‘type’ => ‘colorpicker’,
‘holder’ => ”,
‘class’ => ‘mat-gradient’,
‘heading’ => __( ‘Gradient Ending Color’, ‘matland’ ),
‘param_name’ => ‘mat_gradient_end’,
‘value’ => ‘#073ccc)’,
‘description’ => __( ‘used the as the gradient background ending color’, ‘matland’ ),
‘admin_label’ => false,
‘dependency’ => ”,
‘weight’ => 0,
‘group’ => ‘Custom Group’,
),

);

vc_add_params( ‘vc_row’, $vc_row_new_params );

}
[/php]

How to Delete Hidden Files on Mac

Go to the directory –

find . -name '*.DS_Store' -type f -delete

or,

sudo find / -name .DS_Store -delete;

To remove .git file –

rm -rf .git

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

How to fix “There are no HTTP transports available” on Uniserver?

I was facing a terrible problem to install any plugin or theme in my WordPress localhost web server. When I clicked to install a plugin it was showing “There are no HTTP transports available….”. I am using Uniformserver as the localhost server. Let’s see how we fix the issue –
Go to  folder → UniServerZ → core → php70

then open the file named php_production.ini
Then uncomment the line

;extension=php_curl.dll

by removing the (;) semicolon.  Then the line should look like

extension=php_curl.dll

Restart Apache and MySQL services.

Start to install plugins and themes.
Cheers! 🙂