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 :)
Phonetic
tagDiv Member

zlato: you can always get hold of Remy and the guys behind WP Rocket. Their support is excellent and their docs also covers most cases.

Phonetic
tagDiv Member

The files you need to exclude depends on plug-ins etc. Just test your site for critical js exclusions one by one.

In its base form there are no exclusions needed for Newspaper 7.7. If you use Jet pack or other bigger plug-ins then there are a few lines you need to add.

Phonetic
tagDiv Member

You might want to consider using HTTP/2 which among other features uses multiplexing. No need for the “old” minimize requests strategy.

Phonetic
tagDiv Member

Minification works just fine with 7.7 and WP Rocket.

Check out https://www.dailyrush.dk. Using WP Rocket with minifcation with several additions / exclusions. Running 7.7 heavily modified (over 500 changes / additions to base theme code).

Phonetic
tagDiv Member

We’ve been running Newspaper and PHP7 since may version (7 – 7.6) without any problems.

Phonetic
tagDiv Member

Found a solution. Changing the static function login_user in td_login.php

from:

static function login_user($username, $password) {
$credentials = array();
$credentials['user_login'] = $username;
$credentials['user_password'] = $password;
$credentials['remember'] = true;
$user_obj = wp_signon($credentials,false);
return $user_obj;
}

to:

static function login_user($username, $password) {
$credentials = array();
$credentials['user_login'] = $username;
$credentials['user_password'] = $password;
$credentials['remember'] = true;
$user_obj = wp_signon($credentials, true);
return $user_obj;
}

fixes the problem: wp_signon($credentials, true). One can also use wp_signon( $credentials, $secure_cookie )

  • This reply was modified 9 years by Phonetic.
  • This reply was modified 9 years by Phonetic.
Phonetic
tagDiv Member

Yeah, but it’ suspicious that everything works when switicing back to http.

Most likely a server setup issue, but tried four different installs on multiple platforms now. Same result every time. Ajax login over https fails every time.

Phonetic
tagDiv Member

Just found another thread describing the exact same problem except I do not have any permission errors.

https://forum.tagdiv.com/topic/still-facing-login-redirect-issue-with-ajax-based-login-popup-of-newspaper-theme/

  • This reply was modified 9 years by Phonetic.
Phonetic
tagDiv Member

So far no errors running WP 4.6 + Newspaper 7.3

Phonetic
tagDiv Member

Thanks a lot Catalin.

Was already more or less done with adding the functions. I’ve also added several new grid types, new gradients, new sort functions (most comments 24H, 48H, 1 Week, 1 Month) and a few Jetpack-related ones also. Including the first one i added (block categories for based on parent “block” category).

Just finishing up the CSS now.

One thing tho. You should take a good look a your 7 days stat function based on views. It will cook even a relatively small site due to db load. Queries without indexes (wp meta should be banned forever if you ask me) is never an option ๐Ÿ™‚

Let me know if you want the diff-files. I’ve done a lot of modifications and by now added quite few functions.

Have a neat weekend ๐Ÿ™‚

Phonetic
tagDiv Member

Already did Bogdan.

Cheers & have a nice weekend ๐Ÿ™‚

Phonetic
tagDiv Member

Oh – forgot to mention. PHP 7.0.6. Still haven’t found anything incompatible with Newspaper 7.

Phonetic
tagDiv Member

Edward: Site is using modified versions of bbpress and buddypress (otherwise db would overload due to queries without indexes – yeah shitty code from the developers). Forum has +4 million posts / comments.

General database contains 16 years of news / articles.

Most plugins are custom made (showing default avatars, lists, comment-numbering etc.).

Also using “Hide my WP” and WP-Rocket (cache). The latter will be swapped for a custom fragment caching solution soon.

Back-end is FreeBSD 10.3 (4 VM servers), Apache 2.4, MariaDB 10.1

Phonetic
tagDiv Member

Hi Bogdan.

My point is that you’ll have to change the body color in css and not via the theme color settings.

  • This reply was modified 10 years by Phonetic.
Phonetic
tagDiv Member

Using PHP 7.0.6 + Apache 2.4 + MariaDB 10.1.14. No problems. Don’t use WP Super Cache. WP Rocket (premium) is faster anyway.

  • This reply was modified 10 years by Phonetic.
Phonetic
tagDiv Member

Nevermind. Probably a safari-caching issue.

Phonetic
tagDiv Member

tuliss: Disable the mobile site plugin and you should be back to almost normal (with an improved menu with login). The mobile plugin is probably buggy as it is (no menus, login, etc showing even if it has been configured in the theme panel mobile plugin settings).

Phonetic
tagDiv Member

Or is there a smart way om disabling theme media queries completely?

Phonetic
tagDiv Member

Also, shouldn’t pages be displayed using the iPad / tablet settings on an i.e. iPhone 6 Plus?

IPAD LANDSCAPE
1019px - 1140px

IPAD PORTRAIT
768px - 1018px

It’s a 1920×1080 device and way above the theme phone width-range:

0 - 767px

  • This reply was modified 10 years by Phonetic.
  • This reply was modified 10 years by Phonetic.
  • This reply was modified 10 years by Phonetic.
  • This reply was modified 10 years by Phonetic.
Phonetic
tagDiv Member

You’re welcome Bogdan.

Forgot to remove the code indentation. code quotes are a bit messy ๐Ÿ™‚

