Forum Replies Created

Viewing 15 replies - 1 through 15 (of 65 total)
  • kasperbs

    (@kasperbs)

    I just came across this search/replace script, which looks like it takes care of serialized wp_option records too:

    https://github.com/veloper/WordPress-Domain-Changer

    This works very well for what its supposed to do.

    Thread Starter kasperbs

    (@kasperbs)

    Ahh ok. that’s what I thought. I don’t know how to code plugins unfortunately :-(.

    Thread Starter kasperbs

    (@kasperbs)

    I was actually thinking generally. For example; I have a twitter plugin that consists of one file called twitter.php. In that file I need to specify the number of tweets to show.

    Let’s say I want to activate this plugin on another site but on that site show 5 tweets. How do I do that in a multi site environment? I still only have that file right?

    Thread Starter kasperbs

    (@kasperbs)

    Thanks.
    Would mind ellaborating on the ‘save that as an option’ thing?

    Thread Starter kasperbs

    (@kasperbs)

    It now looks like this.

    <?php
    		include_once(ABSPATH.WPINC.'/rss.php'); // path to include script
    		$feed = fetch_rss('https://pipes.yahoo.com/pipes/pipe.run?_id=e49a6cfb219f8180ded1313941be1808&_render=rss'); // specify feed url
    		if( is_object( $feed ) && property_exists( $feed, 'item' ) && is_array( $feed->items ) ) {
      		$items = array_slice($feed->items, 0, 5); } // specify first and last item
    		?>
    
    		<?php if (!empty($items)) : ?>
    		<?php foreach ($items as $item) : ?>
    			<div class="post">
    			<h1 class="post-title"><a href="<?php echo $item['link']; ?>"><?php echo $item['title']; ?></a><?php edit_post_link(' EDIT', '<span>', '</span>'); ?></h1>
    			<?php if (isset($item['description'])) : ?>
    			<div class="entry"><?php echo $item['description']; ?></div>
    			<?php endif; ?>
    			</div>
    
    		<?php endforeach; ?>
    		<?php endif; ?>
    		<?php if (empty($items)) : ?>
    		<p><em>Der blev ikke fundet nogen aktuelle nyheder p? de s?gte medier.</em></p>
    		<?php endif; ?>
    Thread Starter kasperbs

    (@kasperbs)

    Woow thanks. Patience paid off. I will implement it now.

    Thread Starter kasperbs

    (@kasperbs)

    This is actually still a problem, if anyone have any input.

    A contact name or email address would be fine, as we can pay for fixing this.

    Thread Starter kasperbs

    (@kasperbs)

    Anyone know who I could contact about this problem?

    Thread Starter kasperbs

    (@kasperbs)

    No one in here either?

    Thread Starter kasperbs

    (@kasperbs)

    Hi,
    Thanks for your suggestion. I don’t think it would work because basically the authors act as categories. Anyway I just came back to let you know that I managed to find a solution.

    Here’s the template code I ended up with if anyone needs the same.

    <?php
    /*
    Template Name: Netvaerk News
    */
    ?>
    <?php
    get_header(); ?>
    	<div class="span-16 last">
    	<div class="content">
    
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    				<h1 class="post-title">Nyheder & Aktiviteter</h1>
    				<div class="entry">
    					<?php $page_author = get_the_author();?>
    				</div>
    			</div>
    
    	<?php endwhile; endif; ?>
    
    	<?php
    		$temp = $wp_query;
    		$wp_query= null;
    		$wp_query = new WP_Query();
    		$wp_query->query('showposts=5&cat=383&author_name=' . $page_author . '&paged=' .$paged);
    	?>
    
    	<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    		<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    				<h1 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><?php edit_post_link(' - EDIT THIS', '<span>', '</span>'); ?></h1>
    				<div class="post-meta"><?php the_time('j. F, Y') ?></div>
    				<div class="entry">
    					<?php the_excerpt(); ?>
    					<p style="margin-top:-1em;"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">&raquo; L&aelig;s mere...</a></p>
    				</div>
    		</div>
    	<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; &AElig;ldre') ?></div>
    			<div class="alignright"><?php previous_posts_link('Nyere &raquo;') ?></div>
    		</div>
    
    	</div>
    	</div><!-- end of span-17 -->
    
    <?php get_footer(); ?>
    Thread Starter kasperbs

    (@kasperbs)

    Thanks,
    Managed to get it to work. Here my full code that lists subpages:

    <?php // list sup pages
    		if (is_home()) :
    			global $wpdb;
    			$home_page_id = $wpdb->get_var("SELECT OPTION_VALUE FROM $wpdb->options WHERE option_name = 'page_for_posts'");
    			$children = wp_list_pages("title_li=&child_of=".$home_page_id."&echo=0");
    
    		elseif($post->post_parent) :
    			$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
    
    		else :
    			$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    		endif;
    		if ($children) : ?>
    			<ul>
    				<?php echo $children; ?>
    			</ul>
    	<?php endif; ?>

    Thread Starter kasperbs

    (@kasperbs)

    This turned out to be a problem with the WP Firewall plugin. Whitelisting my IP address solved the problem.

    Thread Starter kasperbs

    (@kasperbs)

    Thanks for your quick reply.

    Thread Starter kasperbs

    (@kasperbs)

    I managed to sort this by getting the FTP access, but didn’t figure out a way to fo it without!

    Thread Starter kasperbs

    (@kasperbs)

    Thanks for the links. I had a look at them and think it might be a little too technical for me.

    I’ve decided that I don’t need the custom field image value anyway. I simply need a random post from the ‘Event’ category displayed at the top of my index page.

Viewing 15 replies - 1 through 15 (of 65 total)