boldhand
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Changing the wording of "Posts" within the admin// hook the translation filters
add_filter( ‘gettext’, ‘change_post_to_article’ );
add_filter( ‘ngettext’, ‘change_post_to_article’ );function change_post_to_article( $translated ) {
$translated = str_ireplace( ‘Post’, ‘Article’, $translated ); // ireplace is PHP5 only
return $translated;
}you can add this to give your visitors a sorting menu my title or date
<?php $sort= $_GET[‘sort’];
if($sort == “title”)
{
$order= “orderby=title”;
}
if($sort == “date”)
{
$order= “orderby=date”;
}
?>You can use link:
href=”?sort=title” Sort by title
href=”?sort=date” Sort by DateOr you can use a form:
<form action=”” method=”get”>
<select name=”sort” id=”sorting”>
<option value=”title” <?php if ($sort == “title”){ echo ‘selected=”selected”‘; } ?> >Sort by title</option>
<option value=”date” <?php if ($sort == “date”){ echo ‘selected=”selected”‘; }?> >Sort by publication date</option>
</select>
<input type=”submit” value=”Submit” />
</form><?php $loop = new WP_Query(‘cat=5&showposts=-1&’.$order.’&order=DEC’); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
….
<?php endwhile; ?>Forum: Plugins
In reply to: Allow visitors to reorder postsForum: Fixing WordPress
In reply to: Querying by post type using magic fields pluginThanks a million for your replay, that solved everything.
I really need to say, “Magic Fields” is Wonderful:)
Forum: Fixing WordPress
In reply to: Custom select query – sort by meta value within categoryI have made some searching in PHP scripts and reached to a perfect solution the suits my needs, I’ll type it in here in case someone needs something like this:
this goes at the top of the page:
<?php
$thekey = $_GET[‘thekey’];
$thevalue = $_GET[‘thevalue’];
query_posts(‘meta_key=’.$thekey.’&meta_value=’.$thevalue);
?>this link goes anywhere on the same page:
mysite.com/?thekey=TestKey&thevalue=value>test link</please note I’m not a PHP developer at all, so I’ll sound baby talk for experts:)
– $thekey & $thevalue: these are variables they could be anything, they are just names
– ?thekey & ?thevalue: these are the same variables called in the URL
– TestKey: this is the meta key I gave to the posts
– value: this is the value I gave to the meta key (TestKey)adding the query_posts with the “meta key” and “meta value” arguments and made them equal to the variables
The rest is for the GET command to do.
Forum: Fixing WordPress
In reply to: filter postsThank you MichaelH for you useful links, but when i mentioned author I didn’t mean the blog others (users), it could be player names, actor names, artist names …, sorry for not being clear.
While searching i passed by this
https://www.ads-software.com/support/topic/197405?replies=3the solution here is using $_GET commands to refresh the page with the filtered posts.
I’m not a PHP expert, so can someone assist with this with slightly more details? thanks a million:)
Forum: Fixing WordPress
In reply to: filter postsThank you monkeymynd for pointing out using the query_posts, but there is still a point that I need to understand.
does this mean that i need to create a number of pages equal to the number of authors where each page has a different query_posts,
then make each name in the drop down list point to one of these pages?Forum: Fixing WordPress
In reply to: images dont align properply worried.its a styling problem, all your images are having a none HTML uncomplete attribute alignleft
<img width=”194″ height=”300″ alt=”Most beautiful tennis player_7″ src=”https://www.dwhnow.com/wp-content/uploads/2009/09/Most-beautiful-tennis-player_7-194×300.jpg” title=”Most beautiful tennis player_7″ class=”size-medium wp-image-482 alignleft“/>
when removing it, its aligned center properly, you need to find it and remove it
I suggest changing your admin post editor from visual to html
Forum: Fixing WordPress
In reply to: Show posts in a pageCheck this link
https://codex.www.ads-software.com/Template_Tags/query_postsQuery_posts can be used to control which posts show up on a page
hope this helps:)
Forum: Fixing WordPress
In reply to: images dont align properply worried.can you post a link to that page, to have a visual better understanding.
Forum: Fixing WordPress
In reply to: posts orderby custom fieldCheck this link
https://codex.www.ads-software.com/Template_Tags/query_postsa way to use a custom field to sort and filter posts.
for example:
query_posts(‘meta_key=color&meta_value=blue’);Returns posts with custom fields matching both a key of ‘color’ AND a value of ‘blue’
query_posts(‘meta_key=color’);
Returns posts with custom fields matching a key of ‘color’query_posts(‘meta_key=YOURNAME&orderby=meta_value’);
Forum: Fixing WordPress
In reply to: Custom select query – sort by meta value within categoryI like the idea t31os_ suggested, using a custom query to filter and sort posts, I have a question, I need to have a link that when clicked, filters the posts in the page according to the custom query. Is there a way to do so?
Forum: Fixing WordPress
In reply to: Custom select query – sort by meta value within categoryto have a link to filter the posts on a page you need to create a template page with the filtering code, then link to that page. this isn’t the only way I’m sure, but that’s the one I know. I hope it works for you.
Forum: Fixing WordPress
In reply to: Remove parts of Quick Editanother way similar to the idea of using Javascript is using CSS, something like:
a.editinline{display:none}