Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1575 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Wordpress Templating System

Thread title: Wordpress Templating System
Closed Thread    
    Thread tools Search this thread Display Modes  
08-25-2007, 06:24 PM
#1
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old  Wordpress Templating System

Hello,

The following code will be used to make the filename part of a url, so what im doing is taking the pagetitle and replacing all gaps within in to '-' as well as making it non-caps.

PHP Code:
<?
$title 
the_title();
$str strtolower($title);
$newtitle str_replace(" ""-"$str);
?>
However I'm having a problem getting the function into the variable, at the moment the function is rendering without going into the variable...

Any ideas what's happening?

08-25-2007, 06:51 PM
#2
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old

For future reference, I found that this works:

PHP Code:
global $wp_query;
$title $wp_query->post->post_title;
$str strtolower($title);
$newtitle str_replace(" ""-"$str); 
Hope this helps someone.

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed