Forum Replies Created

Viewing 15 replies - 1 through 15 (of 17 total)
  • I have no problem with this, 5.1.1 installed. Maybe there is some conflict with another plugin?

    For me works in mobile like a charm, I don’t know which problem do you have.

    Thread Starter nuriarai

    (@nuriarai)

    Yes, this was the problem. Yet resolved!

    Thank you very much!

    Thread Starter nuriarai

    (@nuriarai)

    It seems a problem wiht load-more.js because it has errors in console, and only in this pages. I think you point me in the right direction. I explore this.

    Thread Starter nuriarai

    (@nuriarai)

    Thanks a lot for your quick answer. In the meantime I discovered that this behaviour is not only in results page, also in all pages (post_type=”page”) but not in home nor in archive pages.

    You can test here, this is a secondary development site so a lot of things are still ugly.

    https://paddingzero.com/testing/ingblog/

    I can’t see errors in console refered to your plugin and it seems that the plugin is also loaded, by inspecting with chrome in timeline resources.

    Thread Starter nuriarai

    (@nuriarai)

    Hello dcooney, I’m sorry for my delay, but I don’t received any notification about your answer.
    I just tried with your default code and the problem persist, so it not seems a repeater template problem. I think it is related with the total number of posts. If I try in my testing site that has only 40 posts there is no problem, but If I try in the client testing site that has 1000 posts then the problem appears. In a category page with 73 posts the loading stops in the 35 post.

    Any other idea?

    About the post__not_in, I need it because the posts in $ids_used2 array ar not just the 6 previous, they are from different post format (videos & anotation) and they could not be sequencially.

    Thanks,

    Thread Starter nuriarai

    (@nuriarai)

    At least I found the correct aproach, so is not using “init” hook, but the “template_redirect”. Since when template_redirect is executed all the objects and functions are accessible, then I can access to all the information I need.

    In addition, the specification has changed a little bit, so actually I need to find the tag or category from the last post visited and show the last two posts that tag or that category (for lack of tag). So, at least, I did this:

    //setting cookie when user visit single post
    function articlesVisited() {
      if (is_single()){
    	  $postNumber = get_the_id();
    	  $category = get_the_category();
    	  if ($category) {
    		  $cat = $category[0]->term_id;
    	  } else {
    		$cat = "nocat";
    	  }
    	  $posttags = get_the_tags();
    	  if ($posttags) {
    	    $tag = $posttags[0]->term_id;
    	  } else {
    		$tag = "notag";
    	  }
    	  $value = $tag . "/" . $cat . "/" . $postNumber;
    	  setcookie('lastpost',$value,time()+86400, "/");
      }
    }
    add_action('template_redirect', 'articlesVisited');

    Thnaks diondesigns anb bcworks for trying to help.

    Thread Starter nuriarai

    (@nuriarai)

    Hello, DionsDesigns, thanks for your interest. I tried:

    if(defined('DOING_AJAX')) :

    but it ever returns false.

    Thanks bcworkz: I was trying to refresh in order to capture the header changes and display it. There is an example set in a plugin where this refresh is doing well, but this is after a form submit. So it seems, as you say, it can’t be extrapolable to my situation.

    Any other idea?

    Thread Starter nuriarai

    (@nuriarai)

    Don’t worry, going to the server and adding temporarly more time of max_execution_limit and more mb to memory_limit the issue was resolved. File generated correctly. But it generates a very big file, 8,2Mb (without plugin: 166Kb). and when I’m importing in the other site I get this error:

    Request Entity Too Large
    The requested resource
    /sitenou/wp-admin/admin.php
    does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

    Made the same with normal post and run correctly! Maybe the plugin is not allowing the custom post types export?

    Núria

    As others suggest, It would be grate to put the text in a get_text function, so it will be translatable.
    In class-frontend.php in line 24:

    $btn = '<!-- WhatsApp Share Button for WordPress: https://peadig.com/wordpress-plugins/whatsapp-share-button/ --><div class="wabtn_container"><a href="whatsapp://send?text='.get_the_title().' - '.get_permalink().$tracking.'" class="wabtn">Share this on WhatsApp</a></div>';

    Add the get_text call:

    $btn = '<!-- WhatsApp Share Button for WordPress: https://peadig.com/wordpress-plugins/whatsapp-share-button/ --><div class="wabtn_container"><a href="whatsapp://send?text='.get_the_title().' - '.get_permalink().$tracking.'" class="wabtn">' . __("Share this on WhatsApp") . </a></div>';

    I did it when I was trying to resolve the problem, I search and translated all the “home” srtings, but it didn’t work at all. Maybe I forgot something.
    Are you sure that it works? Did you tried?
    Now I can’t do more testing in this issue, because I have resolved the problem with the script posted above and I have not yet more the plugin installed and no more time to explore the thing, but would be interesting to know a solution for the plugin.

    Hi Aiwe, I tried this and didn’t work, I think the string that appears in the “select strings within context: plugin breadcrumbs-navxt”, which I translated without results, come from a label of the plugin, not from the variable input that people can change in the admin plugin’s interface.

    Hello hamergil, thanks to answer. I explain the solution I found at least. I uninstalled the plugin and did the work with a script in functions.php
    The script is a match from the boostrapwp build in and the code posted by Jonathan in this threat 3 months ago:
    https://www.ads-software.com/support/topic/help-fix-breadcrum-function-for-custom-post-types

    I’m still improving the code, but it is working, and it is not necessary to use a different script for every language. WPML translate correctly all the content because it is using the translated strings of every taxonomy and the __(‘home’) translation as well.

    Note that you have to change the “ctegori-producte’ string by whatever is your taxonomy. Note also that you can straight forward of this little code :

    $idlang = icl_object_id(42, 'page', false );
            permalinkk = get_permalink( $idlang );
    	echo '<li><a href="' . $permalinkk . '">' . get_the_title($idlang) . '</a></li> ' . $delimiter . ' ';

    where I put a reference to a ‘page’ that is the wrapper for all the categories that belongs to my custom post typ ‘producte’ that is the one the taxonomy ‘categoria-producte’ is associated, but no exists as a taxonomy. This is only for my purposes, but may be usefull also for someone more.
    Hope this help.

    function bootstrapwp_breadcrumbs() {
    
      $delimiter = '<span class="divider"> ? </span>';
      $home = __('home','bootstrapwp'); // text for the 'Home' link
      $before = '<li class="active">'; // tag before the current crumb
      $after = '</li>'; // tag after the current crumb
    
      if ( !is_home() && !is_front_page() || is_paged() ) {
    
        echo '<ul class="breadcrumb">';
    
        global $post;
        $homeLink = home_url();
        echo '<li><a href="' . $homeLink . '">' . $home . '</a></li> ' . $delimiter . ' ';
    
        if ( is_category() ) {
          global $wp_query;
          $cat_obj = $wp_query->get_queried_object();
          $thisCat = $cat_obj->term_id;
          $thisCat = get_category($thisCat);
          $parentCat = get_category($thisCat->parent);
          if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
          echo $before . 'Archive by category "' . single_cat_title('', false) . '"' . $after;
    	}
    	elseif ( is_tax('categoria-producte') ) {
    		global $wp_query;
    		echo $prepend;
    		$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    		$parents = array();
    		$parent = $term->parent;
    		while ( $parent ) {
    			$parents[] = $parent;
    			$new_parent = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );
    			$parent = $new_parent->parent;
    		}
    		$idlang = icl_object_id(42, 'page', false );
    		$permalinkk = get_permalink( $idlang );
    		echo '<li><a href="' . $permalinkk . '">' . get_the_title($idlang) . '</a></li> ' . $delimiter . ' ';
    
    		if ( ! empty( $parents ) ) {
    			$parents = array_reverse( $parents );
    			foreach ( $parents as $parent ) {
    				$item = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ));
    				echo  '<li><a href="' . get_term_link( $item->slug, 'categoria-producte' ) . '">' . $item->name . '</a></li>'. $delimiter;
    			}
    		}
    
    		$queried_object = $wp_query->get_queried_object();
    		echo $before . $queried_object->name . $after;	
    
        } elseif ( is_day() ) {
          echo '<li><a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a></li> ' . $delimiter . ' ';
          echo '<li><a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '">' . get_the_time('F') . '</a></li> ' . $delimiter . ' ';
          echo $before . get_the_time('d') . $after;
    
        } elseif ( is_month() ) {
          echo '<li><a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a></li> ' . $delimiter . ' ';
          echo $before . get_the_time('F') . $after;
    
        } elseif ( is_year() ) {
          echo $before . get_the_time('Y') . $after;
    
        } elseif ( is_single() && !is_attachment() ) {
    
    	  if ( get_post_type() == 'producte' ) {
    			echo $prepend;
    
    		$idlang = icl_object_id(42, 'page', false );
    		$permalinkk = get_permalink( $idlang );
    		echo '<li><a href="' . $permalinkk . '">' . get_the_title($idlang) . '</a></li> ' . $delimiter . ' ';
    
    			if ( $terms = wp_get_object_terms( $post->ID, 'categoria-producte' ) ) {
    				$term = current( $terms );
    				$parents = array();
    				$parent = $term->parent;
    
    				while ( $parent ) {
    					$parents[] = $parent;
    					$new_parent = get_term_by( 'id', $parent, 'categoria-producte' );
    					$parent = $new_parent->parent;
    				}
    
    				if ( ! empty( $parents ) ) {
    					$parents = array_reverse($parents);
    					foreach ( $parents as $parent ) {
    						$item = get_term_by( 'id', $parent, 'categoria-producte');
    						echo '<li><a href="' . get_term_link( $item->slug, 'categoria-producte' ) . '">' . $item->name . '</a></li>' . $delimiter;
    					}
    				}
    
    				echo '<li><a href="' . get_term_link( $term->slug, 'categoria-producte' ) . '">' . $term->name . '</a></li>' . $delimiter;
    
    			}
    
    			echo $before . get_the_title() . $after;
    	  }
    	  elseif ( get_post_type() != 'post' ) {
            $post_type = get_post_type_object(get_post_type());
            $slug = $post_type->rewrite;
            echo '<li><a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->singular_name . '</a></li> ' . $delimiter . ' ';
            echo $before . get_the_title() . $after;
          }
    
    	   else {
            $cat = get_the_category(); $cat = $cat[0];
            echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
            echo $before . get_the_title() . $after;
          }
    
        } elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {
          $post_type = get_post_type_object(get_post_type());
          echo $before . $post_type->labels->singular_name . $after;
    
        } elseif ( is_attachment() ) {
          $parent = get_post($post->post_parent);
          $cat = get_the_category($parent->ID); $cat = $cat[0];
          echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
          echo '<li><a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a></li> ' . $delimiter . ' ';
          echo $before . get_the_title() . $after;
    
        } elseif ( is_page() && !$post->post_parent ) {
          echo $before . get_the_title() . $after;
    
        } elseif ( is_page() && $post->post_parent ) {
          $parent_id  = $post->post_parent;
          $breadcrumbs = array();
          while ($parent_id) {
            $page = get_page($parent_id);
            $breadcrumbs[] = '<li><a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a></li>';
            $parent_id  = $page->post_parent;
          }
          $breadcrumbs = array_reverse($breadcrumbs);
          foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' ';
          echo $before . get_the_title() . $after;
    
        } elseif ( is_search() ) {
          echo $before . 'Search results for "' . get_search_query() . '"' . $after;
    
        } elseif ( is_tag() ) {
          echo $before . 'Posts tagged "' . single_tag_title('', false) . '"' . $after;
    
        } elseif ( is_author() ) {
           global $author;
          $userdata = get_userdata($author);
          echo $before . 'Articles posted by ' . $userdata->display_name . $after;
    
        } elseif ( is_404() ) {
          echo $before . 'Error 404' . $after;
        }
    
        if ( get_query_var('paged') ) {
          if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
          echo __('Page', 'bootstrapwp') . ' ' . get_query_var('paged');
          if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
        }
    
        echo '</ul>';
    
      }
    } // end bootstrapwp_breadcrumbs()

    The web in development that is using this codes is here:
    https://plasticosjobgar.com/webwp/productes/

    Hamergil, found any solution? I have the same problem.

    Hi, the dojopan solutions works fine for me with the 3.4.2 version. Thanks!

    Ellenweig, the creator of the plugin saids in his download page https://www.qianqin.de/qtranslate/download/ that you can:
    “waiting for the next release, which is usually released 1-2 weeks after the WP release.”

    Robert Coaster, I haven’t had this kind of problem with qtranslate ever, but maybe you refers to the <p> that the tinymce editor wrpas around the paragraphs when you edit in visual mode, that you can’t control exactly when it put and sometimes are unwanted for you. But this is a problem of the editor and wp, not qtranslate.

Viewing 15 replies - 1 through 15 (of 17 total)