for your home page:
On index.php or your home page custom file use:
if (is_home()){
echo 'hi home!';
}
for any other page except 404:
use the file page.php or the custom one:
for example the link is www.xyz.pt/chat/
if (is_page('chat')){
echo 'hi page!';
}
for page 404:
if (is_404()){
echo 'hi error 404';
}
Related Posts:
- How do I only load a plugin js on it’s settings pages?
- AJAX Call Via Vanilla JavaScript In WordPress Plugin Development
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- How to Reload the Dashboard After Clicking Update in Quick-Edit?
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- Dequeue / Deregister script and replace it with a new plugin
- Insert code after tag without using functions.php?
- How do I use WordPress PHP functions in my Javascript code?
- Passing select control value to block
- How to create popup same as wordpress popup feature
- Has anyone used require.js for handling plugin scripts?
- Passing RichText attributes to function onChange
- How do I store information in a dynamic block in WordPress?
- How to load plugin after page is loaded – pagespeed issues
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- React JSX in WordPress Plugin Development
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- Best approach to fetch data from wp options to js file or php file
- Updating the Drag-To-Share eXtended share URLs?
- Enqueue WordPress plugin scripts below all other JS
- How to add Internationalization in WordPress using Javascript/React?
- wp.media javascript issue with on select
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Redirect to another page using contact form 7? [closed]
- Delay JavaScript files from loading
- How to generate an all in one WordPress New content, plugin and theme update report on a website? [closed]
- How to use custom Javascript code inside a plugin?
- how to request a script more than once in wordpress
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- Fixed: Console.log twice in the edit function
- Cannot run script properly with my custom plugin
- How to properly enqueue jQuery knob on WordPress without conflict?
- Problem with wordpress has_action() function
- Multiple image selection custom widget
- Create a form and have custom menu display based on user answers?
- AJAX update fails for public/non-admin users
- WordPress ajax error 400 bad request for sending data to remote site [duplicate]
- How to use information from the database in the front-end?
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- How to pass value from WordPress to Javascript
- Javascript in plugin not working
- How to limit each front-end user to view just his own uploaded files on Amazon S3?
- Creating a user ‘add custom field’ section
- Need to hide an element depending on date and post category
- Ajax, jQuery and WordPress
- Plugin – including external javascript calling google maps
- get_option include in my adsense
- Is it possible to run javascript on plugin deactivated?
- Ajax in Plugins: returns the whole page
- Load css classes after using ajax calls
- How to create post comparison in wordpress
- How to access values from your own settings page in javascript?
- Vanilla javascript in custom gutenberg block not working
- What are the common security flaws I need to look for? [closed]
- Creating a WordPress admin page without a menu for a plugin
- Common functionality between my own plugins
- How To Ignore a Filter On Applying Filter the Content In a Function
- Which functions in theme or plugin load first
- Adding Image in readme.txt file of wordpress plugin
- Saving Plugin settings to the database
- Add CSS animation as Preloader to WordPress
- How to use wp-ajax in wp-cron
- remove custom taxonomy metabox form custom post type
- $wpdb->get_results() does not fetch results with unicode ‘WHERE’ clause
- Adding with javascript to admin bar. Works in Chrome/Safari, not Firefox
- Deleting images through upload folder, but not deleting from media library
- WordPress plugin installation
- Get image URL from media library in input
- How could I execute my plugin just in frontend (not in backend)
- Custom height/width for thickbox in WP Backend
- add action wp_head not working
- WP-Cufon adding extra space in my paragraphs in Firefox and Chrome
- Next and/or previous post content
- Why my Plugin keeps deactivating automatically?
- Self deactivate plugins after an action occurs
- How to get current post user id
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- switched from query_posts to WP_query, not working now?
- Using a custom plugin to capture input data via Ajax and PHP
- Display post lists in 2nd paragraph
- How to get the element ID from new menu list that added with add_filter()?
- Ajax contact form widget plugin data not insert in database
- Single API call exposed via shortcode with params
- Is there a standard way to listen for an on change event of a posts featured image
- Is there a way to test that readme looks in other language before submitting translation?
- What would I need to write into a custom plugin in order to add a switch for a custom string of CSS to the edit page?
- Homemade plugin while using Themify Ultra
- How to deal with WordPress and Pocket API to automate content curation on my hosted wordpress blog? [closed]
- Create tabs in admin options page from custom post type loop
- ob_start() combined with wp_query
- do_action() hook into load-(page)
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Wrong block appender button showing
- Uncaught Error: Cannot use object of type stdClass while showing the list using WP_List_Table
- Select posts from list and add them in a new list
- plugin doesn’t retrieve data from database
- Display Any Field fromAdmin Panel in Frontend via Shortcode?
- Need to add custom cart item data
- I want to create a search option for CPT using plugin. The search options should search for categories and tags
- plugin development code standard not matching for SQL query