aritzalvarez
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Limit output text searchresultsCan use substring. it will return a some part of a string…. Take a look on documentation…
You can use like this…
<?php $excerpt = get_the_excerpt(); $excerpt = substr($excerpt, 0, 100); echo '<p>' . $excerpt . '</p>'; ?>
As you see, we save the excerpt into a variable, and then, we apply a substring to asave only the chars from 0 to 100. Or with less code…
<?php echo '<p>' . substr(get_the_excerpt(), 0, 100) . '</p>'; ?>
Integrated in your code, should look like this…
<h1 class="page-title"><?php printf( __( 'Zoekresultaten voor: %s', '_s' ), '<span>' . get_search_query() . '</span>' ); ?></h1> <h2 class="items"><?php echo 'Gevonden artikelen: ' . $wp_query->found_posts; ?></h2> <?php if(have_posts()): ?> <?php while(have_posts()) : the_post(); ?> <div class="s-res"> <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3> <?php if ( has_post_thumbnail() ): ?> <div class="search-thumb"> <?php the_post_thumbnail('post-thumbnail', array( 'class' => "search-thumb attachment-post-thumbnail")); ?> </div> <?php endif ?> <?php $excerpt = get_the_excerpt(); $excerpt = substr($excerpt, 0, 100); echo '<p>' . $excerpt . '</p>'; ?> </div> <?php endwhile; ?> <?php else : ?> <div class="s-res"> <i><?php _e('Sorry, maar we hebben niets gevonden wat aan uw zoekcriteria voldoet.<br> Probeer opnieuw met andere zoekwoorden..'); ?></i> <div class="s-bar"> <?php get_search_form(); ?> </div> <?php endif; ?> </div>
I hope it be usefull to you ??
Forum: Themes and Templates
In reply to: theme update – will I loose my changesShould create a child theme (not a big deal) before update.
If was only a CSS change there are some plugins to manage css changes like Custom CSS Mananger
ypu can take a look at this plugin… Can help you to create a child theme, but if you?’re coding by yourself i guess you are more likely to use FTP and stuff than plugins
Forum: Everything else WordPress
In reply to: opening ppt failsi tried and download seems work
Forum: Fixing WordPress
In reply to: How to make lists of grouped 'category links' in sidebar?if you’re edition theme in a child theme to display categories take a look at this post on forum..
Forum: Fixing WordPress
In reply to: How to make lists of grouped 'category links' in sidebar?When you create a new category (or when edit) you can set anothr category as “parent category” of it, like in pages..
You can read more about it in codex.
If the categories are shown in a flat list or in nested lists depends of your template
Forum: Fixing WordPress
In reply to: Hit counter for every pageYou’ll need create a “generate code” to every single page…
So, you load simplehitcounter.com/ and use the button “get counter code” then it will generate a tracker code like this
<!-- Start of SimpleHitCounter Code --> <div align="center"><a href="https://www.simplehitcounter.com"><img src="https://simplehitcounter.com/hit.php?uid=1573562&f=16777215&b=0" border="0" height="18" width="83" alt="web counter"></a><a href="https://www.simplehitcounter.com">web counter</a></div> <!-- End of SimpleHitCounter Code -->
If you reload the page (i tried and seems it can work) and click on “get counter code” again it generates a new code, like this
<!-- Start of SimpleHitCounter Code --> <div align="center"><a href="https://www.simplehitcounter.com"><img src="https://simplehitcounter.com/hit.php?uid=1573563&f=16777215&b=0" border="0" height="18" width="83" alt="web counter"></a><a href="https://www.simplehitcounter.com">web counter</a></div> <!-- End of SimpleHitCounter Code -->
Notice than the “uid” value is different 1573562 and 1573563 so i guess are different trackers… jus generate so many codes as pages you want to track and place it in your content (one per page) using “text editor”.
I guess it should work… But tellme if it does
Forum: Fixing WordPress
In reply to: How to Vertically Center an Image With Text Below It?As WPyogi said, the best if you want make changes on your templae is use some plugin as Custom CSS Manager or create a child theme.
In this chase is enough with use CSS Manager, cause it’sa not a big deal, just a detail, but if you want really make a big custom on template, then should create a child theme
i see you created a .centerme class div. it’s not necessary and maybe isn’t a good idea cause you’re editing your PHP files and all changes will be overwrited on a template’s update. I seee it’s working now, but it’s better if you edit css of existing containers using CSS Manager…
The problem editing a template by another coder is you’re never sure about how it works, and a big mess is waiting under every edit ??
Forum: Fixing WordPress
In reply to: PHP code widget plugin – need code – please helpsame post ID?
So… I guess you meant same custom field name; the $post-ID isn’t to edit, it’s to know what post is being read….
Ok, to it works you need have it inside the loop. If your theme hace it outside the loop it will not work…
<?php if ( have_posts() ) { while ( have_posts() ) { the_post(); // HERE YOU CAN USE IT } // end while } // end if ?>
A way to fix it is use
<?php $custom_field_value = get_post_meta($post->ID, 'custom_field_name',true); ?>
Inside of the loop and, then, use storage value and
echo $custom_field_value;
In the sidebar… But only will work if your sidebar is after the loop….
Ypu can try add a secondary loop in the sidebar, but it’s a pretty messy way to do it
I will try to use it in the loop, where the content is shown, to see if everything is ok
Forum: Fixing WordPress
In reply to: PHP code widget plugin – need code – please helpTo get a custom field, the code is
$custom_field_value = get_post_meta($post->ID, 'custom_field_name', true);
It will save the value stored in your custom field on to $custom_field_value, then you can display, like this:
echo $custom_field_value;
There is a very simple method, but are a lot of ways more, take a look on codex: custom fields it can really help you.
Forum: Fixing WordPress
In reply to: Email notification to followersby “followers” do you mean “blog users” or “RSS feeds subscribers”?
Anyway, no one of them are notified by mail… Not the default behavior on wordpress.
If you want do it can use some newsletter plugin for wordpress or create a newsletter by using some service as mailchimp
I hope it be usefull to you
Forum: Fixing WordPress
In reply to: How to add a video WITHOUT embedding YouTubeTry the html5 videoplayer
https://www.w3schools.com/html/html5_video.asp
And yes, there’s a plugin to it… But i never try it
Forum: Themes and Templates
In reply to: I want to include menu but it should come as i sort..try
<?php wp_list_pages('title_li=&sort_column=menu_order&include='); ?>
For more info, take a look in codex: wp_list_pages
Forum: Fixing WordPress
In reply to: How to Vertically Center an Image With Text Below It?Hi Frankie… There is a simple CSS way to achieve it…
In the example, i created my own CSS class, you can apply as you wish
<div class="centerme"> <p>asdasd</p> </div>
And the CSS
.centerme { width:300px; height:200px; position:absolute; left:50%; top:50%; margin:-100px 0 0 -150px; background:#99A; }
As you can see, must declare a Height and Width, then use position absolute with a 50% top and left. It will “almos” center the div, cause it will put the top left corner of div in a 50% of top browser and a 40% of left browser borders.
So use margin to “compensate”… adding negative half of height as margin top and negative half of width as margin left. It will correct.
You can see it working in https://jsfiddle.net/aritz81/HLzhu/
There is possible reason it don’t work on your template: If the DIV you’re trying to center is inside another one DIV with position relaitve. A relative DIV alters the behaviour of child DIVs with position absolute…
By default, absolute is relative to browser viewport, but inside a “position:relative” parent the position is absolute… inside parent, not browser viewport.
I hope it be usefull to you.
Forum: Themes and Templates
In reply to: Grey space below footerThat gray space is here dur your content isn’t enough to “push” you footer at the bottom of the browser
When your content is over, the theme puts ther the footer but there is too many space util the bottom of browser and it’s filled with that gray…
That gray is, in fact, tha background color of your body (i checked with “inspect element”) you can change that color by using some CSS management plugin like Custom CSS Manager anb revert it to white.
So, that “space” will remain there anyway…
Also have the option of use some CSS condition to declare a min-height than allow you to push it to bottom, but as you can’t know the size of your visitiors browser it’s a pretty ugly solution (and can be specially messy on cellphones)
When your content grows will push the footer to it’s place….
I’m not sure if the explain is clear :S
Forum: Plugins
In reply to: how to see only one language with qTranslatei know… it worked first time i try… but later, something changed, cause your menu appears now properly aligned in the wrapper (first time i seen the webm it wasn’t there, it was aligned to the right of browser.)
Something is wrong, but is hard to say without cen see the whole code… Today i’ve been terribly bussy in work, i’ll take a look tomorrow….
But, as i said, the best optoino, by now, il remove the changes of “position” in wrappers and begin again