Viewing 5 replies - 16 through 20 (of 20 total)
  • Plugin Contributor contactashish13

    (@rozroz)

    @vegroland try this:

    
    add_filter( 'feedzy_author_name', 'feedzy_author_name', 10, 3 );
    function feedzy_author_name( $authorName, $feedURL, $item ) {
    	$source		= '';
    	
    	if ( is_array( $feedURL ) ) {
    		$link = $item->get_permalink();
    		// if feedURL is multiple urls.
    		foreach ( $feedURL as $feed ) {
    			if ( strpos( strtolower( $link ), 'www.lavanguardia.com' ) !== false ) {
    				$source	= 'La Vanguardia';
    			} elseif ( strpos( strtolower( $link ), 'ep00.epimg.net' ) !== false ) {
    				$source	= 'El País';
    			} elseif ( strpos( strtolower( $link ), 'estaticos.elmundo.es' ) !== false ) {
    				$source	= 'El Mundo';
    			} elseif ( strpos( strtolower( $link ), 'api2.rtve.es' ) !== false ) {
    				$source	= 'RTVE.es';
    			} elseif ( strpos( strtolower( $link ), 'www.europapress.es' ) !== false ) {
    				$source	= 'Europa Press';
    			} elseif ( strpos( strtolower( $link ), 'www.abc.es' ) !== false ) {
    				$source	= 'ABC';
    			} elseif ( strpos( strtolower( $link ), 'www.elperiodico.com/' ) !== false ) {
    				$source	= 'El Periódico';
    			} elseif ( strpos( strtolower( $link ), 'e00-expansion.uecdn.es/' ) !== false ) {
    				$source	= 'Expansión';
    			} elseif ( strpos( strtolower( $link ), 'elmundo.es/' ) !== false ) {
    				$source	= 'El Mundo';
    			}
    		}
    	} else {
    		// if feedURL is a single url.
    	}
    	
    	return $source;
    }
    
    Thread Starter vegroland

    (@vegroland)

    @rozroz, I’ve tried it.
    Partially works only. 5 feed source name appear good.
    Europa Press, La Vanguardia, El Periódico and RTVE don’t work, only showing blank area instead of the name.
    I’ve modified theirs url in several ways but without success.
    I really don’t know what could be the problem.

    This not depends of the feed’s content, no? If the url is declared it should be appear.

    Plugin Contributor contactashish13

    (@rozroz)

    @vegroland as you see some URLs work. Unfortunately, we can only provide you the structure of the hook; beyond that you will have to figure out what more URLs to add.

    Thread Starter vegroland

    (@vegroland)

    @rozroz, yes and I really appreciate your help!!

    The only thing that is not clear: with the same structure how can work one and another one not?
    I’ve tried various version in the last few day and I dont’t know it.
    (I’m using the same URL format for every feed in the hook)

    I’m trying to use your plugin to build my page but I’m confused.

    Plugin Contributor contactashish13

    (@rozroz)

    We are marking this thread as resolved.

    Please don’t forget to leave us a review. It would really help us spread the word!

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Source name’ is closed to new replies.