Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
How to write text at the bottom of the forum page
Avatar
Giovanna
Nijmegen - NL
Member
sp_UserOfflineSmall Offline
Jun 5, 2015 - 3:27 am

Before I put my hands into the code and make real damage... how should I do things properly in order to add some text at the bottom of the page of the forum? If I insert anything in the page it is shown at the beginning...
Thanks and good day everybody 😉
Giovanna

My forum (in Italian) is: MsPforum

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 5, 2015 - 4:14 am

Now that IS an interesting question and not one we have ever been asked before. And at the moment I can not answer it either. I will need to come back to you on this as I need to give it some thought first.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Giovanna
Nijmegen - NL
Member
sp_UserOfflineSmall Offline
Jun 5, 2015 - 4:17 am

Take your time, I am in no hurry! 

My forum (in Italian) is: MsPforum

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 5, 2015 - 6:43 am

May I ask what sort of content you want to display below the forum but on the same page? Is it just simokle text? Or images?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Giovanna
Nijmegen - NL
Member
sp_UserOfflineSmall Offline
Jun 5, 2015 - 7:53 am

Well I am not sure yet but I wanted to have some text/images for sure to allow a better google indexing (I have a very sad orange traffic light from the Yoast plugin at the moment!). Then I thought that I may move the chat down below which is a shortcode to a plugin, within another shortcode for the accordion.
As you can see I am not sure, it was a "preventive" question!

My forum (in Italian) is: MsPforum

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 5, 2015 - 1:32 pm

there is a hook that allows you to do this...  something like this in your spFunctions.php file of your sp theme:

add_action('sph_after_template_processing', 'my_page');
function my_page() {
    echo 'this is what I want to say';  
}
Avatar
Giovanna
Nijmegen - NL
Member
sp_UserOfflineSmall Offline
Jun 5, 2015 - 2:42 pm

Oh thanks, that works! But if I wanted to add more complex things such as shortcodes and images? Can you point to me some place where I can understand how the "echo" command line works? I can read php  and fiddle with code but I am not a php programmer, so I am not too sure what else I can do in that function! There's no hurry to answer, thanks!

My forum (in Italian) is: MsPforum

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 5, 2015 - 3:04 pm

If you know HTML better than PHP then you can construct HTML instead by closing the php tag and opening it again at he end of the function. Like this:

add_action('sph_after_template_processing', 'my_page');
function my_page() {
?>
    HTML here...
<?php
}

that will work. I would quite like to support this a little better though so I am pondering the issue. But that will take some time.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Giovanna
Nijmegen - NL
Member
sp_UserOfflineSmall Offline
Jun 5, 2015 - 3:34 pm

ohh I knew there was a way 😀 So I managed to get an image and the link to the recipe... me happy! Now I try the shortcode...

My forum (in Italian) is: MsPforum

Avatar
Giovanna
Nijmegen - NL
Member
sp_UserOfflineSmall Offline
Jun 5, 2015 - 3:55 pm

Ok: shortcode does not work, which I expected, but simple html does. You can check the bottom of my forum page (link in my signature), I managed to put link and image from my blog 😉

My forum (in Italian) is: MsPforum

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17344
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10117
Posts: 79600