Setting a fluid content width

$content_width is a global variable that can indeed be used by themes and plugins to set a maximum width on content elements. Therefore it’s always a fixed value in pixels. The plugins don’t know about your css. However, this does not limit your possibilities in your theme. You can still set image sizes larger than … Read more

How do I use the add_query_arg function in a template tag like previous_post_link?

previous_post_link and its sibling are pretty simple functions, so there’s not a lot to play with if you really want to use these (if you’re building a plugin and do not want to touch the theme, making you need a filter which isn’t there). However, since you’re talking about templates, I’m guessing that you’re building … Read more

wp_nav_menu custom walker class

You can try to alter the $attributes string, since that outputs the attributes in the a tag. The following is untested: $myClass=”some-custom-class”; $myClassAdded = false; $attributes=””; foreach ( $atts as $attr => $value ) { if ( ! empty( $value ) ) { $value = ( ‘href’ === $attr ) ? esc_url( $value ) : … Read more

Can I use WP Multi-site on a sub-domain with a different theme but use all the original site’s posts/pages?

Here’s an example of a solution I configured, which leaves the site in the network, but establishes a domain map from any registered domain, to the network. It makes the network site appear to be a completely independent site, with all the functionality (log-in, etc.) intact. Goal: Map client’s registered domain, both www.foosite.com and foosite.com … Read more