Forum Replies Created

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter spakainas

    (@spakainas)

    Okay, so i minimised the above tcp_template.php code to this (since I won’t be using any options):

    /**
     * Outputs the image, of the product or of the product's parent
     *
     * @uses tcp_get_the_thumbnail
     * @since 1.3.4
     */
    function tcp_the_thumbnail( $post_id = 0, $option_1_id = 0, $option_2_id = 0, $size = 'thumbnail', $attr = false ) {
    	echo tcp_get_the_thumbnail( $post_id, $option_1_id, $option_2_id, $size, $attr );
    }
    
    	function tcp_get_the_thumbnail( $post_id = 0 ) {
    		$image = '';
    
    		$image = tcp_get_the_thumbnail_image( $post_id );
    			if ( has_post_thumbnail( $post_id ) ) {
    				$post_id = tcp_get_default_id( $post_id, get_post_type( $post_id ) );
    				$image = tcp_get_the_thumbnail_image( $post_id );
    			}
    
    		return apply_filters( 'tcp_get_the_thumbnail', $image, $post_id );
    	}

    My question is now how to implement a below code of Advanced Custom Field into above tcp_template.php code, so I could get a picture put via Advanced Custom field?

    <?php $attachment_id = get_field('thumbnails');
    $size = "thumbnail";
    
    $image = wp_get_attachment_image_src( $attachment_id, $size );
    
    ?>
    <img src="<?php echo $image[0]; ?>" />

    Thread Starter spakainas

    (@spakainas)

    Well, I can only say I solved it.. partially.
    I exported Catablog data before setting site to English. I did a backup.
    Changed language to Lithuanian (in top admin bar) and did import. So it kind of worked. If I need to add new project, I need to upload pictures for both. That’s a minus but what can I do? ??

    Thread Starter spakainas

    (@spakainas)

    Thank you.

    I just followed the plugin guidelines the author provided
    https://www.ads-software.com/plugins/previous-and-next-post-in-same-taxonomy/

    I read through plugin author channel that in future WordPress release 3.8 this plugin expansion I used will be available without plugin.

    All the best. ??

    P.S. – Might as well add your blog to favorites since I might find some info I need it in the future. ??

    Thread Starter spakainas

    (@spakainas)

    Just want to let it know that after few days of searches I finally solved it.
    If someone someday meets with the similar problem – here is how to solve it.

    1. I installed the plugin “Previous and Next Post in Same Taxonomy”.
    2. Next – I changed code

    <?php previous_post_link('%link', '%title', false); ?>
    <?php next_post_link('%link', '%title>', false); ?>

    to:

    <?php be_previous_post_link('%link', '%title', true, '', 'catablog-terms'); ?>
    <?php be_next_post_link('%link', '%title', true, '', 'catablog-terms'); ?>

    If you changed the Default Catablog Options – instead of ‘catablog-terms’ use the “Category Pages Slugs” you have written under Catablog -> Public -> Category Pages Slug.
    Cheers! ??

    Thread Starter spakainas

    (@spakainas)

    I have tried the default theme. The same problem. Yes, I know this structure. I will change it later. Thanks for suggestions. ??

    Thread Starter spakainas

    (@spakainas)

    Solved,
    I simply needed to use <?php previous_post(); ?> <?php next_post(); ?> links.

    Thread Starter spakainas

    (@spakainas)

    Hey, thanks for your answer. Sadly this tutorial doesn’t help. And it actually doesn’t suit my problem since my permalinks all work, the problem is with items disappearing when I go into single page item from catalog.
    My permalink structure is Default. (example – ?p=123)

    I believe it has something to do with link structure.
    Maybe it has to do with how many is written in functions.php ? I noticed this is also a problem on standart WordPress layout too. The only difference is that there you see sub-menu on hover (not always when you go into it). So you can notice that when you go into product the sub-menu link becomes not “marked” (active).
    And the sub-menu navigation is registered in functions.php . Maybe this should be modified somehow?

    function sm_subnav()
    {
    	global $post, $wpdb;
    
    	if ( is_page() )
    	{
    		$child_of = null;
    
    		if ( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='page' && post_parent = ".$post->ID) > 0 ){
    			$child_of = $post->ID;
    		}
    		else if ( $post->post_parent != 0 ){
    			$child_of = $post->post_parent;
    		}
    
    		if ( !is_null($child_of) )
    		{
    			echo '<div class="navigation" id="sub-nav-1">' . "\n";
    				echo '<ul class="katalogas">' . "\n";
    					wp_list_pages('title_li=&child_of='.$child_of);
    				echo '</ul>' . "\n";
    				echo '<div class="clearer">?</div>' . "\n";
    			echo '</div>' . "\n";
    		}
    	}
    }

    Thread Starter spakainas

    (@spakainas)

    Case closed ??

    Thread Starter spakainas

    (@spakainas)

    Thank you for this suggestion!
    It worked out really well.

Viewing 9 replies - 16 through 24 (of 24 total)