bcnbuda
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Clean Retina] How to embed videos?when I use [embed]…URL…[/embed] it works
Forum: Fixing WordPress
In reply to: "What's new" text area behavior variation on static home pageClosing. Duplicate. Figured out this is more appropriate to buddypress forum. My mistake. Newbie
Closing. Moving to buddypress.org form. My mistake.
Forum: Fixing WordPress
In reply to: vexatious Read More links/lack thereofupdated Ticket #3715 – [Read more] doesn’t appear for long group forum activity posts unlike regular activity updates
Forum: Fixing WordPress
In reply to: vexatious Read More links/lack thereofHugo,
valid point. I’m a newbie and just trying to be helpful. Still learning how to use this forum. This particular issue has been very frustrating for a lot of people. So I wanted those people to have the benefit of what I have learned not realizing it might cause a problem.
I have posted several other technical questions on this forum that have so far gone unresponded to so it is not at all clear to me yet of what value this forum is. Perhaps I’m not formulating my questions correctly. I did have one problem that I posted in much the same way and got a very quick response and solution but since then nada. I was beginning to wonder if perhaps I was posting in the wrong place.
It is interesting that for this particular issue my first and only response was over a procedural matter rather than a technical suggestion. I will try to do better and I will investigate using trac. I DO appreciate all the efforts of the developers and users of the community.
Would you have any insights for me on the other questions I have posted about?
Forum: Fixing WordPress
In reply to: vexatious Read More links/lack thereofEureka!
I think I’ve finally figured this out, a partial and reasonable solution anyway, and documenting it here for all the others who I have seen struggling with this problem for literally months or years in some cases. I’m sure there may be a more elegant way of handling it and perhaps someone can suggest a way that will survive upgrades and without editing core files (child theme changes?) but this “brute force” method works for the time being. This takes some explaining so hang in there with me.
Part of the problem is that the behavior is handled in different files depending upon whether you’re talking about updates (like What’s new type of updates and their replies) or Group forum topics and their replies. The group forum topics end up in the activity stream with the dreaded […] and do not expand which is a major bummer.
After many hours of tril and error and research I have found that the size of the excerpt for group forum topics is controlled by
/public_html/wp-content/plugins/buddypress/bp-core/bp-core-template.php beginning in the bp_create_excerpt function and the relevant parts that need to be changed are $length which has a default of 225 and array value for ‘ending’ which is “[…]” by default.In my case I made the length 3000 which is long enough for some pretty long topic posts and ending I made “Continues, click title” to give the user a hint that if the text is longer than 3000 characters and they want to read the rest they’ll need to click the title of the topic in order to so. Still sub-optimal but a lot better than […] which is inscrutable. A link to the topic would be better so it could just say continues and the user would click that
function bp_create_excerpt( $text, $length = 3000, $options = array() ) { // Backward compatibility. The third argument used to be a boolean $filter_shortcodes $filter_shortcodes_default = is_bool( $options ) ? $options : true; $defaults = array( 'ending' => __( ' [Continues, click title]', 'buddypress' ), 'exact' => false, 'html' => true, 'filter_shortcodes' => $filter_shortcodes_default );
Now you also need to know that the length of the excerpt that is displayed in the activity stream in the first place whether an update, group forum topics, etc defaults to ~358 characters. That is controlled in /public_html/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php and possibly also in /public_html/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php.
Snippets from both:
bp-activity-filters.php
$excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
bp-acivity-template.php
$latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 358 ) ) ) );
So by changing the 358 to a larger or smaller value you can change the “default” length of the “displayed” excerpt in the activity stream but the “actual” full excerpt (at least for group forum topics) is controlled by bp_create_excerpt in bp-core_template.php.
Since the group forum topic “actual” excerpts default to 225 characters as explained above which is less than 358 that is why you see the […] at the end of those excerpts by default. If you change the 358 above in bp-activity-filters.php to e.g.. 150, a value less than 225 then miraculously your group forum topics will have a “Read more” link but when you click the [Read more] link to expand the topic you will get at most 225 (150 + 75) characters and still the […]! That’s all you’ll ever be able to get. Once you change the $length discussed above to 3000 (or whatever), that is greater than 358 and so you will get the “displayed” excerpt of ~358 characters and a Read more link but the “actual” full excerpt will be up to 3000 characters long and when the user clicks the Read more link it will expand to it’s new maximum length of 3000, which in most cases will be the full text. More “breathing room” so to speak.
Now, it appears that these “actual” excerpts must be created at the time the group forum topic is created and stored in the database for later retrieval and display. So you cannot expect to make these changes and see them reflected in your older posts. It appears this will only take place for your new posts going forward. At least that seems to have been my experience as a group forum topic I had just created still had the […] and was only 225 and had the […]. After I made the above changes to bp-core-template.php my post was still the same. So I copied the text of the post and deleted the group forum topic post and re-created it. Voila! My topic text now had a “displayed” length of ~358, a [Read more] link AND when I clicked it the post expanded to its full “actual” length which was less than 3000 characters!
I’m not marking this as resolved because I’m hoping someone will come along and suggest a more elegant solution which will survive upgrades.
Forum: Fixing WordPress
In reply to: vexatious Read More links/lack thereofFound something interesting – My group forum topic excerpts in the activity stream that end with the cursed […] and no Read More link are all right around 200 characters long, around 36 words. I found from much research that in /public_html/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php if I change the bp_activity_truncate_entry function at the following line from
$excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
to
$excerpt_length = apply_filters( 'bp_activity_excerpt_length', 150 );
then in my activity stream my group forum topic excerpts will now contain a …[Read more] link just like I want! It actually causes the excerpt to be expanded BUT it only expands as far as its previous length (about 200 characters or 36 words) before the above change and still ends with the […] which is useless, a cruel mirage.
So somewhere else the actual length of the excerpt that is being passed to the activity stream is being controlled and truncated to around 200 characters. If I could find where that is controlled I could lengthen it such that at least most of my excerpts could be expanded to their full length just like other updates (ie., non-group forum topics).
Thoughts on where to look for this?
Forum: Fixing WordPress
In reply to: vexatious Read More links/lack thereofOh, and here’s a link to the page that demonstrates the problem – https://www.virtualstatesofamerica.com/activity/
Forum: Themes and Templates
In reply to: child theme/custom header travailshmmm. ok, I’m obviously a noob but I added that snippet of code to my style.css and it didn’t do anything so maybe it would need to be elsewhere or maybe there is more to implementing it than that. If I change the template file wouldn’t that be lost if I later update the theme? If that is the case then a change to the CSS makes more sense if it can be accomplished using CSS alone.
Looking at style.css I see a section for
/* General Widget Styling */
just wondering why all widgets wouldn’t inherit their characteristics from this css. I see code like
.sidebar .widget li a { font-weight: bold; }
and
.sidebar .widget .current-cat > a { text-decoration: underline; }
followed by the section for widgettitle you cited above. Is “a” for the standard left and right sidebars and I need a “b” for my alternate sidebars?
Forum: Themes and Templates
In reply to: child theme/custom header travailsWPyogi…
thanks much. your tip got me on the right track.
Documenting a few thoughts here in case anyone else stumbles upon the same issue,
there was quite a bit of effort after switching to the child them to get everything put back together like I had for the parent theme:1) As you pointed out, all the theme options had to be restored to match my buddy theme options in Appearance>Theme Options, including my login page, logo image, etc., etc
2) My main navigation menu was missing from header, had to go to Appearance>Menus and set my Main Navigation as before and voila, menu returned
3) All of my former sidebar and Homepage widgets were inactive at the bottom of Appearance>Widgets and all of my sidebars were empty. I had to move all those inactive widgets back where they used to be in my standard and alternate sidebars. Otherwise on my pages all the sidebars had a bunch of default stuff
4) In the slider on my homepage I had to check to hide the titles for each slide as I had before, otherwise the titles appeared in a black box superimposed on the slide. So I had to restore all those to their former setting.I think that’s about it. It took me maybe 30 minutes to go through and find everything and correct them. All in all not too bad to enable the child theme and get on the road to customizing.
Only remaining issue and I’m not certain this is related to changing to the child theme but in my alternate sidebars that I created for my homepage the titles of all the widgets are huge and I’d like to make those fonts the same size as in the standard left and right sidebars. Where would that be accomplished? That may have already been that way and I may not have noticed until now.
I’m marking this as resolved and really appreciate the help.
Forum: Themes and Templates
In reply to: child theme/custom header travailsAh ha! But that would be a one time fix up kind of thing? So I can examine my theme options for buddy (my parent theme), switch themes, re-implement the theme options for my child theme, and I should be back to “normal”?
perhaps that should mentioned somewhere in the codex for implementing child themes?
I’ll make that suggestion. Off to examine this idea and see if this resolves my problem.thanks, WPyogi.
Forum: Themes and Templates
In reply to: child theme/custom header travailsthanks for quick response
https://virtualstatesofamerica.com
everything looks normal right now with buddy theme
if I were to witch to the child theme I would see “buddy” in my header and no logo, menus, etc and my sidebars would all be some default stuff