Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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?


  #1  
Old Nov 10, 2012, 05:41 PM
azazure
 
25 posts · Jan 2011
Gilbert, AZ
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(); ?>
  #2  
Old Nov 10, 2012, 06:20 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
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
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Did you look at the theme option for styling tables? You can do a lot there
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
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 06:17 AM.


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