You’r missing $post variable ( it is not defined and that for you don’t get post_name ).
As a solution you could add global $post;
You’r code would be like:
<a href="https://wordpress.stackexchange.com/questions/201956/<?php echo site_url("/article/full-text/'); global $post;
$slug = $post->post_name; echo $slug; ?>" title="<?php the_title_attribute(); ?>">Full Text</a>
Related Posts:
- Current WordPress Page Title as Search Parameter into A Tag
- How to get URL of current page displayed?
- How to include checkbox in widget backend form?
- Limit the number of inactive widgets
- Encode text string being appended as query to URL [closed]
- Is it safe to use $_SERVER[‘REQUEST_URI’]?
- The correct method to pass query vars in AJAX using ajaxurl
- How display widget by id
- How to check if feed URL was requested?
- What is the best practice for escaping data URIs?
- Create Image Uploader for Widget
- urlencoding of the_title() doesn’t work?
- How to get the registered sidebar’s name by its id?
- How do I get the author’s page url from their ID?
- Dynamic URL to reference custom PHP files
- Displaying a variable stored in functions.php inside widget
- Check if widget has content
- Transform php code into a widget?
- How do I create a drop down menu in a widget?
- Why my image upload button is not working in wordpress widget area?
- My php header() function is not working [closed]
- Adding a widget function into the php theme file
- How to edit widget code to add unique class name to each div?
- Scrape external webpage for first image and add it to new post
- Create custom permalinks to show Custom Post Type’s relationship?
- Search Query: how to construct a search string from two select elements?
- Get URL Parameters from referer
- Need help enqueueing webfonts
- If has $title in widgets
- Archives shortcode displaying above widget title
- Widgets in the loop if active
- Show latest posts in a plain HTML website custom widget [closed]
- How to determine if the sidebar is empty? Or not active?
- How to make widget title accept php?
- Why is $wp->request empty in WordPress 6.0?
- Get the URL of the page from which an ajax request has been launched within ajax callback
- How to check if the current page is at a specified path in the URL?
- Is it bad to add html to a widget by closing and reopening the php tags?
- Widget back end radio button issue
- Hook called before text widget save
- How to pass a PHP $_GET variable and fetch/output it?
- Post’s ID pattern?
- Widgets not showing on custom theme
- My website is not showing Footer section
- I’m unable to call img path using single quotes in an array?
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- Correctly Using checked function of WordPress
- change default RSS feed URL
- How do i add slugs to a URL, but still redirecting to the same page
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- Can’t change website Title on wordpress
- Nginx WordPress and another Web app URL structure
- How to get post category list as select in front-end?
- Simple php in wordpress widget [closed]
- how to get attached file url for current post?
- Call featured image url
- Show different website layout if no sidebar added
- Creating customized php files in theme folder
- display specific widget to a page
- Dynamically display font icons in widget
- Correct code to use php in text widget
- How do I include an external PHP file in a subdir WordPress install?
- How to add PHP pagination to wordpress
- Use an anchor link to open an iframe inside a WordPress page
- Adding custom url to readmore link using get_permalink()
- How to set base url for php widget
- Comment_author_url doing nothing
- random reason on refresh
- Add a select-option to the default widgets
- Stuck with sidebar registering
- Don’t display a sidebar widget when on a specific page
- Modifying WP URL handing code?
- How to deal with a GET variable of ‘name’?
- WordPress permalink issue
- WordPress is removing query variables like page, p from the URL of a custom static page
- Some problems in custom widget
- WordPress 6.0 class-wp-widget.php fatal errors in PHP 8.1.6
- Workaround for og:image unsupported webp image type, Yoast SEO?
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- How do you create a custom category widget that you can style?
- Unable to display multiple parameters from url by javascript through shortcodes
- Allow two posts (from different categories) to have the same slug
- How a HTML form can trigger a PHP function?
- Prepend to all image URLs with PHP, only for mobile devices
- Retrieve the whole widget sidebar and pass it inside an html
- Get nice name of category from slug (remove dashes of category)
- how can i redirect dynamic URL in worpress base on ID in htaccess or wp-config or function.php
- How to use wp_get_attachment_image or wp_get_attachment_image_src instead of $instance[‘single_feature_image_uri’]
- Loading Widgets Via Child Theme
- How to stop hiding buttons forward / backward in pagination?
- Add Link to PHP message
- Inserting a class on before_widget if checkbox is checked
- Rewrite rule not working, but only when parameter is text
- How to create a widget with a populated dropdown?
- dashboard widget form not submit mails
- Get WordPress username to customize url
- Add widget area from visual editor
- WordPress/NGINX not respecting the category URL for new posts
- How does one make a URL return dynamic JSON with custom Content Type?