Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   Embed PHP (http://forum.bytesforall.com/showthread.php?t=5170)

LostBrooklynGuy Jan 6, 2010 02:06 AM

Embed PHP
 
Hi,
I was wondering if there was a way to embed server side calls using PHP into the Atahualpa theme.
I was trying to embed them in the Add HTML/CSS inserts but nothing seemed to be working.

Wondering if this is at all possible.

Thank you.

juggledad Jan 6, 2010 10:08 AM

there is a plugin 'exec-php' (http://wordpress.org/extend/plugins/exec-php/) you might want to look at.

nathanael Mar 29, 2010 06:21 PM

Embed PHP or widget outside main layout
 
First, many many thanks to Juggledad and Flynn for your incredible dedication to this wonderful theme and the forum.

I am working on this site, The Bilingual Psychologist. I am running the latest versions of WP, Atahualpa and the WPML plugin (WP Multilingual language selector).

I would like to move the country flags and their description, from the right sidebar to the upper right hand side of the page, just outside the main layout i.e. to the right of the "Home" link and to the right of the drop shadow around the main layout.

The country flags and their description can be easily reproduced as is with the following PHP code:
Code:

<?php do_action('icl_language_selector'); ?>
I don't know how to code but I can fiddle around alright with ATO settings and copy-pasting code. To solve my problem, I have already tried the following:
(1) Creating a widget area (ATO>Sidebar & Widgets>Add new Widget Areas) outside the main layout and then using the Exec-Php plugin. Unfortunately it doesn't seem possible to define a widget area outside the main layout (which makes absolute sense :))
(2) Adding the above PHP code to "HTML inserts: body top" (ATO>Various content items/Add HTML/CSS inserts).

Solution (2) seems to be in the right direction to me. I tried inserting the following
Code:

<a style="float:right" href="http://www.thebilingualpsychologist.com">Test</a>
and I got a link on the top line, and more or less in the right area of the screen (hurray).

My question therefore:
- Is solution (2) the right way to go, and if so, is it possible to insert PHP code within HTML tags, if so which tags?
- If PHP code inserted within HTML tags works, apparently "float:right" moves everything all the way to the right. How to do I control how far right the elements go?
- If solution (2) is not the right way to go, any ideas to achieve what I'm looking for?

Thank you so much if you read this far.

Rashell Mar 30, 2010 12:12 PM

You can put a widget area outside the main content area. It just requires that you adjust the header.php file. I believe you want to put it right after
Code:

<div id="wrapper">
Rashell

nathanael Mar 30, 2010 05:24 PM

Rashell,

Thank you so much for answering so quickly. I made a lot of progress thanks to you. There are a few things I didn't quite figure out though.

I applied your directions exactly (creating widgets areas, using a div in the widget area, adding some CSS styling). However these header widget areas seem to be in the header area (still within the borders of the main layout), whereas I'm trying to put my language selector widget outside the main layout (to the right of the header).

Instead of creating widget areas in the header, I opted for your other solution, changing header.php as you suggested, embedding the php code for the language selector in a div tag, after div wrapper. It almost works.

As you can see if you go to TheBilingualPsychologist.com, the layout is as I want it, but the language switcher is too close to the main layout border and covers the drop shadow.

Also, with my current resolution, I now have to scroll right/left to see the entire page.

If you have any other ideas, please don't hesitate. Thank you so much for bringing me this far though. I couldn't believe my eyes when I methodically applied what you told me to do.


All times are GMT -6. The time now is 05:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.