Just check the current host:
add_filter( 'the_content', 'domain_dependent_content' );
function domain_dependent_content( $content )
{
// get_the_ID() will return the current post ID if you need
// more information about the current page.
if ( 'page' !== get_post_type() )
return $content;
if ( 'au.example.com' === $_SERVER['HTTP_HOST'] )
return "G'Day buddy!<br>$content";
if ( 'uk.example.com' === $_SERVER['HTTP_HOST'] )
return "How do you do?<br>$content";
if ( 'us.example.com' === $_SERVER['HTTP_HOST'] )
return "Hi!<br>$content";
return $content;
}
You could also create metaboxes for the extra content, so the client can edit it. Then you check if there is extra content for this post with get_post_meta()
, and if you found something, you change the content.
Related Posts:
- Fix 403 error on WordPress multisite network using subdomains
- How to create Sub Sub domain Multi User blogs?
- How to use my style.css file outside of wordpress subdomain?
- Automatically generator a WordPress installation on my subdomain
- How to make Subdomain work for product_tag?
- How to serve WordPress folder over subdomain?
- Dynamic Banner Text based on Subdomain
- What is the best practice for restricting a section to logged in users?
- How to use nonce with front end submission form?
- Mega Menu Walker
- How to add a class to the attachment images
- How to export/import theme customizer settings?
- Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?
- Why can I not use setup_postdata($post) in the sidebar?
- Drop down+sort blog posts date added/most popular
- Activate different theme for temporary preview
- Get WooCommerce shipping methods programmatically
- Add a custom text field to WooCommerce admin product data “Variations”
- How do I output a database option that is an array into a get_posts array?
- Passing jQuery value using Ajax to a page template
- Change logo based on incoming domain
- Why can’t I use “%s” format value in the WordPress function checked?
- Help with some php math in WordPress
- max_input_vars: how many am I using?
- WordPress vs. Custom PHP [closed]
- Trouble With Conditional Logic in PHP
- Multiple WordPress Menus that will only display all pages
- How to make drop down post title
- how to delete 30 day old data using PHP [closed]
- Remove meta description on certain pages
- Image media upload metabox
- Is there CSS to expand the gallery limit on Index Pages?
- Hide categories that are not used in the post type
- esc_html_e() is not translating string in wordpress [closed]
- WordPress, AJAX and pre_get_posts using conditional tags
- Limit 1 global comment per minute
- How can I add an area/option for a custom page description?
- Is there a way to conditionally check whether a WordPress post title is empty?
- Echo a function inside a function
- Download full html page with CSV export plugin
- Advanced Custom Fields – display label and value only if value entered
- Use WordPress function in php file
- Is it bad to add html to a widget by closing and reopening the php tags?
- How to parse multiple links from one variable?
- how to disabled a button when press three times
- $wpdb returns duplicate posts
- variable value disappears in a second loop
- Referencing Images in javascript to display on wordpress page
- Add meta tags to a custom header
- Ajax filter button display all posts
- Check If Post Was Published More Than 6 Months Ago Using get_the_date
- Function sanitize_title() does not appear to be working
- Remove in post content
- JS file is not loading when i put wp_head() and wp_footer
- Nav menu from plugin to theme
- Using Custom Value Options in PHP
- How to prevent a function from running based on host (ie web vs local)?
- Additional file upload in Gutenberg page options/featured image
- Delete images from media library when user deletes an image from ACF Gallery
- Array data not saving to specified sections. How to make seting independantly?
- Add css class to string
- Replace custom SVG icons in Twenty Twenty-One
- Integrate otp in my custom singup form
- Change category thumbnail size
- Dropdown Category form. Only show Sub-Categories
- Display all categories including sub categories under a list ul
- WP Hook Before a post is created
- Unable to retrieve get_author_posts_url
- Polylang and template files
- Add custom ID attribute to all woocommerce products on archive pages
- problem in using wpdb->prepare and a string placeholder
- Custom content using in_category
- Efficient way of querying for a “fallback” post?
- Shortcode in a $output statement
- Need help with PHP functions
- WP Redirect with user nickname/username
- When using shortcode, content stops generating after the_content
- Archive page if else not working for post_excerpt and post_content
- How do you detect if a specific word is at the end of a the_title()
- add bootstrap modal after login in wordpress
- featured post as div background
- Combining fancybox with multiple thumbnail plugin
- How to display thumbnail if post is assigned one otherwise not
- syntax error unexpected ‘}’ at 364 line
- get_post_meta no longer working
- Highlight posts currently being edited on multiple editor site?
- How to check “From Email” via WordPress before an email is sent
- WordPress Plugin Receive a Link
- How to use plugins_url() inside PHP stylesheet file [duplicate]
- Php echo into tag
- Using Excel formula in PHP. Use ^ symbol [closed]
- PHP warning Invalid argument supplied for foreach() on custom page template
- Assign new post author IF another user in custom field on post transition
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- Remove Unused Menu Locations
- Login user into magento using wordpress account
- save array of objects with update_option
- What is the best way to reset the site? Different fails while set up
- Use of undefined constant issue
- Themeco Looper Provider Query String for current user posts [closed]