Web Design Weekly #214

Headlines Seriously, Don’t Use Icon Fonts Make time for this one. A very entertaining post by Tyler Sticka that gives us lots of great reasons to stop using icon fonts and get on the SVG train. (cloudfour.com) Dance to Calypso Matt Mullenweg writes about WordPress’s new publishing and site management experience which has had a lot of hype this week. (ma.tt) Articles Frameworks An excerpt from Ethan Marcotte’s new book, Responsive Design: Patterns & Principles. If you haven’t ordered the book already, I’m sure you won’t hesitate after reading this.…

Pagination in plugin’s backend

I am displaying a list of posts in the plugin backend but I can’t seem to get the pagination to work. I used the standard approach of getting the « paged » variable and then passing it to get_posts()‘s arguments, but whenever I visit my custom backend page or subpage and add the &page=2 variable I get that permissions error about not having enough of them to visit that page. Is there a special way to apply pagination in the backend? Source: https://wordpress.stackexchange.com/feeds

tax_input not working wp_insert_post

I am using wp_insert_post and all the fields are working except tax_input is working. Is there something wrong with my code? $customtax = array( ‘product_link’ => $link, ‘product_price’ => $price, ‘product_description’ => $desc ); $my_post = array( ‘post_title’ => $title, ‘post_content’ => $content, ‘post_type’ => ‘products’, ‘tax_input’ => $customtax ); Thank you in advance Source: https://wordpress.stackexchange.com/feeds

Search only working on front page (index) , not working on other pages

I’m currently building a custom WordPress template and I’ve run into a problem with the search box. When I use the searchbox from the homepage, it works as intended. It also works as long as Permalinks are set to default. (url.com/?page_id=1) However, when I use the searchbox from another page when using pretty permalinks, the URL looks something like this: http://url.com/pretty-page-title/?s=query and a 404 page appears. My search box code looks like this <form id= »search-query »> <div class= »search-box »> <form role= »search » method= »get » id= »searchform » class= »searchform » action= »/index.php »> <div> <label class= »screen-reader-text » for= »s »><?php _x( ‘Search for:’,…

admin-ajax.php returns 0. How do I debug it and fix it?

Trying to use admin-ajax.php to upload image from front-end form. I’m keep getting 0 with below code I have and not sure how to debug this or where it goes wrong. I have HTML input file <input type= »file » name= »wh_image_upload » id= »wh_image_upload » multiple= »false » /> and localized script for AJAX request $img_nonce = wp_create_nonce(‘image_upload_nonce’); wp_localize_script( ‘ajax-script’, ‘ajax_image’, array( ‘ajax_url’ => admin_url( ‘admin-ajax.php’ )) ); and PHP function function write_here_featured_image_upload() { var_dump($_FILES); die(); } add_action( ‘wp_ajax_write_here_img_upload’, ‘write_here_featured_image_upload’ ); add_action( ‘wp_ajax_nopriv_write_here_img_upload’, ‘write_here_featured_image_upload’ ); JS // Featured image upload AJAX $(« #wh_image_upload »).change(function(){ var userFile = new FormData();…

Web Design Weekly #213

Headlines The Cost of Frameworks Paul Lewis sure did spark some #HotDrama this week. Paul’s article focuses on the cost of modern frameworks on mobile devices. I’m not picking sides but two posts that stood out which are worth reading are Tom Dale and Dave Rupert’s. (aerotwist.com) The State of Front-End Dev (alistapart.com) Foundation 6 is here! It’s been a long but incredibly rewarding journey, and we’re absolutely thrilled to share with you the best version of Foundation yet. Faster, lighter, more versatile, more flexible and more powerful than ever…

Removing delete permanently button in uploading files media

How do I delete or remove the word Delete Permanently in uploading files? I wanted to remove this permanently so that the users won’t keep deleting files which are not supposed to delete. I use this code: .button-link.delete-attachment{display:none} But the problem of this, if the user uses the inspect element, they can just change it to display:block to show the delete button. Using CSS is not an option. Is there a function code here to remove this? Or where can I find the core file in wp-admin folder, so that…

WP Cron as Fast as WordPress AJAX?

I have a question about performing a very long and resource intensive task within WordPress. Here is the scenario. I have a plugin that allows users to run a task that takes a very long time and once completed will return the result back to the user. The first thing I did was run the task via WordPress AJAX functions. This did not work since the site locked up to that user. Meaning that if the task was started then no other pages could be loaded from that user. I…