HELP on wordpress site- need to put a php code in page

7 replies
Hi Warriors,

I've built a site utilizing wordpress and need some help figuring something out. I have an events calendar plugin that works great... only thing, I need to be able to display the sidebar code provided for it (that lists as many events as you want) in a page instead.

The sidebar is already full, and I want to put the code on the right hand side of the homepage.

This is what the code looks like:

<?php sidebarEventsList(3);?>

I've tried many different plugins that let you put PHP in a page or post and none of them have worked.

Any suggestions?

Thanks!!
Rebecca
#code #page #php #put #site #wordpress
  • Profile picture of the author Istvan Horvath
    Options:

    1. you can edit directly the sidebar.php file: download, open with Notepad, paste the code; save, upload back.
    2. use this widget: WordPress › PHP Code Widget WordPress Plugins

    (since you want php in sidebar no need to try out the php in posts/pages plugins )
    Signature

    {{ DiscussionBoard.errors[2199254].message }}
  • Profile picture of the author Dan C. Rinnert
    Edit the sidebar file in your theme to add the code manually.
    Signature

    Dan's content is irregularly read by handfuls of people. Join the elite few by reading his blog: dcrBlogs.com, following him on Twitter: dcrTweets.com or reading his fiction: dcrWrites.com but NOT by Clicking Here!

    Dan also writes content for hire, but you can't afford him anyway.
    {{ DiscussionBoard.errors[2199256].message }}
  • I don't want the code in the sidebar though. That's the issue I'm having. I need to be able to put it in the page. Look at my site to see... The code needs to be under "Upcoming Events"

    Eagle Literary Foundation

    Rebecca
    {{ DiscussionBoard.errors[2199325].message }}
  • Profile picture of the author Istvan Horvath
    The proverbial "aha"...

    Well, looked at the source code... and I always get lost when I see tables: I don't know how to work/design with tables

    Anyway, it would be possible to put a widget even in that table or whatever container is around your Events, if you know how to do it.

    Sorry for the confusion (most people want the events in their sidebar). I've never used any of those PHP in post/Page things.

    A question: do you have a specific (Page) template that displays your homepage? If yes, put all your code floated right in the post area/div and it should work.
    Signature

    {{ DiscussionBoard.errors[2199760].message }}
  • Profile picture of the author Mike Adams
    If you save the php code while it is in HTML mode. You may have to: use http://wordpress.org/extend/plugins/exec-php/

    IMPORTANT: If you switch from HTML to VISUAL then wordpress will break the php code, but if you leave it in HTML mode and save it then the PHP should work fine.
    Signature
    P.S. If you found my post useful, please click the "Thanks" button below...
    {{ DiscussionBoard.errors[2200159].message }}
    • Profile picture of the author manwalksintoabar
      Hi RebeccaLynn,

      I will take a shot at it. I am not sure if this is what you are looking for but If you are you trying to include your PHP code below "Upcoming Events:", see the RED code below.

      Again, I don't know if you need more code with the PHP but this is where it goes.

      If you look at the source code of your page in Chrome, below are lines 88 - 95.

      Code:
      <div align="right"> 
      <table border="4" width="94%" id="table3" cellspacing="0" bgcolor="#FFFFCC" bordercolor="#000000"> 
      <tr> 
      <td> 
      <p align="center"><b><font size="5" color="#CC0000">Upcoming Events:</font></b><br /></td> 
      </tr> 
      
      <tr>
      <td>
      <?php sidebarEventsList(3);?>
      </td>
      </tr>
      </table> 
      </div>
      Signature

      Landing pages/graphic design [1] [2] [3] [4]

      {{ DiscussionBoard.errors[2200270].message }}

Trending Topics