Skip to main content
deleted 64 characters in body
Source Link
Jeremi Liwanag
  • 263
  • 1
  • 8
  • 18

i got a custom template with blog post in it...

In my header.php, inside the <head> i have my links like this ...

<link href="http://www.mysite.com/css/design.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.mysite.com/js/myjs.js"></script>

those links are working in my custom template.. by using

<?php get_header(); ?>

All blog post in my custom page are there.. no layout problems.

But when i click one of the post. my layout is broken. and when i checked it via Inspect Element. the link is like this

<link href="http://www.mysite.com/blog/css/design.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.mysite.com/blog/js/myjs.js"></script>

My custom template and single.php are both using

<?php get_header(); ?> means that they are using*** EDIT *** from the answers below, above is my original question, anyway my problem is still the same header right?.

I added this to my functions.php and removed the links on my header.php also i copied the files inside the wordpress folder called links...

/httpdocs/blog/wp-content/themes/myblog/links

    // Get Links 
    
    function theme_scripts_styles() {

  wp_enqueue_style( 'my-styles', get_stylesheet_directory_uri() . '/links/design.css', array(), '1.0', 'all' );

  wp_enqueue_script( 'my-scripts1', get_stylesheet_directory_uri() . '/links/cufon-yui.js', array(), '1.0', true );
  
  wp_enqueue_script( 'my-scripts2', get_stylesheet_directory_uri() . '/links/232MKSD_200.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts3', get_stylesheet_directory_uri() . '/links/232MKSDB_400.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts4', get_stylesheet_directory_uri() . '/links/fonts.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts5', get_stylesheet_directory_uri() . '/links/OpenSans_400.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts6', get_stylesheet_directory_uri() . '/links/OpenSansSB_600.font.js', array(), '1.0', true );



}

 add_action( 'wp_enqueue_scripts', 'theme_scripts_styles' );

i got a custom template with blog post in it...

In my header.php, inside the <head> i have my links like this ...

<link href="http://www.mysite.com/css/design.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.mysite.com/js/myjs.js"></script>

those links are working in my custom template.. by using

<?php get_header(); ?>

All blog post in my custom page are there.. no layout problems.

But when i click one of the post. my layout is broken. and when i checked it via Inspect Element. the link is like this

<link href="http://www.mysite.com/blog/css/design.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.mysite.com/blog/js/myjs.js"></script>

My custom template and single.php are both using

<?php get_header(); ?> means that they are using the same header right?

I added this to my functions.php and removed the links on my header.php also i copied the files inside the wordpress folder called links...

/httpdocs/blog/wp-content/themes/myblog/links

    // Get Links 
    
    function theme_scripts_styles() {

  wp_enqueue_style( 'my-styles', get_stylesheet_directory_uri() . '/links/design.css', array(), '1.0', 'all' );

  wp_enqueue_script( 'my-scripts1', get_stylesheet_directory_uri() . '/links/cufon-yui.js', array(), '1.0', true );
  
  wp_enqueue_script( 'my-scripts2', get_stylesheet_directory_uri() . '/links/232MKSD_200.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts3', get_stylesheet_directory_uri() . '/links/232MKSDB_400.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts4', get_stylesheet_directory_uri() . '/links/fonts.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts5', get_stylesheet_directory_uri() . '/links/OpenSans_400.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts6', get_stylesheet_directory_uri() . '/links/OpenSansSB_600.font.js', array(), '1.0', true );



}

 add_action( 'wp_enqueue_scripts', 'theme_scripts_styles' );

i got a custom template with blog post in it...

In my header.php, inside the <head> i have my links like this ...

<link href="http://www.mysite.com/css/design.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.mysite.com/js/myjs.js"></script>

those links are working in my custom template.. by using

<?php get_header(); ?>

All blog post in my custom page are there.. no layout problems.

But when i click one of the post. my layout is broken. and when i checked it via Inspect Element. the link is like this

<link href="http://www.mysite.com/blog/css/design.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.mysite.com/blog/js/myjs.js"></script>

*** EDIT *** from the answers below, above is my original question, anyway my problem is still the same.

I added this to my functions.php and removed the links on my header.php also i copied the files inside the wordpress folder called links...

