The site crashes, because you have a typo in that code. You’re missing an apostrophe at the beginning of the string:
// Custom Function to Include
function my_favicon_link() {
echo <link rel="shortcut icon" type="image/x-icon" href="https://wordpress.stackexchange.com/favicon.ico" />' . "\n";
^ missing apostrophe
}
add_action( 'wp_head', 'my_favicon_link' );
Here’s the fixed version:
// Custom Function to Include
function my_favicon_link() {
echo '<link rel="shortcut icon" type="image/x-icon" href="https://wordpress.stackexchange.com/favicon.ico" />' . "\n";
}
add_action( 'wp_head', 'my_favicon_link' );
Related Posts:
- Where to find the html for WordPress site? [closed]
- WordPress Shortcode and Dynamic CSS
- Multiple pages on one with different HTML
- Understanding child theme functions.php
- Want to create Child theme, but already edited Parent theme css files and some php files
- Minify HTML, CSS, JS with PHPWee?
- How to display a value from a radio button in the options menu in wordpress
- Shortcode content output but not in correct place
- An unwanted inline style is added to my body tag
- Show post in slider
- How can I hide Home in my menu in a specific page?
- Missing sidebar parameter “fix” – before_content
- How Display Posts on category
- Parent theme CSS overriding child CSS rules
- how to remove metadata from the posts of my blog?
- How to style options page in dashboard?
- Customize position of social icons in upme plugin [closed]
- Different post styles depending on category
- How create a Shortcode with hover and complex options
- WordPress Multiple Navigation bars
- two columns of posts on homepage, one of them “favorites”
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Custom Background by Page IDs
- Wrapping a Sidebar within
- Add Codepen animation as Preloader to WordPress
- How to edit HTML of my website on WordPress? [closed]
- Where can I find the inline-css of my theme header?
- Menu Custom Data Attributes
- Highlight the links without using dropdown
- Website completely messes up when logging out
- Need help removing […] after excerpt
- Link to page with posts of specific type
- How to edit background color of only one sidebar?
- Inline CSS header style priority function.php Child (no enqueing I think)
- Displaying images outside the content
- how to changes mobile menu toggle breakpoint in WordPress
- Background image no longer fits to screen now that project is in php files
- Why would the child theme load in the Customize preview, but not on the site itself?
- Add other class content with reference class value
- PHP function for horizontal Woocommerce thumbnails and badges
- I can’t go to the page archive-{post_type}.php
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- Drop down question
- WP Website is shown in HTML
- Can’t display anything through homepage text editor
- How to find and delete a menu item in php?
- WordPress Slider is not working
- How to display post meta bellow every posts
- How to locate parent theme functions and add functions to my wordpress child theme?
- How to let mobile navigation menu close when link is clicked?
- Make a full-width wordpress page
- How to override html codes in wordpress?
- Target a specific container to style on WordPress storefront theme
- Add Text Area To Child Theme’s Home Page
- How to include different html tags in the header for different pages?
- user update profile for custom code
- Font-Family does not looks like how it should be [closed]
- How to remove image on single product and get product to span page?
- Modify arguments for parent theme’s `wp_register_style` via child theme
- Show contact 7 form in popup
- Child theme not working properly
- WordPress – Image href for home menu nav not working
- How Can I Center the Logo in the Navigation Menu? [closed]
- featured post as div background
- Trying to customize wordpress drop down categories
- Cant get theme to change footer color through theme customizer
- How to customize posts in WordPress by using HTML and CSS?
- WP_Query not returning results
- Child-theme suddenly stopped working [closed]
- Header location [closed]
- How do I link the side images?
- Parse error: syntax error, unexpected ‘}’ in
- Sorting Problem
- How to create a container in php then customise it in CSS
- Custom HTML/CSS Theme into WordPress – SEO considerations
- ‘This Field is Required.’ is Not Displaying on CF7 [closed]
- How to create different templates for woocommerce single-product.php?
- Blank on static home page?
- Problem adding class to body_class
- How to get the value of input hidden html from text editor to custom page template?
- Gravity form built in Captcha
- height should be set to auto to avoid pixelation in the post thumbnail function
- How to convert select to HTML with PHP tags inside of it [closed]
- Started getting warning message following host’s PHP upgrade
- Divi change project category slug
- How to put search bar & logo in the “primary navigation” storefront theme?
- List sub categories and corresponding posts of a parent category
- How to add a CSS class to this php code [closed]
- population category dropdown and sub category onselect
- Using Google Analytics in an enqueued JS file
- Use CSS tag inside PHP code
- Child theme overirde template-tags in a theme built on underscores in inc/template-tags
- How do I disable cache for a certain page?
- Changable favicon
- Multisite – Display different header content based on which site is accessed
- html to posts, jpg to featured image, zip file contains jpg and html
- How do you change the tag font size in the repeater-template.php [closed]
- which php or css file has generated an inline style in WordPress that overwrites my css