Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • I did inactivate, delete the plugin and went into the database and erased all the adrotate tables. And then i did reinstall the plugin. Now it works. I have to add all my ads again tho. Maybee is it possible to get them back from a backup.

    I get exactly the same error as zothecula. Its very annoying, I cannot use the plugin at all now!

    Its also very disturbing that you cannot change the id of ads or ad groups. I tried to do that manually in the database. It worked locally, but and my online site I get this error instead, and cannot do anything now.

    Anyone know how to solve it?

    Thread Starter yurini

    (@yurini)

    The jquery code works like a charm, thanks!

    To only display the show/hide button on posts that allow comments this code can be used:

    <?php if( comments_open( $post->ID ) ) { ?>
    					<?php comments_template( '', true ); ?>
    				<?php } ?>

    Unfort. I have not yet solve a nice way to display the current number of comments within that button like “Show comments (21)”.

    Thread Starter yurini

    (@yurini)

    It works great! The “& nbsp ;” adds extra space, but if you put a space after the “|” it will read that and I only need one space after the “|”. If you need more you can use the ” % nbsp ;”.

    Thank you very much!

    Thread Starter yurini

    (@yurini)

    Okay thank you I will go home and try this! I supose this snippet of code is checking if the post is allowing comments?:

    // Only do this work if that div isn't empty
      if (commentsDiv.length) {

    I didn´t mention that I was planing to display the current number of comments within the button like: “Show comments (21)”. I know how to do this with the wordpress commands, but maybee I do need to pull that out of jquery now aswell? Unfort I dont know how to do that.

    Regards yurini

    Thread Starter yurini

    (@yurini)

    Thank you! I will go home and give it a try. I guess the use of span instead of div can stick the text before and after the “|” at the same row. Don´t know why you suggested to use “& nbsp ; ”  there, but I will try it and return with the result!

    Im not realy sure im getting you correct. But if I am one way to solve this is via custom fields.

    Look at this code:

    <?php  if((get_post_meta($post->ID, "bild-lopsedel-fullbredd", true))) { ?>
    			<div id="bild-lopsedel-fullbredd">
    				<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
    				<img src="<?php echo get_post_meta($post->ID, 'bild-lopsedel-fullbredd', true); ?>" alt="Artikelbild #<?php the_ID(); ?>" />
    				</a>
    			</div>
    		<?php } ?>

    It display any image url that you copy and paste into your custom field with a name of “bild-lopsedel-fullbredd”. It also has a div with the same name that you now can use for absolute positioning or whatever you wanna target it with in your stylesheet.

    Regards
    yurini

    You can also make the image clickable and link it to the article.

    Here is an example how to use an a-link with the the_post_thumbnail command:

    <?php if ( has_post_thumbnail()) : ?>
       <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
       <?php the_post_thumbnail(); ?>
       </a>
     <?php endif; ?>

    jalacom

    It maybee gets the picture of 400×300 pixles because it did crop and set the sizes at the moment you uploaded it to WordPress. If you changed the “large” thumbnail sizes under “Media” recently you have to remove and reupload your picture again to make WordPress crop and/or resize your pictures to the new sizes you set under Media. It should then pull the correct size if you call for ‘large’.

    This might be the problem in your case?

    Thread Starter yurini

    (@yurini)

    Yes I understand.

    I used conditional statements as you suggested to solve it. I am using the Advanced Custom Field´s plugin (http://www.advancedcustomfields.com) and used if statements with it, in this case “bildplacering-lopsedel” with the values of “bild-lopsedel-fullbredd”, “bild-lopsedel-hoger” and “bild-lopsedel-vanster” equivalent to the placement (fullwidth, alignright and alignleft) and added a class with the same name for the floats.

    I also removed the add_image_size code and ended up with using the three sizes set under “Media” and called for “thumbnail”, “medium” etc instead. For anyone curious here´s the final code I ended up with (this code also contains some other options for getting the picturecomments etc from other custom fields to display below the picture):

    [35 lines of code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Big thanks FMarion for taking your time!

    Thread Starter yurini

    (@yurini)

    Thanks for your reply! Okay I think I get that.

    But do you mean that even if I remove the custom “add_image_size” values, WordPress is always going to make three sizes of every image (beeing read from the Media options under Settings in the admin-panel) that is going to be stored in the wp-content/uploads folder? I supose you meant that it can affect the bandwith or at least the space on the server if WordPress generates alot of images that maybee not is necessary?

    One way to solve this would maybee be with custom taxonomies I can imagine? For example something like this:

    <?php
    $post = $wp_query->post;
    	if ( has_term('bild-lopsedel', 'lopsedel', $post->ID ) ) the_post_thumbnail( 'bild-lopsedel', array( 'class' => 'bild-lopsedel' ));
    elseif ( has_term( 'bild-lopsedel-hoger', 'lopsedel', $post->ID )) the_post_thumbnail( 'bild-lopsedel-hoger', array( 'class' => 'bild-lopsedel-hoger' ));
    endif; ?>

    I haven´t tried it yet, I will now.

    Thread Starter yurini

    (@yurini)

    Hi!

    I did not try much with towonders suggestion, it may work.

    At first it did not work with keesiemeijer suggestion either. The problem was that term names are case-sensitive, so type carefully!

    My taxonomys term was “Fullbreddsartikel” with an F instead of an f (even tho the permalink for it was in lowercases). Now it works great with this code:

    <?php
    $post = $wp_query->post;
    	if ( has_term('Fullbreddsartikel', 'artikelbredd', $post->ID ) ) {include(TEMPLATEPATH . '/single-fullbreddsartikel.php');}
    	elseif ( has_term( 'bloggare1', 'category', $post->ID )) {include(TEMPLATEPATH . '/templates/single-bloggare1.php');}
    	else {include(TEMPLATEPATH . '/single-default.php');
    	}
    ?>

    Thank you very much for your help!

    Thread Starter yurini

    (@yurini)

    Thanks again, problem solved!

    Added “title_li=” to the wp_list_pages parameter (set the value to empty or null) and the Pages list heading disapeard. The code now looks like:

    <ul id="nav3">
    <li <?php if(is_front_page()) { ?>class="current_page_item"<?php } ?>>
    </li>
    <?php
    $page1 = get_page_by_title( 'About' );
    $page2 = get_page_by_title( 'Home' );
    $page3 = get_page_by_title( 'News' );
    wp_list_pages( 'title_li=&include=' . $page1->ID .','. $page2->ID .','. $page3->ID );
    ?>
    </ul>

    Problem solved!

    This community is so friendly, its almost unbelivable! This was my first own question and post on this support forum and it was solved within an hour or two.

    Regards
    Yurini

    Thread Starter yurini

    (@yurini)

    Thank you, both methods worked!

    Alltho I get the message “Pages” getting echo:ed out on the row above the list. It did not show up before. Any idea why and how to remove it?

    My ul code now looks like:

    <ul id="nav3">
    <li <?php if(is_front_page()) { ?>class="current_page_item"<?php } ?>>
    </li>
    <?php
    $page1 = get_page_by_title( 'About' );
    $page2 = get_page_by_title( 'Home' );
    $page3 = get_page_by_title( 'News' );
    wp_list_pages( 'include=' . $page1->ID .','. $page2->ID .','. $page3->ID );
    ?>
    </ul>

    Thank you again
    /Yurini

Viewing 14 replies - 1 through 14 (of 14 total)