Format numeric symbols in titles

WordPress makes number of typographical replacements, related to dashes. You can read through the How WordPress Handles Dashes and Hyphens for full details, but in short your specific case is [space][hyphen][space] getting replaced with [space][en-dash][space]. You will have to step through your code to make sense at which point it goes wrong and turns into … Read more

Display data on same page as form without refresh

If I understand correctly you need the original form to display the values of what has just been posted. You also need the table to display 0 on values that haven’t been calculated. At the moment the table calculates information perfectly with a submit refreshing the page. You can use the if(isset($_POST[“fieldname”])){ variable you have … Read more

SmoothScroll not working in WordPress

Thanks to CSS Tricks, I changed the existing SmoothScroll code that came with the site to the following which worked: $(function() { $(‘a[href*=#]:not([href=#])’).click(function() { if (location.pathname.replace(/^\//,”) == this.pathname.replace(/^\//,”) && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $(‘[name=” + this.hash.slice(1) +”]’); if (target.length) { $(‘html,body’).animate({ scrollTop: target.offset().top }, 1000); … Read more

No data received

Your code is wrong. You are confusing wp_enqeue_script function and wp_enqueue_scripts action. It should be: function theme_script(){ wp_deregister_script( ‘jquery’ ); wp_register_script(‘jquery’,get_template_directory_uri().’/sliderengine/jquery.js’); wp_enqueue_script(‘jquery’); wp_register_script(‘amazingslider’,get_template_directory_uri().’/sliderengine/amazingslider.js’,array(‘jquery’)); wp_enqueue_script(‘amazingslider’); wp_register_script(‘initslider-1′,get_template_directory_uri().’/sliderengine/initslider-1.js’,array(‘jquery’)); wp_enqueue_script(‘initslider-1’); } add_action(‘wp_enqueue_scripts’,’theme_script’);

Correct way to write jQuery functions in WordPress

As suggested in comments, this kind of error is caused by the fact that WordPress loads jquery in noconflict mode. The most common workaround is to wrap all functions in your script file: jQuery(document).ready(function($) { … scripts … } Another, more risky option is to switch off noconflict mode by starting the script file with … Read more

Front-end Ajax File Upload

I use this code to upload if ( ! function_exists( ‘wp_handle_upload’ ) ) { require_once( ABSPATH . ‘wp-admin/includes/file.php’ ); } if($_FILES[‘file’][‘name’] != ”) { $uploadedfile = $_FILES[‘file’]; $upload_overrides = array( ‘test_form’ => false ); $movefile = wp_handle_upload( $uploadedfile, $upload_overrides ); if ( $movefile && ! isset( $movefile[‘error’] ) ) { $file_url = $movefile[‘url’]; $file_url = … Read more

How to get those data using with ajax json?

There are two methods to access the object. 1. Ajax response. $.ajax({ url:”your_file.php”, type : “POST”, data : your_data, dataType: “json”, success:function(data){ // Retrieve the object var result = data[0]; // Grab username from the object console.log(result[‘username’]); }, error:function(xhr){ alert(‘Ajax request fail’); } }); 2. Server side script $yourArray = array(); $yourJson = json_encode($yourArray); $userData … Read more

Use Media Uploader on Multiple Images on same page

So I set a new variable of target_input that grabs the previous input field ID, this input is where I want the URL of the selected media stored, this is done in the click function of the button that selects the media. That variable is used to attach the URL. jQuery(document).ready(function($){ var custom_uploader; var target_input; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)