the_permalink()
function doesn’t return the post permalik, it prints the permalink. To assing the permalink value to $url
variable you need to user get_the_permalink()
instead:
$url = get_the_permalink();
Related Posts:
- Experiences with compiling WordPress using Hip Hop?
- Facebook Comment Count
- Should I store my Facebook access tokens?
- wp_head function not outputting
- Liking a facebook page from wordpress website?
- OG:Audio facebook meta tags
- Strip hashtag off permalink with php
- Show Gutenberg facebook embed with a custom theme
- How can I add “.html” to the end of a single URL on a WordPress website?
- Facebook like update status for wordpress
- Getting most popular posts based on Facebook comments count
- How can i call the facebook #hashtag images on my site
- Facebook php sdk 4 getSessionFromRedirect() always null
- SHARING TO FACEBOOK – FROM DYNAMICALLY GENERATED PAGE
- How to add Paragraph Tags in WordPress using Visual Composer?
- Fatal error: Call to undefined function mysql_connect()
- How to Add Image to WordPress RSS-Feed with no Plug-in?
- Childs PHP files not overwriting Parent’s PHP files
- Is it safe to use $_SERVER[‘REQUEST_URI’]?
- Namespacing WordPress project according to FIG standards
- How will php 7 affect WordPress?
- How to add active class to custom menu using while loop and wp_list_pages
- How can I run a .php file located in my site’s root folder?
- Get list of WP Updates Across Sites
- Want to create Child theme, but already edited Parent theme css files and some php files
- Switching between custom templates in a post type of the admin menu
- Woocommerce HTML email option unavailable
- Use template for posts with a particular category grandparent
- How to add a custom id to each post URL in wordpress
- How to start a script from cli within wordpress
- How do I display the function the_content in this loop?
- Custom Plugin For Converting CSV To MySQL
- What’s the best user registration library to integrate WordPress?
- WordPress add post format support not working
- Page Automatically Generated from Theme?
- Can I install/embed WordPress on a ‘single page’?
- Adding Custom Slider
- Displaying custom taxonomy on WooCommerce product page
- conditional logic for front-end custom field edits
- Custom posts in different columns style
- Can I use a jQuery Ajax request in Code Snippets Plugin for WordPress?
- php syntax : [ && ] between commands [closed]
- Insert custom PHP head above in WP pages
- How to do a code in php and have text before it? [closed]
- Which PHP page is the Default Posts Page
- Can we count the WordPress Loop
- Need to put a script above tag in header.php – WP 5.7.1
- Add data-id attribute to child page links
- Fixing Memory Leaks in WordPress (HHVM)
- How to deal with too many $_POST variable conditions from ajax request at backend? [closed]
- Warning: in_array() null given in PHP function
- Convert code – not work
- PHP error when using newer PHP versions
- Environment to do updates to legacy (4.7) version of WP while staying on php 5.6?
- How can I count ACF sub_field with a certain value
- Adding function to child theme’s function.php
- WordPress language switcher doesn’t work
- Hook on file upload
- Contact Form 7 WordPress, checking a few fields, if empty then invalid
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- WordPress Multisite login_redirect to primary blog and specific page based on role
- Pagination at category doesnt work with same name of page
- Date translation doesn’t work
- Is it secure to use SMTP password in .php file in WordPress website?
- How to move a post from one category to another
- WordPress add custom search
- How to get the url of the entry in which an image belongs
- How to override theme’s public static function inside of a trait?
- pass datetime using wp_localize_script to frontend from settings page
- Advanced Custom Forms PHP formatting for do_shortcode
- Infinite loop when logging out using custom login form
- add custom metabox to media library custom widget
- wp_signon works local, not on https
- add_action in wp_head accessible from class
- Can’t add to time? [closed]
- WP_Query To Display Product Of Brand On Taxonomy Page
- Let user select the number of posts shown per page jquery error
- How can I export data without using any import/export plugin
- How to have more than one ID included in the exclude command?
- Can’t make product images clickable
- wordpress ajax return 0
- divide custom field values in div every two values
- Weird slug in archives permalink
- Admin bar nodes
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Cron job to call php to email last 24 hours posts
- WP Ecommerce: Display the “Order Notes” as column in the Sales Log [closed]
- if is_home(), change class of menu-item-225 of wp_nav_menu
- WordPress most commented posts of last X days
- How to check if a value exists in one of two database tables
- A next page function with shortcode?
- How to dynamically change webcam photo timestamps
- How to improve wordpress site creation process to increase productivity.
- What is the wrong with this function to enqueue the scripts and styles to the theme? [closed]
- How to use multiple 404 Error Pages in WordPress
- Find owner of coupon
- WordPress wp_remote_request() – How to do async await in wordpress php?
- How Create Automatically Image jpg.webp from image .jpg without delete or change original images upload
- Need help with conditional logic for menus
- Disabling User Email Notifications for Erase Personal Data Utility