Support Forum

How to write text at the bottom of the forum page

GI Giovanna
Giovanna
Member

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

12 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

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.

YS Yellow Swordfish
Yellow Swordfish
Member

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?

GI Giovanna
Giovanna
Member

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!

MP Mr Papa
Mr Papa
Member

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';  
}
GI Giovanna
Giovanna
Member

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!

YS Yellow Swordfish
Yellow Swordfish
Member

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.

GI Giovanna
Giovanna
Member

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…

GI Giovanna
Giovanna
Member

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 😉

MP Mr Papa
Mr Papa
Member

shortcodes do work… but you have to meet the wp requirements…  they are not html…  so something like this

echo do_shortcode( '' );

of course, replace gallery with your shortcode and any attributes...
GI Giovanna
Giovanna
Member

Yes! I managed to put a shortcode (the one with the chat). Now I have taken it off as for now I leave it above the forum but it’s good to know how to do it. Of course it’s just a shame that has to be done by fiddling the code. I guess I need to learn how to make a child theme.
Thanks a lot!

MP Mr Papa
Mr Papa
Member

well, ‘hooking’ in is what wp is all about! 😉

yes, in a child theme, you could just put same ‘code’ right below the forum footer…  thats actually where the hook is called from now…