Cbas23
Forum Replies Created
-
Forum: Hacks
In reply to: Change menu item from post to pageNvm, 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?
Forum: Themes and Templates
In reply to: Formating issue after uploading custom themeThanks 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?
Forum: Fixing WordPress
In reply to: Cannot display full post (w/ any theme)Nevermind.. It had something to do with my permalinks structure. When I reset it to default, the site started working again
Forum: Hacks
In reply to: the_excerpt method not functioning correctlyNevermind actually.. I figured out that my theme was using the “advanced excerpts” plugin. Disabling that plugin got everything to work
Forum: Hacks
In reply to: Dynamically retrieve youtube embed url from postI 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?
Forum: Hacks
In reply to: Dynamically retrieve youtube embed url from postThanks, 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 textForum: Hacks
In reply to: Extract and resize a post attachmentActually 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?
Forum: Hacks
In reply to: Extract and resize a post attachmentThanks 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?
Forum: Hacks
In reply to: Strange bullet points in header – how do I get rid of them?Perfect, that solved it. Many thanks