Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter curchunflo

    (@curchunflo)

    I haven’t needed to run redis with commands other than to install it. What I did was follow the steps to install it and then install the plugin in my wordpress, then when I click to activate the cache object, something causes a server failure when entering the backend (which is what “the server is temporarily unable to service your request due to maintenance downtime or capacity problems. please try again later”). If I browse the web from “outside” (from the front end) it works correctly, but I can’t access wp-admin. and when I deactivate the redis plugin I see the error that it cannot connect to the database (but the backend is shown saying database connection error), if I activate it, the “service unavailable. …” appears again. I deactivated all plugins and template (but only with redis plugin enabled) and the error persists, so I think the problem is in the configuration (although I have configured the server and wp-config with the correct information), I understand that the problem is somewhere that I don’t I can see. What other information could you give them to help you diagnose?

    Thread Starter curchunflo

    (@curchunflo)

    vìa ssh, the problem is when I activate object cache in the plugin, but redis is installed and I can connect, but when I enabe object cache, I get “service unavailable” in the backend

    Thread Starter curchunflo

    (@curchunflo)

    I execute redis-cli

    Thread Starter curchunflo

    (@curchunflo)

    hello! yes! I am

    Thread Starter curchunflo

    (@curchunflo)

    It was a clock problem, I solved it, could you please delete this post?

    Thread Starter curchunflo

    (@curchunflo)

    I made it! hehe, now this is my code and it’s working, thank you @bcworkz for your help!

    function category_head_hook() {
    if (is_front_page()):
    // Head homepage
    ?>
    <script> my analytics script for single post </script>
    <script> my ads script for single post </script>
    <?php
    endif;
    if (is_singular ()):
    // Head single
    ?>
    <script> my analytics script for single post </script>
    <script> my ads script for single post </script>
    <?php
    endif;
    if ( is_category( ‘category-slug’ )):
    <script>my analytics script for ‘categories home page'</script>
    <script> my ads script for ‘categories home page’ </script>
    <?php
    endif;
    }
    add_action( ‘wp_head’ , ‘category_head_hook’ , 10)
    • This reply was modified 3 years, 3 months ago by bcworkz. Reason: code format fixed
    Thread Starter curchunflo

    (@curchunflo)

    Thank you very much! Now I have new problems ??

    This is my code now:

    function category_head_hook() {
    	if (is_singular ()):
            // Head of single
    ?>
    <script> my analytics  script for single post </script>
    <script> my ads script for single post </script>
    					<?php
        endif;
       if ( is_category( 'category-slug' )):
    <script>my analytics script for 'categories home page'</script>
    <script> my ads script for 'categories home page' </script>
    					 <?php
        endif;
    }
    add_action( 'wp_head' , 'category_head_hook' , 10)

    If I want to read all the articles that are within the ‘Technology’ category, I click on the main menu and the page loads all the articles that I have written within that section, consequently, the head must contain the code of analytics and the code of the ads, which are specific to be displayed within the technology category, and if I later enter an individual article, the head must load the analytics and ads that are specific to the interior of the articles.

    The category code works perfectly and only shows the analytics and the category homepage ads, when I am inside the category.
    If I am inside an individual article, the code also works and specifically shows analytics and ads of individual articles, but if I am on the home page, it shows me the analytics + ads of the home page, but also the analytics + ads script inside the articles.
    I can’t find why, I appreciate your help enormously. Don’t know why, but I think that is the endif, I wrote that thinking: if you are in 1 do A else, if you are in 2 do B, else if you are in 3 do C, but can’t find the way to say that in PHP,

    thank you very much for your help, really

    • This reply was modified 3 years, 3 months ago by bcworkz. Reason: code format fixed
    Thread Starter curchunflo

    (@curchunflo)

    Thank you very much! With ‘posts’ I mean a single article. I have wrote this, but it has a parse error

    function cambiar_head_posts(){
    do_action('cambiar_head_posts');
    }
    
    add_action('cambiar_head_posts','imprime_head_posts', 10);
    function imprime_head_posts() {
    global $wp_query;
    $postid = $wp_query->post->ID;
    	//Carga ads y analytics en los posts
    	//
    	?>
    	<script> analytics
    </script>
    	<script> ads
    </script>				
    <?php
    echo $output;
    wp_reset_query();
    
    }

    this is the error I get: syntax error, unexpected 'function' (T_FUNCTION)

    I will try what you propose me.
    Thank you very much!

    • This reply was modified 3 years, 3 months ago by bcworkz. Reason: code format fixed

    here 2, thank you very much

    Hi Ahmed, my website still have this error, you can check it at https://www.tribunahacker.com.ar please, could you fix it?? thanks in advance

Viewing 10 replies - 1 through 10 (of 10 total)