Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Jimmyfrantic

    (@jimmyfrantic)

    I’ve seen it, but as I said, Frame Redirect would always display a fixed domain name, without everything which normally follows. So wherever I’d be on the page instead of gandalf.de/?p=123 I would always get just gandalf.de. This is bad.

    Their support helps in domain/server things, I consider that issue as more WordPress-ish, so I ask here first.

    Thread Starter Jimmyfrantic

    (@jimmyfrantic)

    Yeah, as I said in 1st post – I can redirect it with no problem, but if I choose Frame Redirect I would always get gandalf.de on every subpage, and I couldn’t use that domain name to navigate around my site (gandalf.de/wp-admin/ wouldn’t work). HTTP Redirect on the other hand doesn’t even keep gandalf.de in address bar, there is an original address instead.

    How to replace domain.de/projects/gandalf with gandalf.de? Simple URL Rewrite? Will it work?

    Thread Starter Jimmyfrantic

    (@jimmyfrantic)

    You see, the problem is – gandalf.de (of course gandalf is just a made-up example by me ;p) is only a domain. No hosting behind it, no server, it’s just an address.

    Thread Starter Jimmyfrantic

    (@jimmyfrantic)

    Hah! ?? thanks a lot!

    Awesome addon, by the way, saved me countless hours already!

    …if only I knew about this before, I wouldn’t create all these damned data-sheets all by myself…*shivers*

    Thread Starter Jimmyfrantic

    (@jimmyfrantic)

    Thanks for the response!

    I was away for some time, so I couldn’t thank you sooner. ??

    Nice to know I contributed a little to such a great plugin!

    Thread Starter Jimmyfrantic

    (@jimmyfrantic)

    Okay, so: all PHP functions go in the functions.php, I haven’t changed that in any way. So all shortcodes are in functions.php. The problem is the following: most of them (template dir, url), which I use for embedding PHP code in editor, work, but the new ones, more complex, I try to create – do not work.

    Examples:

    function bloginfo( $atts ) {
       extract(shortcode_atts(array(
           'key' => '',
       ), $atts));
       return get_bloginfo($key);
    }
    add_shortcode('bloginfo', 'bloginfo');

    WORKS

    function breakall() {
       return '<br clear="all" />';
    }
    add_shortcode('br', 'breakall');

    WORKS

    function upper_structure() {
       return '<div id="wrap"><div id="main"><div id="something"><p class="green"><a href="<?php bloginfo('url'); ?>/?page_id=80"><strong>Something</strong></a></p>';
    }
    add_shortcode('upstr', 'upper_structure');

    ERROR 500

    When I replace the bloginfo() in it, it works, with no problem… Tried replacing is with before-set bloginfo shortcode, same. Any solutions? How to embed a function inside function? I guess it’s about putting a function in return '', but… is there any workaround?

    Thread Starter Jimmyfrantic

    (@jimmyfrantic)

    I’m aware of that, this is why I put all the PHP codes in editor as shortcodes – [bloginfo key='stylesheet_directory'] and [bloginfo key='url'], it works wonderfully, that was not the question.

    My question is – why the code inside my new shortcode function does not work?

    function wplink() {
       return '<a href="https://www.www.ads-software.com">WordPress</a>';
    }
    add_shortcode('wp', 'wplink');

    works excellently, if I put [wp] in Page editor, it is shown with no problems at all…

    If I, instead of simple anchor tag, paste more advanced code, like 10 lines with php functions, it doesn’t. As soon as I upload functions.php, wild Error 500 appears. If I replace raw php function with a shortcode, it’s the same, so it’s not really the PHP syntax issue, I guess.

    Any ideas?

    Thread Starter Jimmyfrantic

    (@jimmyfrantic)

    Ok, thanks! Working pretty great.

    Next question, for which I couldn’t find the answer anywhere else.

    I’m making the site for my client, he wants to edit it later…
    The problem is with editor, he’s complete novice when it comes to the code, so I just want to keep things as simple as possible… Is there an option to put large chunks of code in the WP page editor as shortcodes to lower the chance of accidental editing? There are also php scripts… I tried to do it myself, putting everything in functions.php in following form:

    function upper_structure() {
       return 'CODE GOES HERE';
    }
    add_shortcode('upstr', 'upper_structure');

    but it crashes the site and renders 500 Error. What’s wrong? Or how can I do that in a simpler way?

    If you ask why I put content which is intended to be uneditable in dynamic WP editing areas, the reason is following: I need it translated. WPML (translation plugin which I mentioned earlier) does not translate static content which means that:

    1. I put it in the dynamic area as I want to do it, or
    2. I make 3 copies of each HTML tag which I want to translate (since I have 4 languages), give them different classes , assign to my body tag dynamic class based on which language version do I now use, translate new, copied tags and, using CSS and display: none property, show or hide respective ones in following way:

    <div class="content_en">Content</div>
    <div class="content_es">Same Content in Spanish</div>
    <div class="content_fr">Same Content in French</div>
    div.content_en,div.content_es,div.content_fr {display: none;}
    
    body.en div.content_en {display: block;}
    
    body.es div.content_es {display: block;}
    
    body.fr div.content_fr {display: block;}

    Okay, but this leaves me with the bigass file, looking bad when viewing source… Any other ideas? ??

    Thread Starter Jimmyfrantic

    (@jimmyfrantic)

    Ok, another question since nobody answered me for the first one.

    I changed the homepage in the Reading settings to a static page, which means it uses now page.php to display the site, right?

    Which means index.php is practically unused and I can do whatever with it?

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