/httpdocs/blog/wp-content/themes/myblog/links

    // Get Links 
    
    function theme_scripts_styles() {

  wp_enqueue_style( 'my-styles', get_stylesheet_directory_uri() . '/links/design.css', array(), '1.0', 'all' );

  wp_enqueue_script( 'my-scripts1', get_stylesheet_directory_uri() . '/links/cufon-yui.js', array(), '1.0', true );
  
  wp_enqueue_script( 'my-scripts2', get_stylesheet_directory_uri() . '/links/232MKSD_200.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts3', get_stylesheet_directory_uri() . '/links/232MKSDB_400.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts4', get_stylesheet_directory_uri() . '/links/fonts.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts5', get_stylesheet_directory_uri() . '/links/OpenSans_400.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts6', get_stylesheet_directory_uri() . '/links/OpenSansSB_600.font.js', array(), '1.0', true );



}

 add_action( 'wp_enqueue_scripts', 'theme_scripts_styles' );
deleted 786 characters in body
Source Link
Jeremi Liwanag
  • 263
  • 1
  • 8
  • 18

Here'sI added this to my wholefunctions.php and removed the links on my header.php also i copied the files inside the wordpress folder called links...

/httpdocs/blog/wp-content/themes/myblog/links

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlGet xmlns="http://www.w3.org/1999/xhtml">
<head>Links 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="" />
<title>Title</title>
<link href="http://www.mysite.com/css/design.css" type="text/css"function rel="stylesheet"theme_scripts_styles() />{
<script 
 type="text/javascript" src="http://www.mysite.com/js/cufon-yui.js"></script>
<scriptwp_enqueue_style( type="text/javascript"'my-styles', get_stylesheet_directory_uri() src="http://www.mysite.com '/jslinks/OpenSansSB_600.fontdesign.js"></script>
<script type="text/javascript"css', array(), src="http://www.mysite.com/js/OpenSans_400.font'1.js"></script>
<script type="text/javascript"0', 'all' src="http://www.mysite.com/js/232MKSD_200.font.js"></script>);
<script type="text/javascript" 
  src="http://www.mysite.com/js/232MKSDB_400.font.js"></script>
<scriptwp_enqueue_script( type="text/javascript"'my-scripts1', get_stylesheet_directory_uri() src="http://www.mysite.com '/jslinks/fontscufon-yui.js"></script>
</head>
<body>
<div id="section_top">
  <div class="wrapper">
 js', array(), '1.0', <divtrue class="header">);
      <div class="social_networks"> </div>
      <divwp_enqueue_script( class="topnav">'my-scripts2', <aget_stylesheet_directory_uri() href="index.html" title="mysite" class="logo"><'/a>
     links/232MKSD_200.font.js', array(), '1.0', <divtrue class="links">);
          <ul>
           wp_enqueue_script( <li>'my-scripts3', <aget_stylesheet_directory_uri() href="index.html" title="home" class="home "><span><img src="http:'/links/www.mysite232MKSDB_400.com/css/images/homefont.gif" alt="Home" /></span></a> </li>
           js', <li><aarray(), href="maintenance'1.html" title="Website"0', class=""><span>true Website</span></a></li>);
         
  wp_enqueue_script( 'my-scripts4', <li><aget_stylesheet_directory_uri() href="company.html" title="Why mysite" class=""><span>Website</span><'/a><links/li>
    fonts.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts5', <li><aget_stylesheet_directory_uri() href="contact.html" title="Contact" class=""><span>Contact</span><'/a><links/li>
      OpenSans_400.font.js', array(), '1.0', true </ul>);
        </div>
  wp_enqueue_script( 'my-scripts6', get_stylesheet_directory_uri() . <'/div>
    <links/div>
    <div class="breadcrumb">OpenSansSB_600.font.js', <aarray(), href="index'1.html"0', title="Home">Home</a>true &raquo;);



}

 Blogadd_action( </div>
'wp_enqueue_scripts', 'theme_scripts_styles' </div>
</div>);

Here's my whole header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="" />
<title>Title</title>
<link href="http://www.mysite.com/css/design.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.mysite.com/js/cufon-yui.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/OpenSansSB_600.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/OpenSans_400.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/232MKSD_200.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/232MKSDB_400.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/fonts.js"></script>
</head>
<body>
<div id="section_top">
  <div class="wrapper">
    <div class="header">
      <div class="social_networks"> </div>
      <div class="topnav"> <a href="index.html" title="mysite" class="logo"></a>
        <div class="links">
          <ul>
            <li> <a href="index.html" title="home" class="home "><span><img src="http://www.mysite.com/css/images/home.gif" alt="Home" /></span></a> </li>
            <li><a href="maintenance.html" title="Website" class=""><span> Website</span></a></li>
            <li><a href="company.html" title="Why mysite" class=""><span>Website</span></a></li>
            <li><a href="contact.html" title="Contact" class=""><span>Contact</span></a></li>
          </ul>
        </div>
      </div>
    </div>
    <div class="breadcrumb"> <a href="index.html" title="Home">Home</a> &raquo; Blog </div>
  </div>
</div>

I added this to my functions.php and removed the links on my header.php also i copied the files inside the wordpress folder called links...

/httpdocs/blog/wp-content/themes/myblog/links

    // Get Links 
    
    function theme_scripts_styles() {
 
  wp_enqueue_style( 'my-styles', get_stylesheet_directory_uri() . '/links/design.css', array(), '1.0', 'all' );
 
  wp_enqueue_script( 'my-scripts1', get_stylesheet_directory_uri() . '/links/cufon-yui.js', array(), '1.0', true );
  
  wp_enqueue_script( 'my-scripts2', get_stylesheet_directory_uri() . '/links/232MKSD_200.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts3', get_stylesheet_directory_uri() . '/links/232MKSDB_400.font.js', array(), '1.0', true );
 
  wp_enqueue_script( 'my-scripts4', get_stylesheet_directory_uri() . '/links/fonts.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts5', get_stylesheet_directory_uri() . '/links/OpenSans_400.font.js', array(), '1.0', true );

  wp_enqueue_script( 'my-scripts6', get_stylesheet_directory_uri() . '/links/OpenSansSB_600.font.js', array(), '1.0', true );



}

 add_action( 'wp_enqueue_scripts', 'theme_scripts_styles' );
added 1999 characters in body
Source Link
Jeremi Liwanag
  • 263
  • 1
  • 8
  • 18

Here's my whole header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="" />
<title>Title</title>
<link href="http://www.mysite.com/css/design.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.mysite.com/js/cufon-yui.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/OpenSansSB_600.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/OpenSans_400.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/232MKSD_200.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/232MKSDB_400.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/fonts.js"></script>
</head>
<body>
<div id="section_top">
  <div class="wrapper">
    <div class="header">
      <div class="social_networks"> </div>
      <div class="topnav"> <a href="index.html" title="mysite" class="logo"></a>
        <div class="links">
          <ul>
            <li> <a href="index.html" title="home" class="home "><span><img src="http://www.mysite.com/css/images/home.gif" alt="Home" /></span></a> </li>
            <li><a href="maintenance.html" title="Website" class=""><span> Website</span></a></li>
            <li><a href="company.html" title="Why mysite" class=""><span>Website</span></a></li>
            <li><a href="contact.html" title="Contact" class=""><span>Contact</span></a></li>
          </ul>
        </div>
      </div>
    </div>
    <div class="breadcrumb"> <a href="index.html" title="Home">Home</a> &raquo; Blog </div>
  </div>
</div>

Here's my whole header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="" />
<title>Title</title>
<link href="http://www.mysite.com/css/design.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.mysite.com/js/cufon-yui.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/OpenSansSB_600.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/OpenSans_400.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/232MKSD_200.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/232MKSDB_400.font.js"></script>
<script type="text/javascript"  src="http://www.mysite.com/js/fonts.js"></script>
</head>
<body>
<div id="section_top">
  <div class="wrapper">
    <div class="header">
      <div class="social_networks"> </div>
      <div class="topnav"> <a href="index.html" title="mysite" class="logo"></a>
        <div class="links">
          <ul>
            <li> <a href="index.html" title="home" class="home "><span><img src="http://www.mysite.com/css/images/home.gif" alt="Home" /></span></a> </li>
            <li><a href="maintenance.html" title="Website" class=""><span> Website</span></a></li>
            <li><a href="company.html" title="Why mysite" class=""><span>Website</span></a></li>
            <li><a href="contact.html" title="Contact" class=""><span>Contact</span></a></li>
          </ul>
        </div>
      </div>
    </div>
    <div class="breadcrumb"> <a href="index.html" title="Home">Home</a> &raquo; Blog </div>
  </div>
</div>
Source Link
Jeremi Liwanag
  • 263
  • 1
  • 8
  • 18
Loading