how do you get one specific term from a shortcode attribute?

I’m working on a function where I just want to output a button that links to a specific term. I have used get_the_terms and have gotten it to work successfully, but I’ve been trying get_term and I’ve have no luck. I want the shortcode to look like this [see_all_products category= »bakery »] and output a button that links to it. This is my function so far: function product_category_button($atts) { extract(shortcode_atts(array( ‘category’ =>  », ), $atts)); // if( $category ) : // Vars $taxonomy = ‘product_categories’; $term = get_term( $category, $taxonomy ); //$post->ID…

WordPress pagination not returning posts on second page

I’ve got a page where I only want to display one post per page with pagination at the bottom to go to the next/ previous post. This is my code: <?php $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : ‘1’; $args = array ( ‘nopaging’ => false, ‘paged’ => $paged, ‘posts_per_page’ => ‘1’, ‘post_type’ => ‘post’, ‘category_name’ => ‘enforcement’, ); ?> <?php $wp_query = new WP_Query($args); ?> <?php if ( $wp_query->have_posts() ) : ?> <?php while ( $wp_query->have_posts() ) : the_post(); ?> <!–<div class= »case-studies-text-banner »> <img src= »http://www.mariadev.co.uk/wp-content/uploads/2017/05/case-study-layer.png »/>…

Output terms for custom post types

I was able to echo out all terms belonging to a custom taxonomy using the code below: $args = array(‘post_type’ => ‘my_post_type’,’number’ => ‘999’); $terms = get_terms( ‘my_taxo’, [ ‘hide_empty’ => true, ‘orderby’ => ‘wpse_last_word’, ] , $args ); foreach ( $terms as $term ) { echo  » . $term->name .  »; } This code provides the results I want on my localhost (xampp). Basically, it outputs all of the terms assigned to a particular post. But when I upload the code to a live server, the code no longer…

Web Design Weekly #280

Headlines A Unified Styling Language Mark Dalgleish shares some thoughts around the current CSS-in-JS landscape, why people do it, and why the CSS community should care. (medium.com) DevTools: State of the Union 2017 (youtube.com) UX teams learn from customers faster with NomNom Get all your customer feedback and user research in one place. (nomnom.it) Articles Managing resources for large-scale testing An interesting look into how engineers at Facebook can use a single API to communicate with a range of remote resources within their tests and other automated systems. (code.facebook.com) Stuff…

is_wp_error is missing error

I am getting the following error in the code snippet below—and pointing to the line that references the $result[ ‘body’ ] assignment. The is_wp_error should have caught the error. ?????????????? Fatal error: Cannot use object of type WP_Error as array $result = wp_remote_post( ….. ) ); if( is_wp_error( $result ) ): $display = ‘Error Message’; else: $display = $result[ ‘body’ ]; endif; Source: https://wordpress.stackexchange.com/feeds

Tried to create a user role that can only edit user information, but my test account cannot view the dashboard. What am I missing?

One of our websites includes an online store, which alongside phone sales is one of two ways customers can purchase our products. All of our customer info is stored in a program called Orderwise, which assigns a unique number code to each customer. Now, we’ve set up the ability to add an Orderwise number to user info on the website, so I’ve been trying to set up a role which will allow the sales department to get through to the dashboard, but only so they can edit user info and…

Using an ACF field from a page within a post loop?

I have a page set up with custom fields using Advanced Custom Fields. One of the fields is a text field for specifying the text for a read more button. Within the page template I have a post query to pull in a post and I would like to use the ACF field for the « Read More » text within this loop. However, because the ACF field is associated with the page, it doesn’t work when I am trying to call it from within the post loop: <?php query_posts(‘showposts=1&post_type=post&cat=1’); if (…

Web Design Weekly #279

Headlines Mavo – Create Web Apps Entirely By Writing HTML Mavo helps you turn your static HTML into reactive web applications without a single line of programming code and no server backend. Lea Verou has also written a great introduction article over on Smashing Magazine that is worth a read. (mavo.io) Announcing JSON Feed (jsonfeed.org) Snag the hottest new domain name for designers .design domains were just released and some of the best ones are still available. Normally cost $35 but Web Design Weekly subscribers get them now for only…

Button not refreshing page

I’m creating a WooCommerce site where the archive page shows products related to the city the user is interested in « London » or « Manchester. On the /shop page of the website I’ve created a banner which will either have a button saying ‘Switch to London’ (if you’re in Manchester) or ‘Switch to Manchester’ (if you’re in London). The content of this banner is set based on an IF function on which location you’re in. Code below. But, if you press the button it makes the submission BUT it doesn’t properly refresh…