Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   How do I use the ATO from a custom page template? (http://forum.bytesforall.com/showthread.php?t=18880)

azazure Nov 10, 2012 05:41 PM

How do I use the ATO from a custom page template?
 
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(); ?>

juggledad Nov 10, 2012 06:20 PM

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

azazure Nov 11, 2012 02:59 PM

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>";
?>

juggledad Nov 11, 2012 05:20 PM

Did you look at the theme option for styling tables? You can do a lot there


All times are GMT -6. The time now is 11:06 PM.

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