• Hello!
    I can not figure out what the error is for:

    NOTICE: USE OF UNDEFINED CONSTANT GET_CONTENT – ASSUMED ‘GET_CONTENT’ IN /VAR/WWW/ZAMEKA5/DATA/WWW/TATJANA-PHOTO.KIEV.UA/WP-CONTENT/THEMES/KAMERA/FRAMEWORK/MODULES/BLOG/TEMPLATES/PARTS/POST-INFO/DATE.PHP ON LINE 6

    The code itself:

    <?php
    $month = get_the_time('m');
    $year = get_the_time('Y');
    ?>
    <div itemprop="dateCreated" class="edgtf-post-info-date entry-date published updated">
        <?php if(get_content){ ?>
            <a>">
        <?php } else { ?>
            <a>">
        <?php } ?>
    
            <?php the_time(get_option('date_format')); ?>
    
    		</a>
        <meta itemprop="interactionCount" content="UserComments: <?php echo get_comments_number(kamera_edge_get_page_id()); ?>"/>
    </div>
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Next time please encase your code within ‘`’ or select it and press the code button to be easier to read.

    To the problem at hand.

    Your code:
    <?php if(get_content){ ?>

    You probably wanted to write:
    <?php if(get_content()){ ?>

    I don’t know what are you trying to achieve just pointing out what I see here.

    Best regards,
    Konstantinos

    Xenos is correct about the syntax error, but you’ll likely run into another issue when you make the fix, since get_content() isn’t a function. You’ll need to use get_the_content().

    Thread Starter Farid Dokuchaev

    (@farik780)

    `<?php
    $month = get_the_time(‘m’);
    $year = get_the_time(‘Y’);
    ?>
    <div itemprop=”dateCreated” class=”edgtf-post-info-date entry-date published updated”>
    <?php if(get_content){ ?>
    <a itemprop=”url” href=”<?php the_permalink() ?>”>
    <?php } else { ?>
    <a itemprop=”url” href=”<?php echo get_month_link($year, $month); ?>”>
    <?php } ?>

    <?php the_time(get_option(‘date_format’)); ?>

    </a>
    <meta itemprop=”interactionCount” content=”UserComments: <?php echo get_comments_number(kamera_edge_get_page_id()); ?>”/>
    </div>

    Thread Starter Farid Dokuchaev

    (@farik780)

    Thanks big for answers but nothing came up.
    Example of the post https://tatjana-photo.kiev.ua/pervoe-zanyatie/

    Thread Starter Farid Dokuchaev

    (@farik780)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘USE OF UNDEFINED CONSTANT GET_CONTENT’ is closed to new replies.