Forum Replies Created

Viewing 15 replies - 1 through 15 (of 34 total)
  • I don’t know what causes your issue. Probably you got hacked or another malware plugin is generating this description.

    Sorry for the delay…
    Did you mean “Realia” theme?

    Then go to the plugin’s settings page and near the bottom of the page fill in these:

    The classes: entry-header
    The regular expressions: <span class=”author(.*?)/span>

    Another way is this. Go to Appearance -> Editor.
    Then scroll to the bottom of the file, and place the cursor in a new line at the very bottom. Then paste the following:

    .entry-header .author {display:none;}

    Hello!

    There are 2 ways of hiding the “By” word.

    1st Regular Expression

    Got to the plugin settings and near the bottom of the page fill in these:

    The Parent Classes: post-meta
    The Regular Expressions: By;by

    (When copy pasting be careful NOT to include spaces)

    2nd CSS

    Go to Appearance -> Editor.
    Then scroll to the bottom of the file, and place the cursor in a new line at the very bottom. Then paste the following:

    .post-meta > span:first-child {display:none;}

    If you still want to use my plugin so you can show/hide the author in specific pages, then do this:

    Again, in lib/functions/utility.php, replace the original code (above) with this:

    /** Retina Post Author */
    function retina_post_author() {
    
    		$output = sprintf( '<span class="entry-meta-sep author-dot"> &sdot; </span><span class="entry-author author vcard"><a href="%1$s" title="'. __( 'by %2$s', 'retina' ) .'" rel="author">%2$s</a></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) );
    		return $output;
    
    }

    Notice the <span class="entry-meta-sep author-dot"> &sdot; </span>?
    Then in the plugin settings use this regular expression:

    <span class="entry-meta-sep author-dot"(.*?)/span>

    Ok. Let’s do it the proper way then.

    In your theme, open this file:

    lib/functions/utility.php

    You will find this piece of code:

    /** Retina Post Author */
    function retina_post_author() {
    
       $output = sprintf( '%3$s<span class="entry-author author vcard"><a href="%1$s" title="'. __( 'by %2$s', 'retina' ) .'" rel="author">%2$s</a></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ), retina_entry_meta_sep() );
       return $output;
    
    }

    So just comment out (//) these two lines and you’ll get this:

    /** Retina Post Author */
    function retina_post_author() {
    
       //$output = sprintf( '%3$s<span class="entry-author author vcard"><a href="%1$s" title="'. __( 'by %2$s', 'retina' ) .'" rel="author">%2$s</a></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ), retina_entry_meta_sep() );
       //return $output;
    
    }

    Done! You don’t need my plugin anymore…

    Ok… So here is the HTML on your website:

    <div class="entry-meta">
       <span title="August 31, 2013 6:13 am" class="entry-date">
          <a rel="bookmark" title="Pepper Pot" href="http://capefearreview.com/?p=31">August 31, 2013 6:13 am</a><br />
       </span>
       <span class="entry-meta-sep"> ⋅ </span>
       <span class="entry-author author vcard">
          <a rel="author" title="by " href=""></a>
       </span>
    </div>

    So to remove the dot, go to the plugin settings and add near the bottom:

    The classes: entry-meta
    The regular: <span class="entry-meta-sep"(.*?)/span>

    Hello!

    I can’t help you with the code you provided.
    Please let me know the name of the theme that you are using and/or a link to your website.

    You could try to open the functions.php file in your theme’s folder and search for retina_post_date. Probably you will find the text that you need to remove…

    Nice! 🙂 No problem at all…
    Take care!

    I don’t think 24 hours will be a problem! 😛

    It’s weird, cause on my website (localhost) it shows up correctly and I have the classes: icon-home icon-large

    Screenshot

    Are you (absolutely) sure you replaced both functions?
    I had updated my answer a couple of times at the beginning with changed code. Maybe you were too fast and copied my initial (wrong) code?

    By the way, thank you for your feedback…

    So not sure what having them properly in an i element would get us

    It’s totally fine not having them in the i element.
    And since it works for you in the li element you shouldn’t change anything. 🙂

    The i element is useful for those that want the icon to be right next to the text (not visually only, but in the code too).

    And the plugin was meant to work like that. That’s why I provided the solution. For others that might come across and want the same functionality with multiple classes.

    It appears to REMOVE the two icon font classes from the original $nav.

    Now I am confused! Since it removed both classes from the li element, how come you say right above that “…only the first class got put into the li”?

    Anyway. The plugin deliberately removes the class from the li element and then adds it to the newly created i element (otherwise we would have duplicate classes). That’s the plugin’s default functionality.

    (Remember, adding classes is not provided by the plugin, but by WordPress, and WordPress adds the classes to the li element by default)

    if I naively put a “print $nav;” as the first line in the fontawesome_menu function, I get the right output.

    Cool! What do you mean my code doesn’t work though?
    Do you mean that it doesn’t work the way you wanted it to work?

    Basically by placing the print $nav; you are not letting the plugin to do its job and create the <i class="..."></i> right before the link text. You are just leaving the classes in the <li> element, which is the default in WordPress.

    That’s fine, but I needed the plugin behavior 🙂

    I modified the code to accept more classes, like icon-large. Go to the plugin folder and open: font-awesome-menus.php.

    1. Around line 157, replace function fontawesome_menu with this:

    function fontawesome_menu( $nav ) {
    	$menu = preg_replace_callback(
    		'/<li(.*)class="(.*)"(.*)><a[^>]+>(.*)<\/a>/',
    		array( $this, 'fontawesome_replace' ),
    		$nav
    	);
    	print $menu;
    }

    2. Right below, replace function fontawesome_replace with this:

    function fontawesome_replace( $a ) {
    	$str = $a[0];
    	$class_tag = $a[2];
    	$classes = explode(' ', $class_tag);
    	$icon_classes = array();
    	foreach( $classes as $class ) {
    		if( preg_match( '/icon-/', $class ) ) {
    			array_push( $icon_classes, $class );
    		}
    	}
    	if( !empty( $icon_classes ) ) {
    		$listitem = $str;
    		$link_text = $a[4];
    		$i_class = '';
    		foreach( $icon_classes as $icon ) {
    			$listitem = str_replace(
    				$icon,
    				'',
    				$listitem
    			);
    			$i_class .= $icon . ' ';
    		}
    		$i_class = trim( $i_class );
    		$str = str_replace(
    			$link_text,
    			'<i class="' . $i_class . '"></i><span class="fontawesome-text"> ' . $link_text . '</span>',
    			$listitem
    		);
    	}
    	return $str;
    }

    I have the exact same problem…

    mspyratos

    (@mspyratos)

    I followed exactly your steps and it worked fine for me.

    If you want me to investigate further, send me an email with access details to your wordpress website.

    Thank you…

    mspyratos

    (@mspyratos)

    Could you please be more specific? What settings exactly are you using?

Viewing 15 replies - 1 through 15 (of 34 total)