How do I add php to all links automatically?

Inserting PHP is not really the way you want to do this. You would then need additional code to execute the PHP in the post body. It could be complicated. Replace the links using a filter on the_content. Something like this: function replace_urls_wpse_91463($matches) { $ret=”<a”; if (isset($matches[1])) { $ret .= $matches[1]; } if (isset($matches[2])) { … Read more

Modify query after meta value

Here’s an example using WP_Query‘s meta_query to query posts between two meta key values: $meta_query = array( array( ‘key’ => ‘event_date’, ‘value’ => array( $date_start, $date_end ), ‘compare’ => ‘BETWEEN’ ) ); $args = array( ‘posts_per_page’ => -1, ‘meta_key’ => ‘event_date’, ‘orderby’ => ‘meta_value’, ‘meta_query’ => $meta_query ); $results = new WP_Query( $args );

Media Manager 3.5 custom options

I got the solution. I used the following script: WordPress Media Manager 3.5 – default link to and altered it to my needs with this modification: (function() { var _AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay; wp.media.view.Settings.AttachmentDisplay = _AttachmentDisplay.extend({ render: function() { _AttachmentDisplay.prototype.render.apply(this, arguments); this.$el.find(‘select.link-to’).val(‘none’); this.model.set(‘link’, ‘none’); this.updateLinkTo(); this.$el.find(‘select.link-to’).parent(‘label’).hide(); this.$el.find(‘select.size option[value=full]’).hide(); this.model.set(‘size’, ‘medium’); this.updateLinkTo(); } }); })();

Page that ‘subscribes’ to multiple categories

Enable the category taxonomy for your custom post type, or enable it for the default page post type: function wpa_cats_for_pages(){ register_taxonomy_for_object_type( ‘category’, ‘page’ ); } add_action( ‘init’, ‘wpa_cats_for_pages’ ); Then within your page template, get the category IDs assigned to the client page and create a new query which passes those IDs: // get IDs … Read more

How to add different CSS for galleries

What I would do is open it up in chrome, inspect element, and check to see if the featured image has a different ID or CLASS to the other images in the gallery. Then I would add an additional line to my CSS that targets those ID/CLASS. In the event that a ID/CLASS aren’t unique … Read more