Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
$10
Wordpress Pagination
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages
) );
?>the problem is the code is outputting single quotes instead of double quotes and so I can't style with css.
Example output:
<span class='page-numbers current'>1</span>
<a class='page-numbers' href='http://www.jules-photographer.com/articles/page/2/'>2</a>
<a class='page-numbers' href='http://www.jules-photographer.com/articles/page/3/'>3</a>
<a class='page-numbers' href='http://www.jules-photographer.com/articles/page/4/'>4</a>
<a class="next page-numbers" href="http://www.jules-photographer.com/articles/page/2/">Next »</a>Any thoughts?
This question has been answered.
julesphoto | 01/26/12 at 11:37am
Edit
(6) Possible Answers Submitted...
See a chronological view of answers?
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
-

Last edited:
01/26/12
11:43amLuis Abarca says:You can styles, with single or double quotes.
.page-numbers {
/* your styles */
}
You can also wrap the pagination in a DIV
<div id="pagination">
<span class='page-numbers current'>1</span>
<a class='page-numbers' href='http://www.jules-photographer.com/articles/page/2/'>2</a>
<a class='page-numbers' href='http://www.jules-photographer.com/articles/page/3/'>3</a>
<a class='page-numbers' href='http://www.jules-photographer.com/articles/page/4/'>4</a>
<a class="next page-numbers" href="http://www.jules-photographer.com/articles/page/2/">Next »</a>
</div>
And add styles like this
#pagination span {}
#pagination a {}
Previous versions of this answer: 01/26/12 at 11:43am | 01/26/12 at 11:43am
- 01/26/12 11:52am
Luis Abarca says:Yep, you can add styles, maybe yor styles are overwrited by other rules in your stylesheet, so you can use !important to check
.page-numbers {
color: #00f !important;
}
.page-numbers:hover {
color: #f00 !important;
}
- 01/26/12 11:52am
-

Last edited:
01/26/12
11:41am -

Last edited:
01/26/12
11:42amHai Bui says:Hi,
It doesn't matter if it outputs single quotes or double quotes, you can add css styles either way. -

Last edited:
01/26/12
11:43amRoss Wilson says:Why can you not style this type of output. I was able to style your html here:
http://jsfiddle.net/2Pf9c/ -

Last edited:
01/26/12
11:45amJohn Cotton says:Hi Julian
I never noticed that before, but you're absolutely right, that function mixes single and double quotes.
But why does it stop you using css? A class attribute is a class attribute which you use....
You could always wrap a str_replace or preg_replace around the function if you really wanted the consistency.- 01/26/12 11:54am
julesphoto says:Wow another thing learned... I had no idea that you could style with either single or double quotes.. just rushed to the assumption that it was wrong. Still I would prefer if it was double quote to keep everything consistent. I have no idea how to wrap in the str_replace to format as I want.
- 01/26/12 11:54am
-

Last edited:
01/26/12
11:51amidt says:You can style regardless of single or double quotes.
a.page-numbers{
/* page number styles */
}
a.current {
/* style for current page link */
}
a.next {
/* Style for next page link */
}
This question has expired.
Julio Potier had additional discourse to offer.
Gabriel Reguly, julesphoto, Julio Potier, Kannan C voted on this question.
Current status of this question: Completed
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
