Jump to content
Sign in to follow this  
edwelly

Need to add a snippet of .php code to a page but have no idea how

Recommended Posts

edwelly

Hello all. I am working on a project for a client and I need to be able to run a snippet of code in a specific page, but I am really struggling with finding a plugin to do this. I have one that works perfect but it is only for a widget and I need this to run in a page. In the past, I would have taken a specific template, renamed it and modified it to work, but it does not appear to be that simple with Platform Pro. Any suggestions on how to achieve this? The code is:

<?php do_action ('bp_profile_search_form'); ?>
This is allow searching of profiles within buddypress but at much greater detail. Thanks - Erik

Share this post


Link to post
Share on other sites
edwelly
http://communindiefilms.com/search-members/ Thanks for your help!

Share this post


Link to post
Share on other sites
Rob
Some questions: Is this related to Buddypress or bbPress? Have you visited your page, in HTML view and pasted this code? If that failed, did you try Shortcode Exec PHP. This would save the code allowing you to create a specific shortcode and dropping the shortcode on your page. Think of it in terms of old-fashioned PHP includes.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
edwelly
Related to buddypress [quote]Have you visited your page, in HTML view and pasted this code? [/quote] - Not sure I follow you on this one Tried that plugin and could not get it to work. I probably spent 3 hours on that plugin.

Share this post


Link to post
Share on other sites
Rob
Okay. Related to buddypress or bbpress - by that I meant do you have buddypress or bbpress installed on your site or have you ever had them installed? By "Have you visited your page, in HTML view and pasted this code?" I mean, Go into that page you showed us in edit mode, pasting that code you gave us earlier on the page in HTML view. In WP, when logged in as ADMIN, you go to Pages on the left, find the page in question, and Edit it. In the edit mode, you should see two tabs, One says HTML. That's the one you want. Paste the code above and see if it works after saving the page and viewing it in your browsers. Shortcode Exec PHP is pretty easy to handle. Just add a name to a shortcode field, similar to where it says hello... and add your code in the edit box below. Save it, then apply the shortcode on a page.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
edwelly
rangelone - OK, I must have had mu dumb hat on earlier. Sorry about that. When you said HTML I totally misunderstood where you were going with that. I went back and worked with Shortcode Exec PHP again and figured out what I was doing wrong. It is working PERFECTLY now!!! Thanks. Please mark as resolved.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×