Forum Replies Created

Viewing 15 replies - 1 through 15 (of 30 total)
  • Thread Starter youknowmenot

    (@youknowmenot)

    So after experimenting I found out that this only happens when the error 404 pops up. As I described above, the albums are bugged and after opening several galleries through the albums, they start showing error 404 instead. When that happens, if there is a post with the same name as the gallery, it opens up instead of the single gallery alone. This was a well known bug before when I browsed through your support forums, has that been fixed?

    PS. None of the free hosting websites have enough storage available to host my website.

    Thread Starter youknowmenot

    (@youknowmenot)

    So instead of %d I used %.1f and it worked, but even though I have selected “Remove decimals if ends in zero” in the field settings in POD, it still shows numbers such as 23.0 24.0 instead of just “23” and “24”.

    Thread Starter youknowmenot

    (@youknowmenot)

    A little late but thanks again for trying to help me out. It sounded simple but I couldn’t manage to make it work. I changed int to float and also the field type into currency but I don’t understand your third instruction – isn’t that automatically done by POD in the field settings? Here is a screenshot:

    https://i.imgur.com/XOZIian.png

    And here is the code of the function that I need to have a decimal point on:



    add_shortcode(

        'ricerolls-journal-years',

        function( $atts, $content, $shortcode_tag ){

            ob_start();

            $base_query_args = [

                'post_type' => 'daily_journal',

                'post_status' => 'published',

                'posts_per_page' => -1,

                'fields' => 'ids',

            ];

            echo '<tr>';

            $ricerolls_by_year = [];

            // Current year back to 2023 in decending order.

            foreach( range( date('Y'), 2023 ) as $year ) {

                $ricerolls_by_year[ $year ] = 0;

                // December to January in decending order.

                foreach( range( 1, 12 ) as $month ) {

                    // Skip months in the current year after the current month.

                    $this_months_timestamp = strtotime( $year . '-' . $month );

                    if ( $this_months_timestamp > time() ) {

                        continue;

                    }

                    $this_months_post_ids = get_posts(

                        array_merge(

                            $base_query_args,

                            [

                                'year' => $year,

                                'monthnum' => $month,

                            ]

                        )

                    );

                    $this_ricerolls = $this_months_ricerolls = 0;

                    if ( ! empty( $this_months_post_ids ) ) {

                        foreach( $this_months_post_ids as $post_id ) {

                            $this_ricerolls = (float) get_post_meta( $post_id, 'rice_rolls', true );

                            $this_months_ricerolls += $this_ricerolls;

                            $ricerolls_by_year[ $year ] += $this_ricerolls;

                        }

                    }

                }

                printf(

                    '<td colspan="2" bgcolor="#222222" style="white-space:nowrap;border:1px dotted #666666;width:460px;">Year %s</td>

                    <td id="tdArchive" bgcolor="#000000" style="width:50px;"> %d </td></tr>',

                    $year,

                    $ricerolls_by_year[ $year ]

                );

            }

            echo '

            </tr>';

            return ob_get_clean();

        }

    );

    And it’s still rounding up the numbers. I tried floatval () too – same story.

    • This reply was modified 3 years, 4 months ago by youknowmenot.
    Thread Starter youknowmenot

    (@youknowmenot)

    I have the backup running on my laptop, with my old design, my default style looks to be twentytwentyone there. I copied everything in both styles and templates folders because I wasn’t sure which one I was using and pasted it in my current site folders. But the design on my site stays the same. I cleared my browser’s cache to be sure. So I must be doing something very wrong and I’m confused. What must I do?

    Thread Starter youknowmenot

    (@youknowmenot)

    The styles folder exists, but my CSS isn’t there. All files are dated from the time I updated the version. I do keep a backup, but what’s the point if every update I have to rework/reset it. :/ I liked how customizable MC was because I was using images and tables for design, now it seems like it would be best only to mess with the main colors.

    Thread Starter youknowmenot

    (@youknowmenot)

    I referred to your help document and indeed looked for it there before asking, but no such folder exists. I guess it didn’t migrate after all? After migrating it just broke the style even more. At least it allowed me to select another style now.

    Thread Starter youknowmenot

    (@youknowmenot)

    Yes, that seems to fix it. Although the line in my file was on 2022. So do I leave it as it is?

    And since I’ve missed the removal of custom CSS, and my calendar was very custom, is there a way to obtain the old CSS I’ve used? After clicking Migrate, it said “CSS migrated to custom directory.” but I don’t see it anywhere. And after selecting a new style, it says security check failed.

    Thread Starter youknowmenot

    (@youknowmenot)

    And here is the code for the menus that my theme uses:

            <p class="headnav">Main Menu</p>
    
            <?php
    
                wp_nav_menu(
    
                    array(
    
                        'menu' => 'main',
    
                        'container' => '',
    
                        'theme_location' => 'main',
    
                        'items_wrap' => '<ul id="" class="">%3$s</ul>'
    
                    )
    
                )
    
            ?>
    Thread Starter youknowmenot

    (@youknowmenot)

    Ok, fixed the first issue. What information do you need for the second one? I’m using li’s and ul’s for my menus. But my “latest articles” sidebar window does not use those formats, here is an example code for the output of my “latest review” section:

    <?php
    
    $args = array(
    
        'post_type' => 'review',
    
        'posts_per_page' => 1,
    
        'cat' => '11,52',
    
    );
    
    $q = new WP_Query( $args);
    
    if ( $q->have_posts() ) {
    
        while ( $q->have_posts() ) {
    
        $q->the_post(); ?>
    
                <div class="sidebarhead"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php
    
            the_title(); ?></a></div>

    Thread Starter youknowmenot

    (@youknowmenot)

    You are next level! Thank you for all the explanations. What if the value entered is 0.5 or 1.5, how do I go about displaying increments?

    Thread Starter youknowmenot

    (@youknowmenot)

    Wow, that looks perfect, thank you! I have integrated it to my tables design, but is there a way to call the year and monthly value separately so I can style them in their own table rows? I know I can do it by duplicating the shortcode and commenting the year/month printf’s in your code but it looks like a bit of an overkill. I would love to toy with that code and get more field values that way!

    Thread Starter youknowmenot

    (@youknowmenot)

    Perfect! Thank you!

    Thread Starter youknowmenot

    (@youknowmenot)

    Thanks for your answer. I tried it but it ‘li.post-count’ removes everything except pages. Since I’m using li.post-count to style my custom post types and it removes them too.

    Thread Starter youknowmenot

    (@youknowmenot)

    Bump

    Thread Starter youknowmenot

    (@youknowmenot)

    Ok, after a ton of googling I managed to come up with a working code. I’m pretty bad at PHP so I’m fairly sure someone can write a better one, but I’m pasting it anyway in case it might help someone else:

    
    $spotlightNum = 0; 
    $args = array( 'post_type' => 'spotlight', 'posts_per_page' => -1 );
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post();
        $spotlighttotalvalue       =   get_post_meta(get_the_ID(), "total_value", true);
        if (!empty($spotlighttotalvalue)){
            $spotlightNum += $spotlighttotalvalue;
        }
    endwhile;
    echo $spotlightNum;

    `

    • This reply was modified 3 years, 9 months ago by youknowmenot.
Viewing 15 replies - 1 through 15 (of 30 total)