Jump to content
Sign in to follow this  
jennajonesdesign

Embed Stock Chart in Header - Position Problem Using Hooks

Recommended Posts

jennajonesdesign

Hello! I am adding a stock chart to the header. I would like it to go where the social icons are (I am using PlatformPro). I have had no problem embedding the charts using hooks. The only problem is that instead of staying to the right of the branding it keeps moving to a second line. I do not have this problem if I insert a static image in the same place. It is just when I embed the chart. Is there some sort of alignment code I need to add? Here is the link: jennajonespreview4.info Thanks! Jenna

Share this post


Link to post
Share on other sites
Rob
Jenna, Can you provide me with the names you applied to each stock chart (if there are more than one)?

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Rob
On my site, I created a div for my leaderboard ad, with a div called "leaderboard" built into the hook. I then applied, via Custom Code / CSS Rules this [code]div.leaderboard {float: right;}[/code] which ensured that the ad floats to the right in the header. We simply need the name of your div and change "leaderboard" for that name.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
jennajonesdesign
Thank you so much for your response! I do not know a lot of code. I understand what you are saying, but I am not exactly sure how to create a div for my header. Below is the code that I have in the Base Theme under functions.php. On a different website I was able to put a video in that same spot using the same code with no problems. I am not sure what the difference is. (refugefoundation.org). In the code below you can see I put three things there. The first one goes after the logo like it is supposed to. It is just the charts that keep moving down. (I just left the action name "add_icons_to _branding" even though it is actually the charts). add_action('pagelines_before_branding_icons', 'add_icons_to_branding'); function add_icons_to_branding(){ ?>

Share this post


Link to post
Share on other sites
Rob
This comes from the child theme hooks section of our docs: [code]// add_action('hook_name','function name'); add_action('pagelines_branding_icons_end', 'add_icons_to_branding'); // function name function add_icons_to_branding(){ // what the function does??“in this case adds a stumbleupon icon to the header of your theme. The class referenced in the link can be seen in the style.css // and is the image from the CSS is placed in the images folder ?>[/code] The div is created with this part... "add_icons_to_branding" and you'll see that twice in the code I posted above. You have to ensure that code is the same for each "div" that's created. In the case of my leaderboard, Platform automatically creates [code]
[/code] to place the ad. My code replaced "add_icons_to_branding" with "google_leaderboard_ad" that made a div called "leaderboard" which allowed me to use the code in my previous posting here showing the leaderboard div floating right. I'd suggest reviewing this and watching the video several times. (I had to and it was worth it. Play and stop for each step... it would help.http://www.pagelines.com/docs/base-child-theme

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
jennajonesdesign
Yeah if you look at the code I pasted above that is exactly what I did. I just left the div name what it was in the example "add_icons_to_branding" as it doesn't really matter what you name it. I have been using the hooks as described in this video with no problem. Following the steps in the video everything shows up where it is supposed to EXCEPT the charts. If I use the same exact code but embed a JPG it is right aligned. It is just something about the charts that won't align to the right.

Share this post


Link to post
Share on other sites
Rob
Jenna, I think the problem is that the piece of code you left there has specific meaning inside other parts of code. The instructions say to change it for a reason. I suspect that if you did change it and set the proper CSS to match what you changed, your alignment would be proper.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
jennajonesdesign
Thanks guys - I did try changing the name on that piece of code and it did not fix things. My client was happy to let me just put it somewhere else. Like I said before it was only a problem with the stock chart and not anything else that I tried to put there. You guys are probably right that it is a css problem. I am just going to move on instead of spending more time trouble shooting. I appreciate your insight.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×