Forum Replies Created

Viewing 15 replies - 76 through 90 (of 92 total)
  • Thread Starter dropshot

    (@dropshot)

    Ok. I thought I could remove the function and replacing it with a custom one, through my functions.php. I just don’t know how to accomplish that.

    I found this solution which searches for the textstring and replaces it with a custom string, here: Back to %s without the left arrow. %s gives get_bloginfo(‘title’). I would like to replace that with get_bloginfo(‘url’). Any ideas anyone?

    function back_to_site_text( $translated ) {
    
        if ( in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) )
            $translated = str_ireplace(  '← Back to %s', 'Back to %s',  $translated );
            return $translated;
    }
     add_filter('gettext', 'back_to_site_text');
    Thread Starter dropshot

    (@dropshot)

    Ok. Think I got it now. This is what I ended up with.

    add_filter( 'get_comment_author_url_link', 'custom_comment_author_url_link' );
    function custom_comment_author_url_link( $linktext, $before = '', $after = '' ){
        $url = get_comment_author_url();
        if ( $url == '' ) return;
    	$display = ( $linktext != '' ) ? $linktext : $url;
    		if ( '/' == substr( $display, -1) )
    		$display = substr( $display, 0, -1);
    	return "$display";
    }
    Thread Starter dropshot

    (@dropshot)

    Update:

    I deleted

    $display = str_replace( 'http://www.', '', $display );
    $display = str_replace( 'http://', '', $display );

    So now, the correct links are returned.

    But… When there is no url no anchor is returned. But when there is a url the anchor is returned twice with different output…

    Like this

    <a rel="external" href="http://authorurl.com"> </a>
    <a rel="external" href="http://authorurl.com">authorurl.com</a>
    Thread Starter dropshot

    (@dropshot)

    Ok.

    I’ve tried it now and this code does two things.

    As we were attempting to do it doesn’t produce the empty anchor tag. Thats great!

    But. Something in the code makes the author url a link inside my site.

    Instead of
    authorurl.com

    the link is
    mysite.com/authorurl.com

    I can’t really figure out what line does what. Help please.

    Thread Starter dropshot

    (@dropshot)

    That didn’t really do anything. It didn’t hide Jetpack from the menu, but it didn’t either mess up the Editors access to Media Library.

    I will mark this as solved and start a new thread for the Jetpack-menu-issue if I can’t find another solution.

    Thanks for your help Sandy!

    Thread Starter dropshot

    (@dropshot)

    Thanks again Sandy.

    Tried your fix adding a new editor. That didn’t work. The new editor has the same issues.

    Then I did a little search and wp-admin/includes/plugin.php on line 1395 includes remove_menu_page

    So I searched my functions file for the same. What I did find was another hide-from-nonadmin snippet. I forgot I had it.

    add_action('admin_init', 'remove_menus');
    function remove_menus(){
    	if(!current_user_can('add_users')){
    		remove_menu_page('jetpack');
    	}
    }

    It obviously hides Jetpack from non admins. When I deleted this the problem was solved.

    But then Editors can access Jetpack and all its options. I really don’t want that. So I need to find another way to hide it I guess… So, now I have another problem.

    Thread Starter dropshot

    (@dropshot)

    Additional info:

    Editor can see all images from menu item Media Library. But when in post editor and add media Editor can’t see anything in Media Library. Not even images that they have uploaded.

    When trying to edit an image from menu item Media Library Editor get this message:

    Warning: Invalid argument supplied for foreach() in /home/u/mywebhostaccount/www/victoria/wp-admin/includes/plugin.php on line 1395

    Admin can edit images without problem.

    On localhost Editor can edit images.

    Thread Starter dropshot

    (@dropshot)

    Thank you for replying Sandy!
    (didn’t see it until now, didn’t get the email notification)

    I have some hide-if-not-admin code in my functions.php
    But deleting them did no difference.

    What I found though is that everything works fine on mamp/localhost.

    So I guess the issue is with my web host? Is there something I can check and edit myself?

    Thread Starter dropshot

    (@dropshot)

    No need to feel bad!

    I will try this later.

    Thank you!

    Thread Starter dropshot

    (@dropshot)

    That filter unfortunately white-screens the site…

    Any other suggestions?

    Thread Starter dropshot

    (@dropshot)

    Ok, I might not be clear enough. Sorry for that.

    Yes, I know I should not edit core files. That’s why I was stuck.

    I’ll try adding your filter.

    Thanks a lot Jose!

    Thread Starter dropshot

    (@dropshot)

    Thank you Jose.

    I found the comment-template file. I just don’t know how to edit it.

    The adding a filter advise is a big help. But still I don’t know how to edit it. I’m not sure what the original if statement does.

    if ( '/' == substr($display, -1) )
    	        $display = substr($display, 0, -1);
    	        $return = "$before<a href='$url' rel='external'>$display</a>$after";

    Another push in the right direction please…

    Thread Starter dropshot

    (@dropshot)

    Never mind.
    Found a solution.

    Thread Starter dropshot

    (@dropshot)

    Sure sounds like a conflict. But I can’t find it.

    I have inactivated EVERY plugin. Still doesn’t work.

    This is the markup from my header.php

    <nav>
    <?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?>
    </nav>

    When containing three items the menu is displayed as it should be. When a fourth item is added nothing is displayed. It’s empty…

    <nav>
    <div class=" responsiveSelectContainer"></div>
    </nav>

    Can’t figure out what the “markup issue” could possibly be. I’m guessing something is messed up in the database. How can uninstall the plugin and clear every little trail left in the database?

    Thanks.

    Thread Starter dropshot

    (@dropshot)

    Ok. Thanks for trying to help. Really appreciate it.

    Unfortunately nothing solved it.

    Sorry again… What do you mean with the site’s error logs?

Viewing 15 replies - 76 through 90 (of 92 total)