Home Forums Blog Vlog LINK COLOR

This topic contains 1 reply, has 2 voices, and was last updated by  arjun 4 months, 3 weeks ago.

  • Author
    Posts
  • #2118

    giuliabnch
    Participant

    Hi, I’m using Blog Vlog theme for my WordPress blog but I have a major issue. If I add a link in my article the word doesn’t change color and since I work with affiliate links to me is a big problem because people don’t see the presence of a link. I’ve tried to change the color of “a” element in CSS code section but nothing changed.

    Also, I would like to eliminate the box around the article and the widgets, is it possible??

    Thanks, Giulia.

  • #2146

    arjun
    Keymaster

    hello add this on additional CSS for the removed box around an article:

    .blog_vlog-post-wrapper {
    border: 1px solid #25202000;
    }
    #secondary .widget {
    border: 1px solid #0c0c0c00;
    margin: 0 0 50px;
    padding: 15px;
    }

    For support HTML tag on the main page you need to edit code, have knowledge about theme code file? if Then add this code on ”function.php”
    if you are not familiar to code please provide you wp-admin details at ”’amplethemes@gmail.com”’ ,we will help you add this code,if you are familiar please add this:

    function wpse_allowedtags() {
        // Add custom tags to this string
            return '<a>, <script>,<style>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>,<p>,<img>,<video>,<audio>';
        }
    
    if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) : 
    
        function wpse_custom_wp_trim_excerpt($wpse_excerpt) {
        global $post;
        $raw_excerpt = $wpse_excerpt;
            if ( '' == $wpse_excerpt ) {
    
                $wpse_excerpt = get_the_content('');
                $wpse_excerpt = strip_shortcodes( $wpse_excerpt );
                $wpse_excerpt = apply_filters('the_content', $wpse_excerpt);
                $wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt);
                $wpse_excerpt = strip_tags($wpse_excerpt, wpse_allowedtags()); /*IF you need to allow just certain tags. Delete if all tags are allowed */
    
                //Set the excerpt word count and only break after sentence is complete.
                    $excerpt_word_count = 75;
                    $excerpt_length = apply_filters('excerpt_length', $excerpt_word_count);
                    $tokens = array();
                    $excerptOutput = '';
                    $count = 0;
    
                    // Divide the string into tokens; HTML tags, or words, followed by any whitespace
                    preg_match_all('/(<[^>]+>|[^<>\s]+)\s*/u', $wpse_excerpt, $tokens);
    
                    foreach ($tokens[0] as $token) { 
    
                        if ($count >= $excerpt_word_count && preg_match('/[\,\;\?\.\!]\s*$/uS', $token)) {
                        // Limit reached, continue until , ; ? . or ! occur at the end
                            $excerptOutput .= trim($token);
                            break;
                        }
    
                        // Add words to complete sentence
                        $count++;
    
                        // Append what's left of the token
                        $excerptOutput .= $token;
                    }
    
                $wpse_excerpt = trim(force_balance_tags($excerptOutput));
    
                   
                    $excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end); 
    
                    //$pos = strrpos($wpse_excerpt, '</');
                    //if ($pos !== false)
                    // Inside last HTML tag
                    //$wpse_excerpt = substr_replace($wpse_excerpt, $excerpt_end, $pos, 0); /* Add read more next to last word */
                    //else
                    // After the content
                    $wpse_excerpt .= $excerpt_end; /*Add read more in new paragraph */
    
                return $wpse_excerpt;   
    
            }
            return apply_filters('wpse_custom_wp_trim_excerpt', $wpse_excerpt, $raw_excerpt);
        }
    
    endif; 
    
    remove_filter('get_the_excerpt', 'wp_trim_excerpt');
    add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt');
    • This reply was modified 4 months, 3 weeks ago by  arjun.
    • This reply was modified 4 months, 3 weeks ago by  arjun.
    • This reply was modified 4 months, 3 weeks ago by  arjun.
    • This reply was modified 4 months, 3 weeks ago by  arjun.
    • This reply was modified 4 months, 3 weeks ago by  arjun.

You must be logged in to reply to this topic.