Forum Replies Created

Viewing 15 replies - 46 through 60 (of 116 total)
  • Thread Starter Jarod Thornton

    (@jarmerson)

    I believe I found the culprit in a custom plugin I’ve been working on. It’s been very stable, but a few lines that were added and never checked up on appear to have caused my rewrite flush issues.

    Here’s the code…

    // Remove Category Base //
    // Refresh rules on activation/deactivation/category changes
    register_activation_hook(__FILE__, 'no_category_base_refresh_rules');
    add_action('created_category', 'no_category_base_refresh_rules');
    add_action('edited_category', 'no_category_base_refresh_rules');
    add_action('delete_category', 'no_category_base_refresh_rules');
    function no_category_base_refresh_rules() {
    	global $wp_rewrite;
    	$wp_rewrite -> flush_rules();
    }
    
    register_deactivation_hook(__FILE__, 'no_category_base_deactivate');
    function no_category_base_deactivate() {
    	remove_filter('category_rewrite_rules', 'no_category_base_rewrite_rules');
    	// We don't want to insert our custom rules again
    	no_category_base_refresh_rules();
    }
    
    // Remove category base
    add_action('init', 'no_category_base_permastruct');
    function no_category_base_permastruct() {
    	global $wp_rewrite, $wp_version;
    	if (version_compare($wp_version, '3.4', '<')) {
    		// For pre-3.4 support
    		$wp_rewrite -> extra_permastructs['category'][0] = '%category%';
    	} else {
    		$wp_rewrite -> extra_permastructs['category']['struct'] = '%category%';
    	}
    }
    
    // Add our custom category rewrite rules
    add_filter('category_rewrite_rules', 'no_category_base_rewrite_rules');
    function no_category_base_rewrite_rules($category_rewrite) {
    	//var_dump($category_rewrite); // For Debugging
    
    	$category_rewrite = array();
    	$categories = get_categories(array('hide_empty' => false));
    	foreach ($categories as $category) {
    		$category_nicename = $category -> slug;
    		if ($category -> parent == $category -> cat_ID)// recursive recursion
    			$category -> parent = 0;
    		elseif ($category -> parent != 0)
    			$category_nicename = get_category_parents($category -> parent, false, '/', true) . $category_nicename;
    		$category_rewrite['(' . $category_nicename . ')/(?:feed/)?(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
    		$category_rewrite['(' . $category_nicename . ')/page/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]';
    		$category_rewrite['(' . $category_nicename . ')/?$'] = 'index.php?category_name=$matches[1]';
    	}
    	// Redirect support from Old Category Base
    	global $wp_rewrite;
    	$old_category_base = get_option('category_base') ? get_option('category_base') : 'category';
    	$old_category_base = trim($old_category_base, '/');
    	$category_rewrite[$old_category_base . '/(.*)$'] = 'index.php?category_redirect=$matches[1]';
    
    	//var_dump($category_rewrite); // For Debugging
    	return $category_rewrite;
    }

    I have no use for it so I don’t even care what and why it doesn’t work. ??

    Thread Starter Jarod Thornton

    (@jarmerson)

    Unfortunately I did not. I was short on budget so I opted to just setup a cheatsheet for my client and show them the shortcode syntax.

    I had this issue.

    Use this in your functions.php or plugin.

    // Create FontAwesome Shortcode
    function fontawesome_func( $atts ) {
    	$atts = shortcode_atts(
    		array(
    			'icon' => 'icon',
    		), $atts, 'fa' );
    
    	return '<i class="' . $atts['icon'] .'"></i>';
    }
    add_shortcode( 'fa', 'fontawesome_func' );

    Now simply input this shortcode wherever you please.

    [fa icon=”fa fa-phone”]

    Thank you, pfitzgld. This was not an option for me as the errors were not allowing access the these options, i.e. using the URL to reset by appending the /options-general.php?page=ga_reset wouldn’t do the trick. The work around accessing the database worked for me and was the only option I could perform without affecting other sites on the network.

    I also setup an admin menu item via custom plugin we wrote for support with a direct link to this reset. The problem with GA is it was breaking the widgets in both normal and special access as well as the customize theme area.

    Thread Starter Jarod Thornton

    (@jarmerson)

    Ah, success.

    I cleared the options table of all ga_ settings.

    ga_version
    ga_status
    ga_disable_gasites
    ga_analytic_snippet
    ga_uid
    ga_admin_status
    ga_admin_disable_DimentionIndex
    ga_admin_disable
    ga_admin_role
    ga_dashboard_role
    key_ga_show_ad
    ga_adsense
    ga_extra
    ga_extra_after
    ga_event
    ga_outbound
    ga_outbound_prefix
    ga_enhanced_link_attr
    ga_downloads
    ga_downloads_prefix
    ga_widgets
    ga_annon
    ga_defaults
    ga_google_token
    ga_google_authtoken
    ga_domain_name
    ga_enable_remarketing
    key_ga_track_login
    ga_analyticator_global_notification

    From WP Admin I went to GA settings and it was ready to be enabled, authenticated, and is working as expected now…

    In your options table look for ga_

    I just solved my issue by backing up all the ga_ options, deleted them, went to the settings page in WP admin and it was ready to be authenticated…

    These were the settings I cleared in the options table for the site ID having issues.

    ga_version
    ga_status
    ga_disable_gasites
    ga_analytic_snippet
    ga_uid
    ga_admin_status
    ga_admin_disable_DimentionIndex
    ga_admin_disable
    ga_admin_role
    ga_dashboard_role
    key_ga_show_ad
    ga_adsense
    ga_extra
    ga_extra_after
    ga_event
    ga_outbound
    ga_outbound_prefix
    ga_enhanced_link_attr
    ga_downloads
    ga_downloads_prefix
    ga_widgets
    ga_annon
    ga_defaults
    ga_google_token
    ga_google_authtoken
    ga_domain_name
    ga_enable_remarketing
    key_ga_track_login
    ga_analyticator_global_notification

    I see. The error I’ve shared would be in place of the dashboard widget and would appear on the settings page. If you can access the dashboard widget and see the stats and access the settings page then this is unrelated.

    Would you confirm if the problem you’re experiencing is related to anything mentioned herehttps://www.ads-software.com/support/topic/fatal-error-uncaught-exception-7?replies=1#post-7220917

    I think this topic has been misunderstood. IMO auto populating the ALT tag just as the Title tag is ideal. I personally name all the images according to their content. ie My Picture.jpg – when uploaded WordPress auto creates the Title attribute My Picture. If this were also the case for the ALT tag then it would make it so much easier. If that wasn’t useful and preferred to manually enter the ALT tag then just replace what WordPress populated.

    I did find this plugin – https://www.ads-software.com/plugins/seo-image/

    Here’s a blog with more detail – https://roadtoblogging.com/alt-text-to-wordpress-images/

    This allows an attribute to include %title% so it should do the trick as explained above.

    I will test this on our MU network and if I experience any problems will report back.

    Thread Starter Jarod Thornton

    (@jarmerson)

    Thank you for the follow up.

    Are you suggesting revisions to my template above? I’m a novice and the filtering is above my head. If you don’t mind pointing me in the right direction I would greatly appreciate it.

    As for the registered custom post types, they are listed in the options as a selection to choose from. It’s a theme by MySiteMyWay – https://mysitemyway.com/theme/echelon-wordpress-theme/

    I don’t believe they would have coded it incorrectly.

    Thread Starter Jarod Thornton

    (@jarmerson)

    I’ve updated the plugin with your github copy without luck.

    I did have to finagle the template code but did so in my own plugin. Here’s the code I’ve used to customize the search results.

    if ( ! function_exists('is_plugin_active'))
    					{
    require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
    					}
    if (is_plugin_active('instant-search.php'))
    {
    #  Custom Instant Search Suggestions
    /**
     * Output a filterable jQuery template for rendering post type search suggestions
     *
     * @return string jQuery template
     */
    function wpiss_post_template() {
    
    	$template  = '
    
    	<div class="search-results-style">
    	<script type="x-tmpl-mustache" id="wpiss-post-template">
    		<li class="iss-result">
    			{{#image}}
    				<img src="{{image}}" width="50" height="50" />
    			{{/image}}
    			{{{title}}}
    			<span class="iss-sub">{{posttype}}</span>
    		</li>
    	</script>
    	</div>';
    
    	echo apply_filters( 'wpiss_post_tempalte', $template );
    }
    add_action( 'wp_footer', 'wpiss_post_template');
    
    /**
     * Output a filterable jQuery template for rendering taxonomy search suggestions
     *
     * @return string jQuery template
     */
    function wpiss_taxonomy_template() {
    
    	$template  = '
    	<script type="x-tmpl-mustache" id="wpiss-taxonomy-template">
    		<li class="iss-result">
    			{{{title}}}
    			<span class="iss-sub">{{taxonomy}}</div>
    		</li>
    	</script>';
    
    	echo apply_filters( 'wpiss_taxonomy_template', $template );
    }
    add_action( 'wp_footer', 'wpiss_taxonomy_template');
    
    }

    Do you see anything that might cause an issue?

    Thread Starter Jarod Thornton

    (@jarmerson)

    I made the edit but it is still pulling pages and posts. I did a search for contact and it pulls the pages too. It’s not a deal breaker by any means, but I would like to force the search results to the custom posts types alone, as is in settings.

    Thread Starter Jarod Thornton

    (@jarmerson)

    Thank you for the response.

    iemajen.com/anntowergallery/exhibits/

    Click on the Past Exhibits

Viewing 15 replies - 46 through 60 (of 116 total)