WordPress Articles

update core js wordpress in functions.php

add_action(‘wp_enqueue_scripts’, ‘nwd_modern_jquery’); function nwd_modern_jquery() { global $wp_scripts; if (is_admin()) return; $wp_scripts->registered['jquery-core']->src = 'https://code.jquery.com/jquery-3.5.1.min.js'; $wp_scripts->registered['jquery']->deps = ['jquery-core']; }

Read More

WordPress – show posts of custom taxonomy in a page template.

$cat_args = array( 'orderby' => 'term_id', 'order' => 'ASC', 'hide_empty' => true, ); $terms = get_terms('downloads_cat', $cat_args); foreach ($terms as $taxonomy) { $term_slug = $taxonomy->slug; $tax_post_args = array( 'post_type' => 'gediflora_downloads', 'posts_per_page' => -1, 'order'...

Read More

How to keep footer at bottom of the web page.

function setMainHeight() { $headerHeight = $("#header").height(); $alertHeight = $("#alert-messge").height(); $footerHeight = $("#page-foooter").height(); $windowHeight = $(window).height(); $mainHeight = $windowHeight - ($headerHeight + $alertHeight + $footerHeight); console.log($mainHeight); $("main").css("min-height",$mainHeight); } jQuery(document).ready(function () { var $ = jQuery; setMainHeight();...

Read More

How to change fie permissions using wp-config.php?

define('FS_CHMOD_DIR', (0777 & ~ umask())); define('FS_CHMOD_FILE', (0777 & ~ umask()));

Read More

How to remove FTP permission for installing plugins from admin dashboard

Sometime when installing plugin from admin panel , there is a prompts for entering FTP details. To remove that go to wp-config.php and write this define('FS_METHOD','direct'); This bypasses WordPress’s recurring prompts, and allows auto-updates of...

Read More

How to get image height and width using PHP in WordPress?

Sometime while creating a website there may be a situation to put a condition on the basis of image dimensions. For example show images only if they are greater than of 800 width. To get...

Read More

How to display list of custom taxonomy terms of a custom post type on custom post type detail page or single page?

While creating custom post type detail template, there may be need to display list of categories or taxonomies related to it. For example wp_get_object_terms() To display list of all the terms use wp_get_object_terms $tax_lists =...

Read More

How to unzip files on filezilla using php script?

FileZilla itself does not provide functionality to unzip files on server. So here comes a handy solution using PHP. Navigate to your directory where the zip folder is Here create a file unzip.php Now edit...

Read More
How to create shortcode in wordpress

How to create shortcode in wordpress

What is shorcode in wordpress? Shortcode basically group of codes that perform an action while called via small code. For example: [myform] now when using this in theme or code editor it will display a...

Read More
How to get featured image url in wordpress.

How to get featured image url in wordpress.

to get featured image url in wordpress use following code if you are not using custom query loop then simply use Also you can use this get featured image size you can pass the featured...

Read More