Forum Replies Created

Viewing 15 replies - 16 through 30 (of 37 total)
  • Forum: Hacks
    In reply to: show posts of a subcategories
    Thread Starter carlosgonca

    (@carlosgonca)

    I tried this but I get error. I think I have to have three “if” the code that I put here, the second to do a loop to show the subcategory select, but with permalink to the post and other to show the single post, but I don′t know how.

    Forum: Hacks
    In reply to: show posts of a subcategories
    Thread Starter carlosgonca

    (@carlosgonca)

    any help?

    Thread Starter carlosgonca

    (@carlosgonca)

    I have this code in category.php

    <?php
    /**
     * The template for displaying Category Archive pages.
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    
    get_header(); ?>
    
    		<section id="primary">
    			<div id="content-category" role="main">  
    
    			<?php if ( have_posts() ) : ?>
    
    				<header class="page-header">
    					 <h1 class="entry-title2"><?php _e('Produtos'); ?></h1>
    
    					<?php
    						$category_description = category_description();
    						if ( ! empty( $category_description ) )
    							echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
    					?>
    
    				</header>
    
    				<?php twentyeleven_content_nav( 'nav-above' ); ?>
    
    				<?php /* Start the Loop */ ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php
    						/* Include the Post-Format-specific template for the content.
    						 * If you want to overload this in a child theme then include a file
    						 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    						 */
    						get_template_part( 'content', 'category' );
    					?>
    
    				<?php endwhile; ?>
    
    				<?php twentyeleven_content_nav( 'nav-below' ); ?>
    
    			<?php else : ?>
    
               	<article id="post-0" class="post no-results not-found">
    					<header class="entry-header">
    						<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
    					</header><!-- .entry-header -->
    
    					<div class="entry-content">
    						<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
    						<?php get_search_form(); ?>
    					</div><!-- .entry-content -->
    				</article><!-- #post-0 -->
    
    			<?php endif; ?>
    
    			</div><!-- #content -->
    		</section><!-- #primary -->
    
    <?php get_footer(); ?>

    and in content-category.php this

    <?php
    /**
     * The template for displaying posts in the Gallery Post Format on index and archive pages
     *
     * Learn more: https://codex.www.ads-software.com/Post_Formats
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">
    
    	</header><!-- .entry-header -->
    
    	<?php if ( is_search() ) : // Only display Excerpts for search pages ?>
    		<div class="entry-summary">
    
    			<?php the_excerpt(); ?>
    		</div><!-- .entry-summary -->
    		<?php else : ?>
    		<div class="entry-content-category">
    			<?php if ( post_password_required() ) : ?>
    				<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
            <?php else : ?>       
    
    		 <span class="cat-links"><h3 class="entry-title">
    	<?php
    foreach((get_the_category()) as $childcat) {
    if (cat_is_ancestor_of(12, $childcat)) {
    echo '<a href="'.get_category_link($childcat->cat_ID).'">';
     echo $childcat->cat_name . '</a>';
    }}
    ?></h3>
    		        <?php
    foreach((get_the_category()) as $childcat) {
    if (cat_is_ancestor_of(icl_object_id(12, 'category', false), $childcat)) {
    echo '<div id="thumb-category"><a href="'.get_category_link($childcat->cat_ID).'">';
     echo do_shortcode('[types field="imagem-1" alt='.($childcat->cat_ID).' title="'.get_category_link($childcat->cat_ID).'" size="thumbnail" align="none"]') . '</a><div>';
    }}
    ?></span> 
    
    		<?php endif; ?>
    		<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    	</div><!-- .entry-content -->
    	<?php endif; ?>
    
    	<footer class="entry-meta">
    
    		<?php
    			/* translators: used between list items, there is a space after the comma */
    			$tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    			if ( $tags_list ):
    			if ( $show_sep ) : ?>
    		<span class="sep"> | </span>
    			<?php endif; // End if $show_sep ?>
    		<span class="tag-links">
    			<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
    			$show_sep = true; ?>
    		</span>
    		<?php endif; // End if $tags_list ?>
    
    	</footer><!-- #entry-meta -->
    </article><!-- #post-<?php the_ID(); ?> -->

    I can show subcategory perfect with ther first image of some of the posts, but when I click I have to go to page with posts of this subcategory and if I click in one of the posts, go to single page of it. How can I do this?

    Almost. I tried it now, image fade perfect but text has problem yet. The second text overlay the first without any fade. This in IE 8. But It is some advance. We are going almost to the point…:)

    The problem is not with add code to autoslide. The problem is with the method. In original code, css fade is used. IE8 and IE7 have problem with css fade. So after try many solutions, I decided to stop with fade in IE, in other browsers continues. I change the code to:

    (function($) {
    	$(document).ready( function() {
      $('.feature-slider a').click(function(e) {
    
    		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
     var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
     if (ieversion>=8)
    
    	        $('.featured-posts section.featured-post').css({
    	            opacity: 1,
    	            visibility: 'hidden'
    	        }); }
    else
     			$('.featured-posts section.featured-post').css({
    	            opacity: 0,
    	            visibility: 'hidden'
    	        });
    
    	        $(this.hash).css({
    	            opacity: 1,
    	            visibility: 'visible'
    	        });
    	        $('.feature-slider a').removeClass('active')
    	        $(this).addClass('active');
    	        e.preventDefault();
    	    });
    	});
    	var current=1;

    If browser is IE I put the start opacity to 1 like the second. So It doesn′t have any animation, only show and hide the image. To resolve the problem with black borders (with PNG and Gif too) I used it

    function fixPNGs(){
      if(jQuery.browser.msie && jQuery.browser.version < 9){
     var i;
     //alert(document.images.length);
     for(i in document.images){
       if(document.images[i].src){
      var imgSrc = document.images[i].src;
      if(imgSrc.substr(imgSrc.length-4) === '.png' || imgSrc.substr(imgSrc.length-4) === '.PNG'){
      document.images[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='crop',src='" + imgSrc + "')";
      }
       }
     }
      }
    }

    It not the perfect solution, because in the second loop, I don′t know why, the first imagem show with black borders. I use PNG and GIF with background transparent.

    Thread Starter carlosgonca

    (@carlosgonca)

    answer here

    Thanks a lot for your help!

    Thread Starter carlosgonca

    (@carlosgonca)

    Perfect! Thanks a lot for your help!

    Thread Starter carlosgonca

    (@carlosgonca)

    Ok, thanks for your help!

    Thread Starter carlosgonca

    (@carlosgonca)

    Any help please!

    Thread Starter carlosgonca

    (@carlosgonca)

    I try to use this but I get error message:

    <?php if $download = get_post_meta($post->ID, 'manual em pdf', true) {?>
    <a href="<?php
    $download = get_post_meta($post->ID, 'manual em pdf', true);
    echo wp_get_attachment_url($download);
    ?>" target="_blank">Manual</a></br>
    <?php } else {?>
    nothing
    <?php }?>
    Thread Starter carlosgonca

    (@carlosgonca)

    Thanks a lot for your fast answer. I will try this and post here if runs ok.

    Thread Starter carlosgonca

    (@carlosgonca)

    I found a solution. I put this

    background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 0%); /* FF3.6+ */
    	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(0%,rgba(0,0,0,0))); /* Chrome,Safari4+ */
    	background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 0%); /* Chrome10+,Safari5.1+ */
    	background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 0%); /* Opera11.10+ */
    	background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 0%); /* IE10+ */
    	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
    	background: linear-gradient(0,rgba(0,0,0,0) 0%); /* W3C */
    Thread Starter carlosgonca

    (@carlosgonca)

    Sorry but it′s not the solution. If I remove the function, It continues to run from original function.php file. I need to remove this function, or deactivate it, but I don′t know how. And It needs to be in the child function file.

    Thread Starter carlosgonca

    (@carlosgonca)

    THis solution ok if I use it in Twenty Ten′s function, but I want to use in child function theme. If I put this there, I receive a error message. I need a solution to child theme.

    thanks a lot.

    same problem. We have to wait for a solution

Viewing 15 replies - 16 through 30 (of 37 total)