• Dear,

    I have made a website which uses WP GRID BUILDER. In the grid builder i have added the custom field options which gets the data from a custom field i have created called ‘datapostimi’. What i want to know is that is it possible to get a string in this custom field (in posts) so i can use a differen format and not the one wordpress offers.

    The data format i want to use is for example just 20 Aug and this should show in this form

    20
    Aug

    I hope i was clear, and i am sorry if i was not.

    Thank you very much in advance.

Viewing 1 replies (of 1 total)
  • Thread Starter glaukabazi

    (@glaukabazi)

    I have found a solution by creating a custom shortcode and then using it.

    But i am having trouble with this code i’ve created. I have been doing this for a long time and maybe this is something simple but my brain isn’t working.

    <?php 
    
    function fshk_fakulteti_menu_shortcode() {
     echo '<div class="total">
        echo '<div class="example">' . get_the_date( 'd' ) . "<br>";
    	
       echo '<div class="example">' . get_the_date( 'M' ) . ;
       
       </div>';
    }
    add_shortcode('datapostimi', 'fshk_fakulteti_menu_shortcode');
    
    ?>

    Please, anyone? what is wrong here

    it alerts
    Parse error: syntax error, unexpected token “class”, expecting “,” or “;” in C:\xampp\htdocs\s3\wp-content\themes\twentynineteen\glauk-shortcodes.php on line 6

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Field String’ is closed to new replies.