Author: admin

wordpress

How to add a title attribute to WordPress posts links

If you’re encountering issues adding a title attribute to WordPress post links, follow these steps: In the post loop or within your custom HTML, you can use the title attribute along with the anchor () tag to ensure it is added properly.

Hooks & Filters

How to include styles and scripts on wordpress admin pages?

How do I add CSS and JavaScript to WordPress admin area? In  “admin_enqueue_scripts” hook used to include scripts and css in admin area add_action(‘admin_enqueue_scripts’, function() { wp_enqueue_style( ‘myscript’, PTS_CSS_URL.’/myscript.css’); });

wordpress

Page Template dropdown missing from page attribute in wordpress

Page Template dropdown missing from page attribute in wordpress: Either you are are added any page template or format is not correct while adding page template name It is because of space after the page template name: wrong code : <?php /* Template Name :Contact page    // No need to add space here */…

wordpress

How to add a logo uploading field in customize settings in wordpress

How to add a logo uploading field in theme customize settings in wordpress While creating our own theme, we need to add a logo adding field in in customize settings of theme (under appearance). add_action( ‘customize_register‘, ‘themecustomizer’ ); function themecustomizer( $wp_customize ) { $wp_customize->add_section( ‘theme_logo’ , array( ‘title’ => __( ‘Logo’, ‘theme’ ), ‘priority’ =>…

wordpress

How to add a new page in wordpress admin

In functions.php  file, Add following code add_action( ‘admin_menu’, ‘mycustompagemenu’ ); function mycustompagemenu(){ add_menu_page( __( ‘My own Settings’, ‘textdomain’ ), ‘my theme settings’, ‘customize’, ‘mythemesettings’, ‘my_theme_settings_fun’, get_template_directory_uri().’/images/icon.png’, 60 ); } function my_theme_settings_fun(){ esc_html_e( ‘Admin Page’, ‘textdomain’ ); }   For more details   add_menu_page()

wordpress

Template is missing. Standalone themes need to have a index.php template file. Child themes need to have a Template header in the style.css stylesheet.

In WordPress themes showing error like : Broken Theme as below : Template is missing. Standalone themes need to have a index.php template file. Child themes need to have a Template header in the style.css stylesheet.   This is because of your child theme missing,  Template Name is missing from the style.css Add this line…

Jquery & Javascript

Click function display and hide a div with jquery

How to show/hide div content on click event (jquery)? $( document ).ready(function() { $(‘.searchbutton’).click(function(){ $(“.searchbox”).toggle(); }); });

Amzon s3 and Php

How to create a instance of aws s3 class to upload files using php?

if (!class_exists(‘S3’)) require_once ‘s3.php’; // include s3.php file if (!defined(‘awsAccessKey’)) define(‘awsAccessKey’, ‘keyhere’); //awsAccessKey key here if (!defined(‘awsSecretKey’)) define(‘awsSecretKey’, ‘secretkey here’); //secret key $bucketName = “bucketname”; // bucketname if (!extension_loaded(‘curl’) && !@dl(PHP_SHLIB_SUFFIX == ‘so’ ? ‘curl.so’ : ‘php_curl.dll’)) exit(“\nERROR: CURL extension not loaded\n\n”); $s3 = new S3(awsAccessKey, awsSecretKey); For more deatils : https://www.pgs-soft.com/blog/how-to-store-and-manage-files-on-amazon-s3-with-php-class/

Php

Difference between parse error and fatal error in php?

Difference between parse error(syntax error) and fatal errors: Parse error or syntax error occurs if any syntax mistakes in code, example missing braces, semi column, quotes etc.. Fatal error occurs when we try to call any function that is not exist. Both errors stop the execution of program and shows the errors. Warning and notices…

Amzon s3 and Php

How to create and access buckets in amazon s3?

How to create and access buckets in amazon s3 with php? In amazon s3 storage, files(objects) are stored inside buckets,we need to create buckets to store the objects. To create buckets s3 provide different API, that is we can create buckets within code itself. Or we can create the buckets from s3 console itself. We…

Load More