Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
louist
tagDiv Member

Thanks Andrei,

That’s the file I was looking for. I’m pretty lazy so I just swapped the snippet that renders the google ad to the same code that renders the normal ad. So far it’s working.


if (!empty($ad_array[$spot_id]['current_ad_type'])) {
switch ($ad_array[$spot_id]['current_ad_type']) {
case 'other':
//render the normal ads
$buffy .= $this->render_ads($ad_array[$spot_id], $atts);
break;
case 'google':
//render the magic google ads :)
$buffy .= $this->render_ads($ad_array[$spot_id], $atts);
break;
}
}

louist
tagDiv Member

Hi Chris,

Thanks, but that’s not it. All my tags are giving out 404s.

louist
tagDiv Member

Hi Andrei,

I updated the theme to its latest version. It’s better but I’m still getting errors. I know my host works differently from other hosts and sometimes there are php errors even though their minor.

[Tue Nov 17 06:54:13.832421 2015] [:error] [pid 7714] [client 173.255.198.194:37051] PHP Warning: Invalid argument supplied for foreach() in /nas/wp/www/cluster-41332/dailyhp/wp-includes/functions.php on line 515
[Tue Nov 17 06:54:13.832512 2015] [:error] [pid 7714] [client 173.255.198.194:37051] PHP Warning: in_array() expects parameter 2 to be array, string given in /nas/wp/www/cluster-41332/dailyhp/wp-includes/functions.php on line 524
[Tue Nov 17 06:54:14.161822 2015] [:error] [pid 7714] [client 173.255.198.194:37051] PHP Warning: Invalid argument supplied for foreach() in /nas/wp/www/cluster-41332/dailyhp/wp-includes/functions.php on line 515
[Tue Nov 17 06:54:14.161933 2015] [:error] [pid 7714] [client 173.255.198.194:37051] PHP Warning: in_array() expects parameter 2 to be array, string given in /nas/wp/www/cluster-41332/dailyhp/wp-includes/functions.php on line 524
[Tue Nov 17 06:55:29.028812 2015] [:error] [pid 7714] [client 173.255.198.194:37247] PHP Warning: Invalid argument supplied for foreach() in /nas/wp/www/cluster-41332/dailyhp/wp-includes/functions.php on line 515
[Tue Nov 17 06:55:29.028893 2015] [:error] [pid 7714] [client 173.255.198.194:37247] PHP Warning: in_array() expects parameter 2 to be array, string given in /nas/wp/www/cluster-41332/dailyhp/wp-includes/functions.php on line 524
[Tue Nov 17 06:57:37.933117 2015] [:error] [pid 7718] [client 173.255.198.194:37525] PHP Warning: Invalid argument supplied for foreach() in /nas/wp/www/cluster-41332/dailyhp/wp-includes/functions.php on line 515
[Tue Nov 17 06:57:37.933203 2015] [:error] [pid 7718] [client 173.255.198.194:37525] PHP Warning: in_array() expects parameter 2 to be array, string given in /nas/wp/www/cluster-41332/dailyhp/wp-includes/functions.php on line 524
[Tue Nov 17 08:25:39.461467 2015] [:error] [pid 21992] [client 66.249.69.69:46868] PHP Fatal error: Call to undefined function get_header() in /nas/wp/www/cluster-41332/dailyhp/wp-content/themes/Newsmag/index.php on line 6
[Tue Nov 17 23:12:29.474414 2015] [:error] [pid 27828] [client 66.249.69.69:39472] PHP Fatal error: Call to undefined function get_header() in /nas/wp/www/cluster-41332/dailyhp/wp-content/themes/Newsmag/index.php on line 6

Only the last two errors seem to be from the theme. Since the update the situation’s definitely got better. I’ll keep monitoring.

Thanks!

louist
tagDiv Member

I couldn’t get the links to show up properly on the first post so here’s the post again:

Hi,

I’m trying to add custom classes to the wp_link_pages’ ANCHORS so I can have more flexibility with the styling.

Right now when the wp_link_pages is called the theme outputs the pagination as follows:

<div class="page-nav page-nav-post td-pb-padding-side clearfix"><a href="http://localhost/wordpress/demo-5-reasons-you-need-the-x-theme/">Previous</a><a href="http://localhost/wordpress/demo-5-reasons-you-need-the-x-theme/3/">Next</a></div>

All the docs I’ve found in relation to wp_link_pages add classes to the div element. However I need to add custom classes to the A element or previous and next such as:

<div class="page-nav page-nav-post td-pb-padding-side clearfix"><a class="newclass1" href="http://localhost/wordpress/demo-5-reasons-you-need-the-x-theme/">Previous</a><a class="newclass2" href="http://localhost/wordpress/demo-5-reasons-you-need-the-x-theme/3/">Next</a></div>

Can that be done?

  • This reply was modified 10 years by louist.
  • This reply was modified 10 years by louist.
  • This reply was modified 10 years by louist.
louist
tagDiv Member

Thanks Catalin,

I must be cursed :P.

louist
tagDiv Member

UPDATE

Ok so I went for lunch came back and checked the code again. Regenerated the tags and now it works…

Consider this as solved.

Thanks.

louist
tagDiv Member

Thanks Andrei,

I actually got it working differently.

I used this code to add the class to the td_module_single_base.php since I thought that’s where the headline was being generated.

Old code in td_module_single_base.php on line 52:

$buffy .= '<h1 class="entry-title">';

Replaced with the line below:

$buffy .= '<h1 class="entry-title optimizely-' . $this->post->ID . '">';

But looking back I think your method seems more efficient. So does the new variable overwrite the old one to avoid having duplicate titles on the post?

Viewing 7 posts - 1 through 7 (of 7 total)