wp_nav_menu add something before closing container and after last list item

I think you can use: ‘items_wrap’ => ‘<ul id=”%1$s” class=”%2$s”>%3$s <div class=”foo”>bar</div> </ul>’, as a wp_nav_menu() argument. We’re using this part of the wp_nav_menu() function: $nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items ); where the items_wrap argument contains the following sprintf specifiers: %1$s to match the wrap id %2$s to match … Read more

Implement advanced search

If you use get_search_link() and someone filter the search URL and change it, get_search_link() will return the filtered URL; that is the great of non-hardcoded URL. You or third party plugin may modify the URL and it will always return the correct value. So, issues 1 and 2 seems to not exist. The issue 3 … Read more

Understand post type

You are confusing things a bit, these are post formats, not post types. Formats are a native taxonomy, not a post type. As any taxonomy its primary (and only) functionality is to organize posts in logical groups. Formats don’t do anything on top of that. You need to implement yourself any and all functionality you … Read more

How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)

There are several ways to achieve this. Using get_the_terms: $args = array( ‘post_type’ => ‘movies’, ‘posts_per_page’ => 10 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php the_title(); $terms = get_the_terms( get_the_ID(), ‘genre’ ); if ( is_array( $terms ) ) { //Manipulate array of WP_Term objects } ?> <div … Read more

WordPress not working on localhost

1) Make sure the wp-config.php doesn’t have multisite reference settings such as define(“DOMAIN_CURRENT_SITE”, “somesite.com” );. If it does, delete these settings 2) If you have updated siteurl and home settings in the *_options table to use local settings and it still doesn’t work, then 3) Delete all themes but a basic one (twentytwelve, twentythirteen,…) and … Read more

Can’t delete theme

You might have a permissions problem with your files. Can you login to your server via SFTP (or FTP)? You should then go to /wp-content/themes folder and find the theme you want to delete in its own folder. You can then delete it there if you have permissions, or change the files to give yourself … Read more

Customizer: widget-synced triggers twice

The reason for this is that the widget will run its update logic on keydown and also on change for a given input element. See https://github.com/WordPress/wordpress-develop/blob/4.7.2/src/wp-admin/js/customize-widgets.js#L891-L907 There are some tradeoffs made when widgets were added to the customizer to bring these PHP-driven interfaces into a JS-driven context. It wasn’t perfect and so this is part … Read more

Show video as part of the post?

When I want to embed a video on a WP post I use the html5 <video> tag. It’s very simple to put into the html code and is much like the <img> tag. W3Schools breaks it down for dummies. Here is their sample code: <video width=”320″ height=”240″ controls> <source src=”https://wordpress.stackexchange.com/questions/259420/movie.mp4″ type=”video/mp4″> <source src=”movie.ogg” type=”video/ogg”> Your … Read more