Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 15,001 through 15,025 (of 32,503 total)
  • Author
    Search Results
  • #122479

    In reply to: Google Authorship

    Martin ( Martin_C )
    Participant

    The following is what I use at AppGlobe:

    /* Add Google+ profile URL as profile contact method  */
    
    function appglobe_add_google_profile( $contactmethods ) {
    
       $contactmethods['google_profile_url'] = 'Google Profile URL';
    
       return $contactmethods;
    
    }
    add_filter( 'user_contactmethods', 'appglobe_add_google_profile', 10, 1);
    
    /* Remove nofollow, and ad author to the profile link */
    
    function appglobe_switch_nofollow_for_author($str) {
    
       $str = preg_replace(
    
       '~<a ([^>]*)\s*(["|\']{1}\w*)\s*nofollow([^>]*)>~U',
    
       '<a ${1}${2}${3}>', $str);
    
       return str_replace(array(' rel=""', " rel=''"), 'rel=author', $str);
    
    }
    
    add_filter( 'bbp_get_topic_author_link', 'appglobe_switch_nofollow_for_author' );

    And then in your user-profile.php (create a bbpress folder in your theme root, and copy it over) you can add this:

    
    <?php if( bbp_get_displayed_user_field( 'google_profile_url' ) ) : ?>
    
    <h2 class="author-subtitle">Google Profile</h2>
    
    <?php if( bbp_get_user_role(bbp_get_displayed_user_id()) == 'bbp_keymaster' || bbp_get_user_role(bbp_get_displayed_user_id()) == 'bbp_moderator') : ?>
    
    <a rel="me" class="bbp-user-url" href="<?php esc_url(bbp_displayed_user_field( 'google_profile_url' )); ?>"><?php bbp_displayed_user_field( 'google_profile_url' ); ?>
    
    </a>
    
    <?php else : ?>
    
    <a rel="me nofollow" class="bbp-user-url" href="<?php esc_url(bbp_displayed_user_field( 'google_profile_url')); ?>"><?php bbp_displayed_user_field( 'google_profile_url'); ?>
    
    </a>
    
    <?php endif; ?>

    Since I beleave only the first rel=me link on a page counts there would be best to use topic lead:

    add_filter( 'bbp_show_lead_topic', '__return_true' );

    …by doing so each page will be considered authored by the topic creator even if its paged.

    Alexander
    Participant

    [WP 3.4.2 + bbPress v2.2.2]

    I’ve searched around a bit for a way to do this – but have found no neat solution. All threads relating to this seem to be 2-3 years old and be for the bbPress standalone rather than the plugin.

    Basically what I want is a simple list displaying forums + topic count, in my page.php. Example:


    <ul>
    <li><a href="#">Forum title 1<span>Topic count</span></a></li>
    <li><a href="#">Forum title 2<span>Topic count</span></a></li>
    <li><a href="#">Forum title 3<span>Topic count</span></a></li>
    </ul>

    Etc.

    I know that there is a widget listing the forums categories, but I need the topic count as well for a better overview. Also, if easily doable, I need to exclude a forum category from the list.

    Any help would be greatly appreciated.

    #122463
    SydneyDesigner
    Participant

    To all those smart coding guys out there, please can someone help me with the bbP functions needed to complete the code below. I think there are two bbP functions needed – see square brackets [??…]. Or maybe someone has a better way of doing it.

    I’m trying to integrate BP1.6.1, the new bbP2.2.2 forums and WordPress SEO1.3.1.1 so that the WordPress SEO (meta) page titles are shown when a bbP Topic is being shown within a BP page (just like they are shown for native bbP forum pages).

    I’ve hooked functions into ‘bp_modify_page_title’ before and managed to extract ‘_yoast_wpseo_title’ before. So I’m part way there I guess.

    I also understand that I need to change the priority from 10 to 16 (or more) in line below (in buddypress>bp-core>bp-core-filters.php), to make bp_modify_page_title filter execute after, and hence overrule, WPSEO title which has priority 15 (in worpress-seo>frontend>class-frontend.php).
    add_filter( ‘wp_title’, ‘bp_modify_page_title’, 16, 3 );


    add_filter( 'bp_modify_page_title', 'new_page_title', 10, 4 );
    function new_page_title( $new_page_title, $title, $sep, $seplocation ) {
    global $bp, $bbp;
    /** If bbP Topic is being shown within a BP page then replace title with title input via Yoast WordPress SEO plugin */
    if ( [?? a bbp function that is true when bbP Topic is being shown within a BP page] && bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) ) {
    [?? a bbp function that loads the bbP Topic Post ID to $topic->ID];
    $new_page_title= get_post_meta( $topic->ID, _yoast_wpseo_title, true);
    }
    return $new_page_title;
    }

    If you can help please, and I can then get this to work, I’ll post the result back again so others can benefit.

    Many thanks.

    #122450

    In reply to: Forum Icons ?

    Martin ( Martin_C )
    Participant

    If you know CSS you can easily add some styles to your to style sheet. If you use the default templete, it could look like this:

    .bbPress.forum .entry-title {

    /*Styles to add icon image to the left of this element goes here*/

    }

    #122425
    Daniel.Haugen
    Participant

    Well, this is the logs from the time I activated the plugins:
    20121207T212805: www.conatu.net/wp-admin/admin-ajax.php
    PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3743

    20121207T212805: www.conatu.net/wp-admin/admin-ajax.php
    PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3743

    20121207T212806: www.conatu.net/wp-admin/admin-ajax.php
    PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3743

    20121207T213434: www.conatu.net/wp-admin/admin-ajax.php
    PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3743

    20121207T213434: www.conatu.net/wp-admin/admin-ajax.php
    PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3529

    20121207T213436: www.conatu.net/wp-admin/admin-ajax.php
    PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3529

    And btw, from where can I make forums?

    bruceleebee
    Participant

    I’m having the exact same problem. And like ffalder I can’t code, but usually Google my way out of a problem. But this time no luck.

    From my research it seems lots of people are having the same problem.

    I think the main issue here is the breadcrumbs.

    1) You create a custom ‘forum home page’ using short codes (or whatever means you like) to be your default page that users see as the homepage of your forum.

    2) A user try’s to get back to the ‘forum home page’ using the breadcrumbs by clicking the text “forums” in the breadcrumbs.

    3) Unfortunately it just redirects to the forum slug chosen in Settings, not your actual ‘forum home page’. And that forum slug is always defaulted to an archives page.

    4) So setting that slug to the same as your ‘forum home page’ does not work, because woprdpress overrides your ‘forum home page’ created in step 1 and defaults it to an archives page.

    Sorry for re-hashing this, but it’s sometimes better to make it a little clearer. At least in my own head anyway.

    I don’t know how simple this is or not, but one solution that comes to mind is to have an option in Settings that lets you decide where the ‘forums’ text link in the breadcrumbs will point to. If you can choose to have it point to your ‘forum home page’ then all would be solved right?

    This person suggested changing the breadcrumbs in the core of the plugin, but obviously it’s not very desirable since it’s changes to the core. And I also cannot find the file that they edited. Think it might have been a mod to an old version: http://mysitemyway.com/support/topic/infocus-bbpress-20-root-slug

    Pippin Williamson
    Participant

    It should be possible with some custom code tweaks. Are you comfortable with a little PHP?

    #122416
    Martin ( Martin_C )
    Participant

    Since I wan’t only replies ( not created topics and replies) I’ve created a filter function:


    function ag_force_replies_only( $query, $user_id ) {

    if( bbp_is_single_user() ) { // Just in case

    $query = bbp_has_replies( array(
    ‘post_type’ => array( bbp_get_reply_post_type() ),
    ‘post_parent’ => ‘any’,
    ‘posts_per_page’ => bbp_get_replies_per_page(),
    ‘paged’ => bbp_get_paged(),
    ‘orderby’ => ‘date’,
    ‘order’ => ‘DESC’,
    ‘author’ => $user_id,
    ‘show_stickies’ => false,
    ) );
    }

    return $query;

    }
    add_filter(‘bbp_get_user_replies_created’, ‘ag_force_replies_only’, 10, 2);

     

    Now is shows replies only: http://appglobe.com/forums/users/martin/replies/

    #122410

    In reply to: How to use converter?

    Shane Gowland
    Participant

    Have you followed the Import Forums guide on the Codex? If so; where did you get stuck?

    #121413
    LabSecrets
    Participant

    Making a child theme is beyond the scope of this forum, but there are plenty of good resources if you google “create a wordpress child theme”.  In a nutshell, you need “at least” to have a new folder, with a style.css file that references the proper header elements of your parent, including its name and the location of the parent theme’s style sheet.

    If you are using the shortcode method, please try the default method instead, which is to change bbPress’s default root slug to something that is “NOT” an existing page (try “sitewide-forums” for example). This will allow you to keep your existing page / shortcut method index. Please show us what happens when you do this? (provide the URL)

    #121409
    LabSecrets
    Participant

    You have several issues going on here, but they are directly related to your theme. As is very common, it appears to me that your theme has a conditional statement in the template file that builds archive pages. As such, it’s treating the content for bbPress forums as excerpts, as well as applying some unwanted styling.

    Have you tried to build a page using the shortcode method? If so, what was the result? If you found it worked properly, then the issue as suggested above, and you could try to modify your theme or child-theme files to add a similar conditional that looks for bbPress and forces it to use the_content() instead of the_excerpt(). See: https://bbpress.org/forums/topic/non-functional-index-page-when-bbpress-2-1rc4-is-used-with-woothemes-canvas-5-05/

    If this page is being built with shortcodes (I don’t think it is from what I see) then what is the result if you try the default forum index method? We outline both methods in our step by step video here: http://labzip.com/the-definitive-guide-to-buddypress-bbpress-configuration/

    We’ll get you there… 😉

     

     

    #121407
    LabSecrets
    Participant

    What is your site url? I can give you some suggestions on where to place the code for a login-box so it shows up on the top of a page.

    Also, if you prefer, you can build your forum site index using shortcode / page method… this would give you flexibility of having your default theme sidebar, etc. available to you.

    Not sure? Check out our updated step by step guide that covers the two methods for creating a forum index page:

    http://labzip.com/the-definitive-guide-to-buddypress-bbpress-configuration/

    Cheers!

    spence

    #121402

    In reply to: Categories

    Len
    Participant

    Hi Ishr,

    In Stephen Edgar’s reply that I linked to he posted a link to a gist on GitHub. Place the code he referenced in your child theme’s functions.php file.

    Make sure to backup that file before editing it just in case something goes wrong and you can easily revert.

    #121388
    smbassett
    Participant

    I understand widgets and sidebars but I how is
    /forums/ rendered. It is not a page, post or blog. I don’t understand how to add a sidebar to this.

    My work around is to create a PAGE and add the forumns via a shortcode but it seems like there should be an option to add to /forums/ (of course I am sure I am missing something simple)

    #121386

    In reply to: bbPress permalinks

    LabSecrets
    Participant

    Fundamentally you need to understand that the use of the prefix is designed to put a unique prefix in place when you’re on a forum index page vs when you are on a topic index page. As such, it is not possible with the default code to show “/forum/topic” if ou mean both are prefixes.

    I suggest you use the plural term “forums” as your base, then “forum” and “topic” as your prefixes.

    If you like, have a watch of our comprehensive guide video:

    The Definitive Guide To BuddyPress & bbPress Configuration

     

    cheers!

    spence

    #121383
    #121369
    Stephen Edgar
    Keymaster

    What about using the ‘Login Widget’ https://codex.bbpress.org/widgets/

    Or one of the ‘account’ shortcodes? https://codex.bbpress.org/shortcodes/

    #121366

    In reply to: Custom loop

    Shane Gowland
    Participant

    Couldn’t you achieve this using bbPress’ shortcodes? Namely; [bbp-forum-index]

    #121340
    Kslad
    Participant

    Hi guys,

    I have done my research and I have been able to remove the side bar from (what I think is) the top level of the forums by editing the archive-forum.php file.

    When I select a forum (I currently only have one) and a topic in the forum (again, I only have one) I still see my theme’s sidebar. I decided to modify the archive-topic.php file and comment out the get_sidebar(); line (as I did above), but unlike above, this did not work.

    I commented out the get_sidebar(); line for every file in the plugins/bbpress/templates/default/extras folder. This did not work for me.

    My question is: how do I remove my theme’s sidebar from the list of forums, topics and inside the topics too?

    #121321
    brianmcculloh
    Participant

    I’m having this exact same problem. Unfortunately my WordPress page does not win when I set them to the same slug. Because of this, I want to use different slugs for my WordPress page that contains the shortcode and my Forums Base. This works just fine, the only problem is in the breadcrumb the “Forums” link takes the user to the forum index instead of the WordPress page with the shortcode.

    #121320
    frenzis73
    Participant

    I would like to display a ‘New Topic’ form at the bottom of my posts with the [bbp-topic-form] shortcode . When someone publish a topic through this form (inside a regular WP post), I would like to save a post_meta for the regular WP ID post that bind the new topic ID with the post ID.

    Someone could me suggest an action to hook ?

    #121303
    sbroways
    Participant

    If anyone has any ideas I’m working on this issue on Stack Overflow as well. I think I’ve done a better job explaining it there and getting some good code put together from contributors but haven’t reached the finish line.

    MySQL query help moving data between tables

    #121302
    sureshtmp-456
    Participant

    Hi

    I have a wordpress(3.4.1) installation and I don’t use standard WordPress
    Authentication. I have my own login page(mylogin.php) where I capture the
    userid/password and then compare with values in my own user table.

    Now I am using BBPress plugin(2.2.2). I have created a page(askanexpert) in
    wordpress and inside that page I have put the BBPress shortcode [bbp-forum-index].
    Now from frontend when the user does login and go to forum(http://www.domainname.com/askanaexpert),
    bbpress forum is visible and all the topics are visible, but forum shows the message that

    “You must be logged in to create new topics.”

    I think it happens because BBPress is perhaps looking for some authenticated cookie which
    was not created due to my custom authentication.

    Is there a way to create the cookie from my custom authentication page, which
    bbpress will understand ?

    I can not get rid of my custom authentication. Is there a way to fix it, so that when user is
    logged in to wordpress site he/she can use the forum as regular logged in user without login again?

    I am fine to do some programming, but not sure which way to go.

    #121287
    Todd – WireFlare
    Participant

    I’m looking for the correct method to dequeue bbpress css from the plugin directory and also that of the css folder within the theme.

    The entire site is much larger than just the forum and I really don’t want to call the css for every page as most people don’t have a need to access the forums. I’ll then enqueue the css with is_bbpress combined with is_page(array for the 2 pages that contain shortcodes.

    I need to make sure that it dequeues from both locations as there is a custom css being used.

    Thanks in advance for the help!

    #121286
    remike
    Participant

    I am currently manipulating with the function that was posted on forums a few days ago and I can’t find a way round a funny issue.

    I erased homepape as a first part of my breadcrumb.

    There are two options right now and neither are working for me. I will present it underneath (bold means clickable). I either get this

    forum>forum | forum>category1 | forum>category1>topic
    or this:
    forum | forum | forum>category1

    I want:

    forum | forum>category1 | forum>category1>topic
    or this:
    (nothing) | forum | forum>category1

    Any ideas?

    The function I’m trying to get to work is diplayed below

    function mycustom_breadcrumb_options() {
    // Home - default = true
    $args['include_home'] = false;
    // Forum root - default = true
    $args['include_root'] = true;
    // Current - default = true
    $args['include_current'] = true;

    return $args;
    }

Viewing 25 results - 15,001 through 15,025 (of 32,503 total)
Skip to toolbar