Forum Replies Created

Viewing 15 replies - 16 through 30 (of 51 total)
  • Thread Starter rw1

    (@rw1)

    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 "";
    ?>
    Thread Starter rw1

    (@rw1)

    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!

    hello,

    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!

    Thread Starter rw1

    (@rw1)

    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.

    Thread Starter rw1

    (@rw1)

    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!

    Thank 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.

    Thread Starter rw1

    (@rw1)

    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!

    i’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.

    i am also interested in this.

    the drop down menu’s don’t seem to work in 3.0.4.

    hello,

    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!

    Thread Starter rw1

    (@rw1)

    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!

    Thread Starter rw1

    (@rw1)

    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?

    Thread Starter rw1

    (@rw1)

    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.

    Thread Starter rw1

    (@rw1)

    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!

    Thread Starter rw1

    (@rw1)

    Parse Shortcodes in your Custom Fields

    i came across this link but am not sure how i could implement it.

    any help appreciated – thanks!

Viewing 15 replies - 16 through 30 (of 51 total)