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 » Plugins & Atahualpa »

Why no single.php


  #1  
Old Mar 30, 2009, 08:25 PM
DavePorter
 
130 posts · Mar 2009
Perth, Western Australia
Hi Everyone,

I'm learning to program plugins via the Packt Book 'Wordpress Plugin Development'.

The first project is a simple Digg It plugin which works fine.

But it want me to edit the single.php file to add the function
( Just as a first step, then it goes on to make it global )

But I notice there is no single.php in Atahualpa.

I wondered why this is ? Can I assume that the functionality of single.php is in the index.php file ?

regards, Dave Porter
  #2  
Old Mar 30, 2009, 09:05 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Yes, in Atahualpa everything is done by index.php.

You can make a copy of index.php as single.php (or page.php, category.php etc...)

Or put your code into index.php with a conditional statement:

PHP Code:
<?php if ( is_single() ) { ?>
YOUR CODE HERE
<?php ?>
  #3  
Old Mar 30, 2009, 10:45 PM
DavePorter
 
130 posts · Mar 2009
Perth, Western Australia
Thanks Flynn - appreciate that
Dave
  #4  
Old Mar 24, 2010, 07:46 PM
GlobalNeat
 
21 posts · Dec 2009
Australia
Hi Flynn

I am using the instructions within this thread to setup and use the 'Related Posts by Category' plugin.

This code in red is what I have inserted into index.php, and also where I have placed it (not sure where in index.php to put it):

<?php /* get all options: */
include (TEMPLATEPATH . '/functions/bfa_get_options.php');
get_header(); ?>

<script type="text/javascript" src="http://forms.aweber.com/form/90/758182490.js"></script>

<?php if ( is_single() ) { ?>
`
<ul>
<?php do_action(
'related_posts_by_category',
array(
'orderby' => 'RAND',
'order' => 'DESC',
'limit' => 5,
'echo' => true,
'before' => '<li>',
'inside' => '&raquo; ',
'outside' => '',
'after' => '</li>',
'rel' => 'nofollow',
'type' => 'post',
'image' => 'thumbnail',
'message' => 'No matches'
)
) ?>
</ul>
`
<?php } ?>


<?php /* If there are any posts: */
if (have_posts()) : $bfa_ata['postcount'] == 0; /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>

It isn't showing any 'related posts' in any posts. What do I need to do to get this to work?

Any help is much appreciated.

Thanks
Neat
  #5  
Old Apr 3, 2010, 05:13 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
why are you surrounding your code witha set of quotes??
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Apr 23, 2010, 06:45 PM
btrandolph's Avatar
btrandolph
 
9 posts · Apr 2010
Quote:
Originally Posted by Flynn
Yes, in Atahualpa everything is done by index.php.

You can make a copy of index.php as single.php (or page.php, category.php etc...)

Or put your code into index.php with a conditional statement:

PHP Code:
<?php if ( is_single() ) { ?>
YOUR CODE HERE
<?php ?>
I am experiencing a related issue in attempting to add the new facebook "like" button to my posts. I inserted the code
<?php if ( is_single() ) { ?>
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo
urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;
show_faces=true&amp;width=450&amp;action=like&amp; colorscheme=light"
scrolling="no" frameborder="0" allowTransparency="true" style="border:none;
overflow:hidden; width:450px; height:60px"></iframe>
<?php } ?>
inside the loop section of index.php. the content appeared above the body, as seen here http://btrandolph.com/2010/04/go-jar...media-clients/. in addition, it appears only for my latest post. the link works as promised, it's just in the wrong place.

I tried moving the section to different pleces above the loop end in the index.php file. I also tried putting it into the body section in the HTML/CSS inserts area of the options screens. I then removed it from everywhere. however, it is still showing up in the one post!

I'd appreciate any suggestions.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
php in single post Haser Atahualpa 3 Wordpress theme 3 Dec 4, 2012 07:54 PM
php in footer.php - links to just show up on homepage chris Atahualpa 3 Wordpress theme 6 May 9, 2010 12:50 PM
make index.php be a "page" and blog postings go to different php page zhidoni Atahualpa 3 Wordpress theme 0 Jun 21, 2009 04:25 PM
[SOLVED] messed up header.php and footer.php monochrome Header configuration & styling 0 Jun 20, 2009 02:16 PM
How do i EDIT Single Post? sns Atahualpa 3 Wordpress theme 2 Mar 9, 2009 10:25 AM


All times are GMT -6. The time now is 09:50 AM.


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