CSS won't load because of the script given from the template - php

I've been looking for the answer I seek in many posts before. But none of them worked for me.
I'm learning CI currently and want to implement it with admin panel template called Clip-Two. I will give brief explaination about my problem.
Problem : In some of my pages the CSS works fine, however in some of the pages the partially loaded.
Below is my controller called Users.php
Users.php
Within this controller, i have two functions, mainly the first one is for index, and the second one is when i want to create a user.
In the first function, the CSS works fine. All the required CSS files are loaded shown below.
Index.php
However, in the second function, which have a new page, it only load partially of the whole CSS files.
Create.php
Below is my header template
header.php
The one that I highlight is the CSS file that doesnt loaded properly.
When I inspect the elements, the file path is wrong, shown below.
Elements
Below is my config file on base_url().
Base_url()
So, I'm confused, is it my base_url() went wrong or is it something else. Any help will be appreciated. Thanks in advance!.
Sorry I made a very long post, i just want everybody have a clear picture of my problem.
EDITED
I'm using admin template from Clip-Two
Below is the console error shown on my page.
Sorry I think my post is a bit misleading, I have edited my title and my problem
Problem : the jQuery from the template have the theme selector, so basically the jQuery could not find the path.
It shows that jQuery could not find the path.
Is this my problem lies on the jQuery?

Are you sure you are not manipulating with that stylesheet using JavaScript? (You have an id identifier on tag.)
Also, insted of <?php echo base_url()?>, try <?=base_url()?> it takes way less space.

Related

Error when include wordpress header

I am trying to make a news section for my homepage "index.php". So I use ajax to load "pages/news.php"'s content into a news div in index.php. This pages/news.php is supposed to pull out latest posts and format them nicely. The blog is in localhost:81/blog/
When I view localhost:81/pages/news.php, it can display the posts, no errors. But when I run localhost:81/index.php, it said
jquery-2.1.4.min.js:4 GET http://localhost:81/pages/news.php 404 (Not
Found)
If I remove this line in pages/news.php:
include(dirname(__DIR__) . '/blog/wp-blog-header.php')
index.php won't have error, but of course cannot view the posts.
If I copy the code in pages/news.php to index.php, it works (of course with appropriate including path). I am very confused here, how come using the same code but retrieving news.php content from ajax does not work but news.php itself works?
Could someone please advise me what has gone wrong?
Thank you for your time reading.
It turned out that this is a common issue: wordpress forces user to use ajax in a specific way. The instruction is here: http://rocketpopmedia.com/discover/2013/06/21/wordpress-ajax-and-the-404-error-youre-receiving/

Insert scripts in Drupal

I want to insert a script to a Drupal page. What I can find there's no footer.tpl.php or head.tpl.php. I can find the page.tpl.php and tried to insert the script there but with no luck. I just want to add the script to a specific page therefore I tried to hard code it into the body of that page but with no luck. Where do I insert a script tag, there's to themes installed as far as I know and it's Base and Garland.
Thanks!
The usual way of adding javascript to a page is using drupal_add_js. By default, if you specify a file to add, it will add it in the section of the markup.
reallyxloco is correct about using drupal_add_js to add your script. What you'd need to do is add that into your template.php file.
The tpl file that you are probably trying to locate is likely html.tpl.php but depending on your version of Drupal, that might be a core file.
I'm trying to use drupal_add_js and it works. The thing is for the script to work it has to be inserted in the footer which also works, but drupal adds a slash in front of the src like this "/http://www.example.js", trying to say that the script is a external script but without no success, here's the code I'm using:
<?php
drupal_add_js('http://example.com/example.js', 'module','footer',FALSE,FALSE,FALSE);
?>

link to id on page but reposition

I've used a modified themeforest template for a single php page and have an issue where the navigation links that take you to the various unique id's on the page are working fine but cut off the top part of the section h3 that it has linked to.
It's a positioning problem for sure and most likely to do with the modifications I made to the flex-slider that the template included.
But I can't determine how to adjust the css (or script) to correct the issue.
For example, the site is http://goudkamp.stacklaw.com.au/ and when you click Services, you can see what I mean.
I have the template on the site as well so you can see how it SHOULD work - http://goudkamp.stacklaw.com.au/v2/template/.
I came across another article that suggested using the script
if(window.location.hash.length){
$(window).scrollTop($(window).scrollTop() - 100);
}
However, I don't think I should need it when the template works perfectly.
I just don't know where to start looking to make the necessary adjustments.
Please help!
Thanks in advance
Wait - I found it!
After looking at the suggestion on the other article, it made me think that it must be done in the theme's custom scripts. So I looked in the custom.js file for any script that referenced the main nav.
There was an "offset" line with the markup "//use this to position the window exactly where you want". Testing a small change to this had the desired effect.
Thanks anyway.

Wordpress - Trying to remove stubborn title

I have tried removing the title by all the methods I could find on Stackoverflow and wordpress support such as pacing a css rule and finding the get_title in the page, single and template php files. But this title doesn't seem to want to go away.
The only way I have had any success is by using a plugin that removes the title but then I am faced with the problem that the spacing remains where the title once was.
Here is a picture showing what I mean: http://i.imgur.com/vj0vbc7.jpg
Thanks in advance for your help!
You need to go into your template file and remove where the title is being outputted.
I checked the source code on your site and it looks like the theme files are not in the regular place. So do this. Go to your FTP client and open up:
/assets/956/themes/header.php
It might be named something slightly different.
Now within that theme locate your h1 tag. At this point I would recommend removing it, saving it, and making sure you have the desired change. It should be gone completely from the page. If it's not, perhaps the H1 tag is located in another file? Check other template files till you find the right one.
You can remove it all together or surround it in a div with ID='homepg-h1' Then just do a rule like this in your CSS:
#homepg-h1 {
display:none;
}
Hope that helps, let me know if you have any questions.

WYSIWYG way to work with xyz.tpl.php/CSS files?

I recently purchased a script that I'm trying to change the CSS to pimp it up :)
However since I'm fairly new to CSS/PHP (I've done ASP before), I'm trying to use the "Live view" feature Dreamweaver 5.5 to edit the tpl.php files. I have setup the site as instructed in DW and it's working with basic PHP files, however when I try to open a tpl.php file it doesnt seem to handle all the includes or something, so essentially it doesnt know how to retrieve all the related CSS etc in order to show me what the site looks like.
It has the following code structure:
www.xyz.com -> this calls the index.php
Within index.php, it calls include_once ('global_mainpage.php');
Within global_mainpage.php it then calls $template_output .= $template->process('mainpage.tpl.php');
mainpage.tpl.php is the file that I need to change the layouts/CSS class reference etc.
My ideal way to work with the site is:
Say if I want to change something on index.php
I just click on one of the elements in live view
It would automatically launch the tpl.php file being used
I can then examine the CSS used and make a change to it
hit save and be able to view the change I just made
If this is not possible, do I have no choice but to use Aptana? I've used it before editing PHP code, but not tpl.php - I was hoping to have a WYSIWYG editor for tpl.php...
Many thanks for your help gurus! :)
Why don't you use FireBug on Firefox and hook it up with cssUpdater?

Categories