Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Revolved] Introductory Text for the Activity Page


  • 1a-spielwiese
    Participant

    @1a-spielwiese

    I wrote an introductory text for the activtiy page and inserted it into the post-form.php. – How can I prevent, that the same text is also displayed below the home tab of the group pages and below the activity tab of the member pages (of the members, who are logged in)? –

    I tried as well inserting the introductory text into the activity-loop.php, but then the introductory text is not displayed, where it should be displayed (rather below the tabs ‘All members’ etc.).

Viewing 5 replies - 1 through 5 (of 5 total)

  • danbp
    Moderator

    @danbp

    you can use the action hook to introduce some static text or even other content.

    For ex. in activity-loop.php, there is do_action( 'bp_before_activity_loop' ); at the begin of the file.

    How to use an existing action hook ?

    • Write a function and add it to the existing hook.

    Such custom function are added to child-theme functions.php or into bp-custom.php. Of course, each function should also have a unique name or you get the sky over your head.

    function spielwiese() {
    echo '<h3>Hallo Sportsfreunde !</h3>';
    }
    add_action ( 'bp_before_activity_loop', 'spielwiese' );

    1a-spielwiese
    Participant

    @1a-spielwiese

    @danbp:

    Thank you very much.

    ‘Write a function’

    You did this for me, isn’t it? It is the code at the end of your post?

    ‘add it to the existing hook’

    What does ‘add’ her mean? Is this adding simply the line add_action ( 'bp_before_activity_loop', 'spielwiese' ); in your code or have I to do something inside the activity-loop.php as well?

    ‘Of course, each function should also have a unique name’

    Is this specfic name already the word ‘spielwiese’ in your code – and it would be sufficient, when I use for the next function ‘spielwiese-1’? Or have I to create that specific name for the current function and to insert somewhere?


    1a-spielwiese
    Participant

    @1a-spielwiese

    1st:

    ‘Such custom function are added to child-theme functions.php’

    I did this, and I deactivated my reddle-child/buddypress/activtity-folder by renaming it. – I get the text displayed, but not at the place, where I want:

    http://1a-spielwiese.de/wp-content/uploads/2014/10/Activity_Intro.jpg

    2nd:

    I tried it as well by using the bp-custom.php:

    a) When I inserted your code at the end of that file, I got displayed nothing.

    b) And when I inserted it before the line <?php get_footer(); ?>:

    <?php
    /**
     * BuddyPress: Full-width template
     *
     * A custom page template without sidebar.
     *
     * @ since Reddlle 1.3.1 and BuddyPress 2.1
     */
    
    get_header(); ?>
     
    	<div id="primary">
    		<div id="content" role="main">
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', 'page' ); ?>
    			<?php endwhile; // end of the loop. ?>
    		</div><!-- #content -->
    	</div><!-- #primary --> 
    
    <?php get_footer(); ?>

    then I got my introductory text displayed behind the activity stream.


    1a-spielwiese
    Participant

    @1a-spielwiese

    Even worse:

    My introductry text is still not only displayed on the activity page (where it should be displayed), but as well below the home tab of the group pages and below the activity tab of the member pages (where it should not be displayed).


    1a-spielwiese
    Participant

    @1a-spielwiese

    @danbp:

    I found the solution:

    1st:

    The new code within my reddle-child/functions.php is now:

    /* Vorspann-Text für Neuigkeiten-Seite */
    
    function spielwiese() {
    echo '<p><small>Auf dieser Seite werden Dir alle Online-Aktivit&auml;ten bei 1a-Spielwiese angezeigt. Mit dem "Zeige"-DropDown-Men&uuml; auf der rechten Seite kannst Du die Liste auf jeweils eine bestimmte Art von Ereignissen (z.B. Profil-Aktualisierungen) einschr&auml;nken.
    <br>
    Wenn Du eingeloggt bist, siehst Du neben dem Tab "Alle Mitglieder" auch noch Tabs "Meine Gruppen" und "Erw&auml;hnungen". Mit diesen Tabs kannst Du Dir die Aktivit&auml;ten in den Gruppen, denen Du angeh&ouml;rst, bzw. die Neuigkeiten, in denen Du selbst erw&auml;hnt bist, anzeigen lassen.</
    <br>
    Au&szlig;erdem kannst Du die Neuigkeiten auch als <a href="https://de.wikipedia.org/wiki/RSS" target="_blank">RSS-Feed</a> abonnieren.
    <br>
    In den Neuigkeiten selbst werden Dir die 1a-Spielwiese-Mitglieder, die an den fraglichen Aktivit&auml;ten beteiligt waren, und ggf. die Gruppen, in denen bzw. in Bezug auf die die sie stattfanden, angezeigt. Wenn Du eingeloggt bist, kannst Du die einzelnen Neuigkeiten sowohl kommentieren als auch favorisieren. Nachdem Du die erste Neuigkeit favorisiert hast, erscheint ein neuer Tab zwischen "Meine Gruppen" und "Erw&auml;hnungen", der alle Deine "Favoriten" auflistet.</small></p>
    <br>';
    }
    add_action ( 'vorspann_activity-seite', 'spielwiese' );

    2nd:

    Within my reddle-child/buddypress/activity-folder is now a modified version of the index.php from the original buddypress/bp-templates/bp-legacy/buddypress/activity-folder.

    The modification is, that I inserted there between the lines

    <div id="buddypress">

    and

    <?php do_action( 'bp_before_directory_activity_content' ); ?>

    simple the line:

    <?php do_action( 'vorspann_activity-seite' ); ?>

    I guess: This thread can be marked as ‘[Revolved]’.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Revolved] Introductory Text for the Activity Page’ is closed to new replies.
Skip to toolbar