Forum Replies Created

Viewing 15 replies - 1 through 15 (of 52 total)
  • Thread Starter maisteriharju

    (@maisteriharju)

    I found out whats causing this. It’s just my messed up coding in the sidebar. Nothing wrong with the plugin.

    Thread Starter maisteriharju

    (@maisteriharju)

    I had no time to wait so I hardcoded some changes to submit.php.

    If someone else is having the same problem I explain what I did. First of all here is why I did it: I needed to have three different submit buttons for my website since the website has three different languages. So there should be “Send-button” in three languages. Of course each button is in it’s own contact form.

    Here’s how I managed to change those texts.

    Open submit.php from wp-content/plugins/contact-form-7/modules and just change the following:

    $value = $values[0];
    if ( empty( $value ) )
    $value = __( 'Send', 'wpcf7' );

    To this:

    $value = $values[0];
    if (is_page('first contact page id here'))
    $value = __( 'first submit text here' );
    elseif ( is_page('second contact page id here'))
    $value = __( 'second submit text here' );
    else
    $value = __( 'third submit text here' );

    I’m no php coder, so it may not be beautifully written or even absolutely correct (honestly I don’t know, I just tried stuff until it worked) but it seems to work. This isn’t very good solution and I don’t recommend it because when you update the plugin, this code propably vanishes and you need to write it again. It’s based on basic conditional tags of WordPress.

    – Tuomas

    Thread Starter maisteriharju

    (@maisteriharju)

    Hmm.. I could do that if I just could. ?? I haven’t ever done anything with cookies or session vars and I don’t know much about them. Is there some quick tutorial about this?

    Thread Starter maisteriharju

    (@maisteriharju)

    I solved it.

    If someone else is having this same problem this is a 2.5.1 problem. I tried the same template with 2.6.2 and it works fine. The “exclude_category”-tag doesn’t exist in bookmark-template.php of 2.5.1 but it exists in 2.6.2’s bookmark-template.php.

    2.5.1:

    $defaults = array(
    		'orderby' => 'name', 'order' => 'ASC',
    		'limit' => -1, 'category' => '',
    		'category_name' => '', 'hide_invisible' => 1,
    		'show_updated' => 0, 'echo' => 1,
    		'categorize' => 1, 'title_li' => __('Bookmarks'),
    		'title_before' => '<h2>', 'title_after' => '</h2>',
    		'category_orderby' => 'name', 'category_order' => 'ASC',
    		'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">',
    		'category_after' => '</li>'

    2.6.2:

    $defaults = array(
    		'orderby' => 'name', 'order' => 'ASC',
    		'limit' => -1, 'category' => '', 'exclude_category' => '',
    		'category_name' => '', 'hide_invisible' => 1,
    		'show_updated' => 0, 'echo' => 1,
    		'categorize' => 1, 'title_li' => __('Bookmarks'),
    		'title_before' => '<h2>', 'title_after' => '</h2>',
    		'category_orderby' => 'name', 'category_order' => 'ASC',
    		'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">',
    		'category_after' => '</li>'

    Thread Starter maisteriharju

    (@maisteriharju)

    Come on!

    Thread Starter maisteriharju

    (@maisteriharju)

    Anyone?

    Thread Starter maisteriharju

    (@maisteriharju)

    Can someone who knows better confirm that exclude_category doesn’t work with bookmarks? My deadline is killing me.

    Here is the full page template I’m using. It doesn’t exclude the 1,3 and 4 categories but instead it just shows all the categories:

    <?php
    /*
    Template Name: Others
    */
    ?>
    
    <?php get_header(); ?>
    
    <table class="table" cellpadding=0 cellspacing=0 border=0>
    <tr valign=top>
    <td class="leftshade">
    &nbsp;
    </td>
    <td class="sidebar">
    <?php get_sidebar(); ?>
    </td>
    <td id="content">
    
    <div class='narrowcolumn'>
    
    <ul class="list">
    <?php wp_list_bookmarks ('exclude_category=1,3,4&between=<br />&show_description=1') ?>
    </ul>
    
    </div>
    
    </td>
    <td class="rightshade">
    &nbsp;
    </td>
    </tr>
    </table>
    
    <?php get_footer(); ?>
    Thread Starter maisteriharju

    (@maisteriharju)

    I looked into depth of the WordPress core and couldn’t find ‘exclude_category’ from bookmark-template.php and bookmark.php.

    Is it so that exclude_category isn’t coded at all to the bookmark-template.php in 2.5.1? From bookmark.php I found ‘exclude’ but I still have no idea how to make it exclude the category. If I use just exclude-tag instead of exclude_category it removes certain bookmarks but not bookmark categories.

    Hmm… or is there just some typo in my code?

    Thread Starter maisteriharju

    (@maisteriharju)

    Anyone?

    Thread Starter maisteriharju

    (@maisteriharju)

    Ok. So it’s not possible.

    Thread Starter maisteriharju

    (@maisteriharju)

    Anyone?

    Thread Starter maisteriharju

    (@maisteriharju)

    Ok. I abandoned the whole idea of having the basic WP calendar show the info (links to the posts) because I’m seriously bad in writing PHP (read: don’t know PHP at all).

    But got this new idea: a CALENDAR THEME! In the calendar theme all the headlines of posts would be presented inside calendar grid. There are three-column layouts and four column layouts so why can’t there be 5-rows-and-7-columns calendar grid layout?!

    Only problem is that I can’t do it either. I can’t figure out how the wordpress would add empty space to the calendar when there aren’t any posts for some particular day. And also how the posts would actually go to the right boxes. I suppose conditional tags aren’t enough for that.

    Hmm… If you get some kicks out of this obviously amazing idea and know how to do it, pls let me now.

    Thread Starter maisteriharju

    (@maisteriharju)

    Anyone?

    Hi,

    I corrected your code. You can find example from here:
    https://www.kolumbus.fi/tuomas.harju/blog.zip

    You should check the theme files (header.php, index.php and so on) and the css. Copy the necessary codes from html to the theme files and use the css-file inside the zip. Also check the codes I took away. I took away some unnecessary codes from there. In header.php just use basic <center> for the logo image.

    I hope this helps.

    – Tuomas

    Thread Starter maisteriharju

    (@maisteriharju)

    I managed to get so far that I actually can see the future posts now in the basic WP calendar.

    Here is how I did it.

    I opened general-template.php to text editor and found place where it says: “// Get days with posts”. Couple of lines below there is this code

    AND post_date <

    Little bit googling and I found appropriate code. So I changed it to this

    AND post_date !=

    This made the calendar to show hyperlinks to all posts – the posts in the past and posts in the future.

    Now I still needed to have the post topics show in the day box. For to get that I changed this code

    if ( in_array($day, $daywithpost) ) // any posts today?
    echo '<a href="' . get_day_link($thisyear, $thismonth, $day) .
    "\" title=\"$ak_titles_for_day[$day]\">$day</a>";

    to this:

    if ( in_array($day, $daywithpost) ) // any posts today?
    
    echo '<a href="' . get_day_link($thisyear, $thismonth, $day) .
    "\" title=\"$ak_titles_for_day[$day]\">$day</a>
    $ak_titles_for_day[$day]";

    But I still have a problem which I can’t figure out. I have the titles now in the calendar but how can I make the WordPress change those titles to hyperlinks which lead to the post?

    Usually I’m pretty alone with these problems here but now I really hope someone would look at this code and tell me what kind of function adds the hyperlinks to those titles.

    $ak_titles_for_day[$day] seems to add the post titles to the calendar. Is it possible to change it somehow that it would change the titles to hyperlinks?

    Anyone?

Viewing 15 replies - 1 through 15 (of 52 total)