someone questioned me today that I am not doing it correctly?
<?php echo get_bloginfo('template_url') ?>/images/logo.png
There are 2 possible reasons this could be considered ‘incorrect’:
get_bloginfo
is a very old function that does multiple things, this particular function was replaced byget_template_directory_uri
andget_stylesheet_directory_uri
- Security! You didn’t escape anything! The entire thing should be wrapped in an
esc_url
Related Posts:
- bloginfo() vs get_option?
- WordPress function bloginfo not echoing output on parts of the pages
- How do I get the current edit page ID in the admin?
- Order posts (across the whole site) by metadata date
- Disable visual editor on one specific page
- How to display random users with avatars
- Apply custom role capabilities to administrator (without plugin)
- Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php?
- In a WordPress plugin, how do you output HTML code inside the DOM header? [closed]
- Different ‘WP_CONTENT_URL’ for different subsites in Multisite setup?
- Linking thumbnail to full size image
- is_front_page not working in functions.php
- Removing Unnecessary Text from Admin Menu without CSS
- VERY new to coding – keep breaking site trying to add to functions.php
- Display WordPress Search
- Preferred Use of home_url()?
- Functions.php reverted to new one
- Where does function_exists() look to decide whether a function exists? [closed]
- Get page slug and assign a variable within functions.php
- Clean-up script tags
- Make “sidebar template” the default template for new pages
- Custom roles can’t access to wp-admin
- How to specify which Gutenberg blocks are available in the editor for a page template
- Refactor create_function
- How to use thumbnails in gallery?
- Hide Author.php template from specific user role
- Customizer field value into functions.php variable
- wp_insert_posts keeps adding multiple pages
- Best practice when altering a parent theme function inside a child theme?
- list tags with count in author profile page
- Breadcrumbs – Exclude Child Categories
- Auto delete post if certain custom field data is empty
- Why won’t my scripts load?
- using `require` in my functions.php breaks the site
- Is it OK to include files using ABSPATH?
- Overwriting Parent Theme’s Image Sizes
- Hard-coding custom menu elements for menu manager
- Limit length of first excerpt in the loop
- Do not add content filter on page template
- Function to update post_meta based on existing post_meta
- check if the user is owner of current page
- How to set the default avatar of buddypress avatar [closed]
- Custom styles.css sheet for visual editor
- Publishing just a Facebook URL without full code snippet
- Filter an WordPress Function in (general-template.php)
- attachment page template? only show attachments for current post?
- Conditional statement not working in function
- Adding code before post title with the_title produces weird results
- Remove the month and year from a WordPress Date?
- Show some menu sub items as dropdown under a menu item
- Set “woocommerce_is_purchasable” to false for specific “$product->is_stock_status”
- How to insert class in each list of categories?
- The correct way to add a JavaScript in the functions.php [closed]
- How to remove some item from WordPress Dashboard for user Author
- Editing the formatting.php file vs functions.php file?
- How to make a new function that includes a template
- Disabling Author Page only for subscribers
- Function not saving unchecked checkbox
- Removing parent theme CSS without editing parent theme
- Showing user profile data on front-end
- How to register a menu based on a ACF condition
- Entirely Different Functions.php per Page?
- Breaking up multiple words and inserting an image after first word
- Why is this function crashing my wordpress installation? [closed]
- colorbox not loading in
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- How to Override Page Template if URL matches query?
- Save_post – Warning: Cannot modify header information
- Woocommerce Display Discount On cart
- Modify content inside post before first publish
- Pass an argument into a function to extract from array
- How to offset main query without affecting other queries and backend
- ACF Date Form in Custom Admin Field
- how to remove a tag in the_category function
- Function to disable “href” anchor tags that contain “a data-name” on mobile only
- Execute jQuery with custom event listener after successfully add an item to the cart
- Copying a widget class to functions.php results on a blank page
- WordPress undefined function error on using add_action() in functions.php
- How to create admin ajax function for my contact form
- No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file
- Changing the register url is not working
- Newest comments first not working
- Pass arguments to function class with do_action()
- how to display featured image for single post for a specific category
- Database Query not working
- Can I use a function to return HTML and the result of another function?
- Figure inlined width trigger distorted layout
- save_post hook – headers already sent?
- Exclude javascript in certain page url and all following url’s after forward slash
- How to use WP_rewrite?
- Wp get archive only text not link
- can not call functions in function.php
- Custom shortcode not being included in content paragraph [duplicate]
- Display post_meta-by_key on product catalogue
- What are the parameters are used in add_action and filters?
- Which template file to edit to edit homepage in Mystile [closed]
- Does functions.php apply to every page?
- Creating mixture of shortcodes to use in the visual/text editor
- Customizer cuistom CSS Priority ordre Issue
- WPDB query suddenly not working