Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,151 through 2,175 (of 32,460 total)
  • Author
    Search Results
  • #216185
    defiance12
    Participant
    /** add field to bbp edit **/
        public function peditField()
        {
            $opt = $this->settings();
    		?>
    			<div>
    				<label for=""><?php echo apply_filters('bmen_pedit_field_header', __('Email notifications', $this->text_domain)); ?></label>	
    				<label>
    					<input type="checkbox" name="bmen_notify" style="width: auto;" <?php checked( $this->canNotify( bbp_get_displayed_user_field('ID') ) ); ?> /> <?php echo $opt['label']; ?>
    				</label>
    			</div>
    		<?php

    Think the custom field for the checkbox for email notifications for @mentions is bmen_notify

    #216184

    In reply to: Submit Button Editing

    Robin W
    Moderator

    generally the styling is part of the theme – the ‘submit’ button has classes of ‘submit’ and ‘button’, so see if you theme lets you change this.

    if not try

    http://css3buttongenerator.com

    this will give you code you can put in your themes custom css area

    just change

    .btn {

    to

    .button {

    and

    .btn:hover {

    to

    .button:hover {

    before you paste the code

    #216182
    Robin W
    Moderator
    add_action( 'bbp_template_before_topics_loop' , 'rew_add_shortcode3'); 
    
    function rew_add_shortcode3 () {
    	echo do_shortcode( '[shortcode here]' );
    }
    #216180
    Robin W
    Moderator

    if you mean the bits in dashboard>settings>bbp mentions they are in the options table under ‘bmen_settings’

    so

    get_option('bmen_settings', null)

    #216178
    truth4vahid
    Participant

    Could you give me another code to put shortcode in this area under lables:
    shortcode 1

    #216160
    Robin W
    Moderator

    Coding to do ID’s is possible I suspect, but I have no idea how to do that πŸ™‚

    This article suggests that urls are used for seo ranking

    https://moz.com/learn/seo/url

    and says

    A well-crafted URL provides both humans and search engines an easy-to-understand indication of what the destination page will be about.

    Although URLs can include ID numbers and codes, the best practice is to use words that people can comprehend.

    Just a thought.

    #216152
    bodybyloud
    Participant

    @robin-w Sorry but that bit of code created a fatal error when I used it in the plugin. Please let me know if you’re available to custom code it for me.

    #216149
    bodybyloud
    Participant

    @robin-w Thanks so much for the code. I think I’ll try to implement it with the code snippet plugin, I’m not familiar with adding code to files. One thing, the custom post type is actually called “job-listing” is it ok to change the term in the code snippet you provided?

    #216132
    Robin W
    Moderator

    @bodybyloud the old version might work for you if you are not using blocks if you add this

    add_filter( 'bbppt_eligible_post_types', 'rew_add_types' ) ;
    
    function rew_add_types () {
    	$types = array( 'post', 'page', listings' )  ;
    return $types ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    defiance12
    Participant

    OMG you are awesome thanks so much! did a new reply and it worked!

    <meta property="og:title" content="Reply to:Some New Cyberpunk 2077 Gameplay">

    Reply To: Some New Cyberpunk 2077 Gameplay

    Just one small detail, how do I add a space between the Reply to:Some New Cyberpunk 2077 Gameplay

    Robin W
    Moderator

    and is that for a new reply – the code sets this for new replies

    defiance12
    Participant

    <meta property="og:title" content="| Nerdpunk">

    didn’t work πŸ™

    Robin W
    Moderator

    This should do it if I have the right yoast meta name

    add_action ('bbp_new_reply', 'add_yoast_title' , 10 , 7) ;
    
    function add_yoast_title ( $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author, $false, $reply_to ) {
    	$topic_title = get_the_title ($topic_id) ;
    	$title = 'Reply to:'.$topic_title ;
    	update_post_meta ($reply_id , '_yoast_wpseo_title' , $title ) ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    defiance12
    Participant

    this works however the meta title needs to include the post title also e.g.

    Reply To: %forum post title%

    What code is needed to add this?

    Thanks!

    #216096
    Robin W
    Moderator

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    add_filter (‘bbp_subscription_mail_headers’ , ‘rew_headers’ ) ;

    function rew_headers ($headers) {
    $headers = str_replace ('hello' ,'\'', $headers) ;
    return $headers ;
    }

    but instead of hello put & # 0 3 9 ; but without the spaces – sorry wordpress keeps interpreting the code so best way I can get it in here

    #216094
    mibrenner
    Participant

    Thank you for your help. That helped me filter through the different parts of the breadcrumb and selectively replace the default forum URL with my static forum URL.

    For anyone else reading this that wants the code I used, to replace the URL (or text if you want to) of the “Forum” portion of the breadcrumb:

    function gnpwdr_bbp_breadcrumb_url($crumbs) {
      global $bsp_breadcrumb;
      $pattern = '/(?<=href\=")[^]]+?(?=")/';
      $my_forum_url = '/custom-page/';
      $crumbs[0] = preg_replace($pattern, $my_forum_url, $crumbs[0]);
      return $crumbs; 
    }
    add_filter('bbp_breadcrumbs', 'gnpwdr_bbp_breadcrumb_url');
    #216087
    Matthias
    Participant

    The above code in functions.php works for me, except for “weeks” in german “Wochen”
    Perhaps the regex is wrong, but after Wochen I have an “ag”

    It’s not there in my german language file?
    https://gtauscht.de/forums/
    Do you have any suggestions?

    Thanks
    Matthias

    #216066
    Josue Ardon
    Participant

    Hi guys,

    I am trying to disable the arrow in the images gallery in order to avoid images theft. When one clicks on the image, it is possible to see the gallery bigger and there is an arrow which allows the visitor to download the image.
    You may check one of my galleries here: https://www.mayangateway.com/tour/guatemala-getaway/
    What should I do? I am not very good with code by the way.

    I’ll appreciate your advice.
    Josue

    #216051
    kubajuncewicz
    Participant

    Hey, thank you for that answer. I combined it with

    
    <script>
         jQuery( document ).ready(function() {
          jQuery('#nickname').prop('disabled', 'disabled');
          });
    </script>
    

    And it worked as I needed πŸ™‚

    #216042
    flamuren
    Participant

    Hi,

    I am new to all of this (building a homepage etc) and I am not native English speaking. I say this so you keep in mind I do my best to use the correct terminology when writing this question and I maybe will have some issues understanding what you answer if you use to advance terminology without some explanation. Excuse me for this.

    I have googled and asked a friend with no direct luck regarding my issue.

    So to the problem at hand. I have set up a homepage, installed bbpress and got the forum going. I installed a new theme to make the editing easier and get some help getting everything looking good (the same issue I will describe soon, I also had using twentytwenty theme)… the webpage looks mostly like I want it to and feels kinda modern (if I may say so myself). The problem however is that BBpress looks aweful and dont inherite the theme at all and I cant seem to get it to work properly. However! if I go in to forum and then use the forum menu to go back one forum level the theme seems to inherite the look I have on the page mostly and looks okey. Also when I “go back one level” in my forum on the webpage some minor things happen, other than it start to look good. It uses another url for the page I go back to, even tho its the same “forum page” and the forum page title/header text changes.

    I can add I just made a new page using WP admin panel – then added some text as a title/header and used the code [bbp-forum-index] under that text to implement the forum.

    This is the link to the forum if you use my top menu (which is the correct way to enter the forum and which makes the forum look weird): https://www.glademokraterna.se/partiforum/
    This is the link when I manually “go back one level” in my forum (which looks ok for my purpose): https://www.glademokraterna.se/forums/

    INFO:
    WP version: 5.5.3 (Swedish)
    Theme: Hestia 3.0.6
    BBpress: 2.6.6

    I dont know if this is possible to understand what I mean. I can try to describe in other words if you ask me.

    Many thanks in advance if you like to help me πŸ™‚

    /Flamuren

    #216039
    Robin W
    Moderator

    thanks everyone

    so yes, the plugin won’t work with Gutenberg, as it doesn’t use the same way to interact with metaboxes. I can write some code to do that, and I’ll take a look at what’s involved.

    For those of you that aren’t using Gutenberg eg disabling or installing classic editor plugins, then as far as I can see it still works ok – does anyone have any issues with it ?


    @bodybyloud
    – not sure if you are looking for an additional feature – ie automatically create a topic on post publishing, or if the existing functionality isn’t working for you – ca you come back with some further detail please.

    #216027
    neon67
    Participant

    Thanks for the interesting ideas!
    I will try to code))

    #216026
    Robin W
    Moderator

    so you would set the default role in

    dashboard>settings>forums to be ‘spectator’ and then wordpress login hook to wp-login or init

    add_action('wp_login', 'xxx', 10, 2);  which passes '$user_login, $user'
    add_action('init', 'xxx');

    your function then would check date current user registered, and if over a month, change the role to ‘participant’ using

    
    bbp_set_user_role( $user_id, bbp_get_participant_role() );
    #216020
    neon67
    Participant

    I want to make a publication delay (for example 1 month) for newly registered users — as protecting against spam.
    Is it possible without a plugin, using only code?

    Where to dig? )

    neon67
    Participant

    Thanks everyone! Found a solution in the bbpress codeΡ…

Viewing 25 results - 2,151 through 2,175 (of 32,460 total)
Skip to toolbar