Web Design Weekly #237

Headlines Taking The Robots To Design School An epic post by Jon Gold that shares his thoughts around merging typographic design and artificial intelligences. Fascinating read. (jon.gold) Regressive Web Apps (adactio.com) Start using new tools in minutes​ You don’t have to wait for a far off sprint to start using new integrations. Just activate integrations with Segment, we’ll immediately start streaming over your data. (segment.com) Articles Building a Visual Language An insightful post by Karri Saarinen that looks behind the scenes of Airbnb’s new design system. (airbnb.design) Debugging CSS If…

Shortcodes not working in an AJAX call

I am using AJAX to load next set of posts on homepage. The posts load fine but the shortcodes are not rendered. I am trying to use the do_shortcode function on the content the ajax call fetches (although experts have suggested not to use do_shortcode) but apparently it is failing. Here’s my function that processes the request: function theme_load_more_posts() { check_ajax_referer( ‘theme-load-more-posts-nonce’, ‘nonce’ ); $args = isset( $_POST[‘query’] ) ? array_map( ‘esc_attr’, $_POST[‘query’] ) : array(); $args[‘post_type’] = isset( $args[‘post_type’] ) ? esc_attr( $args[‘post_type’] ) : ‘post’; $args[‘paged’] = esc_attr(…

How to limit page pagination… again

I’m digging out on old question as no solution came out. How to limit page pagination I’m looking for a way to limit pages on homepage and categories (archive.php). I have around 200k posts spread into about 50 categories. If I leave the default pagination, homepage has 20k pages. Then most categories have over 5k pages. This will send google in some long long loops… and each time a post is added (200/day) google will start again etc… when all I want is google to look into recent posts (this…

How create a Shortcode with hover and complex options

I am wondering how do you do when you have to create a shortcode with multiple hover or complex options ( gradient, boxshadow etc, thing that can’t be inline ). How do you generate the css. I don’t want to generate a <style></style> block because for a simple shortcode used 10 times in the page would generate 10 blocks. All the shortcode are set from the page, by the user, so are created when the_content() is called. I want to give the user the possibility to edit and custom the…

Web Design Weekly #236

Headlines Aarron Walter – Ways We Work Interview In this interview with Vice President of Design Education at InVision, Aaron Walter, shares how he ended up in design leadership, and what he thinks is most challenging about his current role. He also shares some wisdom for young designers looking to get into management and leadership roles. (wayswework.io) Web and Chrome at Google I/O 2016 (youtube.com) ​​Get a job at a top company ​​Want to work on more exciting projects? Join Hired to start getting offers from top tech companies. You’ll…

has_term or in_category for Custom Post Types

I have property as a custom post type. I want to display a specific message if the property is in the sold category. To do that, I’m using the function below: if ( has_term(‘sold’, ‘category’)) { ?> <div class= »sold_prop_note »> <h3>This Property is sold. Take a look at our current exclusives! <a href= »/properties »>View Exclusives</a></h3> </div> <? } Before using the above, I also tried in_category like the one below: if ( in_category( array( ‘sold’, ‘homepage-sold’ ) )) { ?> <div class= »sold_prop_note »> <h3>This Property is sold. Take a look at our current…

How to solve 404 permalink errors on nginx server

I can’t solve this issue. I tried everything I found over the web. I first tried configuring my nginx.conf following the example on codex with no success. https://codex.wordpress.org/Nginx I found that many users encounter this issue but the most popular fix is this: location / { try_files $uri $uri/ /index.php?$args; } I still get 404 for all pages. This only happens if I don’t use the Plain setting in permalinks structure. Any ideas on how can I fix this? Thank you! Source: https://wordpress.stackexchange.com/feeds

Web Design Weekly #235

Headlines Designing Inward An interesting reminder by Cap Watkins that it is important to look inward into your team to make sure that each person understands the roles of others and that the team is working together. He is of the view that this will ultimately improve collective user experience, rather than simply focusing upon design methodologies to enhance user experience. (blog.capwatkins.com) Danger – Testing Accessibility with real people An insightful look into user testing from four people who are blind and care deeply about making the web more accessible.…

Filtering multiple custom fields with WP REST API 2

I want to filter posts based on multiple acf custom fields with AND relation. Something like this: $args = array( ‘post_type’ => ‘product’, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘color’, ‘value’ => ‘blue’, ‘compare’ => ‘=’, ), array( ‘key’ => ‘price’, ‘value’ => array( 20, 100 ), ‘type’ => ‘numeric’, ‘compare’ => ‘BETWEEN’, ), ), ); I might even have more filters. How can I convert these to REST API 2 filters? Source: https://wordpress.stackexchange.com/feeds

How to connect my wordpress plugin to a remote database securely?

First of all I do not have a lot of experience with wordpress plugins, but I am developing a plugin which has to connect and send data to a remote database ( which it is already doing ). But at this point of time my connection is not secure at all because all the database info is shown for the admin of the site. This is my code at the moment, it works and all but how can I make sure that noone will see the database data that is…