I’ll write a guide post when I got some spare time. Launch is in less than two weeks ๐Ÿ™‚

Phonetic
tagDiv Member

NP.

We’re all here to help out ๐Ÿ™‚

Phonetic
tagDiv Member

Hi Dhananjay.

The website I’m building / redesigning will launch May 1st. It’s under wraps until then ๐Ÿ™‚

I realised that Newspaper theme really is not geared for CPT. In the end there is too many customisations needed and would probably break all sorts for theme updates in the future.

I had to options to accomplish my goal:

1. Use CPT to get the data-sorting i wanted.
2. Modify and add the needed sorting logic to the data backend.

I chose the latter. Today I rewrote the ajax functions and implemented the function (only get posts from main box / menu filter AND sub-filters (from drop-downs).

I’ve documented the changes here: Adding Ajax Logic

You might wanna take a look.

  • This reply was modified 10 years by Phonetic.
Phonetic
tagDiv Member

Hi Bogdan.

I’ve implemented the changes to the backend and added a new option ‘Filter by categories and block filter’ for blocks (td_config.php)


    static function get_map_block_ajax_filter_array() {
        return array(
            //custom filter types
            array(
                "param_name" => "td_ajax_filter_type", //this is used to build the filter list (for example a list of categories from the id-s bellow)
                "type" => "dropdown",
                "value" => array('- No drop down ajax filter -' => '', 'Filter by categories' => 'td_category_ids_filter', <strong>'Filter by categories and block filter' => 'td_category_ids_parent_filter'</strong>, 'Filter by authors' => 'td_author_ids_filter', 'Filter by tag slug' => 'td_tag_slug_filter', 'Filter by popularity (Featured | All time popular)' => 'td_popularity_filter_fa'),
                "heading" => 'Ajax dropdown - filter type:',
                "description" => "Show the ajax drop down filter. The ajax filters (except by popularity) require an additional parameter. If no ids are provided in the input below, the filter will show all the available items (ex: all authors, all categories etc..)",
                "holder" => "div",
                "class" => "",
                "group" => "Ajax filter"
            ),

I’ve added an new case to td_block.php:


                    case 'td_category_ids_parent_filter': // by category AND block / menu category filter
                        $td_categories = get_categories(array(
                            'include' => $td_ajax_filter_ids,
                            'exclude' => '1',
                            'number' => 100 //limit the number of categories shown in the drop down
                        ));

                        // check if there's any id in the list
                        if (!empty($td_ajax_filter_ids)) {
                            // break the categories string
                            $td_ajax_filter_ids = explode(',', $td_ajax_filter_ids);

                            // order the categories - match the order set in the block settings
                            foreach ($td_ajax_filter_ids as $td_category_id) {
                                $td_category_id = trim($td_category_id);

                                foreach ($td_categories as $td_category) {

                                    // retrieve the category
                                    if ($td_category_id == $td_category->cat_ID) {
                                        $td_pull_down_items [] = array(
                                            'name' => $td_category->name,
                                            'id' => $td_category->cat_ID,
                                        );
                                        break;
                                    }
                                }
                            }

                        // if no category ids are added
                        } else {
                            foreach ($td_categories as $td_category) {
                                $td_pull_down_items [] = array(
                                    'name' => $td_category->name,
                                    'id' => $td_category->cat_ID,
                                );
                            }
                        }
                        break;

I could have done it the lazy way:


case 'td_category_ids_filter' && 'td_category_ids_parent_filter':

But might as well add a proper case.

I’ve also modified td_ajax.php to handle category ids as an array (this is needed for td_data_source.php – see below):


				case 'td_category_ids_parent_filter': // by category AND block main category  - the user selected a category from the drop down. if it's empty, we show the default block atts

					if (!empty($ajax_parameters['td_filter_value'])) {
						$ajax_parameters['td_atts']['category_ids'] = array($ajax_parameters['td_atts']['category_id'], $ajax_parameters['td_filter_value']);
						unset($ajax_parameters['td_atts']['category_id']);	
					}

					// debug
					// $output = print_r($ajax_parameters['td_atts'], true);
					// file_put_contents('ajax_query.txt', $output);					

					break;

Finally changes to td_data_source.php:


        // if $category_ids = array then only get posts with main block / menu category AND ajax filter set
        // if $category_ids is an aray then prepare query with "category_and" instead of "cat"    
        if (!empty($category_ids) and is_array($category_ids)) {
            $wp_query_args['category__and'] = $category_ids;
        }

Checks for $category_ids == array and then prepares query with “category__and” instead of “cat”.

Changes enables you so choose the function with the main block / menu category id as parent for data in sub tabs.

Let me know if you guys want the diffs from code. I’m pretty sure a lot of your customers would love this imho much needed added feature.

Disregard the out-commented debug code.

Cheers ๐Ÿ™‚

  • This reply was modified 10 years by Phonetic.
Phonetic
tagDiv Member

Got it working. Almost..

Pagination is showing, but following pages are not working. Clicking them will generate a 404 error. Someting I’m missing?


$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
$args = array( 
    'post_type'   => 'custom1',
    'post_status' => 'published',
    'posts_per_page' => '10',
    'paged' => $paged
);

$wp_query = new WP_Query( $args );
  • This reply was modified 10 years by Phonetic.
  • This reply was modified 10 years by Phonetic.
Viewing 25 posts - 1 through 25 (of 48 total)