Adarsh Verma
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Using the get_userdata functionGlad that your issue is resolved! ??
Forum: Fixing WordPress
In reply to: Probleem met WordHello @rolfvp,
The error is because your theme is using excerpt to be displayed over blog listing page if you will change it to ‘full post’ under customize->post options section then it will show your image also.But if you still want to show excerpt on blog listing page then paste this code in theme’s functions.php filefunction retain_image_excerpt($value) { global $post; if ( '' == $value ) { $value = get_the_content(''); $value = apply_filters('the_content', $value); $value = str_replace('\]\]\>', ']]>', $value); $value = preg_replace('@<script[^>]*?>.*?</script>@si', '', $value); $value = strip_tags($value, '<img />'); $excerpt_length = 55; $alphabates = explode(' ', $value, $excerpt_length + 1); if (count($alphabates)> $excerpt_length) { array_pop($alphabates); array_push($alphabates, '[...]'); $value = implode(' ', $alphabates); } } return $value; } remove_filter('get_the_excerpt', 'wp_trim_excerpt'); add_filter('get_the_excerpt', 'retain_image_excerpt');
Please Note: If you are not dealing with child theme, you’ll lose this code snippet on theme updation.
Thanks.- This reply was modified 8 years, 4 months ago by Adarsh Verma.
Forum: Fixing WordPress
In reply to: Using the get_userdata functionHi @kosmicbird,
I can help you in a more better way if you send some lines of code that you’re using.
I’ll try to help you with your issue.Thanks!
Forum: Fixing WordPress
In reply to: Using the get_userdata functionHi @kosmicbird,
If anyhow you get the ID of the recipient of the message, you can use the code that you are using like this:<?php
$user_info = get_userdata( $user_id );
$username = $user_info->user_login;
?>This “$username” will be the username of the recipient of the message.
Thanks!
Forum: Fixing WordPress
In reply to: HELP! How to remove or hide Admin Bar front endHi @joelpastor,
Please add the following lines of code in your functions.php file in the top, it will hide the admin bar for all the non-admin users.// Hide Admin Bar For Non-admin Users
add_action(‘after_setup_theme’, ‘remove_admin_bar’);
function remove_admin_bar() {
if (!current_user_can(‘administrator’) && !is_admin()) {
show_admin_bar(false);
}
}Hope this will serve the purpose!
- This reply was modified 8 years, 4 months ago by Adarsh Verma.
Forum: Fixing WordPress
In reply to: Stuck in Maintenance mode while adding new pluginHello @subhaprasad91,
Please try to rename the plugins folder via ftp. Make it something like this: “_plugins” and then try to run your site.
Tell if this doesn’t work for you!Thanks!
Forum: Fixing WordPress
In reply to: Stuck in Maintenance mode while adding new pluginHi again,
If you have already deleted the plugins that you had updated, isn’t your site working fine still?Forum: Fixing WordPress
In reply to: Query Posts WITHOUT Featured ImageHi @alkorr,
One thing you can do is, just add this condition check when the looping of the posts starts:<?php if( !has_post_thumbnail() ){?> //Just after the loop starts
—-POST CONTENT—-
<?php }?> //Just before the loop endsThis will only print the posts that will not have the featured images.
Thanks!
Forum: Fixing WordPress
In reply to: Stuck in Maintenance mode while adding new pluginHi @subhaprasad91,
I think, what you can do is just take a back up of the recent updated plugins “Wordfence and EWWW Image” as you have mentioned either from the cpanel or ftp and then delete the plugins from the site.
The site will start to run as prior to the update.Thanks!
Forum: Fixing WordPress
In reply to: WooCommerce Product image insanely bigHi @zaheershaiz,
All you need to add this code in your current theme’s functions.php file:add_filter( ‘single_product_large_thumbnail_size’,’custom_size_function’,10,1);
function custom_size_function($class) {
$class = array (‘prd-img’);
}Now, add the following lines in the css file used in your theme:
.prd-img{
height: 100px;
width: 100px;
}You can change and put the name of the class that I’ve added (prd-img). You can put any name here and you can even change the width and height being defined for this class that will set up the size of the product images.
Hope this helps!
- This reply was modified 8 years, 4 months ago by Adarsh Verma.
Forum: Fixing WordPress
In reply to: Admin bar has disappeared on my siteHi @newki75,
Just place this code in your current theme’s functions.php file on the top://Show Admin Bar
add_action(‘after_setup_theme’, ‘show_admin_bar’);
function remove_admin_bar() {
show_admin_bar(true);
}Hope this helps! ??
Forum: Fixing WordPress
In reply to: Plugin could not be activated because it triggered a fatal error.Hi @rabiushuaybu,
Please delete the plugin from the plugins section, download it from www.remarpro.com, click here: LifterLMS and then upload the plugin via FTP. Do not upload the plugin from the admin backend.
The plugin will be activated and work fine.Hope it helps you. ??
Forum: Fixing WordPress
In reply to: pulling photos with posts to static pageHi @mikehhfx,
You can just modify some lines in your code above.<?php query_posts( ‘showposts=6’ );
while ( have_posts() ) : the_post();
?><h4 class=”home link”>“target=”_blank”><?php
the_title(); ?></h4>
<?php if ( has_post_thumbnail() ) {
set_post_thumbnail_size(‘300px’, ‘300px’);
the_post_thumbnail();
}
the_excerpt();
endwhile;
?>You can set the size of the featured image you wish to have.
Hope it serves you as required.
Thanks!Forum: Fixing WordPress
In reply to: How to Access Website through IP Adress?Hi ,
Yeah, you can look into this: Change Site URLAll you need to do is just replace https://www.example.com by <IP ADDRESS>.
Forum: Fixing WordPress
In reply to: How to Access Website through IP Adress?Hi again,
You need to update the ‘siteurl’ and ‘home’ in ‘options’ table in phpMyAdmin to the IP Address that you’re trying to run, but please make sure, there is no redirection code written in ‘.htaccess’ file (placed in root folder).
Also note, please re-update the values of ‘siteurl’ and ‘home’ in ‘options’ table if this doen’t work.
Also first make the backup of all the things you are updating, including the database.Thanks!
- This reply was modified 8 years, 4 months ago by Adarsh Verma.