IngmarVerheij
Forum Replies Created
-
Sure thing, here’s the complete content of add-tags-and-category-to-page.pgp
<?php /* Plugin Name: Add Tags And Category To Page And Post Types Plugin URI: https://dineshkarki.com.np/add-tags-and-category-to-page Description: This plugin adds tags and category to wordpress pages and post types. Author: Dinesh Karki Version: 1.1 Author URI: https://www.dineshkarki.com.np */ /* Copyright 2012 Dinesh Karki (email : [email protected]) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ function add_tags_and_category_for_post_types(){ $tcp_add_tag = get_option('tcp_add_tag'); $tcp_add_category = get_option('tcp_add_category'); $tcp_add_tag_array = explode(',',$tcp_add_tag); $tcp_add_category_array = explode(',',$tcp_add_category); foreach ($tcp_add_tag_array as $postType): //add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', $postType, 'side', 'default'); register_taxonomy_for_object_type('post_tag', $postType); endforeach; foreach ($tcp_add_category_array as $postType): //add_meta_box( 'categorydiv', __('Categories'), 'post_categories_meta_box', $postType, 'side', 'default'); register_taxonomy_for_object_type('category', $postType); endforeach; } function tcp_add_post_types_in_category_and_tag_template($query) { if( $query->is_main_query()) { if (is_category()){ $tcp_add_category = get_option('tcp_add_category'); $tcp_add_category_array = explode(',',$tcp_add_category); $tcp_add_category_array[] = 'post'; $post_type = get_query_var('post_type'); if($post_type) $post_type = $post_type; else $post_type = $tcp_add_category_array; $query->set('post_type',$post_type); return $query; } if (is_tag()){ $tcp_add_tag = get_option('tcp_add_tag'); $tcp_add_tag_array = explode(',',$tcp_add_tag); $tcp_add_tag_array[] = 'post'; $post_type = get_query_var('post_type'); if($post_type) $post_type = $post_type; else $post_type = $tcp_add_tag_array; $query->set('post_type',$post_type); return $query; } } } add_action('admin_init', 'add_tags_and_category_for_post_types'); add_filter('pre_get_posts', 'tcp_add_post_types_in_category_and_tag_template'); include('plugin_interface.php'); ?>
Forum: Themes and Templates
In reply to: [Travelify] Header (image/menu) on category archiveUpdate The problem can easily be fixed as described here
https://www.ads-software.com/support/topic/nav-menu-disapears-when-the-plugin-is-active?replies=4#post-4926337This problem is solved by checking if the pre_get_posts filer runs in the main query.
Add the following lines in the function tcp_add_post_types_in_category_and_tag_template in the file add-tags-and-category-to-page.php
if( $query->is_main_query()) { ...existing code... }
PS: This is explained in detail here
Forum: Themes and Templates
In reply to: [Travelify] Header (image/menu) on category archivePlease ignore this question, it is caused by the plugin ‘Add Tags And Category To Page and Post Types’.
https://www.ads-software.com/plugins/add-tags-and-category-to-page/After disabling this plugin it works as expected.
Thanks for the quick responses Silkalns!
Forum: Themes and Templates
In reply to: [Travelify] Header (image/menu) on category archiveSorry, I think I didn’t describe my challenge proper. I’m not trying to add something IN the loop but BEFORE the loop.
Normally when I open a page I can see the header-image and main-nav:
https://www.ducug.nl/wp-content/uploads/2013/11/Header-Okay.pngHowever, when I open a category archive they are both not visible:
https://www.ducug.nl/wp-content/uploads/2013/11/Header-Missing.pngPS: Site is not live yet so I can’t send the link
Forum: Themes and Templates
In reply to: [Travelify] Header (image/menu) on category archiveExactly like that ??
What file should I edit to customize it like this?By removing the other lines the plugin is unable to determine when it failed, not sure what will happen though ??
PS: You can easily download the code of 1.6.3 here and just remove line 330.
Nooooo don’t delete all 3!
Just delete the one on line 330 ??
Forum: Plugins
In reply to: [WP About Author] Google Social Link Interferes with rel=authorI had the same problem and applied a workaround.
There seems to be confusion about the user profile. Should we fill in the full URL (required for the rel=author) or just the user ID (required for WP About Author)?
The workaround I’ve applied is removing the full URL in the wp-about-author.php
In my case I’ve only done this for LinkedIn and Google+Before:
$socials['linkedin'] = array('title'=>'LinkedIn', 'link'=>'https://www.linkedin.com/in/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/linkedin.png'); $socials['googleplus'] = array('title'=>'Google Plus', 'link'=>'https://plus.google.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/googleplus.png');
After:
$socials['linkedin'] = array('title'=>'LinkedIn', 'link'=>'%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/linkedin.png'); $socials['googleplus'] = array('title'=>'Google Plus', 'link'=>'%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/googleplus.png');
The problem is caused by line #330:
$data = FALSE;
this line should be removed.The author apparently forgot to remove his test code, guess we’re all humans right?
The problem is caused by line #330:
$data = FALSE;
this line should be removed.The author apparently forgot to remove his test code, guess we’re all humans right?
The problem is caused by line #330:
$data = FALSE;
this line should be removed.The author apparently forgot to remove his test code, guess we’re all humans right?
Forum: Plugins
In reply to: [WP About Author] Remove default WordPress author boxThe code above will only hide the default WordPress author box, not the “WP About Author” box ??
It is possible to hide the box when the description is not filled out, i’ve posted a solution 2 weeks ago: https://www.ads-software.com/support/topic/hide-authors-withouth-description
Thanks for adding the timeout as a setting, this way I can automatically update your plugin again.
Hi all,
The problem is caused by the Yahoo API service, not the plugin. The timeout of 20 sec. is simply too short. I’ve been using “WP smush.it” successfully for the past 6 months.
I’ve posted my solution here:
https://www.ingmarverheij.com/automatic-smushing-has-been-disabled-temporarily-due-to-an-error/Cheers,
Ingmar Verheij