WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] problem with theme after wordpress updated (33 posts)

  1. anatspecht
    Member
    Posted 3 years ago #

    hi,
    i'm using the theme twenty ten in my site. after updating wordpress version to 3.1, the file page template - page.php changed and i can't find the following code line there:
    <h2 class="entry-title"><?php the_title(); ?></h2>
    any ideas?
    many thanks

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Try looking in loop-page.php.

  3. anatspecht
    Member
    Posted 3 years ago #

    i found it there, but it is not helping... the reason i need it is to place google adsense code after it. when i put it in the loop page it is not showing in the site

  4. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Try loop.php or loop-index.php?

  5. anatspecht
    Member
    Posted 3 years ago #

    i tried... if i'm placing the adsence adds there they are not showing..

  6. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Can you post a pastebin of these three files?

  7. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    (Also, you should seriously consider making your modifications in a Child Theme, rather than editing TwentyTen directly.)

  8. anatspecht
    Member
    Posted 3 years ago #

    sorry, but what is the child theme?

  9. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

  10. anatspecht
    Member
    Posted 3 years ago #

    ok, thanks.
    i'm not sure how to post a pastebin

  11. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

  12. anatspecht
    Member
    Posted 3 years ago #

    this is the page template

    http://pastebin.com/g9jzpnmu

  13. anatspecht
    Member
    Posted 3 years ago #

    and this is the loop page:

    http://pastebin.com/FcusiqU2

  14. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Need to see the loop-page.php template file (and any other loop.php or loop-*.php template files).

  15. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    and this is the loop page:

    http://pastebin.com/FcusiqU2

    I don't see where you've added your AdSense code?

  16. anatspecht
    Member
    Posted 3 years ago #

    here the loop page with the adsense code
    http://pastebin.com/UJf53dLy

    loop attachment: http://pastebin.com/EvcCk7L0

    loop singe: http://pastebin.com/pJfTAaJe

    loop.php: http://pastebin.com/x9L1Q780

  17. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    here the loop page with the adsense code
    http://pastebin.com/UJf53dLy

    What is the name of this template file? It doesn't appear to be "loop.php", "loop-index.php", "loop-page.php", or "loop-attachment.php".

  18. anatspecht
    Member
    Posted 3 years ago #

    it is loop-page.php

  19. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    And if you're viewing a Page, do you see the AdSense code?

  20. anatspecht
    Member
    Posted 3 years ago #

    no. that is the problem.
    normaly i have to add the adsense code to the file "page.php" but the line <h2 class="entry-title"><?php the_title(); ?></h2> that the code sould be below it, is not there.

  21. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Can you link to an example Page where the AdSense code fails to display?

  22. anatspecht
    Member
    Posted 3 years ago #

    you mean the loop.php?

  23. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    No, I mean a live Page, on your site.

  24. anatspecht
    Member
    Posted 3 years ago #

    ok, it should be in all pages on my site: http://the-dogs-world.info/ under the headline.

  25. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    You've put your AdSense code inside this conditional:

    <?php if ( is_front_page() ) { ?>
         <h2 class="entry-title"><?php the_title(); ?></h2>
    
    <!-- GOOGLE ADSENSE CODE WAS HERE -->
    
    <?php }

    So, the only place that would ever output is on a Static Page used as the Front Page.

    You need to move your code outside of this conditional.

    Also, if you want it to appear on blog posts, and not just on Pages, you'll need to copy the code into loop.php (for blog index pages), and also into loop-single.php (for single blog posts).

  26. anatspecht
    Member
    Posted 3 years ago #

    you mean after <?php } ?

    it is not showing it either

  27. anatspecht
    Member
    Posted 3 years ago #

    do you know why the line : <h2 class="entry-title"><?php the_title(); ?></h2>, is not in page.php anymore?

  28. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Well, if you put it inside an open PHP tag, yeah, it's probably not going to output...

  29. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    do you know why the line : <h2 class="entry-title"><?php the_title(); ?></h2>, is not in page.php anymore?

    Yes: because it was put into loop-page.php, to facilitate being over-ridden by Child Themes.

  30. anatspecht
    Member
    Posted 3 years ago #

    can you please show me where exactly to put it at the loop-page.php?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.