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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Edited by Jessica
Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.