Skip to main content
improvement
Source Link
mmm
  • 3.8k
  • 3
  • 16
  • 22

you can do this with a shortcode like this

add_shortcode("custom_text_se282078", function ($attr, $content, $tag) {
    
    $result = "";
    
    if (date_i18n("H") > 15$attr["time"]) {
        $result = "It's after 15 h.";$attr["text_after"];
    } else {
        $result = "It's before 15 h.";$attr["text_before"];
    }
    
    return $result;
    
});

with that you just have to put [custom_text_se282078]that in the page :

[custom_text_se282078 time="10" text_before="text before 10 h" text_after="texte after 10 h"]

you can do this with a shortcode like this

add_shortcode("custom_text_se282078", function ($attr, $content, $tag) {
    
    $result = "";
    
    if (date_i18n("H") > 15) {
        $result = "It's after 15 h.";
    } else {
        $result = "It's before 15 h.";
    }
    
    return $result;
    
});

with that you just have to put [custom_text_se282078] in the page

you can do this with a shortcode like this

add_shortcode("custom_text_se282078", function ($attr, $content, $tag) {
    
    $result = "";
    
    if (date_i18n("H") > $attr["time"]) {
        $result = $attr["text_after"];
    } else {
        $result = $attr["text_before"];
    }
    
    return $result;
    
});

with that you just have to put that in the page :

[custom_text_se282078 time="10" text_before="text before 10 h" text_after="texte after 10 h"]

Source Link
mmm
  • 3.8k
  • 3
  • 16
  • 22

you can do this with a shortcode like this

add_shortcode("custom_text_se282078", function ($attr, $content, $tag) {
    
    $result = "";
    
    if (date_i18n("H") > 15) {
        $result = "It's after 15 h.";
    } else {
        $result = "It's before 15 h.";
    }
    
    return $result;
    
});

with that you just have to put [custom_text_se282078] in the page