So I built up this Wordpress theme for my buddy. The design was already set, so I just built what I think/thought is a pretty robust template.
We've had a few issues a long the way, and the final stumbling block is the ad block on the top of the sidebar on the right hand side.
If you refresh until it displays a video, it breaks everything - not only the stuff that's below the sidebar call, but the body too.
Can anyone please give me some insight? I'm going insane. I've been working on this project for too long and just want to fix this final problem.
http://www.touchlinetalk.com/
Uh, help!?
Your code is not valid (check with http://validator.w3.org/). A lot of elements are not closed, overlapping, some anchors are not closed, etc. Adding your video probably introduces a new div element or something like this, which actually interfers with the overlapping other elements you have in your page and breaks the layout. You should give a link to the page that does not work (call it "proof of concept") and not to a page that is OK.
If you are using WordPress, here is a really handy function for you, to avoid non-closed tags: force_balance_tags(). It closes tags that havent been closed. More info here: http://codex.wordpress.org/Function_Reference/force_balance_tags
Related
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.
I'm building a site where there will be four tiles on the front page. When a tile is selected, I want the content to pop up in like a window that will be a bit transparent so you can see the main page behind it.
I've successfully coded just that, getting the link to bring up another div that is otherwise hidden and I've even gotten it to load another html document. I accomplished this with XMLHttpRequest();. My question is, is there a more efficient way to do this? I know I've done something similar in PHP before in school and when I google, I do see that being a way to do it, but I'm also seeing jQuery and AJAX being mentioned. My overall goal is to get it to where if I want to update the CSS of the screens, that I only have to do that for the main page, and it affects the content pop-ups.
I hope I explained this well enough. Thank you for any advice!
It's very simple to do in jQuery:
$("#yourDivsId").load("/UrlOfYourIntendedMarkupDelivery?anyarguments=true");
I am attempting to tweak an existing Wordpress theme called Pytheas (for a quickie video tour of its features, visit this page). It is a WP theme oriented toward displaying portfolios. The homepage features a slideshow. My aim is to replace the slideshow with an embedded Prezi presentation.
The home page elements are (moving from top to bottom): header, menu, slideshow, tagline, highlights, posts. However, the Homepage is an odd little thing. It omits any content you may have typed into the editing window (instead, using only the images that have been uploaded to another dashboard section).
I have confirmed that the Prezi-Embedder plugin works on standard style default, blog, and pages. My presumption is there’s some CSS element at work.
My gut (and a little sniffing around) says that this bit of CSS (from template-home.php) may play a role. Specifically clearfix:
<div id="home-wrap" class="clearfix">
<?php
//get template path
$template_path = get_template_directory();
//show tagline if setting isn't empty
if(of_get_option('home_tagline')) { ?>
<div id="home-tagline" class="clearfix">
<?php
//tagline content
echo of_get_option('home_tagline'); ?>
</div>
This is where I turn to you, StackOverflow community members. What might I do to provide additional data and/or context?
Many thanks, in advance, for your attention.
Matt Warren
First step was to verify that the slideshow content was indeed being output to the final HTML. After verifying this, I moved on to the one JavaScript error being displayed:
Uncaught Error: Syntax error, unrecognized expression: a[href$=.mp3]
A quick Google on the full error seemed to confirm suspicion that this error was killing the rest of your site's JavaScript, and thus causing your slideshow to not work.
So the idea now (without being able to see all your installed plugins) was, you had some plugin that was installed to playback MP3 files. So that's where I pointed you for a possible fix. The link above provided a potential fix for an installed plugin causing this issue, but simply installing a new audio player was another valid, and less technical, solution.
I was only able to help you by actually seeing the site, that would have likely been pertinent information to provide to get additional feedback from the community.
Glad you got it resolved!
I reached out to a colleague of mine who's more skilled in the php/css dark arts. He was able to confirm that clearfix was not the issue. I was way off. However, his tinkering got some neurons firing and he snooped for a while.
Using Chrome's built-in developer tools, he was able to determine that I was experiencing the same javascript error (which was invisible to me) as this person.
In that thread, one zoonini offere another link to a solution she used. The money is here:
Search for href$=.mp3 and replace by href$=".mp3"
From what I can gather, this is the rub: For whatever reason, pre-HTML5 embedded-audio plugins can fluster these newfangled adaptive themes (oooh, did I use a buzzword?). I fiddled with the javascript file, couldn't resolve the problem and said "to hell with it."
My solution was to uninstall WPAudio and install Haiku Minimalist Player (which is HTML5 and doesn't interfere with such theme elements).
Not only does this make my embedded Prezi displayable, it allowed my frontpage slideshow (which didn't work to begin with) to work properly.
I need to insert a google adsense square box in the middle of all articles on the site.
What is the best approach?
The site is in drupal, so I figures I can hook to the view node function. this way the ad won't be saved together with the article. does that make sense? If so, than the question is how do I ensure I won't have image on the other side of the ad (the ad is aligned to the left and should take 50% of the article width)?
should I be using a block? but how will I know to place the block in inside the block.
So in short, I really have no idea where to start to implement it... How is this thing implemented in all the news sites?
I'd approach it by implementing a custom input filter that would insert the AdSense code (or the AdSense module shortcode, if you want) into the processed text. Once you have that custom filter implemented, you'll have to enable it in the text format you're using for the content type.
For implementing a custom filter, take a look at filter_example here.
This solution is for Drupal 7. The solution which worked for me is that I used the adsense tags format and then used this format to show ads on the site. Note that this line doesnot need any js inclusion or script tags. You just need to enable the Adsense tags format(I mean shortcode). Actually I was getting Ads disabled for admin and for other users i was getting the empty ad with space occupied on page but nothing shown. After different tweaks and experiments I got the following code working for me
[adsense:336x280:XXXXXXXXXX]
2nd parameter is width x height
3rd parameter: XXXXXXXXXX denotes the google ad slot/id.
I hope this will help others.
Ata ul Mustafa
I need to insert a google adsense square box in the middle of all articles on the site. What is the best approach?
From my experience:
On some drupal sites I used simply node editor to put box with adsense into content. For websites with not many nodes its best solution because of:
1) Box perfect fits in rest of content - you can change it manually.
2) Total control of viewed boxes - images, flash, text adds etc.
Etc.
But for websites with many nodes, this solution looks like stupid suicide.
Better option will be change node.tpl file in your theme folder. But there is some trouble. In this file, you have $content variable, with contains all of content in this node. This situation gives you ability to put box up or down of this node. But no in the middle. Perhaps solution will be to divide $content into 2x variables which will contains a half of contents. But question is - how do to it? Or maybe while content from node is saved into database, then you can put some html code with adsense box? And search best position to put box by regular expressions? Or maybe change all of nodes by adding html box directly in database?
should I be using a block? but how will I know to place the block in
inside the block.
As I remember, you cannot put block inside another block.
I'm starting with "PrestaShop" and I just can't figure out, how to put a link in template to custom page I created in CMS module... I thought, there might be some easy way, as there is in WordPress, like "get_permalink(ID)", but there's nothing like this and I can't find anything about this anywhere and it just drives me mad.
So, here's the deal, I've got a custom template, and there are some top links, like "About Us". I've created this page in CMS and it has ID "6".
How do I make this bloody "PrestaShop" to generate a link to this page in my template file?
About
I think you're looking for SMARTY template tags and custom variables defined for Prestashop specifically. The one the you probably need is {$base_dir} which will be translated to http://www.yoursite.com/ obviously with appropriate protocol (non-secure HTTP or secured HTTPS).
After that, you only need to include page URL, which you can get from Admin->Tools->CMS section.
If I find any specific tags that you can use to call the content, I will update my post here.
Your Text
the "WHAT goes here" is just the url you want your link drives the client to when clicking on that link.
You need to understand a little minimum of HTML for this I guess. Check html tag a meaning .
Prestashop has a fairly good and extensive documentation. Two and half seconds googling drives me here, just like answering your question it looks like.