AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Solved] How to add a page template?

8 Posts
3 Users
1 Reactions
4,553 Views
Posts: 21
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@gamedevhq)
Eminent Member
Joined: 7 years ago
[#10290]

Hi, 

I really like how the pages load within the forum. I'd like to add a page template and add some helpful shortcodes my site uses. How can I go about doing this? 


7 Replies
Sofy
Posts: 5774
 Sofy
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@sofy)
Support Team
Joined: 8 years ago

@gamedevhq,

I don't follow you well. 

As far as I understand you'd like to Enable Shortcodes in Post Content, right? If so just navigate to Dashboard > Forums > Settings > Features admin page and set "Yes" value for the "Enable WordPress Shortcodes in Post Content" option.


Posts: 21
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@gamedevhq)
Eminent Member
Joined: 7 years ago

Hi @sofy

Sorry for the confusion. Basically, I'd like to load a page within the forum. Almost like a template page. 

A great example, is the Profile page that comes with WPForo. I'd like to create a new page that imbeds into this. 

Notice how this page is imbedded within the forum. 

 6459f8f3ea1

2 Replies
Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5774
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

ok @gamedevhq,

In the case of the profile page, you can use the following shortcode. e.g. loads ID=25 user profile page.

[wpforo item="profile" id="25"]

The wpForo Shortcodes can be found here: https://wpforo.com/docs/root/getting-started/forum-page/wpforo-shortcodes/


(@gamedevhq)
Joined: 7 years ago

Eminent Member
Posts: 21
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@sofy

I'm basically asking how I can go about adding a new tab with my own content. 

For example, I want to include the courses they have as a tab. So I would add to the nav bar: Courses

And then when they click it, it would display the courses available to them. I have a short code for it: [showcourses] 

I want it to imbed within the forum template page. Like the profile page. 

Does that make more sense?

Essentially, you have provided us with the following pages: 

Index forum, Profile, Activity, Account, Subscriptions. 

How can I add a new page to this?


Robert
Posts: 10716
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 2 months ago

@gamedevhq

How about the user ID? Is this ia general content or a user ID depended content? Is this the same for all users? If this is a static data you can create a static wpForo Page putting this code in your theme functions.php file:

function wpforo_page_show_courses( $template ){
if( $template == 'courses' ){
?>
<div class="wpforo-page wpforo-page-courses wpforo-text">
<?php echo do_shortcode('[showcourses]'); ?>
</div>
<?php
}
}
add_action( 'wpforo_page', 'wpforo_page_show_courses', 10 );

Then call this page with URL:

 https://example.com/community/?wpforo=page&view=courses 

You can put it in wpForo Menu, using "Custom Links" menu type in Dashboard > Appearance > Menus admin page. use the wpForo Navigation menu.


Posts: 21
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@gamedevhq)
Eminent Member
Joined: 7 years ago

damn your support is amazing. Worked Perfectly!!!

 

Out of curiosity, if i wanted to add a short code to extend something at the bottom of the profile page, could this be done?


1 Reply
Robert
Admin
(@robert)
Joined: 2 months ago

Support Team
Posts: 10716
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Thank you @gamedevhq,

You can customize any page in wpForo. The profile page can be customized as well. However you should use the plugin update safe way. All is described in documentation:

wpForo template customization: https://wpforo.com/docs/forum-themes/theme-customization/

wpForo template files: https://wpforo.com/docs/root/forum-themes/theme-files/

 

You should use profile-home.php file to add shortcode. For example, in profile-home.php file line 97 you can add your shortcode or something else. It'll be displayed right after the statistic boxes on profile home page:

 

 


Share: