WordPress
WordPress : Add js and css in your custom theme
In your theme functions.php add your css and js like:
In your theme functions.php add your css and js like:
WordPress Form Value WordPress Data Validation: sanitize_email() sanitize_file_name() sanitize_html_class() sanitize_key() sanitize_mime_type() sanitize_option() sanitize_sql_orderby() sanitize_text_field() sanitize_title_for_query() sanitize_title_with_dashes() sanitize_user() sanitize_meta() sanitize_term() sanitize_term_field() Escaping: Securing Output: esc_html() we should use anytime our HTML element encloses a section of data we’re outputting. esc_url() should be used on all URLs, including those in the ‘src’ Read more…
Note: In above code i use a function named decodeURIComponent() this function give the query string data with spaces
Navigate to application/config/routes.php you will find a line like set your controller name whatever you want like:
By default, the index.php file will be included in your URLs: First Enable Your Apache server rewrite_module enable, And Create a .htacces file in your root folder with the following code:
Suppose you hav a url like this: and you need the color_id use the following code :
Suppose you have an array like this: If you need to insert above data into 3 different tables named product_door_type, product_door_design , product_door_color : in your controller:
Sometimes we need to validate an array of input elements: For example – Now we will use jquery validation plugin jquery.validate.js for validating the form. The condition will be that user will have to choose field_name from each dropdown. The script for validation will be as below – Now the Read more…
Way 1 : Using Admin panal To remove the toolbar from frontend, Navigate to Users > Your Profile. Scroll down to “Toolbar” and Uncheck “Show Toolbar when viewing site.” Save the setting by clicking update profile button at the bottom. WAY 2 : Paste this code in your theme’s functions.php Read more…