Forum Replies Created

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter Cbas23

    (@cbas23)

    Nvm, I fixed that with this code:

    <ul class="link-item-menu">
    <?php global $page_id; $page_id = 116;?>
    <li><h2 class="link-item-menu"><?php echo get_the_title($page_id);?></h2></li>
    </ul>

    However, the text that it creates has none of the hover or color properties that the others have. Why is this happening? And if that isn’t fixable, how can I hyperlink that menu box?

    Thread Starter Cbas23

    (@cbas23)

    Thanks for the response. I’m a bit confused though – I got rid of most of the CSS errors, but they didn’t look like errors. Some of that css stuff was pretty important (like the opacity definitions which I left in), and it all came from the demo of a premium theme. Should I really delete all that stuff? Also, I was able to track down a few markup errors, but I am completely unable to find/fix most of them – the second error on the list is not even in my code, I don’t have any refernces to “h2” in any of my php files. And again, all of this code came from premium/professional quality themes which function fine when used by themselves. All I need to do is change the placement of the first post on the homepage. Is fixing all the other stuff really necessary?

    Thread Starter Cbas23

    (@cbas23)

    Nevermind.. It had something to do with my permalinks structure. When I reset it to default, the site started working again

    Thread Starter Cbas23

    (@cbas23)

    Nevermind actually.. I figured out that my theme was using the “advanced excerpts” plugin. Disabling that plugin got everything to work

    Thread Starter Cbas23

    (@cbas23)

    I tried:
    <?php echo do_shortcode('[media id="$attachment_id"]') ?>
    but all it gave me was “[MEDIA not found]”

    Even if I did get this to work though, how could I resize the video to match my column width?

    Thread Starter Cbas23

    (@cbas23)

    Thanks, but thats for embedding in posts. I need something I can embed directly in my php file. I tried this:
    [media id="$attachment_id"]
    But it only saw text

    Thread Starter Cbas23

    (@cbas23)

    Actually I got it. Just needed to add “echo” before the call. This code works:

    <?php
    global $wpdb;
    $attachment_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_parent = '$post->ID' AND post_status = 'inherit' AND post_type='attachment' ORDER BY post_date DESC LIMIT 1");
    ?>
    <a href="http://beachief.com/?cat=10"><img src="<?php echo wp_get_attachment_url($attachment_id); ?>" alt="Daily Chief" class="scaled"/></a>

    It gets the first image attached to the post, resizes it as needed (parameters set in the “scaled” css class), and adds a hyperlink to wherever you want.

    Now.. How could I do the same thing for a Youtube video embedded in a post?

    Thread Starter Cbas23

    (@cbas23)

    Thanks for the response. The wp_get_attachment_url doesn’t seem to work though. I got the ID for the first image in the post and tried to display it with this code:

    <?php
    global $wpdb;
    $attachment_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_parent = '$post->ID' AND post_status = 'inherit' AND post_type='attachment' ORDER BY post_date DESC LIMIT 1");
    ?>
    <a href="http://beachief.com/?cat=10"><img src="<?php wp_get_attachment_url($attachment_id); ?>" alt="Daily Chief" class="scaled"/></a>

    but all I get is a blank image box. What’s wrong?

    Thread Starter Cbas23

    (@cbas23)

    Perfect, that solved it. Many thanks

Viewing 9 replies - 16 through 24 (of 24 total)