Forum Replies Created

Viewing 15 replies - 16 through 30 (of 45 total)
  • Thread Starter iansane

    (@iansane)

    I’ve deleted the htaccess and had wordpress recreate it several times.

    I do have a backup which I”m going to go back to because even with the siteurl and home fixed all the images are missing since it changed those urls too.

    Thread Starter iansane

    (@iansane)

    I couldn’t go to the dashboard because the site wouldn’t load after running that search and replace script. I went in to mysql and see that it dropped the 2 off the end of the directory name. Above what I meant to say was that the url auto changes to dev.metrotechpc.com/proximus/25. But I fixed that by manually updating siteurl and home like I had done before. Only thanks to the script there are 540 places where it dropped the 2 off the directory name.

    Now that I fixed that issue, permalinks still don’t work as ‘post’ type url and just like before, it’s writing the htacess file with no problem.

    Here's the htaccess if you see anything wrong with it.
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /proximus2/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /proximus2/index.php [L]
    </IfModule>
    
    # END WordPress

    Thanks

    Thread Starter iansane

    (@iansane)

    Not sure what happened but using the search and replace script screws the whole site up. It say’s be sure you know what tables to choose but if I knew anything other than site_url and home in wp-options I would have changed them myself.

    Now when I go to the url of the site it changes the url and adds the number 25 to the end of it.

    The dev site is dev.metrotechpc.com/proximus2 and when I go there it automatically changes to dev.metrotechpc.com/proximus2/25/ and tells me page not found.

    I think I was better off before because the site at least worked with default permalinks.

    Any other ideas?

    Thanks

    Thread Starter iansane

    (@iansane)

    Well actually I did search and replace all instances of the old url but I did it with notepad++ because I had done it before and it worked. Maybe there were no serialized strings in the one that worked before but there are a lot of them in this site so I’ll restore the database and then use the search and replace script from your link and see if that fixes it.
    Thanks, I’ll be back in a few to post if it worked or not.

    Thread Starter iansane

    (@iansane)

    Well, I finally was able to get the database access I needed so the problem is fixed but if anyone knows a way to do it without db access for future use I appreciate it.

    Thread Starter iansane

    (@iansane)

    I haven’t been able to get a copy up to a live server to post a link yet (I’m working local at the moment) but something interesting is, I tried divs instead of a table and it does the same thing. It appears to be the social buttons (facebook, twitter, linkedin, etc. that are going all over the place when loaded through the wp loop and no matter what I do with divs or tables they force it to expand. It’s got to have something to do with the iframes and elements coming through with them because I can replace all the buttons with text and my tables or divs take the size and styling like they are supposed to.

    Thread Starter iansane

    (@iansane)

    wp was putting in p tags for html comments but I took those out and the table is still messed up.

    In firebug under the style tab for the table it shows 60px height which is what it should be but under computed boxmodel shows 286px height which is what it is displaying.

    Any idea what would cause this?

    thanks

    Thread Starter iansane

    (@iansane)

    Yeah actually that’s why I was wondering if there’s a known issue. I wasn’t seeing anything in firebug.

    I do see a couple of random empty paragraphs wp is throwing in there so that’s definitely a problem since p tags have margins and padding applied to them in my style sheet for the ones that are supposed to be there.

    So how do I stop wordpress from putting in p tags in random places that aren’t there in my code?

    Thanks

    Thread Starter iansane

    (@iansane)

    It would be the same with php. the \ is supposed to escape the next character. But there’s more than that going on here. It strips out the < and > and converts the double quotes to single quotes. Actually when I try to escape a character with the \ it ends up blank so maybe it is interpreting the \ as escape everything else after it.

    For a work around and probably more secure way, I made an input for each meta tag and then in the header have a function that gets those values and builds out the meta tags but I’d like to know how to do it the other way so if I wanted to just have a text area where the user can just type in a block of meta tags and have them added to the header all in one chunk.

    Thanks

    Thread Starter iansane

    (@iansane)

    Well I thought the problem was resolved but it’s not.

    When saving meta data with a custom metabox add_post_meta() is stripping out double quotes and the closing ‘/’ for the closing tag.

    I need to be able to save this:
    <meta name="fb:whatever" content="somecontent"/>

    How do I protect the string so add_post_meta() won’t strip it?
    I tried addslashes() but that ends up causing an error somewhere and stoping it from writing anything to the database at all.

    here is my save code excluding the admin check part.

    $current_data = esc_textarea(get_post_meta($post_id, '_my_meta_facebook', TRUE)); 
    
        $new_data = $_POST['_my_meta_facebook'];
    
        //$new_data = addslashes($new_data);
        //my_meta_facebook_clean($new_data);
    
        if ($current_data)
        {
            if (is_null($new_data)) delete_post_meta($post_id,'_my_meta_facebook');
            else update_post_meta($post_id,'_my_meta_facebook',addslashes($new_data));
        }
        elseif (!is_null($new_data))
        {
            add_post_meta($post_id,'_my_meta_facebook', addslashes($new_data), TRUE);
        }
    
        return $post_id;

    Thanks

    Thread Starter iansane

    (@iansane)

    I thought the problem was resolved.

    I can’t seem to put in double quotes or slashes for the html because add_post_meta() is stripping them out.

    Can anyone tell me how to stop that? How would I protect the metabox data from stripping? I tried using addslashes() but that causes the data to not get written to the database at all.

    Here is my code for saving the data:

    $current_data = esc_textarea(get_post_meta($post_id, '_my_meta_facebook', TRUE)); 
    
        $new_data = $_POST['_my_meta_facebook'];
    
        //$new_data = addslashes($new_data);
        //my_meta_facebook_clean($new_data);
    
        if ($current_data)
        {
            if (is_null($new_data)) delete_post_meta($post_id,'_my_meta_facebook');
            else update_post_meta($post_id,'_my_meta_facebook',addslashes($new_data));
        }
        elseif (!is_null($new_data))
        {
            add_post_meta($post_id,'_my_meta_facebook', addslashes($new_data), TRUE);
        }
    
        return $post_id;

    I need to add this with slashes and double quotes intact:
    <meta name="fb:something" content="whatever"/>

    Thanks

    Thread Starter iansane

    (@iansane)

    Once again, I work on figuring something out for hours and then figure it out after posting the question.

    get_post_meta was returning the array with the value intact. I just used esc_textarea on the single value before echoing it instead of trying to use it on the get_post_meta function.

    function get_facebook_meta()
    {
    	global $post;
    	$my_facebook_meta = get_post_meta($post->ID, '_my_meta_facebook', true);
    	echo esc_textarea($my_facebook_meta['facebook']);
    }

    I’ll mark it resolved but any suggestions on doing this better are appreciated.

    Thanks

    Forum: Fixing WordPress
    In reply to: syntax error

    No problem. Glad you found the issue.

    Forum: Fixing WordPress
    In reply to: Menu Problems

    Oh and the person who designed the web site used Custom Community theme and should have access to the support forum there as an additional resource. http://themekraft.com/forums

    Forum: Fixing WordPress
    In reply to: Menu Problems

    The two important pieces of code are

    header.php
    <?php wp_nav_menu( array( 'container_class' => 'menu menu-top', 'theme_location' => 'menu_top','container' => 'div', 'fallback_cb' => false ) ); ?>

    and functions.php

    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( array(
    'menu_top' => __( 'Header top menu', 'cc' ),
    'primary' => __( 'Header bottom menu', 'cc' ),
    ) );

    The register_nav_menus in the functions.php is registering two menus. Both of them with the name cc but there are two of them so you can have different menus for different locations. In the header.php it is passing the theme location parameter of ‘menu_top’ which tells it to use that one. Normally for semantic sense I think this one would be using ‘primary’ since it is your primary nav menu but it’s just a name and since it is using ‘top_menu’ all your css styles are probably tied to it so I wouldn’t change that part.

    So creating your menu and calling it ‘cc’ should force it to use your menu which you should have control over in the dashboard. You could call it something else but would need to change the code above to match. So if you named your menu ‘my_menu’ the register_nav_menus code would be

    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( array(
    'menu_top' => __( 'Header top menu', 'my_menu' ),
    'primary' => __( 'Header bottom menu', 'my_menu' ),
    ) );
Viewing 15 replies - 16 through 30 (of 45 total)