Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

Adding PHP to single comments


  #1  
Old Aug 2, 2013, 04:37 PM
nevermoor
 
12 posts · Aug 2013
Hello,

First, thanks for the new theme. I'm excited to give it a whirl.

The one problem I have is that I have a bit of PHP work I need to do for each comment, like so:

Use PHP to set variables

Print top of comment
Print variable set by PHP
Print body of comment
Print variable set by PHP
Print bottom of comment

I know I can't use PHP directly in the Montezuma options box, but I can't for the life of me figure out where to put it to achieve this.
  #2  
Old Aug 2, 2013, 06:25 PM
juggledad's Avatar
juggledad
 
23,667 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You will have to add a dynamic sidebar ( should be called a dynamic widget area) where you want to put in the php. Then use a php plugin like exec-php and add your php to a text widget you put in the new widget area you created.
  #3  
Old Aug 3, 2013, 12:15 AM
nevermoor
 
12 posts · Aug 2013
I'm not quite sure I follow. There isn't any way to create a php file on the server that will just make the comments display the way I want? This seems like a lot of steps (and exec-php is 4.5 years old, so I suspect it isn't perfectly compatible with newer WP installs).
  #4  
Old Aug 3, 2013, 02:53 AM
juggledad's Avatar
juggledad
 
23,667 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Quote:
isn't any way to create a php file on the server that will just make the comments display the way I want?
could be, give it a try
Quote:
This seems like a lot of steps (and exec-php is 4.5 years old, so I suspect it isn't perfectly compatible with newer WP installs).
it is the way I've added extra php to the virtual templates and I use exec-php all the time. I suspect it hasn't been updated because there is nothing to update, it is just doing an 'eval()' on the code you enter.
  #5  
Old Aug 3, 2013, 02:45 PM
nevermoor
 
12 posts · Aug 2013
Thanks.

I can feel myself being dense, but I just can't seem to figure out where anything lives. For example, say I wanted to add another option to the comment quicktag buttons (which are pretty, and a good start). I can't figure out where the file is that allows me to expand on the list provided.

Similarly, if I did want to make a non-virtual subtemplate for individual comment displays, I have no idea where that code goes. I'm going to try to work my head around your solution, and I really like a lot of the features and design in this theme. I'm just having trouble digesting it, I guess.
  #6  
Old Aug 3, 2013, 10:18 PM
nevermoor
 
12 posts · Aug 2013
So I solved my initial problem by adding functions to the whitelist and then defining them outside the theme. Seems to be the cleanest way since it preserves the web-editable virtual subtemplate.

Next up is the quicktags question.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Adsense code below Title in Single Posts mkellam Center area post/pages 3 May 9, 2011 04:01 PM
Adding image to single front page jorgfoto Center area post/pages 0 Aug 30, 2010 02:08 PM
[SOLVED] Changing font size in single post, adding it to text widget glennvogelsang Center area post/pages 2 Jul 30, 2010 11:29 PM
How to avoid comments appear open in single posts? ahc Comments, trackbacks & pings 2 Dec 29, 2009 06:48 PM


All times are GMT -6. The time now is 12:57 PM.


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