Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

How do I use the ATO from a custom page template?


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Nov 10, 2012, 05:41 PM
azazure
 
25 posts · Jan 2011
Gilbert, AZ
Hi. This is my first page template and I'm having trouble getting it to use Atahualpa styling for the table created for the query results. I have been researching and found that all of this is in the wp_options file, but I don't know how to call it. The header and footer display correctly according to the theme settings, but not the center section. Here is my code, any help would be greatly appreciated. (new to php)

<?php
/*
Template Name: example
*/
list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
get_header();
extract($bfa_ata);
?>

<?php
if (is_user_logged_in()):

global $wpdb;
$Test = $wpdb->get_results("SELECT * FROM Test;");

echo "<table>";
foreach($Test as $Test)
{
echo "<tr>";
echo "<td>".$Test->ID_Number."</td>";
echo "<td>".$Test->First_Name."</td>";
echo "<td>".$Test->Last_Name."</td>";
echo "<td>".$Test->Date_Issued."</td>";
echo "</tr>";
}
echo "</table>";

echo "</table>";
else:
echo "Sorry, only registered users can view this information";
endif;
?>

<?php get_footer(); ?>
  #2  
Old Nov 10, 2012, 06:20 PM
juggledad's Avatar
juggledad
 
22,186 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
If you want it to use the atahualpa table styling then you have to use the same CSS selectors.

Put a table in a post and then look at the CSS it uses and use the same in your template
__________________
Give a person a solution, you fix one issue, teach a person how to solve their problem you enable them forever.
Juggledad | Forum Moderator/Support

Last edited by juggledad; Nov 11, 2012 at 05:19 PM.
  #3  
Old Nov 11, 2012, 02:59 PM
azazure
 
25 posts · Jan 2011
Gilbert, AZ
Thank you so much for pointing me in the right direction. It's where php, css and html all converge, but I think I'm getting it. My table in the page template now matches except that I can't figure out how to make the alternating row background colors change. Here is my internal stylesheet if you could comment I would appreciate.

<?php
echo "<style>";
echo "table
{
border-collapse: collapse;
margin: 10px 0;
}";
echo "table caption {
background: none repeat scroll 0 0 #EEEEEE;
border: medium none #999999;
color: #666666;
margin: 0 auto;
padding: 4px 8px;
width: auto;
}";
echo "table th {
background: none repeat scroll 0 0 #888888;
border: 1px solid #FFFFFF;
color: #FFFFFF;
font-size: 90%;
font-weight: bold;
padding: 4px 8px;
text-align: left;
}";
echo "table td
{
background-color: #FFFFFF;
border-bottom: 1px solid #DDDDDD;
padding: 4px 8px;
text-align: left;
}";
echo "table tfoot td
{
}";
echo "table tr.alt td
{
background: none repeat scroll 0 0 #F4F4F4;
}";
echo "table tr.over td
{
background: none repeat scroll 0 0 #E2E2E2;
}";
echo "</style>";
?>
  #4  
Old Nov 11, 2012, 05:20 PM
juggledad's Avatar
juggledad
 
22,186 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
Did you look at the theme option for styling tables? You can do a lot there
__________________
Give a person a solution, you fix one issue, teach a person how to solve their problem you enable them forever.
Juggledad | Forum Moderator/Support

Bookmarks

Tags
custom page template, table styling, wp_option

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: a 'Custom Query' PAGE template juggledad Atahualpa 3 Wordpress theme 1 Jul 15, 2010 06:07 PM


All times are GMT -6. The time now is 03:56 PM.


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