i tried to write a code to override the main template – and i make the script run as a plugin
here what i did
<?php
/*
Plugin Name: PAGTEM
Plugin URI: https://www.example.com
Version: 0.0.1
Author: NULL
Author URI: https://www.example.com
*/
class PageTemplate {
/**
* A reference to an instance of this class.
*/
private static $instance;
/**
* The array of templates that this plugin tracks.
*/
protected $templates;
/**
* Returns an instance of this class.
*/
public static function get_instance() {
if ( null == self::$instance ) {
self::$instance = new PageTemplate();
}
return self::$instance;
}
/**
* Initializes the plugin by setting filters and administration functions.
*/
private function __construct() {
$this->templates = array();
// Add a filter to the attributes metabox to inject template into the cache.
if ( version_compare( floatval( get_bloginfo( 'version' ) ), '4.7', '<' ) ) {
// 4.6 and older
add_filter(
'page_attributes_dropdown_pages_args',
array( $this, 'register_project_templates' )
);
} else {
add_filter(
'theme_page_templates', array( $this, 'add_new_template' )
);
}
// Add a filter to the save post to inject out template into the page cache
add_filter(
'wp_insert_post_data',
array( $this, 'register_project_templates' )
);
// template assigned and return it's path
add_filter(
'template_include',
array( $this, 'view_project_template')
);
$this->templates = array(
'FullC.php' => 'Full Canvas',
// this file exist in the same folder as the plugin like that
/* Plugin Template ( Folder ) ========
|
|
|
Index.php (file)
FullC.php (file)
================ */
);
}
/**
* Adds template to the page dropdown for v4.7+
*
*/
public function add_new_template( $posts_templates ) {
$posts_templates = array_merge( $posts_templates, $this->templates );
return $posts_templates;
}
/**
* Adds our template to the pages cache in order to trick WordPress
* into thinking the template file exists where it doens't really exist.
*/
public function register_project_templates( $atts ) {
// Create the key used for the themes cache
$cache_key = 'page_templates-' . md5( get_theme_root() . '/' . get_stylesheet() );
// Retrieve the cache list.
// If it doesn't exist, or it's empty prepare an array
$templates = wp_get_theme()->get_page_templates();
if ( empty( $templates ) ) {
$templates = array();
}
// New cache, therefore remove the old one
wp_cache_delete( $cache_key , 'themes');
$templates = array_merge( $templates, $this->templates );
// Add the modified cache to allow WordPress to pick it up for listing
// available templates
wp_cache_add( $cache_key, $templates, 'themes', 1800 );
return $atts;
}
/**
* Checks if the template is assigned to the page
*/
public function view_project_template( $template ) {
// Return the search template if we're searching (instead of the template for the first result)
if ( is_search() ) {
return $template;
}
global $post;
// Return template if post is empty
if ( ! $post ) {
return $template;
}
// Return default template
if ( ! isset( $this->templates[get_post_meta(
$post->ID, '_wp_page_template', true
)] ) ) {
return $template;
}
// Allows filtering of file path
$filepath = apply_filters( 'page_templater_plugin_dir_path', plugin_dir_path( __FILE__ ) );
$file = $filepath . get_post_meta(
$post->ID, '_wp_page_template', true
);
// check if the file exist first
if ( file_exists( $file ) ) {
return $file;
} else {
echo $file;
}
// Return template
return $template;
}
}
add_action( 'plugins_loaded', array( 'PageTemplate', 'get_instance' ) );
now if you go to
Pages > Edit xor Add New Page > Page Attributes > A New Section Called Templates > I Click On the Full Canvas > [UPDATED]
Nothing Changed (:
Why’s Is That – Is There’s Wrong With The Code Or The Buddypress V that i use ?
i use ==> Version 6.3.0 | By The BuddyPress Community
Hello, I’m currently using bbpress 2.6.6 and buddypress 7.1.0, (wordpress 5.6, php 7.4.12, theme is siteorigin-unwind 1.6.6), and experiencing this problem as mentioned here, (members of hidden groups not being able to see the topics of the sub-forum). I’m a newbie with the background code, though my private and public groups are working. I can see the fix 7443 in buddypress.js that was indicated then, but am wondering if other people still have a problem with this, and if so if there is another fix available. Thank you.
I have a boombox themed site where members can post photos or videos and these appear as tiles on main page.
Question is, if i import buddypress to expand the user experience abilities, members where post from buddypress can merge their activities to main page as post or they have to do double it? Can be bidirectional connection of posts?
I want to create a dedicated URL for a specific group type to be able to link to the groups in that category as a new directory.
My page is in german, so the general group directory is listed under:
myurl.com/gruppen/
I tried various things to see if I could filter by group type, like this:
myurl.com/gruppen/typen/Inspiration
myurl.com/gruppen/typ/Inspiration
myurl.com/groups/types/Inspiration
None worked, always got 404.
I have a custom code which sets the “per_page” option already to 50. It looks like:
add_filter('bp_after_has_groups_parse_args', 'wbcom_theme_alter_groups_parse_args');
function wbcom_theme_alter_groups_parse_args($options) {
if (bp_is_groups_directory()) {
$options['per_page'] = 50;
}
return $options;
}
It works.
And I found that there are a lot more options in class-bp-groups-group.php for BP_Groups_Group::get(), like ‘include’, ‘group_type’, ‘group_type_in’.. so I tried to extend my code from above by:
$options['group_type'] = 'Inspiration';
I also tried to use the group-id instead of the “slug”….
None worked…
I have a problem with buddy press, in that my client is saying they can not login using the usual buddy press button.
Please see video of issue
what i have tried so far:
Changed wordpress themes tp the 2019, an tested on another theme
Updated plugins
Turned off plugins
Im not aware of any custom code
I Have tried logging out (wordpress included), and then try to login
I am using BuddyPress as part of Woffice theme and trying to remove the ability for users to use weak passwords when they use the checkbox “Confirm use of weak password Check”. Third-party plugins do not work as I have disabled the WordPress profile page in favour of the one provided my woffice.
Any assistance will be appreciated. If possible just the ability to disable/hide the section would work
I’m uploading a large png as the cover image for a group and it seems to be reducing the size to 640px x 225px and then displaying it as 1160px x 225px making it blurry.
I’ve reported this to ThimPress who wrote the theme I’m using, StarKid, and they say the problem is with BuddyPress.
Since reporting the problem to ThimPress, the problem seems to have changed (not sure how) in that the image is now being displayed is 640px x 225px and it’s being stretched to 1160px x 1051px which is taking up too much space on the page and the image is blurry.
In addition, if I don’t upload an image I get a 1160px x 1051px blank space.
On another of my sites which uses a different theme I don’t get the option to upload a group cover image.
I have the same problem with you. When I press the messages tab in my profile nothing happens. The links are just like yours but they stop to members page/my page/messages/compose. This happens with every messages tab, and just like you, I have an empty page below that nav menu.
I am developing my own theme, but I have tested it with 3 different twenty themes and I have the same issue with the messages tab. All the other links are working except for messages.
I hope we get a solution with this.
If I find anything sooner, I will post again with my solution.
*I am using local by flywheel for the development
Problem
I’m working on a site with a custom theme. The members’ list says “All members 0” and lists no members, and, below the search box “Sorry, no members found”. What do I need to do to show the actual members?
——
Details
I’ve copied wp-content/plugins/bp-templates/bp-nouveau/buddypress to wp-content/themes/my-custom-theme/buddypress. I’ve added links to discussion boards, groups and a members list to the menu and populated the site with members data by using the Buddypress Detault Data plugin (and added a few extra users, and logged in as them).
If I insert the contents of buddypress/members/members-loop.php into the custom theme’s index.php, then the index.php shows me a listing of members (showing when the database says when they were last active). I am wondering if this means I need to set a path somewhere.
I am seeing the same behaviour if I use the “twenty seventeen” “twenty twenty” and “twenty twentyone” themes. This is using WordPress 5.6 and Buddypress 7.1.0. I can’t provide a URL as it’s currently a development version on my NetBSD (unix) laptop.
Well, the size of the image is back to 1160px x 225px today??
Twenty Twenty
The image is 640px x 225px being displayed as 580px x 225px
StarKid
The image is 640px x 225px being displayed as 1160px x 225px
They both look blurry compared to the image that I uploaded – something to do with image optimisation? It hasn’t happened elsewhere on the website.
(I realise that it’s a huge file, when I was testing I tried making the image big in order to fix the problem).
I guess this means that the problem is within the StarKid theme, not the BuddyPress plugin?
I have scoured Google, YouTube, and even this very forum for an answer but no one has been able to help me. I’ve even tried talking to Elegant Themes and they were of no help – blaming it on the plugin developers, even though they created the feature. Also, time is running out for me to incorporated this into the website, so I’m desperate. Plus, I KNOW I’m not the ONLY one in the world who has encountered this problem. I can’t be…
I’m using WordPress version 5.5.3 and BuddyPress version 7.1.0. I’m building a website for an online college using Divi (version 4.7.7, developed by Elegant Themes). Out of the box, Divi is compatible with BuddyPress, except when it comes to the Theme Builder.
I have a template I created using the Theme Builder that I associate for the pages generated by BuddyPress (User Groups, Members, Activity). On the theme, there’s a module called the Post Content Module which renders whatever content is entered in the page/post body field through the admin dashboard.
For whatever reason, it will not render the content from the BuddyPress generated pages, or allow the children of those pages (such as profiles) from rendering within the Post Content Module. If I turn the theme template off on those BuddyPress generated pages, the content shows up. But, it’s out of theming with the rest of the website.
I have recorded a video that shows exactly what I’m talking about that can be looked at by clicking here.
Please, please, please can someone give me an answer and a fix for this issue. I’ve tried reaching out to Elegant Themes, the creator of Divi, and they were of absolutely no help at all.
I have tried changing the theme, but then the button disappears so i can’t test, I’m not aware of any custom code, the clients isn’t tech savy and won’t be able to tell us. I’ve been in contact with WP bakery’s support which is the page builder and they are saying that the issue is something to do with buddy press, how do i go about getting support from Buddy press ?
Use the following code in your bp-custom.php file to change it. You can read more on it here
—
Utilice lo siguiente en su archivo bp-custom.php para cambiarlo. Puedes leer más aquí:
It was just the problem.
The 2021 theme.
I had uninstall all plugins, even the “Hello World” and “Akismet” plugins.
What means that the conflict was only with the theme.
Thank You very much for your help.
i have registration and signUp issues in my site,http://finapress.com
am using Explicit reviews theme with buddypress plugin Version 7.1.0
Wordpress Current version: 5.6