Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
mm-2
tagDiv Member

Managed to get this sorted after digging through Composer and Cloud Library plugins’ code.

Here’s the code snippet:

add_filter('author_template', 'columnist_custom_author_template', 99999);

function columnist_custom_author_template($default_template) {
global $wp;
// 1. Check if it's actually an author archive
// 2. Check the matched_rule to see if it's the columnist rule
if (is_author() && isset( $wp->matched_rule ) && '^columnist/([^/]+)/?$' === $wp->matched_rule) {
apply_filters('td_single_override', id); // COLUMNIST Cloud Library's Cloud Template ID (integer)
}
// Otherwise, return the default template (which might load template from TagDiv’s normal assignment)
return $default_template;
}

The important bit is
apply_filters('td_single_override', id);
where the second parameter is TagDiv Cloud Library’s Cloud Template ID (integer).

mm-2
tagDiv Member

Hi petar777, thanks for the replay.

We followed the steps Anamaria outlined in this topic and have compared them with the steps described in the topic you linked

  • option in theme panel to show views on post
  • 24h/48h post views sorting
  • ajax view count
  • insert the element for single post views inside template for single post
  • hide with css showing views on frontend.

and oddly enough we did not have to do the “insert the element for single post views inside template for single post” step as the “7 Days Post Sorting” works without it.

Granted, we have not tested yet and compared the post views to see if it’s calculating the views correct as opposed to data collected via Jetpack and Google Analytics vs theme counter but it is noted that if caching plugins are used this will only be an estimation. Unfortunately, we do use WP Rocket on our website so I don’t expect this option to show 100% correct data.

  • This reply was modified 1 year by mm-2.
mm-2
tagDiv Member

Thanks, the “SHOW POST VIEWS” option was disabled, enabling it did the trick but I am curious, how does the description “Enable or disable the post views (on single post page)” correlate to making the sort option “Popular” work and display the posts while this sort option is used?

mm-2
tagDiv Member

Hi,

thanks for help. Now post counter works, and has been active for almost 2 days now but still no posts are showing when “Popular (last 7 days) option is selected in the Sort order field. We tried clearing the cache and disabling the cache but to no luck.

mm-2
tagDiv Member

@Ruteris do you know what the problem was? As we’re also experiencing a similar issue on our website where post counter is working but no posts are showing when “Popular (last 7 days) option is selected in the Sort order field.

mm-2
tagDiv Member

No offset is used. Taking a regular Flex Block element, putting it anywhere on the site and just selecting the Jetpack Popular sorting option does not work.

mm-2
tagDiv Member

Hi, thanks for the quick answer.

I have everything setup the way it’s mentioned in the the linked article – no filtering options or any other options active, just sorting by Jetpack popular option is active. It does not work after the theme has been updated.

mm-2
tagDiv Member

Thanks, @Bettina. Downloaded!

mm-2
tagDiv Member

Hello @Anamaria,

could you possibly again share the v10.3.6 download link as the one you provided has expired?

Thanks!

mm-2
tagDiv Member

Ok, I got the pagination working again. It seems that the problem is with the redirect_canonical() WP function.

I disabled canonical redirect for my front-page and the pagination works again as it should. The code I used:

add_filter( 'redirect_canonical','custom_disable_redirect_canonical' );
function custom_disable_redirect_canonical( $redirect_url ){
if ( is_front_page() ) $redirect_url = false;
return $redirect_url;
}

NOTE: Pagination wasn’t working only on front-page. On archive pages it worked just fine.

mm-2
tagDiv Member

I am sorry for the late replay, but disabling the content filters as the plugin authors suggested didn’t do the trick. I have the latest version of the Newspaper theme, WordPress & NGFB plugin installed and it’s still not working.

Plugin authors said that problem is not in the plugin, but in the theme and I’m being sent back and forth between two parties.

Although I noticed that pagination works when I change the permalink structure from “Post name” to “Default”.

mm-2
tagDiv Member

This is the reply I got from the plugin author:

“It’s not a plugin’s malfucntion.

The problem is that your composer has the post content as shortcodes
so a typical post content is:

[vc_row][vc_column width="2/3"][td_block6 limit=”6″
custom_title=”Posljednji članci” ajax_pagination=”infinite”
category_id=”1″ header_color=”#7bc6f1″ header_text_color=”#ffffff”
sub_cat_ajax=”n”
ajax_pagination_infinite_stop=”3″][/vc_column][vc_column
width="1/3"][vc_widget_sidebar
sidebar_id="td-top-right"][/vc_column][/vc_row]

Which is indeed a small text, so the time is less than a minute. In
order that issue to be solved, you have to search for the composer’s
documentation to see how the post content is rendered in order to use
that instead of the shortcodes one.

As you sort out how the content is displayed, you just replace the line 81 in plugin.php

$content = strip_tags($post->post_content);

with the content the plugin author give you.”

Any idea how to fix the problem or at lest how to use infinite scroll without Page Builder?

Regards,

  • This reply was modified 11 years by mm-2.
mm-2
tagDiv Member

Hello again,

it seems that the problem is in Visual Composer plugin. When I setup my homepage to display posts without the VC plugin it works correctly, but then I do not have the infinite scroll option.

Is there a way to use infinite scroll without using Page Builder that comes with Visual Composer plugin?

Regards,

mm-2
tagDiv Member

It seems like I’ll have to contact the author of the plugin, because I installed the WP from scratch, reinstalled the Newsletter theme and disabled all plugins and it still didn’t work as expected.

Although I tried several other plugins they also showed the same result (“less than a minute”).

Thank you for your help, Lucian.

Regards

  • This reply was modified 11 years by mm-2.
mm-2
tagDiv Member

Thank you for a quick response, but I’m getting only “less than a minute” result on all my posts (see the screenshot). I’ve added the same code to my loop-single.php file and it works just fine there. I’m using the https://wordpress.org/plugins/estimated-post-reading-time/ plugin to output the est. reading time. I’m not using any caching plugins.

Any clue as to why it’s not displaying properly? You can check it out at http://matijaculjak.com

Screenshot: http://i.imgur.com/pxvJb5L.png

Regards,

  • This reply was modified 11 years by mm-2.
  • This reply was modified 11 years by mm-2.
Viewing 15 posts - 1 through 15 (of 15 total)