There is nothing wrong with wp_redirect
part of your code…
But… is_page
function can’t be used with URL address… You should pass “Page ID, title, slug, or array of such” as stated in documentation.
Related Posts:
- Redirect if not logged in?
- Redirect a list of URLs to another URL, using functions.php
- is_user_logged_in not working to redirect only logged out users
- Using wp_redirect and .htaccess to re-route searches (and pass along the remaining GET vars)
- Cannot modify header information – headers already sent (wp_redirect in functions.php)
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- How to add array [closed]
- Remove attachment page for audio media type only
- A blank page is shown after I add a Function
- Making an under maintenance page (without using plugins)
- How to check if a user exists by a given id
- How to use the do_action () with parameter
- TinyMCE custom styles remove class when switching styles
- Add admin bar link to edit author
- Extending the site search to include a single custom field
- Notify users whenever a new post is published based on their preference
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- syntax for remove_filter in parent theme with class
- Remove Header and Footer in iframe
- How to Acheive the custom woocommerce category template
- Can I remove the Rich Text box editor for a specific post?
- How to add CSS style sheet dynamically in wordpress
- How to update BuddyPress xprofile fields programmatically? [closed]
- A snippet after every image
- Programmatically set page template based on page ID
- Setting featured image with function, 1 part not working
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- wp_remote_post with ssl:// protocol
- Best way to programatically add “rel” attributes to page and post images
- Remove function or filter
- options.php problem – data not saved
- Filtering posts by category name based on page’s slug
- adding custom classes for tables
- How to include local menu based on page id?
- CSS for menu item added via functions.php
- Default Gallery Edit/Template Editable?
- Unset Category if other Category is unset during post transition
- Automatically wrap multiple images in div
- Ajax not working properly
- create shortcode to list users with specific meta key value
- Assigning WP functions which echo to PHP variables
- How to add ‘data-caption’ inside an anchor tag
- How can I get my Script to work on the Login page?
- WordPress menu link doesn’t work properly
- Search filter by Post title OR Meta Title Value [duplicate]
- Why is functions.php file in child not initializing and over-writing parent?
- Filtering out the #more anchor link that gets produced by
- Does code run faster in functions.php than in different theme templates?
- file_get_contents – failed to open stream
- Exclude from the query posts with meta_key and meta_value
- wp_nonce_field is breaking form for reasons unknown
- How do I call a function to use on a page?
- login_headertitle is deprecated since version 5.2.0
- Where is this JQuery coming from?
- Different favicon on different pages
- Javascript not loading after the document ready
- Need to convert image url to a Base_64 data url with wordpress function..
- Setting Permalinks in wp_config or functions file?
- How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields? [closed]
- Modify shortcode to work with custom post types
- How to hightlight all ancestor menu items of a child page NOT displayed in menu
- How to place a div inside a function that creates a div
- Echo post title in post
- dynamic enquiry form [closed]
- Fatal error: allowed memory size when after using enqueue_script
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- How to apply the ‘current_page_item’ class to an archive page in `wp_list_pages()`?
- How to redirect Subscribers on login to specific page, when logging in from a Page
- how can I add filter in specfic field in my website?
- Which filter fires upon setting a featured image
- functions.php pharse error on complete new install
- If has action not working as expected
- Update wp_postmeta table based on 2 keys
- Best practice to call a function from a button-link?
- Disable wordpress update notification
- How to customize archive widget only for cpt?
- Shortcode to output category description by passing ID
- some profile informations like youtube link doesnt seem
- Help using ShortCodes to style whole chunks of the post
- How to modify or override a core function (wp_star_rating)
- Is there is a way to check daily first login?
- Printing medium sized image
- Filter posts on new page
- Sticky – Featured Image
- Pagination not working on my archive page for a custom post type
- WordPress Jquery+scripts enqueue issue
- Remove Featured Images from Posts Older Than a Certain Date
- Adding a jQuery rotator function
- How to pass a variable from a template page to the child theme functions.php
- Home/Static Page View for Visitors pages after that should be restricted
- functions.php filters not applied in AJAX call
- Settings in functions.php used by a plugin
- Make WordPress search for only this tags or exclude certain tags from search [duplicate]
- Can’t change excerpt length and more tag
- Adding result from PHP function into an input field
- Echo a div to header.php from functions.php
- Changed functions.php file and now site is blank [closed]
- PHP error in shortcode [closed]
- function to show youtube videos within excerpt – if condition and apply_filters
- sort by date in users