Tags and Taxonomy links not working for Custom Post Types

I had to modify queries before they run. So the best practice was to add the following code to function.php: if (!function_exists(‘my_theme_filter’)) { function my_theme_filter( $query ){ if ( $query->is_main_query() ) if ( $query->get( ‘tag’ ) OR is_search() ) $query->set( ‘post_type’, array( ‘artprim_item’ ) ); //echo ‘<pre>’; print_r($query); echo ‘</pre>’; return $query; }} add_filter( ‘pre_get_posts’, … Read more

Accidentally Changed WordPress Url

If you’re on a local install, it’s fairly trivial to fix this. Just use phpMyAdmin to reset home_url and/or site_url in the wp_options table in the database. Switching between two localhost installs is also fairly straight-forward: just don’t actually use “localhost” for anything. Instead, set up a unique domain in your system’s hosts file for … 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.

Choose options via url

I think this Custom Field Template plugin will help you. Plugin site. Don’t worry about Chinese screenshots. If you set at least one Custom Field Template for one category, when creating post and check that category additional options will appear.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)