Jump to content
php.lv forumi

osC

Reģistrētie lietotāji
  • Posts

    122
  • Joined

  • Last visited

Posts posted by osC

  1. Nomeklē šito un iekopē ar visu turpinājumu

     

    function max_get_timthumb_image

    function max_get_timthumb_image( $return = false, $p_id = false, $img_size = 'full' ){
    
    	global $shortname, $post, $imgDimensions, $imgDimensions1x, $p_tpl, $resize_images;
    
    	$max_mobile_detect = new Mobile_Detect(); // get the sting we need for the different devices
    	$size              = $img_size; // set the attachment image size
    	$post_id           = !$p_id ? $post->ID : $p_id; 	// check if its a lightbox or a project page link
    	$photo_item_type   = get_post_meta($post_id,  MAX_SHORTNAME.'_photo_item_type_value', true); // get the item type
    	$imgUrl            = max_get_post_image_url($post_id, $size); // Get the post image url
      $tpl_show_lightbox = get_post_meta(get_query_var('page_id'), MAX_SHORTNAME.'_disable_post_lightbox', true); // check to show the lightbox on this page template
      $use_timthumb      = get_option_max('image_use_timthumb');
    
  2. function max_get_post_custom_image($imgID, $p_id = false, $return = false, $img_size = 'full' ) {
    
      // get the image
    	$output = max_get_timthumb_image( $return, $p_id, $img_size );
    
    	// return the created image
    	if($return === true){
    		return $output;
    	}else{
    		echo $output;
    	}
    

     

    šitas ir īstais

    function max_get_post_custom_image($imgID, $p_id = false, $return = false, $img_size = 'full' ) {

     

    iekopē turpinājumu

  3. Šo te izmeta:

    		// get the gallery item 
    		max_get_post_custom_image(get_post_thumbnail_id());
    
    	        if($itemCaption === true) {
    
    
    					// get the gallery item
    					max_get_post_custom_image(get_post_thumbnail_id(), false, false, $image_size);
    
    					if($itemCaption === true) {
    
    function max_get_post_custom_image($imgID, $p_id = false, $return = false, $img_size = 'full' ) {
    

    Neizskatās ka būtu kautkas uz taga "a" pusi

    Labi, tagad nomeklē šito

    function max_get_post_custom_image

  4. Es tak saku tas nav īstai a tags

     

    Iekopē kodu kas seko aiz šitā. Tur jābūt īstajam a tagam

     

    <li data-time="<?php the_time('m/d/Y H:i') ?>" data-modified="<?php the_modified_time('Y-m-d H:i') ?>" data-menuorder="<?php echo $post->menu_order ?>" data-id="id-<?php echo get_the_ID() ?>" class="item <?php echo $lightbox_class ?> <?php echo $_term_classes; ?><?php if( get_option_max( 'image_show_caption' ) == "always") { echo(" show-title"); } ?><?php if( get_option_max('image_show_fade') != "true" || get_post_meta(get_query_var('page_id'), MAX_SHORTNAME.'_disable_post_lightbox', true) == 'true' || get_post_meta(get_the_ID(), MAX_SHORTNAME.'_photo_item_type_value', true) == 'disable_link' ) { echo(" no-hover"); } ?>">

                    <div class="shadow">

    augstāk :)

  5. Ok, rekur pāris rinas pēc pirmā bloka:

    				<?php
    					// get the gallery item
    					max_get_post_custom_image(get_post_thumbnail_id(), false, false, $image_size);
    
    					if($itemCaption === true) {
    
    						// check if caption option is selected
    						if ( get_option_max( 'image_show_caption' ) == 'true' || get_option_max( 'image_show_caption' ) == 'always'  ) {
    						?>
    
    						<div class="item-caption">
    							<strong class="title"><?php echo get_the_title() ?></strong><br />
    							<?php
    								if(!$hideExcerpt) {
    									echo strip_tags(get_the_excerpt());
    								}
    							?>
    						</div>
    
  6. Otrajā blokā ieskaties title="' . strip_tags(get_the_title()) . '"

    Kaut gan tas nav īstais a tags. Taviem meklējamajiem a tagiem ir vēl atribūti data-link, data-rel

     

     

     

    Pirmajā blokā esi atradis div class="shadow", iekopē kodu, kas seko aiz <div class="shadow">

    Esi jau pavisam tuvu

    hmm, interesanti, bet izdzēšot visu rindu

    <div class="shadow">
    											<?php echo '<a href="' . get_permalink() . '" title="' . strip_tags(get_the_title()) . '"><img src="' . $_imgUrl .'" alt="' . strip_tags(get_the_title()) . '" /></a>'; ?>
    										</div>
    

    nekas nenotiek. :/

  7. Rekur šitādus rezultātus izmeta. Kautkā neredzās tas title. :/

    			<li data-time="<?php the_time('m/d/Y H:i') ?>" data-modified="<?php the_modified_time('Y-m-d H:i') ?>" data-menuorder="<?php echo $post->menu_order ?>" data-id="id-<?php echo get_the_ID() ?>" class="item <?php echo $lightbox_class ?> <?php echo $_term_classes; ?><?php if( get_option_max( 'image_show_caption' ) == "always") { echo(" show-title"); } ?><?php if( get_option_max('image_show_fade') != "true" || get_post_meta(get_query_var('page_id'), MAX_SHORTNAME.'_disable_post_lightbox', true) == 'true' || get_post_meta(get_the_ID(),  MAX_SHORTNAME.'_photo_item_type_value', true) == 'disable_link' ) { echo(" no-hover"); } ?>">
    				<div class="shadow">
    
    
    									<li data-id="id-<?php echo get_the_ID() ?>" class="item <?php echo max_get_post_lightbox_class(); ?><?php if( get_option_max('image_show_fade') != "true") { echo(" no-hover"); } ?>">
    										<div class="shadow">
    											<?php echo '<a href="' . get_permalink() . '" title="' . strip_tags(get_the_title()) . '"><img src="' . $_imgUrl .'" alt="' . strip_tags(get_the_title()) . '" /></a>'; ?>
    										</div>
    
    
    						<li data-id="id-<?php echo $post->ID ?>" class="item <?php echo max_get_post_lightbox_class() . " "; ?><?php echo $_term_classes . " "; ?><?php if( get_option_max('image_show_fade') != "true") { echo("no-hover"); } ?>">
    							<div class="shadow">
    
    

     

    Pameklē templeitos pēc: <div class="shadow">

    šitas div tags tieši iewrapo to a tagu, kuru meklē. Šitā būs vieglāk atrast

  8. Ok, ar to overflow itkā būtu skaidrs, bet vēl jo projām nav saprašanas ar hoveru. Čakarē prātu vēl jo projām. Meklējos es iekš visiem template failiem ar notepad++, bet rezultāta pašalik vēl nekāda. Kāds nevar paskatīties? Links šeit , ja nu kas, tad parādā toč nepalikšu. #free_beer_at_paypal :)

     

    > Uz hoveru izpeldošais teksts ir title atribūts a tagam.

    Nav teikts, ka “a“ tagam. Tik pat labi “b“.

    Also, es tak viņam iedevu linkus. Kas būs nākamais — kāds uzkodēs viņa vietā?

     

     

    Uz hoveru izpeldošais teksts ir title atribūts a tagam. Kur tas tiek uzstādīts nevaru pateikt neredzot pašus templeit failus. Katrai tēmai tas var būt citur

     

    Scrollbars ir tāpēc, ka kādam no tagiem CSSā ir uzstādīts overflow:auto vai arī overflow: scroll. Neredzot lapu nevaru pateikt, kurā vietā tas tiek uzstādīts

    Google Chromam uzspied ar labo peles taustiņu, paņem Inspect element. Klikšķini pa html tagiem un skaties, kuram ir uzlikts overflow:auto. Tur pat auto nomaini uz hidden, ja scrollbars pazūd, tad esi atradi īsto vietu. Tālāk skaties, kurā cssā tas ir un nolabot css failu

  9. Es galīgi netieku galā ar mouse hover. Par mouse hover atbild noteikti PHP, nevis CSS, vaine? Un tas kas atbild par mouse hover atradīsies šajā pašā lapas template vai pašā wordpress

     

    Tas hovera teksts izskatās pēc Excerpt

     

    Atver functions.php un pameklē šādu kodu

     

    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

     

    function custom_excerpt_length( $length ) {
        return 20; // Šitas ir excerpt garums
    }
     

  10. Jā, šitas būs īstais

     

    add_filter('excerpt_length', create_function('$a', 'return 50;'));

     

    Nomaini 50 pret lielāku skaitli

    ok, tas itkā būtu. vēl, kā var noņemt to stulbo scroll bar labajā pusē? itkā defaultā viņš nenāk līdzi, bet nu, jēgas viņam arī nekādas nav, jo pārvieto tikai kādus pāris pikseļus uz augšu un leju.

    tad vēl, kā varētu noņemt to stulbo hover tekstu, kad ar peli uziet uz bildes? tas galīgi traucē. ķeburi lieki un jēgas arī nekādas.

  11. Tas hovera teksts izskatās pēc Excerpt

     

    Atver functions.php un pameklē šādu kodu

     

    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

     

    function custom_excerpt_length( $length ) {

        return 20; // Šitas ir excerpt garums

    }

     

    hmm, atradu tikai šādu...

    /*-----------------------------------------------------------------------------------*/
    /*  Add Excerpt Support to pages
    /*-----------------------------------------------------------------------------------*/
    add_post_type_support('page', array('excerpt'));
    add_filter('excerpt_length', create_function('$a', 'return 50;'));
    
    

    šis būs? 

  12. Sveiki, man radušās pāris problēmiņas ar Wordpress. Respektīvi, vēlos nedaudz rediģēt linku lapu veidni (template). 

    Tad nu tā, lieta tāda, ka uzejot ar peli uz bildes (kā parādīts attēlā) uzlec teksts ar ikonām un fonu. 

    Lietas ko vēlētos parediģēt:

    1. Izlabot CSS tā, lai teksts rādītos pa visu attēlu (nevis tikai daļu, kur beigās ir [...] )
    2. Izņemt peles kursora hover teksta lodziņu (kas tāpat rādās nesakarīgi) 
    3. noņemt bezjēdzīgo lapas ritinātāju labajā pusē 

    Parādīju arī nedaudz visu grafiski, lai ir kautkāda saprašana. 

    Tad vēl paskatījos, un atradu PHP un CSS lapas template.

     

    28hkklh.jpg

    Tad vēl uzgāju pāris kodus.

    <?php
    /**
     * Template Name: Portfolio Fullsize Scroller
     *
     * @package WordPress
     * @subpackage Invictus
     * @since Invictus 1.0
     */
    
    global $meta;
    
    $meta                   = max_get_cutom_meta_array();
    $meta_scroller_height   = get_post_meta($post->ID, MAX_SHORTNAME.'_max_scroller_height', TRUE);
    $scroller_height        = !empty($meta_scroller_height) ? $meta_scroller_height : 0;
    
    get_header();
    
    // show the item caption of an image on hover?
    $itemCaption = true;
    
    // Hide the excerpt on hover?
    $hideExcerpt = false;
    
    ?>
    
    		<div id="primary" class="clearfix portfolio-fullsize-scroller<?php if ( post_password_required() ) : ?> portfolio-fullsize-closed<?php endif; ?>">
    			<div id="content" role="main" class="clearfix">
    
    				<header class="entry-header">
    
    				<h1 class="page-title"><?php the_title(); ?></h1>
    				<?php
    				// check if there is a excerpt
    				if( max_get_the_excerpt() ){
    				?>
    				<h2 class="page-description"><?php max_get_the_excerpt(false) ?></h2>
    				<?php } ?>
    
    				</header><!-- .entry-header -->
    
    				<?php /* -- added 2.0 -- */ ?>
    				<?php the_content() ?>
    				<?php /* -- end -- */ ?>
    
    				<?php if ( !post_password_required() ) { ?>
    				<div id="customScroller" class="scroll-pane">
    
    					<div class="scroll-content">
    					<?php
    						// including the loop template gallery-loop.php
    						get_template_part( 'includes/gallery', 'loop.inc' );
    					?>
    					</div>
    					<a href="#scroll-left" id="scroll_left" class="scroller-arrow disabled">Scroll Left</a>
    					<a href="#scroll-right" id="scroll_right" class="scroller-arrow">Scroll Right</a>
    
    					<div class="scroll-bar-wrap ui-widget-content ui-corner-bottom">
    						<div class="scroll-bar"></div>
    					</div>
    
    					<div class="overlay"></div>
    
    				</div>
    				<?php } ?>
    
    			</div><!-- #content -->
    		</div><!-- #container -->
    
    <?php get_footer(); ?>
    
    

    un tad vēl css'ā atradu pāris rindas ar šo te:

    	/** Scrollable Fullsize Portfolio **/
    	.portfolio-fullsize-scroller .portfolio-list { margin: 0; }
    	.portfolio-fullsize-scroller .portfolio-list li { margin: 0 10px 22px 0; display: block; }
    	.portfolio-fullsize-scroller .portfolio-list li:last-child { margin-right: 0; }
    
    	.portfolio-fullsize-scroller .scroll-content { width: 100000px; } /* set it to extra large to not break images in two or more lines on load */
    
    	.portfolio-fullsize-scroller .scroll-pane {
    		overflow: hidden;
    		width: 100%;
    		float: left;
    		position: relative;
    		padding: 0 0 13px;
    	}
    	.portfolio-fullsize-scroller .scroll-content { float: left; }
    
    	.portfolio-fullsize-scroller .scroll-pane .overlay {
        position: absolute;
        top: 0;
        left:  0;
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        display: none;
    	}
    
    	.portfolio-fullsize-scroller .scroll-bar-wrap {
    		position: absolute;
    		margin: 0;
    		bottom: 0;0
    		height: 50px;
    		right: 0;
    		left: 0;
    	}
    
    	.portfolio-fullsize-scroller .scroll-bar {
    		margin: 0;
    		position: absolute;
    		bottom: 0;
    		left: 0;
    		height: 12px;
    	}
    
    	.portfolio-fullsize-scroller .scroll-bar a.ui-slider-handle {
    
    		display: block;
    		position: absolute;
    		top: 1px;
    		width: 64px; height: 10px;
    		color: rgba(0,0,0,.5);
    		text-shadow: 0 1px 0 rgba(255,255,255,.3);
    		text-align: center;
    		line-height: 1;
    		padding: 0;
    		font-size: 10px;
    		text-decoration: none;
    		letter-spacing: 2px;
    		font-weight: bold;
    
    		background-image: -webkit-linear-gradient(top, rgba(242, 242, 242, 0.25), rgba(209, 209, 209, 0));
    		background-image: -moz-linear-gradient(top, rgba(242, 242, 242, 0.25), rgba(209, 209, 209, 0));
    		background-image: -o-linear-gradient(top, rgba(242, 242, 242, 0.25), rgba(209, 209, 209, 0));
    		background-image: -ms-linear-gradient(top, rgba(242, 242, 242, 0.25), rgba(209, 209, 209, 0));
    		background-image: linear-gradient(top, rgba(242, 242, 242, 0.25), rgba(209, 209, 209, 0));
    
    
    	}
    
    	.portfolio-fullsize-scroller a.scroller-arrow {
    		position: absolute;
    		display: block;
    		text-indent: -999em;
    		z-index: 20;
    		top: 50%;
    		margin-top: -32px;
    		width: 52px;
    		height: 64px;
    
    		display: none;
    	}
    
    	.portfolio-fullsize-scroller a#scroll_left { left: 0; background-position: 0 50%; }
    	.portfolio-fullsize-scroller a#scroll_right { right: 0; background-position: 100% 50%; }
    
    	.portfolio-fullsize-scroller a.disabled { display: none; }
    
    

    Tad nu tā, vēlējos uzzināt, kur ir aprakstīts tieši par to, kur uzlecošais logs uz hover atbilst tā teksta garumam? 

    Kāds varbūt var palīdzēt? Būtu ļoti pateicīgs. Parādā nepalikšu! :) 

  13. Tas ir tikai bibliotēkas source, kur ir kods, kurš attēlo tavu karti? Vienkārši inkludojot source, nekas nemainīsies.

     

    Un ko tu domā ar tevis izvēlētu bildi? Ja tu gribi, lai defaultā attēlojas kāda konkrēta lokācija kartē, tad tas jānorāda tajā kodā, kurš attēlo karti.

    Interesantākais ir tas, ka es nemaz nevaru atrast lokācijas kodu, kurš norāda uz vietu. Vienīgais ko varu atrast index.html par karti ir vēl šis:

    				<div class="map" id="map"></div>
    
    
  14. Sveiki, man ir radusies problēma. Respektīvi - kā izveidot Google Maps api linku? Ielādēju no neta html5 template un re kā, vienā līnijā rāda, ka vajagot Maps API. To es gribu nomainīt tā, lai karti mājaslapā rāda kā manis izvēlēto, nevis to, kas jau ir. Tātad, pašlaik links uz API ir šāds:

    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyASm3CwaK9qtcZEWYa-iQwHaGi3gcosAJc&sensor=false&lang=en"></script>
    
    

    Bet kā es varu šo linku nomainīt, lai lapā rādītos manis izvēlēta bilde no Google Maps?

     

    Paldies!

     

  15. Sanāca ietilpināt bildi ekrānā, bet atkal problēma.

    Menu ir izkustējies 2m3gw0l.png

     

     

    index.html rakstīju šādi:

    <body>
    <img alt="full screen background image" src="http://www.jzstudio.lv/images/background.jpg" id="full-screen-background-image" />
     <div id="wrapper">
    <p> viiss lapas saturs </p>
     </div>
    </body>
    

     

    un style.css šādi:

     

    #full-screen-background-image {
     z-index: -999;
     min-height: 100%;
     min-width: 1024px;
     width: 100%;
     height: auto;
     position: fixed;
     top: 0;
     left: 0;
    }
    #wrapper {
     position: fixed;
     width: 800px;
     min-height: 400px;
     margin: 100px auto;
     color: #333;
    }
    

  16. Body jāliek tač vaine?

    Ieliku

    <body>
    
    
     <script>
    Query(function($){  	 
     $.supersized({    
       	slides  :   [ {image : 'http://buildinternet.s3.amazonaws.com/projects/supersized/3.2/slides/kazvan-1.jpg', title : 'Image Credit: Maria Kazvan'} ]   
     });    
    });
    </script>
    </body>

    Bet nav background bildes, viss melns.

  17. Ok, tomēr sataisīju background css'ā šādi:

    body {
     background-image: url("http://jzstudio.lv/images/background.jpg");
     background-repeat: no-repeat;
    }
    

     

    Tikai tagad ir problēma tāda, ka tā bilde ir ļoti milzīga, ir iespējams viņu sataisīt tā, lai būtu pilnā izmērā uz visu izšķirtspēju monitoriem un browseriem?

×
×
  • Create New...