rw1
Forum Replies Created
-
Forum: Hacks
In reply to: if post title is this then require this include, elseif do this, else nothing.i *think* i’m getting closer – the code below is working, the source code shows all the right custom values, but i still have the issue where the custom values are not being passed on to the lightbox ie whatever ‘Read More’ link i click on opens up the contents assigned to the first slide ie Title 1.
<?php //Set up the variable $post_title = get_the_title(); // If the post title is Title 1 if ($post_title == 'Title 1') { //Then grab this require($_SERVER['DOCUMENT_ROOT'] . '/sub-folder/wp-content/themes/theme_name/includes/includes1.php'); // If the post title is Title 2 } elseif ($post_title == 'Title 2') { //Then grab this require($_SERVER['DOCUMENT_ROOT'] . '/sub-folder/wp-content/themes/theme_name/includes/includes2.php'); } else echo ""; ?>
Forum: Hacks
In reply to: if post title is this then require this include, elseif do this, else nothing.Can anyone tell me which of the above approaches is close to being correct (if any) and if so where i can make changes so that the syntax is correct.
thanks!
Forum: Fixing WordPress
In reply to: Category posts don’t show like frontpagehello,
thanks for all this really helpful info.
i duplicated a file called page_blog.php and renamed it category-slug-name.php as i didn’t have a category.php file in my theme.
i have two menu links which link to cat5 (which i created the custom category page for) and cat4.
after duplicating the file when clicking on cat5’s menu link, the contents of cat4 is displayed.
i don’t know why this is happening.
the only thing i can see in the new category-slug-name.php file that calls the posts is:
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=" .ot_option('blog_cat'). "&showposts=" .ot_option('blog_cat_num'). "&paged=$paged"); while ( have_posts() ) : the_post() ?>
is there anything in this code which would make the page only show the contents of cat4 (even though the menu item links to cat5)?
thanks!
Forum: Hacks
In reply to: how to dynamically define file in flashvars using php?nevermind, i had to find a solution where the custom field value was not in the head area because it needs to be related to the changing slide content and therefore dynamic and not set in the header and i’m not totally there with a solution yet.
Forum: Hacks
In reply to: how to call a posts thumbnail url in the head area?thanks for this, fantastic ??
i’ve gotten close with:
<?php if (in_category('5') ) { the_post(); rewind_posts(); echo '<meta property="text" content="' . wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ) ) . '" />'; } ?>
which is outputting the thumbnail url great, but now i’m wondering how to specify the thumbnail size – i know those links above provide examples of this but i can’t get it to work in the context above – any help appreciated ie how do i get it to output the url of a thumbnail that is 80 x 80.
thanks!
Forum: Fixing WordPress
In reply to: the_post_thumbnail image sizesThank you for this infomation, i added:
add_image_size( 'mycustomsize', 80, 80, true );
to my functions.php and included it in the head area with:
echo '<meta property="text" content="' . the_post_thumbnail('mycustomsize') . '" />';
and it outputted the image at the top of the page.
1. can u tell me how i would output the url of this custom sized thumb?
2. it seemed to resize at 80 x 41 – is there anyway to define it exactly 80 x 80?
(edit – ah see you answered this, existing images will not be cropped)thanks!
ps i’ve been using:
echo '<meta property="text" content="' . wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ) ) . '" />';
and this works well in getting the url but i wanted to know how i could specify an exact thumbnail size.
Forum: Hacks
In reply to: how to call a custom field in the head area?yes thank you, just in the process of posting this solution, thanks to this post.
so the code that worked was:
<?php if (in_category('5') ) { the_post(); rewind_posts(); echo '<meta property="text" content="' . get_post_meta(get_the_ID(), 'custom_field', true) . '" />'; } ?>
thanks for your reply!
Forum: Fixing WordPress
In reply to: Gravatar appearing whenever I try to share on Facebook or Diggi’d like to know also, page source shows:
<link rel="image_src" href="https://www.gravatar.com/avatar/******default=&size=110.jpg" />
but can’t figure out where in the template it would be.
Forum: Plugins
In reply to: [DynPicWaterMark] [Plugin: DynPicWaterMark] Add on does not worki am also interested in this.
the drop down menu’s don’t seem to work in 3.0.4.
Forum: Fixing WordPress
In reply to: Styling the native galleryhello,
i am having an issue where individual image thumbnails are being displayed differently to the thumbnails generated for a gallery.
when i look at the code in the page, for the gallery there is:
[gallery link="file" columns="4" orderby="ID"]
and for the single image there is:
[caption id="attachment_525" align="alignnone" width="150" caption="Caption Here"]<a href="https://www.path_to_image.com/2.jpg"><img src="https://www.path_to_image.com/2-150x150.jpg" alt="" title="Title" width="150" height="150" class="size-thumbnail wp-image-525" /></a>[/caption]
i have the following classes defined in my stylesheet but they don’t seem to be passing on to the gallery thumbnails:
.wp-caption .wp-caption img .wp-caption p.wp-caption-text
any ideas appreciated!
thanks!
looking at the code in the page, the gallery code is:
[gallery link="file" columns="4" orderby="ID"]
whilst the single image thumbnail is:
[caption id="attachment_525" align="alignnone" width="150" caption="Caption Here"]<a href="https://www.path_to_image.com/2.jpg"><img src="https://www.path_to_image.com/2-150x150.jpg" alt="" title="Title" width="150" height="150" class="size-thumbnail wp-image-525" /></a>[/caption]
so it seems there is a style controlled by .wp-caption in my style sheet that is being applied to single image thumbnails, but not gallery thumbnails.
does anyone know how i could apply that style to gallery thumbnails?
thanks!
Have you had any luck in fixing this? I’m wondering if other plugins which use script are interfering with the operation of the scripts in nextgen?
Forum: Fixing WordPress
In reply to: get_post_meta does not work on my site – pls help!ps i’m testing things like:
<?php echo "This is the Exec-PHP 'Hello World'"; ?>
<?php if (1) { ?> <b>Handle THIS!</b> <?php } else { ?> <i>Handle THAT!</i> <?php } ?>
as suggested on the developers site and these codes are all outputting correctly but i cannot get it to ouput the value of my custom field.
Forum: Fixing WordPress
In reply to: get_post_meta does not work on my site – pls help!thanks very much for this tip, i installed and activated the plugin and added this to a text widget:
<?php echo get_post_meta($post->ID, 'customfield', true); ?>
and the widget area is showing up blank on the front end (the value specified for ‘customfield’ in the post is the text ‘test’).
any ideas why this would show up blank? i’m not too familiar with php so perhaps that code syntax is incorrect?
thanks!
Forum: Plugins
In reply to: [Plugin: Get Custom Field Values] How to stop showing shortcode on frontend?Parse Shortcodes in your Custom Fields
i came across this link but am not sure how i could implement it.
any help appreciated – thanks!