Automatic Theme Upgrade hooks?

If you’re making a radical change in a framework style theme, I would most definitely fork it into a new & separate version. Particularly if it’s going to have a potentially adverse affect on a lot of existing child themes. I’m sure I could come up with a creative way to warn your users of … Read more

How to remove parent section in an attachment URL in wordpress?

You can add a filter to the function that gets attachment links to force that format: function wpa60888_attachment_link( $link, $id ){ return home_url() . ‘/?attachment_id=’ . $id; } add_filter( ‘attachment_link’, ‘wpa60888_attachment_link’, 10, 2 ); Calls to get_attachment_link will have this filter applied to the output.

How to create metabox that can be queried in the database?

As Kaiser suggested, the Metabox script available over at http://www.deluxeblogtips.com/2011/03/meta-box-script-update-v30.html propagates metadata to the database as individual entries instead of a serialized array. I suppose it is ultimately a matter of preference between how you want your data to be stored in the database. I have appreciated using Dimas’WP Alchemy plugin up until now, but … Read more

How to add a box for list items?

If you want to create an option page with image upload/select fields you can use the Option Framework plugin. It is straighforward and easy to use for anyone. If you want to add upload/select fields to a wordpress page or post use Custom Fields Creator or the more powerful plugin: Advanced Custom Fields. NB you … Read more

Trying to edit a WP site locally using MAMP

Try adding this to your wp-config.php file: define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’]); define(‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’]); That will define your site URL as whatever happens to be in the browser location bar. Very useful for moving a site from server to server without actually changing the siteurl and home location in the database. Just don’t leave … Read more

Get unique post in parent category

you can easily find solutions for this by using google. — edit with solution for duplicates — to filter out your duplicates fill an array with the ids. then check if the post is in the array if not print it , otherwise skip it. you said you have solution for getting the posts so … Read more

Display by tag from different post types

may i suggest you use instead get_posts()? example $args_t10 = array( ‘tag_id’ => 10, ); $postslist_t10 = get_posts( $args_t10 ); ?> $args_t10_v = array( ‘tag_id’ => 10, ‘post_type’ => ‘videos’ ); $postslist_t10_v = get_posts( $args_t10_v ); you then can merge and filter the duplicates $postmixed = array_merge($postslist_t10, $postslist_t10_v); $uniqueposts = array_unique(postmixed); reference wp: get_posts() and … Read more

Or operators in PHP [closed]

try this <?php if ( (! is_page_template(‘modelPages.php’)) || (! is_archive()) || (! is_single) ) { ?> Think your ‘not’ ! is causing the issue. btw, you could move it to this <?php if ( !( is_page_template(‘modelPages.php’) || is_archive() || is_single() ) ) { ?>