Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,651 through 12,675 (of 32,521 total)
  • Author
    Search Results
  • #142576
    FlyFishersCorner
    Participant

    Still searching for a solution to this. I deleted the live versions of the pages on the website as they were throwing too many errors for Google and decimating my SEO. Essentially what I’m getting is the following in my breadcrumbs:

    From my main index page, “Home > Forums”

    When clicking into one of the forums, I have, “Home > Forum > ForumName” So far so good!

    When clicking on an actual post within this forum, it blows up. Now I have “Home > Topic > TopicTitle” Clicking on the Topic link sends me to a 404 page. What I’d expect to get is “Home > Forum > ForumName > TopicTitle”

    As best I can tell, there must be some issue in my theme’s header.php that is creating the problem. I believe the relevant code section is as follows. I’ve fiddled with it to no end and can only get more errors by changing things.

    Perhaps a fresh set or sets of eyes might be able to see a solution. Anyone see anything immediately obvious that could be creating the issue?

    <div class="text-right">
    	<?php 
    	if (is_404()) {
    	echo '<ul class="breadcrumbs inline-list"><li><a href="'.home_url().'">'.__("Home","zatolab").'</a></li><i class="fa fa-angle-right"></i><li class="active">'.__('Not Found','zatolab').'</li></ul>';
    	} elseif (is_search()) {
    	printf( __( '<ul class="breadcrumbs inline-list"><li><a href="'.home_url().'">'.__("Home","zatolab").'</a></li><i class="fa fa-angle-right"></i><li class="active">%s</li></ul>', 'zatolab' ), get_search_query() );
    	} else {
    	if (zl_options('show_breadcrumbs') == "1"){ 
    	zl_breadcrumbs(); 
    		} 
    		 }
    		?>
    		</div>

    (EDITED for easier readability of code)

    #142574

    In reply to: admin bar

    Robin W
    Moderator

    Ok, I’ve worked out an easy(-ish) way to do this.

    a) Install the plugin WP Modal Login.
    Dashboard>plugins>add new>search “wp modal login” install and activate
    b) Settings
    Dashboard>settings>wp modal login
    you can play with the settings, but primarily you need to select a theme (later on you can play with the css to get it looking nice!)
    c) Then follow the post a couple up from the last in this link which has all the steps to add it to the menu
    NOTES:
    On step 4 – Whilst you can check all the options as he suggests, what you actually need to ensure are checked are “links” on the first line and Description under the “show advanced menu options”
    On step 5 – what you are creating is a new link, sop click “links” on the left hand side, and a dropdown with the url and link text will appear. Populate these two as he suggests and then add to the menu. Then look at the bottom right, and you’ll see this added as a custom item. Open this, and you’ll see the Description box, which is where you drop the shortcode.

    As I said, you can play with the css to get this looking how you want.

    Give it a go ! (I’m about to!)

    #142569
    BenM
    Participant

    Hi,

    Here is what I see using codestyling localisation :

    Loading Issue: Author is using load_textdomain instead of load_plugin_textdomain function. This may break behavior of WordPress, because some filters and actions won’t be executed anymore. Please contact the Author about that.

    Thanks.

    #142559

    In reply to: admin bar

    Robin W
    Moderator

    Yes that is really quite good looking, I’d like to copy that also !

    The inloggen is in the menu, so it is a call from menu item.

    The site is using wordpress twentytwelve, but I don’t know whether it’s a plugin or they have coded it for themselves.

    I have contacted the site to see if they’d tell us how they did it. If I get a reply I’ll let you know !

    Maybe another support person on here knows how to code this – it’s actually a wordpress rather than bbPress solution.

    #142557
    Robin W
    Moderator

    Which version of bbPress are you one, whilst I have your lines of code, my line 1766 of this file is in a different place than yours, and your line 1723 is my line 1700, suggesting you have extra stuff.

    Might be worth you downloading a fresh version of the plugin to your pc, and cracking open this file to see if it’s the same.

    #142555
    Zonic Mirage
    Participant

    Lines 1766 to 1784. It’s a comment block, but it looks like it was closed properly.

    /**
     * Handles the front end tag management (renaming, merging, destroying)
     *
     * @since bbPress (r2768)
     *
     * @param string $action The requested action to compare this function to
     * @uses bbp_verify_nonce_request() To verify the nonce and check the request
     * @uses current_user_can() To check if the current user can edit/delete tags
     * @uses bbp_add_error() To add an error message
     * @uses wp_update_term() To update the topic tag
     * @uses get_term_link() To get the topic tag url
     * @uses term_exists() To check if the topic tag already exists
     * @uses wp_insert_term() To insert a topic tag
     * @uses wp_delete_term() To delete the topic tag
     * @uses home_url() To get the blog's home page url
     * @uses do_action() Calls actions based on the actions with associated args
     * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
     * @uses wp_safe_redirect() To redirect to the url
     */

    Here are lines 1723 to 1764

    /**
     * Fix counts on topic split
     *
     * When a topic is split, update the counts of source and destination topic
     * and their forums.
     *
     * @since bbPress (r2756)
     *
     * @param int $from_reply_id From reply id
     * @param int $source_topic_id Source topic id
     * @param int $destination_topic_id Destination topic id
     * @uses bbp_update_forum_topic_count() To update the forum topic counts
     * @uses bbp_update_forum_reply_count() To update the forum reply counts
     * @uses bbp_update_topic_reply_count() To update the topic reply counts
     * @uses bbp_update_topic_voice_count() To update the topic voice counts
     * @uses bbp_update_topic_reply_count_hidden() To update the topic hidden reply
     *                                              count
     * @uses do_action() Calls 'bbp_split_topic_count' with the from reply id,
     *                    source topic id & destination topic id
     */
    function bbp_split_topic_count( $from_reply_id, $source_topic_id, $destination_topic_id ) {
    
    	// Forum Topic Counts
    	bbp_update_forum_topic_count( bbp_get_topic_forum_id( $destination_topic_id ) );
    
    	// Forum Reply Counts
    	bbp_update_forum_reply_count( bbp_get_topic_forum_id( $destination_topic_id ) );
    
    	// Topic Reply Counts
    	bbp_update_topic_reply_count( $source_topic_id      );
    	bbp_update_topic_reply_count( $destination_topic_id );
    
    	// Topic Hidden Reply Counts
    	bbp_update_topic_reply_count_hidden( $source_topic_id      );
    	bbp_update_topic_reply_count_hidden( $destination_topic_id );
    
    	// Topic Voice Counts
    	bbp_update_topic_voice_count( $source_topic_id      );
    	bbp_update_topic_voice_count( $destination_topic_id );
    
    	do_action( 'bbp_split_topic_count', $from_reply_id, $source_topic_id, $destination_topic_id );
    }
    iejigna
    Participant

    Hi,
    In our site,
    Topics with the status – pending are counted in topic summary text but not listed in topic list(as its pending,)
    Topic count is stored in table name wp_postmeta with meta-key – _bbp_topic_count.
    _bbp_topic_count is count of all topics including ‘pending’ topic.

    How can I get count of topics with status ‘open’ in my summary?

    We are using bbpress version 2.5.3 and wordpress 3.8.1

    Asynaptic
    Participant

    @hillofbeans with respect, I don’t think that is what’s happening exactly. The bbpress team is not jumping up and down with joy to tackle this issue but as jjj said:

    bbPress and WordPress are designed to allow those with specific needs and wants to customize the codebase, and contribute the changes they needed up-stream to the parent project. If this is something multiple people would like, I suggest you group up and build it. If it works, and more people want it, we absorb it into bbPress core.

    This is why I searched and found previous discussions in the forum and a solution which was arrived at several years ago via a plugin (See above). It doesn’t seem like the creator of the plugin took it anywhere though, other than sharing it on the bbpress forums. They didn’t create a plugin officially at the plugin.wordpress.org or update it, etc.

    If I could make a constructive suggestion to the bbpress team, it would be that while they are very busy and it can seem like we are just throwing constant suggestions, critiques, etc. at them, it would be wise to set up a method to gauge the community’s interest or desire for specific issues.

    This can be done very simply with something like uservoice or similar ‘suggestion box’ apps where suggestions are shown and community members here can vote on them to show their interest towards them and move them up the priority list.

    I made a similar suggestion to the buddypress team and I read from jjj or boone that this inspired the recent survey (hopefully we’ll see the results of said survey soon!)

    That was great, btw! at the same time, a survey is a very short lived ‘snapshot’ whereas a uservoice type idea collector and sifter would be continuous

    of course, I’m not at all suggesting that we convert the bbpress or buddypress projects to ‘mob rule’! nope. just that when we have such a communication channel, things like this specific issue would be addressed (rather than linger for 7+ years) because there would be transparency and a collaboration between the wider community and the dev team

    🙂

    #142541
    Stephen Edgar
    Keymaster

    If you are using custom templates then adding <?php bbp_forum_subscription_link(); ?> should be all you need 🙂

    Here is the original source depending on what templates you are using: /templates/default/bbpress/content-archive-forum.php#L26
    and/or
    /templates/default/bbpress/content-single-forum.php#L16

    #142540
    glyndavidson
    Participant

    …no matter, I found one on the bbPress forums:

    <li class="forum-subscribe">
       <span id="subscription-toggle">
          <span id="subscribe-652">
              <a href="https://bbpress.org/forums/forum/requests-and-feedback/?action=bbp_subscribe&forum_id=652&_wpnonce=xxxxxxx" class="subscription-toggle" data-forum="652" rel="nofollow">Subscribe</a>
          </span>
       </span>
    </li>

    I’ll have a play with this and see what I can come up with.

    #142538
    glyndavidson
    Participant

    Thanks for taking the time to create a screenshot Stephen. Using the latest version of bbPress and TwentyEleven, I don’t have the Subscribe link.

    Is it possible to provide an example of the <a href=""> tag so that I might hardcode it into a template?

    Thanks again,

    Glyn

    HillofBeans
    Participant

    I’m with all the non-coders here. This url situation is nuts from a UX and SEO point of view.

    Having built over 200 WordPress sites in the last few years, I’m really surprised to find that bbPress has these fundamental structural flaws when it comes to url organization.

    This topic was raised 1 year and 9 months ago.

    Have we got any further with this?

    #142530
    Robin W
    Moderator

    OK FINAL ANSWER

    Have finally got it working in the menu (and corrected the error in the post above!) !

    so for menu have

    // Filter wp_nav_menu() to add profile link
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    function my_nav_menu_profile_link($menu) { 	
    	if (!is_user_logged_in())
    		return $menu;
    	else
    		$current_user = wp_get_current_user();
    		$user=$current_user->user_login ;
    		$profilelink = '<li><a href="http://www.mysite.com/forums/users/' . $user . '/edit">My Profile/Edit Profile</a></li>';
    		$menu = $menu . $profilelink;
    		return $menu;
    }
    
    

    For on the forum page have

    //action to add "amend profile" to top of forums pages
    function rw_edit_profile () {
    	if (is_user_logged_in()) {
    	$current_user = wp_get_current_user();
    	$user=$current_user->user_login ;
    	$user_link = '<br><a href="http://www.mysite.com/forums/users/' . $user . '/edit">My Profile/Edit Profile</a>';
    	echo $user_link ; }
    }
    
    add_action('bbp_template_before_forums_loop','rw_edit_profile') ;
    
    
    #142528
    Zonic Mirage
    Participant

    Hello. Sorry for the slow response, but I tried again. Now it’s giving me

    Fatal error: fatal flex scanner internal error--end of buffer missed in /site/folders/wp-content/plugins/bbpress/includes/topics/functions.php on line 1766

    #142522
    vildvittra
    Participant

    I would like to display a list of all the moderators, to make it easier for the forum users to know who to contact in case of problems.

    Is there a shortcode or widget or something for this?

    Stephen Edgar
    Keymaster

    We also have a page with a few of the ideas we like that extent bbPress in different ways:

    Feature Plugins Tracking

    #142512

    In reply to: Image upload

    Frumph
    Participant

    ^ the user needs to have the correct rights for example

    
    function add_theme_caps() {
        $role = get_role( 'contributor' );
        $role->add_cap( 'upload_files' ); 
    }
    
    add_action( 'admin_init', 'add_theme_caps');
    

    If you want to add contributors and above to be able to upload_files, change that to subscriber if you want

    #142511

    Both editor.js and bbpress.css are loaded similarly, as well as other scripts and styles in certain situations (single forums/topics, and when editing your password). Are any other SSL errors present, or is it just bbPress? What version of bbPress are you using?

    Without deeper investigation, I’m unsure how this is possible when using core functions and templates. bbp_enqueue_style() calls content_url() which uses set_url_scheme() which is the WordPress core function for correctly determining the http/https/relative scheme for every link on the site. This means it’s difficult for one to be wrong, and another to be right.

    #142509
    koendb
    Participant

    You can add all sorts of changes to your theme or bbpress from the general wordpress functions.php file. You can find this file here:
    /wp-content/themes/%theme name%/functions.php

    But if you update your theme your changes to this file will be overwritten, that’s why you should make a child theme with your own functions.php file. It’s not that hard and after you’ve made your child theme it’s easy to tweak other things as well.

    #142508
    Robin W
    Moderator

    OK, so if we move outside the menu bar, you could have it after the breadcrumbs on the forum page

    Add this to your functions file

    //action to add "amend profile" to top of forums pages
    function rw_edit_profile () {
    	if (is_user_logged_in()) {
    		$user      = get_userdata( $user_id );
    		$name      = esc_attr( $user_name );
    		$user_link = '<br><a href="http://gos.rewweb.co.uk/forums/users/' . $user . '/edit">My Profile/Edit Profile</a>';
    		echo $user_link ; }
    }
    add_action('bbp_template_before_forums_loop','rw_edit_profile') ;

    But if you want to go the admin bar route, then the admin bar doesn’t show to not logged in users,
    just change each of your users to “show toolbar” in dashboard>user>edit

    #142507
    boriskamp1991
    Participant

    Thanks for that!
    it gives an unexpected syntax error when I try to load my website.
    here is my header.php code
    any idea?

    <?php if ( ! isset( $_SESSION ) ) session_start(); ?>
    <!DOCTYPE html>
    <!--[if IE 6]>
    <html id="ie6" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if IE 7]>
    <html id="ie7" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if IE 8]>
    <html id="ie8" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
    <html <?php language_attributes(); ?>>
    <!--<![endif]-->
    <head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>" />
    	<title><?php elegant_titles(); ?></title>
    	<?php elegant_description(); ?>
    	<?php elegant_keywords(); ?>
    	<?php elegant_canonical(); ?>
    
    	<?php do_action( 'et_head_meta' ); ?>
    
    	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    	<?php $template_directory_uri = get_template_directory_uri(); ?>
    	<!--[if lt IE 9]>
    	<script src="<?php echo esc_url( $template_directory_uri . '/js/html5.js"' ); ?>" type="text/javascript"></script>
    	<![endif]-->
    
    	<script type="text/javascript">
    		document.documentElement.className = 'js';
    	</script>
    
    	<?php wp_head(); ?>
    </head>
    <body <?php body_class(); ?>>
    	<header id="main-header">
    		<div class="container clearfix">
    		<?php
    			$logo = ( $user_logo = et_get_option( 'divi_logo' ) ) && '' != $user_logo
    				? $user_logo
    				: $template_directory_uri . '/images/logo.png';
    		?>
    			<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    				<img src="<?php echo esc_attr( $logo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" id="logo" />
    			</a>
    
    			<div id="et-top-navigation">
    				<nav id="top-menu-nav">
    				<?php
    					$menuClass = 'nav';
    					if ( 'on' == et_get_option( 'divi_disable_toptier' ) ) $menuClass .= ' et_disable_top_tier';
    					$primaryNav = '';
    
    					$primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => 'top-menu', 'echo' => false ) );
    
    					if ( '' == $primaryNav ) :
    				?>
    					<ul id="top-menu" class="<?php echo esc_attr( $menuClass ); ?>">
    						<?php if ( 'on' == et_get_option( 'divi_home_link' ) ) { ?>
    							<li <?php if ( is_home() ) echo( 'class="current_page_item"' ); ?>><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Home', 'Divi' ); ?></a></li>
    						<?php }; ?>
    
    						<?php show_page_menu( $menuClass, false, false ); ?>
    						<?php show_categories_menu( $menuClass, false ); ?>
    					</ul>
    				<?php
    					else :
    						echo( $primaryNav );
    					endif;
    				?>
    				</nav>
    
    				<div id="et_top_search">
    					<span id="et_search_icon"></span>
    					<form role="search" method="get" class="et-search-form et-hidden" action="<?php echo esc_url( home_url( '/' ) ); ?>">
    					<?php
    						printf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" />',
    							esc_attr_x( 'Search &hellip;', 'placeholder', 'Divi' ),
    							get_search_query(),
    							esc_attr_x( 'Search for:', 'label', 'Divi' )
    						);
    					?>
    					</form>
    				</div>
    
    				<?php do_action( 'et_header_top' ); ?>
    			</div> <!-- #et-top-navigation -->
    		</div> <!-- .container -->
    		<?php if(! is_front_page()) { 
    }?>
    	</header> <!-- #main-header -->

    Thanks!

    #142499
    Majijiboo
    Participant

    I have multiple functions.php files in different folders of the bbpress plugin. Which of the below functions.php files should I add the code to?

    • …/bbpress/includes/users/functions.php
    • …/bbpress/includes/replies/functions.php
    • …/bbpress/includes/extened/buddypress/functions.php
    • …/bbpress/includes/forums/functions.php
    • …/bbpress/includes/core/functions.php
    • …/%theme name%/functions.php

    Thanks,
    Majid

    #142495
    Robin W
    Moderator

    ahh..if you are saving in ‘text’ view, try changing to ‘visual’ or if you are in visual view try going to text. Sometimes the editor does funny things to stuff it sees as code. Once you have fixed it, try and not edit anything on the page, or if you do check whether it has changed the code, and change the code back as last thing.

    It’s an annoying bug in the wordpress editor where it get’s over-keen to ensure that code doesn’t screw up how it stores, but I’d prefer it to do that than muck up the database !

    #142494
    aravindbachu
    Participant

    I copied and pasted the stuff exactly as you said, and after updating the page, this piece of code :

    echo $current_user->user_login . "";

    is turning into this :

    echo $current_user-/>user_login . "";

    Its happening whenever i am updating the page by saving it.

    #142491
    Robin W
    Moderator

    @donutz – thanks for sharing that, I’ll add it to the codex when I get a moment !

Viewing 25 results - 12,651 through 12,675 (of 32,521 total)
Skip to toolbar