Jagdish Sarma | Reputations

Asked a question
WordPress rename a text to another in frontend

[apcode language="php"] add_filter( 'gettext', 'wpdocs_change_login_form_register_keyword' ); function wpdocs_change_login_form_register_keyword( $text ) {   if ( is_checkout() )...

July 8, 2024 2
Asked a question
Ajax load content dynamically and store in browser for speed optimization

[apcode language="jscript"] //New JS function getLocalStorageData(key) {     var data = localStorage.getItem(key);     return data ? JSON.parse(data) : null; }   function setLocalStorageData(key,...

June 27, 2024 2
Asked a question
Tribe Events WordPress show latest event shortcode

[apcode language="php"] // Add Shortcode function tribe_latest_upcoming_event_shortcode() {     // Get the current date     $current_date = date( 'Y-m-d H:i:s' );      // Query the...

May 16, 2024 2
Asked a question
WPML WordPress query for specific language only

Use [apcode language="php"] 'suppress_filters' => false, [/apcode] and [apcode language="php"] $args['language'] = $language; [/apcode] in [apcode language="php"] get_posts($args);...

May 13, 2024 2
Asked a question
WordPress custom field in Media Gallery

[apcode language="php"] //zodiac_name function zodiac_name_attachment_field_c2($form_fields, $post) {     $zodiac_names = array(         'Aries',         'Taurus',...

May 6, 2024 2
Asked a question
WordPress insert posts from rss feed url

[apcode language="php"] function c2_insert_posts_from_feed($atts) {     // Default attributes     $atts = shortcode_atts(array(         'rss_url' => 'Feed_URL',         'post_type'...

April 24, 2024 2
Asked a question
PHP redirect a url to file name without case sense

[apcode language="php"] add_action('wp_head', 'custom_url_case_insensitive_redirect'); function custom_url_case_insensitive_redirect() {     global $wp;     $requested_url =...

April 22, 2024 2
Asked a question
Woocommerce add Custom url for Out of Stock Product

Create a custom field for dynamic url Or use a static url using commented line [apcode language="php"] add_filter( 'woocommerce_product_add_to_cart_url', 'out_of_stock_read_more_url',...

April 16, 2024 2
Asked a question
Facebook track custom events on click

[apcode language="jscript"] jQuery(document).on('click', '.get_a_quote', function() {  fbq('trackCustom', 'GetAQuote'); }); [/apcode] GetAQuote can be change to...

April 10, 2024 2
Asked a question
All in ONE SEO limit title, meta description

To limit title  [apcode language="php"] add_filter( 'aioseo_title', 'aioseo_filter_title_len' ); function aioseo_filter_title_len( $title ) {    if ( strlen($title) > 60 ) {...

March 27, 2024 2
Asked a question
WordPress create a serch form to search in current page

First create search form shortcode [apcode language="php"] add_shortcode( 'agent_search', 'dtwd_special_agent_search' ); function dtwd_special_agent_search( $atts ) {  ob_start();?>...

March 22, 2024 2
Asked a question
Wordpress replace a tag with span if href and text same

[apcode language="php"] function theme_slug_filter_the_content( $content ) {      $content = preg_replace_callback(         '/<a\s+href="([^"]+)"[^>]*>([^<]+)<\/a>/i',...

March 14, 2024 2
Asked a question
Wordpress add lightbox to any images with or without Builder

[apcode language="php"] function add_prettyphoto_attributes_to_images($content) {     // Add 'prettyphoto' class  $pattern = '/<img\s+[^>]*src=(["\'])(.*?)\1[^>]*>/i';...

March 6, 2024 2
Asked a question
WordPress remove rel=" noreferrer noopener nofollow" from link

[apcode language="php"] function theme_slug_filter_the_content( $content ) {  // Define the attribute you want to remove $attribute = 'rel';  // Regular expression pattern to match and remove...

March 2, 2024 2
Asked a question
WP Create a Shortcode to view and load more posts using Ajax

[apcode language="php"] //Shortcode Created add_shortcode( 'post_view', 'dtwd_special_collection_view' ); function dtwd_special_collection_view( $atts ) {     $atts = shortcode_atts(...

February 29, 2024 2
Asked a question
Wordpress get post id by Title

[apcode language="php"] function c2_get_post_id_by_title( string $title = '' ): int {     $posts = get_posts(         array(             'post_type'...

February 29, 2024 2
Asked a question
Combine multiple csv file using CMD

First create a folder and insert the csv which needs to merge Right click on folder and copy folder path Next open CMD and type [apcode language="bash"] cd "FOLDER PATH PASTE" [/apcode]...

February 13, 2024 2
Asked a question
jQuery Javascript download table as CSV

[apcode language="jscript"] function convertTableToCSV(table) {     // Get the table header row.     var headerRow = jQuery(table).find('tr:first');      // Create a CSV string....

February 12, 2024 2
Asked a question
HubSpot show form in popup

[apcode language="jscript"] jQuery('.enquire-btn').on('click', function() {     hbspt.forms.create({     portalId: "xxxxxx",  formId: "xxxxx-xxx-xxxxxxx",...

February 6, 2024 2
Asked a question
GravityForm Populate Checbox with Category name

[apcode language="php"] add_filter( 'gform_pre_render_3', 'populate_checkbox_vendor' ); add_filter( 'gform_pre_validation_3', 'populate_checkbox_vendor' ); add_filter(...

January 18, 2024 2
Load More