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 »

[SOLVED] Posting Static content for my Front Page


  #1  
Old Dec 8, 2009, 01:54 PM
supergper
 
3 posts · Dec 2009
After <?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?> in the LOOP, I posted

PHP Code:
<?php if (is_front_page(){ ?> 

<?php

//declare the variables
$database='mydb';
$dbserver='myhost';
$user='myuser';
$password='mypass';

//create SQL connection
mysql_connect($dbserver,$user,$password);
@
mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM $database.companies where support='Support' order by support desc";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

?>

<html>
    <head>    
        <link rel="stylesheet" href="./css/custom/style.css" type="text/css" media="print, projection, screen" />
        <link rel="stylesheet" href="./css/jquery.fancybox.css" type="text/css" media="screen" />
        <script type="text/javascript" src="./js/jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="./js/jquery.fancybox.js"></script> 
        <script type="text/javascript" src="./js/jquery.tablesorter.js"></script> 
        <script type="text/javascript" src="./js/sorter.js"></script>
        <script type="text/javascript" src="./js/jquery.cookie.js"></script>        
            <script type="text/javascript" src="./js/jquery.tablefilter.js"></script>
            <script type="text/javascript" src="./js/filter.js"></script>            
           <script type="text/javascript">
            $(document).ready(function() {
                $("a.zoom").fancybox();

                $("a.non-support").fancybox({
                    'overlayOpacity'    :    0.7,
                    'overlayColor'        :    '#000',
                    'frameWidth'        :    900,
                    'frameHeight'        :    600,
                    'hideOnContentClick':     false            
                });

                $("a.submit").fancybox({                    
                    'overlayOpacity'    :    0.7,
                    'overlayColor'        :     '#000',                
                    'padding'            :     '2',
                    'hideOnContentClick':     false      
                });
            });
        </script>        
    </head>
    <body>
          <table border="0">                     
        <!-- Table for the results -->
        
            <tr>
                <td valign="top">
        <table class="tablesorter" id="companies" border="0" cellspacing="1" cellpadding="0">
            <thead>
                <tr>
                    <th><font face="Arial, Helvetica, sans-serif">Business</font></th>
                    <th filter-type='ddl'><font face="Arial, Helvetica, sans-serif">City</font></th>
                    <th filter-type='ddl'><font face="Arial, Helvetica, sans-serif">State</font></th>
                    <th><font face="Arial, Helvetica, sans-serif">Address</font></th>
                    <th><font face="Arial, Helvetica, sans-serif">Website</font></th>
                    <th filter-type='ddl'><font face="Arial, Helvetica, sans-serif">Category</font></th>
                    <th><font face="Arial, Helvetica, sans-serif">Support&nbsp;&nbsp;</font></th>
                </tr>
            </thead>
            <tbody>
                <?php
                $i
=0;
                while (
$i $num) {
                
$business=mysql_result($result,$i,"business");
                
$city=mysql_result($result,$i,"city");
                
$state=mysql_result($result,$i,"state");
                
$address=mysql_result($result,$i,"address");
                
$website=mysql_result($result,$i,"website");
                
$category=mysql_result($result,$i,"category");
                
$support=mysql_result($result,$i,"support");
                
?>

                <tr>                    
                    <td><font face="Arial, Helvetica, sans-serif"><b><?php echo $business?></b></font></td>
                    <td><font face="Arial, Helvetica, sans-serif"><?php echo $city?></font></td>
                    <td><font face="Arial, Helvetica, sans-serif"><?php echo $state?></font></td>
                    <td><font face="Arial, Helvetica, sans-serif"><?php echo $address?></font></td>
                    <td><font face="Arial, Helvetica, sans-serif"><a href="http://<?php echo $website;?>" target="_blank"><? echo $website?></a></font></td>
                    <td><font face="Arial, Helvetica, sans-serif"><?php echo $category?></font></td>
                    <td><font face="Arial, Helvetica, sans-serif"><b><?php echo $support?></b></font></td>
                </tr>

                <?php
                $i
++;
                }
                
?>
            </tbody>
        <?php
        
echo "</table>";
        
?>    
            </td>            
        </tr>        
        
    </table>
        <br>        
    
    </body>
</html>

<?php ?>
However, it's not working. It just gives me a not found error (Gives me the 404 info). Am I doing something wrong? This same php pages works fine if it's a standalone php page. Any info would be greatly appreciated.

Last edited by supergper; Dec 10, 2009 at 05:18 AM.
  #2  
Old Dec 10, 2009, 05:21 AM
supergper
 
3 posts · Dec 2009
I'm using WP 2.8.6 and Atahualpa 3.4.4

Is there a better option of getting this info in the center column on my front page? I tired to put a text widget in the center column, but it won't handle the database query.

Any help?
  #3  
Old Dec 10, 2009, 06:38 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
When you put it in the text widget did you have the exec-php plugin so the php would run?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #4  
Old Dec 10, 2009, 07:37 AM
supergper
 
3 posts · Dec 2009
Quote:
Originally Posted by juggledad
When you put it in the text widget did you have the exec-php plugin so the php would run?
Yes I did.

However, I found another way of doing what I was trying to accomplish. I created a template for the "static" content above and then assigned my Home page to that template. It's now working exactly how I had been hoping.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do I Add Recent Post To A Static Front Page??? Sunmarket Excerpts, Read more, Pagination 2 Nov 23, 2009 08:56 PM
Removing page title from static front page in 3.41 or 3.42? whomadewho New Versions, & Updating 2 Jul 13, 2009 11:54 PM
Front Page - Main content code murdoco Header configuration & styling 1 Jun 30, 2009 06:56 AM
Static Front Page, blog another page? sherimcgregor Atahualpa 3 Wordpress theme 2 Mar 22, 2009 02:16 PM
Inserting Excerpts into Static Front Page Mac Excerpts, Read more, Pagination 0 Feb 28, 2009 05:30 AM


All times are GMT -6. The time now is 10:54 AM.


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