How to loop through a custom field for each post, & display?

You are missing “foreach” loop. Try this way $latest_cpt = get_posts(“post_type=event”); foreach ( $latest_cpt as $cpt_post ) { $theidone =$cpt_post->ID; $this_post_id = $theidone; //get_the_ID(); $key_2_value = get_post_meta( $this_post_id, ‘custom_select’, true ); if( ! empty( $key_2_value )) { $thisisworking = $key_2_value ; ;} echo $thisisworking; }

Show posts from all categories

You need get_categories() with an include argument: if (isset($_GET[‘cat’])) { $this_category = get_categories( array( ‘include’ => $_GET[‘cat’] ) ); var_dump($this_category); } You will get an array of stdClass objects containing category data. There are several ways to parse that but this might do: if (isset($_GET[‘cat’])) { $this_category = get_categories( array( ‘include’ => $_GET[‘cat’] ) ); … Read more

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