How to hide and content from auto-generated excerpts?

To filter the content only when an auto-excerpt is generated you have to chain the hooks: Hook into get_the_excerpt and register a filter for the_content. In the second filter remove both elements and their content before the excerpt can see it. Sample: add_filter( ‘get_the_excerpt’, ‘t5_excerpt_clean_up’, 1 ); /** * Register handler for auto-generated excerpt. * … Read more

How to programmatically bring back “excerpts” field in post editor in WP 3.1+

http://wordpress.org/support/topic/troubleshooting-wordpress-31-master-list?replies=14 a few posts down has instructions for default ‘ON’ options // Change what’s hidden by default add_filter(‘default_hidden_meta_boxes’, ‘be_hidden_meta_boxes’, 10, 2); function be_hidden_meta_boxes($hidden, $screen) { if ( ‘post’ == $screen->base || ‘page’ == $screen->base ) { // removed ‘postcustom’, $hidden = array( ‘slugdiv’, ‘trackbacksdiv’, ‘postexcerpt’, ‘commentstatusdiv’, ‘commentsdiv’, ‘authordiv’, ‘revisionsdiv’ ); } return $hidden; }

WordPress Errors in generated by theme check plugin [closed]

File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls. The WordPress coding styles require that you make use of the WP Filesystem instead of using direct PHP file functions. You can replace your file_get_contents call easily with: $response = wp_remote_get($feed_url); $file_content = $response[‘body’]; For more specific infos just take a look … Read more

Separated Comment from Post

ahaaa 😀 it’s success, I use CSS. Here the screenshot the code i use on single.php : <!– post section –> <section class=”post-section all-round grid”> <div class=”content_wrapper”> <!– YOUR CONTENT –> </div> </section> <!– end .post-section –> <!– comment section –> <section class=”comment-section all-round grid”> <?php if ( comments_open() || get_comments_number() ) : ?> <?php … Read more

query posts in wordpress

There is no term_id parameter. You need a tax_query. $args = array( ‘post_type’ => ‘my_post’, ‘posts_per_page’ => 6, ‘tax_query’ => array( array( ‘taxonomy’ => ‘yourtaxname’, ‘field’ => ‘id’, ‘terms’ => 1 ) ) ); $query = new WP_Query( $args ); Notice that I’ve use new WP_Query and not query_posts. Don’t use query_posts. Doing the above … Read more

Page attribute template dropdown not displayed even the syntax is correct

If you’re wanting to enable the Page Template dropdown for a custom post type, you have to enable support for “page attributes” when you define your CPT. You should currently have something like register_post_type(‘foo’, array(‘labels’ => array( … ), ); You need to add ‘supports’: register_post_type(‘foo’, array(‘labels’ => array( … ), ‘supports’ => array(‘title’, ‘editor’, … Read more

Details of wp_localize_script

wp_localize_scripts writes content to the page in the form of a Javascript object that can be accesses by other Javascript that runs on the page. The point is to be able to pass dynamic data to the executing Javascript without having to make AJAX requests, parse the page for data (extract the post ID from … Read more

How to remove header images from all pages except the home page? skeleton theme

The following one-liner removes regular header images: ! is_admin() && is_front_page() && add_filter( ‘theme_mod_header_image’, ‘__return_false’ ); Usually, header images are saved and retrieved per Theme Modification API, which offers the same filter scheme “theme_mod_$name” for all theme data. Update I see now, the theme is using the post thumbnail as header images on single views: … Read more

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