Jump to content

Help With Getting Some Php To Show In A Link


peeler1967

Recommended Posts

presently I have this

 

<link rel="stylesheet" type="text/css" href="<?php echo get_bloginfo('stylesheet_directory');?>/admin/layouts/<?php echo $data['alt_stylesheet'];" />

 

but it is not showing the $data['alt_stylesheet']; If I put the

 

echo $data['alt_stylesheet']; is a single line it shows the data but in the link line it won't what am I doing wrong?

actually I do apologize but I did close the php <link rel="stylesheet" type="text/css" href="<?php echo get_bloginfo('stylesheet_directory');?>/admin/layouts/<?php echo $data['alt_stylesheet']; ?>" /> It's been a very long day and forgot to type that when posing my question.

How about you just copy and paste the ACTUAL code then, so you don't make more mistakes?

Run a print_r($data); - what do you get?

 

Also, do this instead:

<?php
$directory = get_bloginfo('stylesheet_directory');
echo '<link rel="stylesheet" type="text/css" href="'.$directory.'/admin/layouts/'.$data['alt_stylesheet'].'" />';
?>

 

Easier to read.

if this helps at all here is where I make the option choices

 

$of_options[] = array( "name" => "Theme Stylesheet",

"desc" => "Select your themes alternative color scheme.",

"id" => "alt_stylesheet",

"std" => "style.css",

"type" => "select",

"options" => $alt_stylesheets);

You probably have a variable scope problem, either due to pasting together a page using include statement with URL's instead of file system paths or you are using functions to output content and they don't have access to the variables.

 

Posting your code, less any database connection details, from the start of your main file through to the echo statement that doesn't work would be the quickest way of getting a solution.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.