Forum Replies Created

Viewing 15 replies - 61 through 75 (of 516 total)
  • From a quick look at your code, what is $doaction? Where did you declare it?

    This is very hard to tell what will exactly happen. The best possible solution could be to first let your customer know about the situation and what is required. You should not take the decision of updating stuffs on a live website of your own. You should let your customer know about the downside of such an action since he did not update the theme for a long time as you have mentioned.

    Next, you need a development platform for this to implement and test everything (e.g. demo.brechtgebaeudereinigung.de), make all adjustments that may come up and once you and your customer is happy with everything, move things to production environment.

    However, the theme developer knows about it the best and they can give you the best solution, but the minimum you should do is taking backup of the site and database before going for an update. Since you did not mention exactly how long theme was not updated it is hard to tell how much “breaking changes” you will end up with after the update.

    So, the first and foremost thing is to take backup of everything before going for the update, then create a development environment and test things there.

    Hope this gives you some light about how to proceed.

    In that case you can try https://premium.wpmudev.org/blog/how-to-set-up-wordpress-locally-for-pcwindows-with-wamp/ and scroll to “Setting up WordPress Multisite” section of the tutorial.

    And for subdomain setup on windows you can try this:
    https://blog.droidzone.in/2012/08/24/working-with-wordpress-multisite-sub-domain-install-on-localserver-in-wamp/

    Let me try to make it a bit simple for you. For the time being forget that you have a child theme or you have to copy this to that. Here is how the basics work.

    As you know, a Custom Post Type is no different from a normal WordPress post. In WordPress, all post detail pages (or what we call post page) use single.php as the default, if it is there, otherwise it will use page.php and check whether the incoming request is_single(). Now, if there is a single.php present in your theme all post detail pages will use this be fault as I mentioned. Now, if you have created 3 different custom post types (post-a, post-b, post-c) and want to display them differently, you have to have separate single pages for them, such as single-post-a.php, single-post-b.php and single-post-c.php.

    So first you create a single page for your custom post type, show some content on it like the_title(); or the_content() etc. Once you can load this page with contents, you are almost there. Now comes the template layout part.

    “My problem is when I try to associate the custom cost type with a custom template … I did not find the way to run it…”, I assume you have created a template of your own and want this to be applied on your custom post type page. If this is the case, just put the layout in the single-your-custom-post-type.php file and put say the_title(), the_content() etc. where you want them to be. You don’t have to create any separate so called template page for it.

    Please let me know if this helps you to get going.

    Thank you!

    Ok, here are the complete steps what I did. Please note I am using Ubuntu.

    1. Modified .htaccess file as described in my previous message.

    2. Added 3 entries in /etc/hosts file

    127.0.0.1 mainsitelocal.com
    127.0.0.1 sd1.mainsitelocal.com
    127.0.0.1 sd2.mainsitelocal.com

    2. Following Directory entry added in /etc/apache2/apache2.conf file

    <Directory /var/www/html/multisite>
       Options Indexes FollowSymLinks
       AllowOverride All
       Require all grant
    </Directory>

    3. Enabled main domain and sub domains (or me it is local Ubuntu environment). To do that first create three copies of 000-default.com.conf as follows:

    $sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/mainsitelocal.com.conf
    
    $sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/sd1.mainsitelocal.com.conf
    
    $sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/sd2.mainsitelocal.com.conf

    Once you have all those, edit them separately:

    mainsitelocal.com.conf

    ServerAdmin [email protected]
    ServerName mainsitelocal.com
    DocumentRoot /var/www/html/multisite

    sd1.mainsitelocal.com.conf

    ServerAdmin [email protected]
    ServerName sd1.mainsitelocal.com
    DocumentRoot /var/www/html/multisite

    sd2.mainsitelocal.com.conf

    ServerAdmin [email protected]
    ServerName sd2.mainsitelocal.com
    DocumentRoot /var/www/html/multisite

    4. Enable all the above sites

    $ sudo a2ensite mainsitelocal.com
    $ sudo a2ensite sd1.mainsitelocal.com
    $ sudo a2ensite sd2.mainsitelocal.com

    Once you do it, you would see three new files are added under /etc/apache2/sites-enabled directory with the same content as they have in sites-available directory.

    5. Reload / Restarting Apache service
    $ sudo service apache2 reload OR $ sudo service apache2 restart. If you get any WARNING while using restart, ignore it.

    That’s it! You should now be all set and ready to go.

    Let me know if this helps.

    Hi,
    Let me try to understand in own words.

    1. You are building a Custom Contact Form by the help of a Custom Post Type – Which is fine. It will be able to accept the information and save into wp_posts and wp_postmeta tables. You need to tell WordPress what will go into wp_postmeta table.

    2. You have probably already created the meta boxes. If yes, you will be able to show and edit them in admin as well. From user end, you just need to use a Form. Use save_posts_your_post_type() to save basic post type fields in wp_posts table like title, excerpt etc and rest of the fields to wp_postmeta table using upate_post_meta($post_id , 'meta_field_name', $meta_value);. The function update_post_meta first checks whether any the meta exists for the $post_id. If not it calls add_post_meta automatically.

    3. In admin edit (your post type) you need to call the metaboxes to display the controls with their values prepopulated.

    I am not very sure though if I could address exactly what you actually want to accomplish!

    Hello,
    This is kind of a late reply and hope you have already figured out a solution. However, what worked for me was by replacing WP default .htaccess content for multisite network with the following:

    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    Thread Starter Subrata Sarkar

    (@subrataemfluence)

    Issue fixed.

    Can you please share the URL?

    I think the above URL is not properly encoded. Can you please try rebuilding the URL once again in Google Fonts UI with the same fonts ?

    There are a number of factors which can pull your page speed down considerably like:

    – Extensive use of plugins, which increases latency as they tend to load upfront with every HTTP request
    – Installing plugins that are not properly maintained and do not have a considerable amount of active installs.
    – Plugin compatibility with your version of WordPress.
    – Images that are not optimized take longer time to load
    – Not using caching (You can look at WP Total Cache plugin)
    – Render blocking scripts, i.e. JavaScripts and/or CSS which prevent the actual content of a page to load before they themselves get loaded completely.

    I would suggest you to test your site with Google page insight, which will tell you more about the areas what you can modify to pull up the speed.

    My suggestion is:
    – Minimize the use of plugins as far as possible
    – Follow Google insight and use defer attributes wherever possible.
    – Take a close look at your installed plugins – do they have unresolved issues?
    – Installing Caching plugin might be helpful.

    Hope this will give you some idea about how to start. Let me know if this helps!

    Thank you.

    As you might have known SCSS compilation is nothing to do with a WordPress theme. There are different ways you can do it.

    You might find the following links useful.

    1. Using Grunt: https://mattwatson.codes/compile-scss-javascript-grunt/
    2. Installing any SASS compiler like Koala: https://koala-app.com/
    3. Koala Windows installer: https://github.com/oklai/koala/releases/download/v2.2.0/KoalaSetup.exe

    Let me know if this helps!

    Thank you.

    To update “Read More” text you need to hook a custom function against the action filter excerpt_more in your theme’s functions.php file like this:

    add_filter('excerpt_more', 'mytheme_excerpt_more');
    
    function mytheme_excerpt_more($more) {
       global $post;
       return '<a href="' . get_permalink($post->ID); . '">Replace Read More</a>';
    }

    Hope this works.

    Here is a quick solution to get rid of default “Plugin activated” message and bring in your own message instead. In your theme’s functions.php file please add the following block of code.

    All we have done is modified the output of gettext hook.

    is_admin() && add_filter( 'gettext',
        function( $translated_text, $untranslated_text, $domain )
        {
            $old = array(
                "Plugin <strong>activated</strong>.",
                "Selected plugins <strong>activated</strong>."
            );
    
            $new = "Congratulations! Your plugin has been <strong>activated</strong> and ready for use!";
    
            if ( in_array( $untranslated_text, $old, true ) )
                $translated_text = $new;
    
            return $translated_text;
        }
    , 99, 3 );

    Let me know if this works for you.

    Copy functions.php from parent theme to your child theme folder. Go to line number 335. Change Read More to View Gallery.

    Do not make the above change in parent theme’s functions.php. You will lose it on theme update.

    It is strongly recommended and the best practise to use child theme.

    How to create Child Theme

Viewing 15 replies - 61 through 75 (of 516 total)