WordPress automatic and permanent page

Yes, that is doable. I don’t know about running scripts immediately after WP installation is complete, but you could implement your idea perhaps with a must-use plugin. First you probably want some kind of way to get the contact page id. A helper function for that, function get_my_contact_page_id() { return get_option( ‘my_contact_page’, 0 ); // … Read more

How To Ignore a Filter On Applying Filter the Content In a Function

You can temporarily detach the function from the hook. // THIS IS MY PROBLEM LINE, i USE Apply Filters for post content…. $priority = has_filter(‘the_content’, [‘TableOfContents’, ‘writeTOC’] ); if ( $priority !== false ) remove_filter(‘the_content’, [‘TableOfContents’, ‘writeTOC’], $priority ); $meta = apply_filters(‘the_content’, $post->post_content); if ( $priority !== false ) add_filter(‘the_content’, [‘TableOfContents’, ‘writeTOC’], $priority ); $meta … Read more

How do I create a featured post within a custom post type?

Register a video post type and a “Featured Taxonomy” “Featured Custom Meta Select Box The Post type: function c3m_reg_vid_post() { $labels = array( ‘name’ => _x(‘Videos’, ‘post type general name’), ‘singular_name’ => _x(‘Video’, ‘post type singular name’), ‘add_new’ => _x(‘Add New’, ‘video’), ‘add_new_item’ => __(‘Add New Video’), ‘edit_item’ => __(‘Edit Video’), ‘new_item’ => __(‘New Video’), … Read more

Post visibility on the basis of roles

Give your custom roles the capability to “read_member_posts” or whatever. Then you could apply a filter to the_content() add_filter( ‘the_content’, ‘my_wpse20347_filter’ ); function my_wpse20347_filter( $content ) { global $post; if( author_can( $post->ID, ‘edit_posts’ ) || current_user_can( ‘read_member_posts’ ) ) { return $content; } else { // Everyone else sees this in place of the content. … Read more

Post Size Limit

In the following snippet, you’ll see all filters attached to the title, content & excerpt (from /wp-includes/default-filters.php). Try to remove in a first try only stuff like capital P dangit, smilies and such and if this doesn’t work, remove the more critical stuff. I’d only do this until the post saves and then move stuff … Read more

Number of posts per page setting is not working?

This could be caused by a theme or plugin overriding the WordPress settings. You could try enabling the TwentyEleven or TwentyTen theme, as well as disabling any plugins, to see if it works then. If so, you could post which theme you are using (if it’s prebuilt) or which plugins you had to disable to … Read more

In what sequence are the hooks fired when a post is “published”?

What exactly do you mean with “published”? One thing you can try is this : http://planetozh.com/blog/my-projects/wordpress-hooks-filter-flow/ The script runs in your WordPress root (or in /wp-admin/ if you prefer) and enumerates filters that are loaded in your blog. Hooks are displayed alphabetically, and for each hook, active filters (or actions, they’re the same) are listed … Read more

posts page – different lengths of excerpt

First, you need to filter excerpt_length. Assuming you want your default excerpt length to be 50 words: <?php function wpse53485_filter_excerpt_length( $length ) { return 50; } add_filter( ‘excerpt_length’, ‘wpse53485_filter_excerpt_length’ ); ?> That will make all excerpts 50 words. Make sure that works first. Then, add in an appropriate conditional, to use a different excerpt length … Read more

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