neodjandre Posted November 11, 2012 Share Posted November 11, 2012 //change excerpt function custom_excerpt_more($more) { return ' …<br />' . '<a href="'. get_permalink($post->ID) . '">' . 'Continue Reading: '. get_the_title() . '</a>'; } add_filter('excerpt_more', 'custom_excerpt_more'); newbie alert... I need to change the above syntax to replace . 'Continue Reading: '. get_the_title() with an image.. I am a complete newb with php but i am good with html.. thanks Andy Link to comment https://forums.phpfreaks.com/topic/270574-help-with-code-syntax/ Share on other sites More sharing options...
Jessica Posted November 11, 2012 Share Posted November 11, 2012 If you know HTML, then you know how to put in an image. What is the problem? Link to comment https://forums.phpfreaks.com/topic/270574-help-with-code-syntax/#findComment-1391752 Share on other sites More sharing options...
neodjandre Posted November 11, 2012 Author Share Posted November 11, 2012 i get confused with the dots "." and the " ' " in the above syntax... worst thing is that when i upload the file to my server, the whole site crashes and i can't play around with trial and error... Link to comment https://forums.phpfreaks.com/topic/270574-help-with-code-syntax/#findComment-1391753 Share on other sites More sharing options...
codefossa Posted November 12, 2012 Share Posted November 12, 2012 http://www.w3schools.com/tags/tag_img.asp Link to comment https://forums.phpfreaks.com/topic/270574-help-with-code-syntax/#findComment-1391757 Share on other sites More sharing options...
neodjandre Posted November 12, 2012 Author Share Posted November 12, 2012 ok i know how to use an image in html... but how do i put the image in the above code without messing up ? thanxx Link to comment https://forums.phpfreaks.com/topic/270574-help-with-code-syntax/#findComment-1391758 Share on other sites More sharing options...
codefossa Posted November 12, 2012 Share Posted November 12, 2012 return ' …<br />' . '<a href="'. get_permalink($post->ID) . '">' . '<img src="http://example.com/image.png" />' . '</a>'; Link to comment https://forums.phpfreaks.com/topic/270574-help-with-code-syntax/#findComment-1391761 Share on other sites More sharing options...
neodjandre Posted November 12, 2012 Author Share Posted November 12, 2012 thanxx that works.. btw any free php crash courses you can recommend online ? i dont want to be a stupid newb, php rules! Link to comment https://forums.phpfreaks.com/topic/270574-help-with-code-syntax/#findComment-1391766 Share on other sites More sharing options...
Pikachu2000 Posted November 12, 2012 Share Posted November 12, 2012 i get confused with the dots "." and the " ' " in the above syntax... worst thing is that when i upload the file to my server, the whole site crashes and i can't play around with trial and error... That's why you shouldn't introduce untested code to a production environment. Set up a local testing server, and use an editor that has decent syntax highlighting. Link to comment https://forums.phpfreaks.com/topic/270574-help-with-code-syntax/#findComment-1391779 Share on other sites More sharing options...
neodjandre Posted November 12, 2012 Author Share Posted November 12, 2012 yes i need to do that... been postponing it for a while.. Link to comment https://forums.phpfreaks.com/topic/270574-help-with-code-syntax/#findComment-1391832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.