Forum Replies Created

Viewing 6 replies - 31 through 36 (of 36 total)
  • Thread Starter abreusky

    (@abreusky)

    AHHHHHHH!!!

    I didn’t notice that: there’s a difference from when the post is “opened” to when the post is displayed on the home page!

    Oh my, so much confusion for a small, but important detail ??

    Andrew, I’m sorry for taking your time to help me find out how things were working.

    :O

    I’m sorry!

    Thread Starter abreusky

    (@abreusky)

    Hmmm… it’s not a bug, actually. It’s something that is not working like the normal posts.

    It’s weird because on this:

    <?php
    
    add_action('init','random_add_rewrite');
    function random_add_rewrite() {
           global $wp;
           $wp->add_query_var('random');
           add_rewrite_rule('random/?$', 'index.php?random=1', 'top');
    }
    
    add_action('template_redirect','random_template');
    function random_template() {
           if (get_query_var('random') == 1) {
                   $posts = get_posts('post_type=post&orderby=rand&numberposts=1');
                   foreach($posts as $post) {
                           $link = get_permalink($post);
                   }
                   wp_redirect($link,307);
                   exit;
           }
    }

    I see ‘template_redirect’,’random_template’, but there’s not an actual “random_template” at none of my WordPress folders. I even looked at wp-includes folder (that is not a folder that my theme contains)…

    I changed several words to replace this ‘template_redirect’,’random_template’, but none of them worked out. I even replaced ‘template_redirect’ for ‘template_include’, didn’t work either.

    Well, I think this is way beyond my understanding :-/

    Thread Starter abreusky

    (@abreusky)

    Hmmmm, yes, true, I saw it!

    And these templates are in which files on the wp-content/themes/blogum folder?

    Maybe it is something wrong I did with the initial plugin I created for the random post.

    PS: sorry guy, really sorry. My knowledge is just a bit of HTML, and I go searching for things online but I have no deep knowledge of PHP at all. ??

    Thread Starter abreusky

    (@abreusky)

    And what do you think about this one https://prettygood.style ? Is this the one that has an overlap issue?

    Can I solve it with the .php file?

    Because apparently the title is on a H1 tag

    Thread Starter abreusky

    (@abreusky)

    Ah, ok

    This is my blog: Pretty Good Style

    When you click “Random” on the top menu, you will see that the post title is located together with the content.

    Have a look at how this is different from the normal posts.

    What do you think? Is it a CSS issue?

    edit: the images on the blog are not mine, this is just mockup content

    • This reply was modified 8 years, 2 months ago by abreusky.
    Thread Starter abreusky

    (@abreusky)

    Hi Andrew,

    thank you for the quick reply!

    I don’t know if it a CSS issue… O_o

    Do you think that if I add some line to the empty plugin that I created, then I will be able to place the post title in the correct place?

    What do you think?

    This is my theme: Blogum

Viewing 6 replies - 31 through 36 (of 36 total)