How to restrict posts only from a certain category

try this: <?php //first check if its the category in question if ($cat == ‘1’) { //then if the user is logged in show the content if (is_user_logged_in()){ the_content(); }else{ //if not show the excerpt the_excerpt(); } }else{ // and if its not the category show the content the_content(); } ?> Update Judging by your … Read more

Add existing user as administrator

WordPress user accounts are unique to a single installation of WordPress. Even if they are hosted on the same server, there’s no simple way (and, more importantly, probably no secure way) to hook them together. WordPress accounts on WordPress .com can be added to other sites, but not accounts on self-hosted WordPress installations. The only … Read more

How to give members access to their own protected page?

funtion add_profile_page(){ $title_of_page = “page name”; if( null == get_page_by_title( $title_of_page ) ) { $post_id = wp_insert_post( array( ‘comment_status’ => ‘closed’, ‘ping_status’ => ‘closed’, ‘post_author’ => ‘1’, ‘post_name’ => ‘namehere’, ‘post_title’ => $title_of_page, ‘post_status’ => ‘publish’, ‘post_type’ => ‘page’ ) ); update_post_meta($post_id, ‘_wp_page_template’, ‘mycustomprofile’); } } add_filter( ‘after_setup_theme’, ‘add_profile_page’ ); your template page /* Template … Read more

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