bustel Posted October 10, 2016 Share Posted October 10, 2016 hi guysI'm stuck on a php code, I have searching over the web but nothing helps me, that's why I am here.that's what I have at the moment, but it's not correct... It shows the image to all other titles on the frontpage, I want just the correct icon/image before the correct title. if ( $show_title == 1 ) { $post_id = 133; // post ID $width = "20px"; // width of the image $height = "20px"; // height of the image $space = str_repeat(' ', 1); // white space(s) + how much spaces $icoontje = get_field( 'category_icon', $post_id ); $list_pages_html .= '<h3 class="page-list-ext-title"><img src="'.$icoontje.'" width="'.$width.'" height="'.$height.'">'.$space.'<a href="'.$link.'" title="'.esc_attr($page->post_title).'">'.$page->post_title.'</a></h3>'; } else { $list_pages_html .= '<h3 class="page-list-ext-title"><a href="'.$link.'" title="'.esc_attr($page->post_title).'">'.$page->post_title.'</a></h3>'; } Can anybody help me please? Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/302312-an-iconimage-before-the-title-of-a-page/ Share on other sites More sharing options...
cyberRobot Posted October 11, 2016 Share Posted October 11, 2016 Just to clarify, is the problem that the same icon is displayed for all titles? And you want the icon that was assigned to each title to be displayed instead. Is that correct? Quote Link to comment https://forums.phpfreaks.com/topic/302312-an-iconimage-before-the-title-of-a-page/#findComment-1538190 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.