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

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] Want to change the order of a layout section but can't find the right file to edit

3 Posts
2 Users
0 Reactions
1,367 Views
Posts: 47
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
(@golabs)
Trusted Member
Joined: 5 years ago
[#56285]

I'm working on customizing my forum experience based on the Threaded Layout and Extended Layout.

The category is set to Threaded Layout as I need the threaded setup on the post page.

That said, I'm using in my customization the topic.php and forum.php from the Extended Layout.

When I click through the pages I see:

  • the list with subforums (I added a title to it on the forum-sub.php)
  • followed by the head-bar
  • and then the list with topics.

Where do I need to look to be able to adjust that order to:

  • head-bar
  • the list with subforums
  • the list with topics
wpf screenshot
 wpf screenshot desired setup

2 Replies
Posts: 47
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
(@golabs)
Trusted Member
Joined: 5 years ago

As a temp solution I applied some JS but ideally I would do this with an overwrite of a file, so:

I'm still open for the suggestion which file to edit/override so I can get the prefered order without relying on JS.

/* temp solution to reorder towards: header - subforums list - topics */
document.addEventListener('DOMContentLoaded', function() {
    // select the parent container
    var contentDiv = document.querySelector('.wpforo-content');
    // select the elements to be rearranged
    var forumsDiv = document.querySelector('.wpf-subforums');
    var subforumSepDiv = document.querySelector('.wpf-subforum-sep');
    var headBarDiv = document.querySelector('.wpf-head-bar');

    // check if all elements exist
    if (contentDiv && headBarDiv && forumsDiv) {
        // move `wpf-head-bar` to the top
        contentDiv.insertBefore(headBarDiv, contentDiv.firstChild);
        // move `wpf-subforums` below `wpf-head-bar`, only if `headBarDiv.nextSibling` exists; otherwise, it appends at the end
        if (headBarDiv.nextSibling) {
            contentDiv.insertBefore(forumsDiv, headBarDiv.nextSibling);
        } else {
            contentDiv.appendChild(forumsDiv);
        }
    } else {
        // uncomment the line below in case you want to troubleshoot
        // console.log("One or more elements were not found.");
    }
});

1 Reply
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

@golabs

We're really sorry, but the forum customization is out of our free support.

We recommend purchasing a pro support and ask the pro-support team to customize the layouts: https://wpforo.com/pro-support/#plugin-support


Share: