WordPress.org

Ready to get started?Download WordPress

Forums

LINK: whitespace between desciption and image (8 posts)

  1. ka81
    Member
    Posted 4 years ago #

    /wp-includes/bookmark-template.php

    function _walk_bookmarks($bookmarks, $args = '' ) {
    	$defaults = array(
    		'show_updated' => 0, 'show_description' => 0,
    		'show_images' => 1, 'show_name' => 0,
    		'before' => '<li>', 'after' => '</li>', 'between' => "\n",
    		'show_rating' => 0, 'link_before' => '', 'link_after' => ''
    	);
    
    	$r = wp_parse_args( $args, $defaults );
    	extract( $r, EXTR_SKIP );
    
    	$output = ''; // Blank string to start with.
    
    	foreach ( (array) $bookmarks as $bookmark ) {
    		if ( !isset($bookmark->recently_updated) )
    			$bookmark->recently_updated = false;
    		$output .= $before;
    		if ( $show_updated && $bookmark->recently_updated )
    			$output .= get_option('links_recently_updated_prepend');
    
    		$the_link = '#';
    		if ( !empty($bookmark->link_url) )
    			$the_link = esc_url($bookmark->link_url);
    
    		$desc = esc_attr(sanitize_bookmark_field('link_description', $bookmark->link_description, $bookmark->link_id, 'display'));
    		$name = esc_attr(sanitize_bookmark_field('link_name', $bookmark->link_name, $bookmark->link_id, 'display'));
     		$title = $desc;
    
    		if ( $show_updated )
    			if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) {
    				$title .= ' (';
    				$title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * 3600)));
    				$title .= ')';
    			}
    
    		$alt = ' alt="' . $name . ( $show_description ? ' ' . $title : '' ) . '"';
    
    		if ( $show_description && '' != $desc )
    			$output .= $between . $desc;
    
    		if ( '' != $title )
    			$title = ' title="' . $title . '"';
    
    		$rel = $bookmark->link_rel;
    		if ( '' != $rel )
    			$rel = ' rel="' . esc_attr($rel) . '"';
    
    		$target = $bookmark->link_target;
    		if ( '' != $target )
    			$target = ' target="' . $target . '"';
    
    		$output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>';
    
    		$output .= $link_before;
    
    		if ( $bookmark->link_image != null && $show_images ) {
    			if ( strpos($bookmark->link_image, 'http') === 0 )
    				$output .= "<img src=\"$bookmark->link_image\" $alt $title />";
    			else // If it's a relative path
    				$output .= "<img src=\"" . get_option('siteurl') . "$bookmark->link_image\" $alt $title />";
    
    			if ( $show_name )
    				$output .= " $name";
    		} else {
    			$output .= $name;
    		}
    
    		$output .= $link_after;
    
    		$output .= '</a>';
    
    		if ( $show_updated && $bookmark->recently_updated )
    			$output .= get_option('links_recently_updated_append');
    
    		if ( $show_rating )
    			$output .= $between . sanitize_bookmark_field('link_rating', $bookmark->link_rating, $bookmark->link_id, 'display');
    
    		$output .= "$after\n";
    	} // end while
    
    	return $output;
    }

    url - x-files.net.ua/?page_id=1336

    i placed in bookmark-template description before image, but i can't find out how to make them not so close to each other.
    how to place whitespace or any symbole between them??

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Leave the core files alone unless you really, really, know what you're doing. Otherwise it's one sure way to bring your entire site down very quickly.

    This isn't a script issue - it's a CSS one. Try amending:

    .content .linkcat li a img {
    border:0 none;
    margin:0;
    padding:0;
    vertical-align:middle;
    }

    to

    content .linkcat li a img {
    border:0 none;
    margin:0 0 0 30px;
    padding:0;
    vertical-align:middle;
    }

    in style.css

  3. ka81
    Member
    Posted 4 years ago #

    thanx a lot!!

    P.S. aboutchanging core - how else could i replace image and description?..

  4. esmi
    Forum Moderator
    Posted 4 years ago #

  5. ka81
    Member
    Posted 4 years ago #

    i'm sorry, just can't get it:
    how, using this template code in my page (text area) a i can get showing on www-page:
    desription - image
    ?
    like now it is.

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    get_boomarks isn't a template tag. It's a function that will return all of your bookmarks so you can sort and list them on your pages as you want.

  7. ka81
    Member
    Posted 4 years ago #

    if you please, one more question:
    concerning codes are:

    .content .linkcat {width:520px;list-style-type: none; padding: 0; margin:0;}
    .content .linkcat li a img {border: 0; padding: 0; margin:0 0 0 10px; vertical-align: middle;}
    .content .linkcat li {list-style-type: none; font-size: 12px;padding: 0; margin: 0;}
    .content .linkcat ul {list-style-type: none; padding: 0; margin: 0;}
    .content .linkcat h2 {display: none;}

    all texts are by default starting aligned to left side.
    i want images to be aligned to right side of linkcat block.
    i tried to use float:right for li a img but result is ugly. would you please help with that?

  8. ka81
    Member
    Posted 4 years ago #

    help please..

Topic Closed

This topic has been closed to new replies.

About this Topic