CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2011
    Posts
    8

    Error for Wordpress Theme (phpMyAdmin)

    Hello, I am attempting to work on some code for Wordpress (from a custom theme), and it is giving me an error:

    have_posts() ): while($q->have_posts()): $q->the_post(); $postdate = get_the_date(); $date = date('\<\s\p\a\n\>j\ M', strtotime($postdate)); ?>


    }
    There has been a critical error on this website.
    Here is the code that is giving the error:

    Code:
    function true_load_posts(){
        $args = unserialize(stripslashes($_POST['query']));
        $args['paged'] = $_POST['page'] + 1; // СЛЕДУЮЩАЯ СТРАНИЦА
        $args['post_status'] = 'publish';
        
        <?
        $q = new WP_Query($args);
        if( $q->have_posts() ):
            while($q->have_posts()): $q->the_post();
        
                    $postdate = get_the_date();
                    $date = date('\<\s\p\a\n\>j\</\s\p\a\n\> M', strtotime($postdate));
        ?>
                <!-- News Block -->
                    <div class="news-block col-lg-6 col-md-12 col-sm-12">
                        <div class="inner-box">
                            <a class="overlay-link" href="<? the_permalink(); ?>"></a>
                            <div class="image">
                                <img src="<? echo get_the_post_thumbnail_url( $post->ID, 'thumbnail-570x547' ); ?>" alt="" />
                                <div class="post-date">
                                    <? echo $date; ?>
                                </div>
                                <div class="content">
                                    <h4><a href="<? the_permalink(); ?>"><? the_title(); ?></a></h4>
                                </div>
                            </div>
                        </div>
                    </div>
    <? endwhile; endif; wp_reset_postdata(); ?>
                <?
                die();
                ?>
    }

    I have never worked in PHP, but this is apparently the only issue when I attempt to load the theme that was developed.

    I would ask the developer to fix it, but they are now attempting to price gouge. As someone who codes in C/C++ and C#, I figured it wouldn't be too difficult to figure it out... Yeah, turns out I was mistaken how easy it would be.

    Hopefully someone is willing to give me some assistance on this so I do not have to end up paying what the original developer is attempting to demand.

  2. #2
    Join Date
    Jan 2011
    Posts
    8

    Re: Error for Wordpress Theme (phpMyAdmin)

    Well... It isn't exactly giving me hope that this is something easily solved that a number of people have read this but have not been able to respond. If anyone is willing to reply, does this look like a more complex issue?

  3. #3
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,692

    Re: Error for Wordpress Theme (phpMyAdmin)

    People may have read this thread but not have php knowledge. Myself for instance. I just use c/C++ so although I've read this thread I'm not in a position to provide any advice.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.4.1)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured