echo "<img src=\"" . bloginfo('template_url'); . "/img/sample-ad-side.png\" alt=\"Sample Advertisement\">";
You added a semicolon, what comes after that semicolon is a new statement. . "img/
etc is not valid PHP, so it errors out.
Also bloginfo does not return its value, it prints it, so you need to change that to get_bloginfo.
I would suggest you look up basic PHP error handling so that you can look at the error logs. I also recommend you get a proper code editor that will highlight syntax errors in bright red. Sublimetext/Komodo/PHPStorm/Netbeans/etc will all do this. Syntax errors are a solved problem, you shouldn’t have to look for them, they should be pointed out to you by your code editor
Related Posts:
- Guidance with The Loop for CMS
- How can I loop into two different DIVS without repeating the DIVs
- WordPress loop specific thumbnail size
- How do I Turn This Into An if statement?
- Syntax error when I try to insert my loop into an unordered list? [closed]
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Why in my theme I can’t see all the statics content under the posts?
- Get all posts as an array ID => Name
- home.php show blog posts as grid view
- Search.php gets metadata from first post
- Check if current post in loop is last on current page
- Looping through dummy posts and showing them in the main index.php
- Problems with the WordPress loop [closed]
- WP Knowledge Base Theme bug – Subcategories and Articles, Need to change WP_Query
- Pagination not working properly
- $_html is empty when var dumped
- PHP unit testing WordPress?
- List of all theme customizer control types?
- Inject post (from specific category) between posts in Loop
- Installing wp3.2.1 on IIS; getting empty sessions
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Want to separate sections of posts. Can you restart loop?
- Specific Loop For 2 Within Each
- Two posts in same div – WP loop
- Multiple do_shortcode($content) within one shortcode
- Woocommerce, recognize the loop of related products
- Widgets not showing in my custom theme
- Easiest way to show total number of subpages
- Output 2 items within the Loop
- What is the fastest way to load PHP functions that are only used in one theme template?
- How do I access the media settings
- Can’t load WP function into external function
- How can I add pagination and how can I change thumbnail size?
- APC 500 Internal server error [closed]
- Implement toggle switch for theme options in settings API
- How can i upload images in an admin page?
- Theme Options Page – User Updates Logo
- Wp-login appears White Screen, Error: Cannot modify header information
- Show css depending on activity type in BuddyPress activity-loop [closed]
- Need Help Fixing My Iframes [closed]
- Checking array against author id in loop
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- How do I link a button I created in theme customizer to a function?
- can i fetch a custom metabox data in another page or post type?
- Widgets in the loop if active
- ‘Post-thumbnails’ feature does not seem to register
- How to obtain the current website URL in my theme?
- Admin ToolBar not being displayed at top of site
- How to get post ID in a Page?
- Separation of presentation and code – WordPress
- Search form does not work in my website
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Echo a shortcode div after every 3 posts
- get_template_directory adding FTP root folders in urls
- WordPress get_media_embedded
- Live to Local on MAMP, not working, outputting functions.php code
- Only show first image in foreach loop
- How to pass current loop data into nested loop
- Wpdb get->results to out the the month from the db
- How to Update an old theme for the latest wordpress version
- Adding Updated Post Date PHP Custom Theme
- Infinite Loop – WP_Query
- Search only working on front page (index) , not working on other pages
- How to create Loop code for Menu using WordPress?
- Wp Query : Order by distance lat,lon
- How do I edit the terms output args or array data?
- Display articles with a different template in the home page | Solved |
- When I click for the redirect link it is showing the content of index.php instead of single_assignment_page.php
- How can I prevent a shortcode div from extending beyond its boundaries?
- Should I set a page as “No-index” if I include it’s content within the front-Page.php via this method?
- How to output values from a loop into a javascript array
- Return to the beginning of the results of a for loop
- WordPress child theme, creating a custom php template page
- Exclude category and post from loop in custom category.php
- Menu to the right of screen on desktop using Bootstrap 4
- Custom theme admin-ajax.php 400 (Bad Request)
- Thumbnail wouldn’t scale to size properly
- How to send Ajax Call from frontend without using wp_localize_script in Theme
- Making list of posts with chosen description
- Add Text Area To Child Theme’s Home Page
- what’s the syntax for if the image exists get the image?
- how to remove replicating a tag inside loop?
- My query keeps looping infinitely ! how to stop it?
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- Custom theme: adding unwanted tags in the content
- Relative post date in recent posts list
- Problems With Query and/or Template Part and/or PHP
- Two loops in one function
- append links with unique number string
- Error trying import one category on page
- Adding Media button to only pages
- Sidebar doesnt get updated?
- WordPress post pagination on custom template not working
- Implement “No related posts for this entry” into the loop?
- ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?
- Options.php loop won’t show!
- Predefine Magazine Style Layouts
- Twig+WordPress how to use array arguments inside a function?
- How to store the_post_thumbnail() value in a variable
- Variable ++ in query loop