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 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 to check if feed URL was requested?
- Create Image Uploader for Widget
- urlencoding of the_title() doesn’t work?
- Displaying a variable stored in functions.php inside widget
- Check if widget has content
- Transform php code into a widget?
- WordPress widget in custom theme
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- List authors with posts in a category
- Concatenate site_url and string doesn’t work
- How to add Shortcode (font awesome) in widget title?
- Anything I can add to functions.php to make text widgets accept PHP?
- What’s the proper way to use wp_enqueue_script/style?
- WordPress menu deletes when trying to add a hook
- dynamic sidebar not showing anything
- How can I add a specific, custom widget to my theme’s header.php?
- Get widget settings function?
- Widgets not showing in my custom theme
- javaScript in section of WP API
- Style every second widget?
- How to group 2 radio buttons in a widget?
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- Extract subdomain and relative address from a url
- Remove query string specific key value
- custom widget on the footer
- Why does WordPress remove my variables in the URL?
- Missing sidebar parameter “fix” – before_content
- How to add just one specific page to widget without plugin?
- Dynamic Sidebars & Echo
- Dynamic content based on a URL parameter
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Hide subcategories (widget)
- 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?
- Archives shortcode displaying above widget title
- Widgets in the loop if active
- How to make widget title accept php?
- Why is $wp->request empty in WordPress 6.0?
- Hook called before text widget save
- How to pass a PHP $_GET variable and fetch/output it?
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- 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?
- how to get attached file url for current post?
- Show different website layout if no sidebar added
- random reason on refresh
- Add a select-option to the default widgets
- Don’t display a sidebar widget when on a specific page
- WordPress is removing query variables like page, p from the URL of a custom static page
- Some problems in custom widget
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- Allow two posts (from different categories) to have the same slug
- Prepend to all image URLs with PHP, only for mobile devices
- Retrieve the whole widget sidebar and pass it inside an html
- how can i redirect dynamic URL in worpress base on ID in htaccess or wp-config or function.php
- Add Link to PHP message
- Rewrite rule not working, but only when parameter is text
- Get WordPress username to customize url
- Add widget area from visual editor
- WordPress/NGINX not respecting the category URL for new posts
- Meta inserted through wp_insert_post gets messed up
- is_user_logged_in() not working in homepage
- Dynamic_sidebar load in string makeup
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- Featured Products not showing up in “Featured” area of homepage
- Need to Echo A Url path to show on a wordpress page
- (Who to follow) Twitter widget
- I want url from a file in media using title file
- Widget Logic – display on page and all child
- Add disclaimer before certain posts and pages
- Widget Update problems using a for loop
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- How to list categories by page id in wordpress
- Non-static method error when trying to use class in widgets
- Update title of every instance of widget using text field
- WP_Widget dynamic field array with external AJAX
- List sibling pages widget, exclude current page
- Removing all my hardcoded URLs with get_site_url()
- Name Input from widget displays Sidebar name instead of saved data
- WordPress – show number of comments for each post in widget
- Widget header unique classes
- key( $GLOBALS[‘wp_registered_sidebars’] ) is always showing the same value
- Passing multiple variables through url (php)
- Edit the Publish Widget Options
- How to define template directory in this widget code
- Whats wrong with my code? Need To add String to shortcode? [closed]
- Remove /category/ from category (archive) page URLs (without using a plugin)
- WPMU – How to echo only one URL
- append special url end of my website urls
- How can I change the URL via add_rewrite_rule()
- How to create a WordPress PAGE in another folder?