Hello.
I'm trying to pass a Wordpress post-page name to a url.
I can return the name with the following:
<?php the_permalink(); ?>" title="<?php the_title_attribute() ?>" ><?php the_title() ?>
or
<?php the_title() ?>
or
<?php get_the_title() ?>
But trying to get the title in a url is causing me a problem.
The url is:
if (($handle = fopen('http://www.mywebsite/client-private/210965/data.csv', 'r')) !== FALSE)
and I need to replace the 210965 part with the page title.
Can anyone help?
Kind Regards
the_title syntax
Moderator: General Moderators
Re: the_title syntax
Is this not basically what you want?
Code: Select all
$title = get_the_title();
$url = "http://www.mywebsite/client-private/{$title}/data.csv";-
DaveWillett
- Forum Newbie
- Posts: 2
- Joined: Mon Mar 16, 2015 3:21 am
Re: the_title syntax
Hi. I'll try it out and see if it works. I haven't tried that version.Celauran wrote:Is this not basically what you want?Code: Select all
$title = get_the_title(); $url = "http://www.mywebsite/client-private/{$title}/data.csv";
Thanks You